:root {
  --bg: #f7f3ee;
  --paper: #fffaf4;
  --ink: #2b2521;
  --muted: #776c64;
  --line: #e4d8cc;
  --accent: #d95c43;
  --accent-dark: #ad3c2c;
  --sage: #5d7b68;
  --gold: #b88437;
  --shadow: 0 18px 50px rgba(55, 38, 28, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(217, 92, 67, 0.08), transparent 32%),
    linear-gradient(225deg, rgba(93, 123, 104, 0.1), transparent 35%),
    var(--bg);
  color: var(--ink);
}

html {
  scroll-behavior: smooth;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 112px;
}

.intro {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.04;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
}

.status-pill {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.72);
  color: var(--sage);
  font-size: 14px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel,
.empty-state,
.draft-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.88);
  box-shadow: var(--shadow);
}

.input-panel,
.checklist-panel {
  padding: 20px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input[type="text"],
input[type="file"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--ink);
  outline: none;
}

input[type="text"],
input[type="file"] {
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.55;
}

.parsed-info {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.parsed-info.is-ok {
  border-color: rgba(93, 123, 104, 0.38);
  background: rgba(93, 123, 104, 0.08);
  color: var(--sage);
  font-weight: 700;
}

.parsed-info.is-warn {
  border-color: rgba(184, 132, 55, 0.4);
  background: rgba(184, 132, 55, 0.09);
  color: #835f27;
}

.optional-details {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.72);
}

.optional-details summary {
  cursor: pointer;
  padding: 12px;
  color: var(--sage);
  font-size: 13px;
  font-weight: 800;
}

.optional-details .field,
.optional-details .field-grid {
  margin-right: 12px;
  margin-left: 12px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 92, 67, 0.14);
}

.preview-box {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px dashed #d3b8a3;
  border-radius: 8px;
  background: #fffdf9;
}

.preview-box img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.empty-preview {
  color: var(--muted);
  font-size: 14px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  flex: 1;
  background: var(--accent);
  color: white;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button,
.copy-button {
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
}

.secondary-button {
  width: 88px;
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.output-column {
  display: grid;
  gap: 18px;
}

.checklist {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.checklist li::before {
  content: "";
  width: 17px;
  height: 17px;
  border: 1px solid #c9b8aa;
  border-radius: 50%;
  background: #fffdf9;
}

.checklist li.is-done {
  color: var(--sage);
  font-weight: 700;
}

.checklist li.is-done::before {
  border-color: var(--sage);
  background: radial-gradient(circle at center, var(--sage) 45%, #fffdf9 48%);
}

.drafts {
  display: grid;
  gap: 16px;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--ink);
}

.draft-card {
  padding: 20px;
}

.draft-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.draft-label {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.char-count {
  color: var(--sage);
  font-size: 13px;
  font-weight: 800;
}

.draft-title {
  margin-bottom: 12px;
  font-size: 21px;
  line-height: 1.28;
}

.draft-body {
  white-space: pre-wrap;
  color: #3b322d;
  line-height: 1.8;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tag {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(93, 123, 104, 0.12);
  color: var(--sage);
  font-size: 13px;
  font-weight: 700;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.copy-button {
  padding: 9px 12px;
}

.mobile-action-bar {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 20;
  display: none;
  gap: 10px;
  max-width: 540px;
  padding: 10px;
  margin: 0 auto;
  border: 1px solid rgba(228, 216, 204, 0.92);
  border-radius: 8px;
  background: rgba(255, 250, 244, 0.94);
  box-shadow: 0 14px 42px rgba(55, 38, 28, 0.22);
  backdrop-filter: blur(12px);
}

.mobile-action-bar .primary-button,
.mobile-action-bar .secondary-button {
  flex: 1;
  width: auto;
}

@media (max-width: 860px) {
  .intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .input-panel .actions {
    display: none;
  }

  .mobile-action-bar {
    display: flex;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .draft-meta,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-title span {
    text-align: left;
  }

  h1 {
    font-size: 34px;
  }

  .subtitle {
    font-size: 14px;
    line-height: 1.55;
  }

  .status-pill {
    width: 100%;
    text-align: center;
  }

  .input-panel,
  .checklist-panel,
  .draft-card,
  .empty-state {
    padding: 16px;
  }

  input[type="text"],
  input[type="file"] {
    min-height: 48px;
  }

  .preview-box {
    min-height: 220px;
  }

  .preview-box img {
    height: 300px;
  }

  .copy-button {
    flex: 1 1 30%;
    min-width: 92px;
  }
}
