:root {
  --green: #174c3d;
  --green-dark: #10392e;
  --green-soft: #e5f0e9;
  --cream: #f7f4ed;
  --paper: #fffdf9;
  --ink: #222a26;
  --muted: #777d78;
  --line: #dedfd9;
  --orange: #e77a50;
  --shadow: 0 18px 50px rgba(38, 54, 46, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(174, 204, 182, 0.28), transparent 28%),
    var(--cream);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  border-bottom: 1px solid rgba(23, 76, 61, 0.12);
  background: rgba(247, 244, 237, 0.9);
  backdrop-filter: blur(12px);
}

.header-inner,
.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--green);
  font-family: "KaiTi", serif;
  font-size: 20px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.ghost-button {
  padding: 8px 14px;
  border: 1px solid #cad1cc;
  border-radius: 999px;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.page {
  padding: 50px 0 70px;
}

.intro {
  max-width: 720px;
  margin: 0 auto 34px;
  text-align: center;
}

.eyebrow,
.result-label {
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.intro h1 {
  margin: 10px 0 13px;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 600;
  line-height: 1.16;
}

.intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.feature-tabs {
  width: fit-content;
  margin: 0 auto 22px;
  padding: 5px;
  display: flex;
  gap: 5px;
  border: 1px solid rgba(23, 76, 61, 0.12);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 10px 30px rgba(38, 54, 46, 0.07);
}

.feature-tab {
  min-width: 126px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.feature-tab span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
  font-family: "KaiTi", serif;
}

.feature-tab.active {
  color: #fff;
  background: var(--green);
}

.feature-tab.active span {
  color: var(--green);
  background: #fff;
}

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

.card {
  border: 1px solid rgba(23, 76, 61, 0.1);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: var(--shadow);
}

.config-card {
  padding: 25px;
}

.card-heading {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.card-heading > span {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--green);
  background: var(--green-soft);
}

.card-heading h2,
.card-heading p {
  margin: 0;
}

.card-heading h2 {
  font-size: 18px;
}

.card-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

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

.field > span,
.length-field > span,
.title-box > span,
.body-box > div span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
}

.field b {
  color: var(--orange);
}

.field input,
.field select,
.field textarea,
.title-box input {
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
}

.field input,
.field select,
.title-box input {
  height: 43px;
}

.field textarea {
  min-height: 76px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
  line-height: 1.7;
}

.field input:focus,
.field select:focus,
.title-box input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 76, 61, 0.08);
}

.length-field {
  margin-top: 19px;
  display: block;
}

.length-field strong {
  color: var(--green);
}

.length-field input {
  width: 100%;
  accent-color: var(--green);
}

.length-field > div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.truth-note {
  margin: 17px 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  border-radius: 12px;
  color: #6e553d;
  background: #f7e9da;
}

.truth-note > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--orange);
  font-weight: 700;
}

.truth-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.65;
}

.truth-note.risk-warning {
  color: #762f28;
  background: #f7dcd7;
}

.truth-note.risk-warning > span {
  background: #a9473e;
}

.generate-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 25px rgba(23, 76, 61, 0.2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.generate-button:hover {
  background: var(--green-dark);
}

.result-card {
  min-height: 600px;
  overflow: hidden;
}

.result-empty {
  min-height: 600px;
  padding: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  font-size: 34px;
}

.result-empty h2 {
  margin: 22px 0 8px;
  font-family: "Songti SC", SimSun, serif;
  font-size: 22px;
}

.result-empty p {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.hidden {
  display: none !important;
}

.result-content {
  padding: 25px;
}

.result-heading,
.body-box > div,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-heading {
  margin-bottom: 20px;
}

.result-heading h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.safe-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
}

.note-title {
  height: 48px;
  font-weight: 700;
}

.batch-results {
  display: grid;
  gap: 15px;
}

.note-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.note-card-heading,
.note-body-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note-card-heading {
  margin-bottom: 10px;
}

.note-card-heading strong {
  font-size: 11px;
}

.note-card-heading span,
.note-body-heading small {
  color: var(--muted);
  font-size: 9px;
}

.note-title {
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
}

.note-body-wrap {
  margin-top: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fffdf9;
}

.note-body-heading span {
  font-size: 10px;
  font-weight: 700;
}

.note-body {
  width: 100%;
  min-height: 400px;
  padding: 6px 1px;
  border: 0;
  outline: 0;
  resize: vertical;
  color: #343a36;
  background: transparent;
  font-size: 12px;
  line-height: 2;
}

.note-risk {
  margin-top: 13px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  line-height: 1.6;
}

.note-risk.warning {
  color: #7b4937;
  background: #f7e2d9;
}

.copy-one {
  padding: 5px 10px;
  border: 1px solid #cad8cf;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.result-actions {
  margin-top: 14px;
}

.result-actions button {
  min-height: 43px;
  padding: 0 20px;
  border: 1px solid var(--green);
  border-radius: 11px;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.result-actions .primary-action {
  flex: 1;
  color: #fff;
  background: var(--green);
}

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

.poster-controls,
.poster-preview-card {
  padding: 25px;
}

.upload-zone {
  min-height: 142px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed #abc0b5;
  border-radius: 16px;
  color: var(--green);
  background: linear-gradient(145deg, #f5fbf7, #edf5f0);
  cursor: pointer;
  text-align: center;
  transition: 160ms ease;
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--green);
  background: #e7f3eb;
  transform: translateY(-1px);
}

.upload-zone input {
  display: none;
}

.upload-zone .upload-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 9px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--green);
  font-size: 21px;
}

