:root {
  --ink: #20201e;
  --muted: #77736d;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --line: #ded9cf;
  --red: #ef4538;
  --red-dark: #cc3329;
  --charcoal: #272724;
  --lime: #d9f55b;
  --blue: #c7dff5;
  --shadow: 0 20px 70px rgba(41, 38, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  width: min(1440px, calc(100% - 56px));
  height: 86px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(32, 32, 30, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 22px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.topbar nav a,
.text-button {
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.text-button {
  border-bottom: 1px solid var(--ink);
}

.settings-bar {
  width: min(1440px, calc(100% - 56px));
  margin: 12px auto 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.88);
}

.settings-bar div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.settings-bar strong {
  font-size: 13px;
}

.settings-bar span {
  color: var(--muted);
  font-size: 11px;
}

.settings-bar input {
  width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  outline: none;
}

.hero {
  width: min(1380px, calc(100% - 72px));
  min-height: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 8vw;
  padding: 72px 2vw 86px;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  right: 6%;
  top: 14%;
  border: 1px solid rgba(32, 32, 30, 0.11);
  border-radius: 50%;
  pointer-events: none;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  letter-spacing: 0.08em;
}

.hero h1 {
  margin: 25px 0 20px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(54px, 5.6vw, 88px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero h1 em {
  position: relative;
  color: var(--red);
  font-style: normal;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 3%;
  right: -2%;
  bottom: -7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  z-index: -1;
  transform: rotate(-1deg);
}

.hero-copy > p {
  max-width: 620px;
  color: #5c5954;
  font-size: 17px;
  line-height: 1.95;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  gap: 25px;
  padding: 15px 18px 15px 22px;
  border-radius: 5px;
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 8px 8px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-link:hover {
  transform: translate(3px, 3px);
  box-shadow: 5px 5px 0 var(--ink);
}

.primary-link span {
  font-size: 20px;
}

.micro-copy {
  color: var(--muted);
  font-size: 11px;
}

.hero-board {
  width: min(100%, 500px);
  justify-self: end;
  position: relative;
  z-index: 1;
  padding: 22px;
  border: 1px solid #bdb8ae;
  border-radius: 7px;
  background: #fdfbf5;
  box-shadow: 20px 26px 0 #ded9cf, var(--shadow);
  transform: rotate(1.5deg);
}

.board-head,
.board-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.board-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.board-head b {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 18px;
}

.board-card {
  border: 1px solid var(--ink);
  background: var(--surface);
}

.board-card-main {
  margin: 22px 0 13px;
  padding: 25px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  background: var(--charcoal);
  color: #fff;
}

.card-index {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font: 700 15px Georgia, serif;
}

.board-card-main small,
.board-card-main strong,
.board-card-main p {
  display: block;
}

.board-card-main small {
  color: var(--lime);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.board-card-main strong {
  margin-top: 9px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
}

.board-card-main p {
  margin: 8px 0 0;
  color: #bbb9b4;
  font-size: 12px;
  line-height: 1.7;
}

.board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.board-grid .board-card {
  min-height: 112px;
  padding: 19px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--blue);
}

.board-grid .coral {
  background: #ff9d8e;
}

.board-grid span {
  font-size: 10px;
  letter-spacing: 0.16em;
}

.board-grid b {
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
}

.board-foot {
  padding-top: 18px;
  color: var(--muted);
  font-size: 10px;
}

.board-foot div {
  display: flex;
  gap: 5px;
}

.board-foot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.board-foot i:nth-child(2) {
  background: var(--red);
}

.studio {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 235px minmax(520px, 1fr) minmax(330px, 0.72fr);
  border: 1px solid var(--ink);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(30, 29, 26, 0.12);
}

.tool-rail,
.workspace,
.result-panel {
  min-width: 0;
}

.tool-rail {
  padding: 30px 20px;
  border-right: 1px solid var(--line);
  background: #ebe7de;
}

.tool-rail h2,
.workspace h2,
.method h2,
.history-section h2 {
  margin: 8px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-weight: 600;
}

.tool-rail h2 {
  font-size: 25px;
}

.tool-list {
  margin-top: 30px;
  display: grid;
  gap: 8px;
}

.tool-item {
  width: 100%;
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 10px;
  padding: 13px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.tool-item > span {
  color: #97928a;
  font: 700 10px Georgia, serif;
}

.tool-item strong,
.tool-item small {
  display: block;
}

.tool-item strong {
  font-size: 13px;
}

.tool-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.tool-item.active {
  background: var(--ink);
  color: #fff;
}

.tool-item.active > span,
.tool-item.active small {
  color: #c8c5be;
}

.profile-progress {
  margin-top: 35px;
  padding: 17px 14px;
  border: 1px solid #c8c3b9;
  background: rgba(255, 255, 255, 0.35);
}

.profile-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.profile-progress b {
  color: var(--red);
}

.progress-track {
  height: 4px;
  margin: 10px 0;
  overflow: hidden;
  background: #d2cdc3;
}

.progress-track i {
  display: block;
  height: 100%;
  background: var(--red);
  transition: width 200ms ease;
}

.profile-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.workspace {
  padding: 31px 34px 28px;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 27px;
}

.workspace h2 {
  font-size: 31px;
}

.save-button,
.result-actions button,
.history-head button {
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 5px 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.form-section {
  padding: 23px 0 28px;
  border-top: 1px solid var(--line);
}

.form-section-title {
  margin-bottom: 20px;
  display: flex;
  gap: 13px;
}

.form-section-title > span {
  color: var(--red);
  font: 700 11px Georgia, serif;
}

.form-section-title h3,
.form-section-title p {
  margin: 0;
}

.form-section-title h3 {
  font-size: 15px;
}

.form-section-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.choice-row,
.task-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choice {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.choice.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.field-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px 14px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 7px;
}

.field-label {
  color: #57544f;
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #d2cdc3;
  border-radius: 4px;
  padding: 11px 12px;
  background: #fbfaf6;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field textarea {
  min-height: 78px;
  line-height: 1.65;
}

.field textarea.source-copy {
  min-height: 330px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 69, 56, 0.09);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #aaa59c;
}

.field small {
  color: var(--muted);
  font-size: 9px;
}

.compact-section .field {
  margin-top: 18px;
}

.task-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.task {
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px;
  background: #fff;
  cursor: pointer;
}

.task i {
  color: #aaa59d;
  font-style: normal;
  font-size: 11px;
}

.task span {
  font-size: 11px;
  font-weight: 700;
}

.task.active {
  border-color: var(--red);
  background: #fff3f1;
}

.task.active i {
  color: var(--red);
}

.error-message {
  margin-bottom: 13px;
  border-left: 3px solid var(--red);
  padding: 10px 12px;
  background: #fff0ee;
  color: #9a2f27;
  font-size: 11px;
  line-height: 1.6;
}

.generate-button {
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 17px 18px;
  display: flex;
  justify-content: space-between;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--ink);
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.75;
}

.generate-button span {
  font-weight: 700;
}

.generate-button b {
  font-size: 11px;
  letter-spacing: 0.08em;
}

.form-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.result-panel {
  min-height: 820px;
  border-left: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  background: var(--charcoal);
  color: #f8f5ee;
}

.result-head {
  height: 64px;
  padding: 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #4b4a46;
  font-size: 11px;
}

.live-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(217, 245, 91, 0.12);
}

.result-actions {
  display: flex;
  gap: 14px;
}

.result-actions button {
  color: #d6d2ca;
}

.empty-result,
.loading-state {
  margin: auto;
  max-width: 285px;
  padding: 35px 20px;
  text-align: center;
}

.empty-result > span {
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border: 1px solid #575651;
  border-radius: 50%;
  color: var(--lime);
  font-size: 24px;
}

.empty-result h3 {
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
}

.empty-result p {
  color: #aaa69e;
  font-size: 11px;
  line-height: 1.8;
}

.empty-result div {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.empty-result div b {
  width: 100%;
  margin-bottom: 5px;
  color: #7f7c76;
  font-size: 9px;
}

.empty-result div span {
  border: 1px solid #4c4b47;
  border-radius: 999px;
  padding: 5px 8px;
  color: #99958e;
  font-size: 8px;
}

.loading-lines {
  display: grid;
  gap: 9px;
  margin-bottom: 25px;
}

.loading-lines i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4b4a46 25%, #75736c 50%, #4b4a46 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.loading-lines i:nth-child(2) { width: 85%; }
.loading-lines i:nth-child(3) { width: 92%; }
.loading-lines i:nth-child(4) { width: 64%; }

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.loading-state strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
}

.loading-state p {
  color: #9c9992;
  font-size: 10px;
}

.result-content {
  padding: 28px 25px 38px;
  overflow: auto;
}

.demo-badge {
  margin-bottom: 22px;
  border: 1px solid #6c675b;
  padding: 9px 11px;
  color: var(--lime);
  font-size: 9px;
}

.result-label {
  color: var(--lime);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.result-content h3 {
  margin: 9px 0 18px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 27px;
  line-height: 1.38;
}

.cover-line {
  margin-bottom: 22px;
  border-left: 3px solid var(--red);
  padding: 11px 13px;
  background: #343430;
  font-size: 13px;
}

.cover-line small,
.cta-box small {
  margin-right: 10px;
  color: #98958e;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.result-content pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #dad6ce;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.9;
}

.cta-box {
  margin-top: 24px;
  padding: 16px;
  background: var(--lime);
  color: var(--ink);
}

.cta-box p {
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.65;
}

.hashtag-list {
  margin-top: 19px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hashtag-list span {
  color: #b9d9f5;
  font-size: 10px;
}

.quality-card {
  margin-top: 25px;
  border-top: 1px solid #4c4b47;
  padding-top: 20px;
}

.quality-card > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
}

.quality-card p {
  margin: 7px 0;
  display: flex;
  gap: 8px;
  color: #aaa69f;
  font-size: 9px;
  line-height: 1.5;
}

.quality-card i {
  color: var(--lime);
  font-style: normal;
}

.usage {
  display: block;
  margin-top: 22px;
  color: #77746e;
  font-size: 8px;
}

.method {
  width: min(1340px, calc(100% - 72px));
  margin: 120px auto;
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 7vw;
  align-items: end;
}

.method h2 {
  margin-top: 16px;
  font-size: clamp(36px, 4vw, 58px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.method-intro p {
  max-width: 440px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.method-steps article {
  min-height: 180px;
  padding: 21px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 18px;
  align-content: start;
}

.method-steps article > span {
  color: var(--red);
  font: 700 11px Georgia, serif;
}

.method-steps h3 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
}

.method-steps p {
  grid-column: 2;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.history-section {
  width: min(1340px, calc(100% - 72px));
  margin: 0 auto 110px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 23px;
}

.history-section h2 {
  font-size: 34px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.history-grid button {
  min-height: 145px;
  border: 1px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.history-grid small {
  color: var(--muted);
  font-size: 8px;
}

.history-grid strong {
  margin: 15px 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  line-height: 1.5;
}

.history-grid span {
  color: var(--red);
  font-size: 9px;
}

footer {
  width: min(1440px, calc(100% - 56px));
  min-height: 120px;
  margin: 0 auto;
  border-top: 1px solid rgba(32, 32, 30, 0.17);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 1180px) {
  .studio {
    grid-template-columns: 210px minmax(470px, 1fr);
  }

  .result-panel {
    grid-column: 1 / -1;
    min-height: 520px;
    border-left: 0;
    border-top: 1px solid var(--ink);
  }

  .result-content {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 820px) {
  .topbar,
  .settings-bar,
  footer {
    width: calc(100% - 30px);
  }

  .topbar nav a {
    display: none;
  }

  .settings-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .settings-bar div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .settings-bar input {
    width: 100%;
  }

  .hero {
    width: calc(100% - 30px);
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 56px 0 80px;
  }

  .hero h1 {
    font-size: clamp(44px, 13vw, 68px);
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-board {
    margin-top: 50px;
    justify-self: center;
    transform: none;
    box-shadow: 12px 14px 0 #ded9cf, var(--shadow);
  }

  .hero::before {
    display: none;
  }

  .studio {
    width: calc(100% - 20px);
    grid-template-columns: 1fr;
  }

  .tool-rail {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .tool-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace {
    padding: 26px 18px 25px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .result-panel {
    grid-column: auto;
  }

  .method {
    width: calc(100% - 30px);
    grid-template-columns: 1fr;
    margin: 85px auto;
  }

  .history-section {
    width: calc(100% - 30px);
  }

  .history-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .brand strong {
    font-size: 13px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero-copy > p {
    font-size: 14px;
  }

  .hero-board {
    padding: 15px;
  }

  .board-card-main {
    grid-template-columns: 1fr;
  }

  .tool-list {
    grid-template-columns: 1fr;
  }

  .task-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .workspace-head {
    align-items: flex-start;
    gap: 12px;
  }

  .method-steps {
    grid-template-columns: 1fr;
  }

  .history-grid {
    grid-template-columns: 1fr;
  }

  footer {
    padding: 28px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