.upload-zone strong {
  font-size: 12px;
}

.upload-zone small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.poster-field-grid {
  margin-top: 18px;
}

.poster-shade-field {
  margin-bottom: 0;
}

.poster-copy-editor {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.poster-copy-editor .field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.poster-copy-editor .field > span small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 400;
}

.poster-section {
  margin-top: 17px;
  padding: 15px;
  border: 1px solid rgba(23, 76, 61, 0.1);
  border-radius: 15px;
  background: #f8faf7;
}

.poster-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.poster-section-heading strong {
  font-size: 11px;
}

.poster-section-heading small {
  color: var(--muted);
  font-size: 8px;
  text-align: right;
}

.poster-section .compact-range {
  margin-top: 12px;
}

.poster-corner-field {
  margin-top: 12px;
  margin-bottom: 0;
}

.poster-section .compact-range + .compact-range {
  margin-top: 10px;
}

.poster-style-grid {
  margin-top: 13px;
}

.switch-row {
  height: 43px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.switch-row input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--green);
}

.poster-preview-card {
  position: sticky;
  top: 18px;
}

.poster-result-heading {
  margin-bottom: 15px;
}

.poster-result-heading h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.poster-preview-wrap {
  position: relative;
  width: min(100%, 510px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 19px;
  background: #dce8e1;
  box-shadow: 0 18px 40px rgba(20, 45, 35, 0.16);
  aspect-ratio: 3 / 4;
}

.poster-preview-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}

.poster-preview-wrap img.dragging {
  cursor: grabbing;
}

.poster-preview-wrap canvas {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.poster-drag-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(18, 31, 25, 0.68);
  font-size: 8px;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.poster-preview-note {
  margin-top: 14px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 12px;
  color: var(--muted);
  background: #f5f6f2;
}

.poster-preview-note span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 8px;
  font-weight: 700;
}

.poster-preview-note p {
  margin: 0;
  font-size: 9px;
  line-height: 1.55;
}

.poster-actions {
  margin-top: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  padding: 9px 15px;
  border-radius: 999px;
  color: #fff;
  background: rgba(23, 32, 27, 0.94);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 850px) {
  .workspace,
  .poster-workspace {
    grid-template-columns: 1fr;
  }

  .result-card {
    min-height: 480px;
  }

  .result-empty {
    min-height: 480px;
  }

  .poster-preview-card {
    position: static;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .page {
    width: min(100% - 22px, 1040px);
  }

  .brand small {
    display: none;
  }

  .page {
    padding-top: 34px;
  }

  .intro {
    margin-bottom: 24px;
  }

  .intro h1 {
    font-size: 35px;
  }

  .intro p {
    font-size: 11px;
  }

  .feature-tabs {
    width: 100%;
  }

  .feature-tab {
    min-width: 0;
    flex: 1;
  }

  .config-card,
  .result-content,
  .poster-controls,
  .poster-preview-card {
    padding: 18px;
  }

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

  .result-empty {
    padding: 35px 20px;
  }

  .note-body {
    min-height: 360px;
  }

  .poster-preview-wrap {
    width: 100%;
  }

  .poster-actions {
    align-items: stretch;
  }

  .poster-actions button {
    padding: 0 13px;
  }

  .poster-section {
    padding: 13px;
  }

  .poster-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .poster-section-heading small {
    text-align: left;
  }
}
