:root {
  --ink: #161914;
  --paper: #f6f2e8;
  --card: #fbf8f0;
  --acid: #d8ff38;
  --red: #e84b31;
  --line: rgba(22, 25, 20, 0.2);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.23;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; position: relative; }
.masthead { height: 112px; border-bottom: 1px solid var(--ink); display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 900; font-size: 12px; line-height: 0.92; letter-spacing: 0.06em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font: italic 700 24px Georgia, serif; }
.edition { font-size: 12px; font-weight: 700; letter-spacing: 0.13em; }

.hero { padding: 66px 0 58px; display: grid; grid-template-columns: 1fr 300px; align-items: end; gap: 64px; }
.issue, .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.17em; }
.issue { grid-column: 1 / -1; margin-bottom: -38px; }
h1 { margin: 0; font-size: clamp(48px, 7.7vw, 102px); line-height: 0.92; letter-spacing: -0.065em; font-weight: 900; }
h1 em { display: inline-block; color: var(--red); font-family: Georgia, "Songti SC", serif; font-size: .78em; font-weight: 500; white-space: nowrap; }
.intro { margin: 0 0 8px; font: 19px/1.7 Georgia, "Songti SC", serif; }

.workspace { display: grid; grid-template-columns: 1.45fr 0.8fr; border: 1px solid var(--ink); background: var(--card); box-shadow: 10px 10px 0 var(--ink); }
.form-panel, .preview-panel { padding: 40px; }
.form-panel { border-right: 1px solid var(--ink); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
h2 { margin: 8px 0 0; font: 700 28px/1.2 Georgia, "Songti SC", serif; }
.word-count { display: flex; align-items: baseline; gap: 6px; }
.word-count strong { font: 600 44px/1 Georgia, serif; }
.word-count span { font-size: 12px; }
textarea { width: 100%; min-height: 220px; resize: vertical; border: 1px solid var(--ink); border-radius: 0; padding: 22px; background: #fffef9; color: var(--ink); outline: none; font: 20px/1.7 Georgia, serif; transition: box-shadow 0.18s, transform 0.18s; }
textarea:focus { box-shadow: 6px 6px 0 var(--acid); transform: translate(-2px, -2px); }
textarea::placeholder { color: #9d998f; }
.field-note { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font-size: 12px; color: #696a64; }
.text-button { border: 0; padding: 0; color: inherit; background: none; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.chips { min-height: 42px; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 25px; }
.chip { padding: 7px 10px; border: 1px solid var(--ink); background: var(--acid); font: 600 12px Georgia, serif; }
.chip.more { background: var(--ink); color: white; }

.preview-panel { position: relative; overflow: hidden; background: var(--acid); }
.paper-stack { height: 260px; margin: 34px 12px 26px; position: relative; }
.paper { position: absolute; width: 174px; height: 246px; padding: 17px; background: white; border: 1px solid var(--ink); box-shadow: 4px 4px 0 rgba(22,25,20,.22); }
.back-paper { top: 6px; left: calc(50% - 103px); transform: rotate(-7deg); }
.front-paper { top: 0; left: calc(50% - 70px); transform: rotate(4deg); }
.mock-header { height: 18px; display: grid; grid-template-columns: .7fr 1.4fr 2fr; align-items: center; border: 1px solid #333; font: 5px Georgia, serif; text-align: center; }
.mock-header span + span { border-left: 1px solid #333; height: 100%; display: grid; place-items: center; }
.mock-table, .mock-lines { height: 174px; border: 1px solid #333; border-top: 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 13px, #777 13px, #777 14px), linear-gradient(to right, transparent 0 18%, #777 18% 18.6%, transparent 18.6% 54%, #777 54% 54.6%, transparent 54.6%); }
.chinese-lines { margin-top: 22px; border: 0; background: repeating-linear-gradient(to bottom, transparent 0, transparent 17px, #777 17px, #777 18px); }
.output-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.output-list li { display: flex; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--ink); font-size: 13px; font-weight: 700; }
.output-list span { font: italic 700 13px Georgia, serif; }

.action-row { display: flex; align-items: center; justify-content: space-between; padding: 42px 0 20px; }
.privacy { font-size: 12px; color: #65665f; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #4f9b4c; }
.generate-button { min-width: 260px; height: 72px; padding: 0 12px 0 30px; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--ink); background: var(--ink); color: white; font: 800 18px inherit; cursor: pointer; box-shadow: 7px 7px 0 var(--red); transition: transform .18s, box-shadow .18s; }
.generate-button:not(:disabled):hover { transform: translate(3px, 3px); box-shadow: 4px 4px 0 var(--red); }
.generate-button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.button-arrow { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--acid); color: var(--ink); font-size: 25px; }
.generate-button.loading .button-arrow { animation: spin .8s linear infinite; }
.message { min-height: 28px; text-align: right; color: var(--red); font-size: 13px; font-weight: 700; }
.site-footer { min-height: 118px; margin-top: 62px; padding: 28px max(20px, calc((100vw - 1180px) / 2)); display: flex; justify-content: space-between; align-items: flex-end; color: #f6f2e8; background: var(--ink); font-size: 11px; letter-spacing: .12em; }
.site-footer span:first-child { font: 800 clamp(30px, 5vw, 64px)/1 Georgia, serif; letter-spacing: -.04em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  main { width: min(100% - 24px, 620px); }
  .masthead { height: 82px; }
  .edition { display: none; }
  .hero { grid-template-columns: 1fr; gap: 24px; padding: 50px 0 38px; }
  .issue { margin: 0 0 -8px; }
  .intro { font-size: 16px; max-width: 480px; }
  h1 em { white-space: normal; }
  .workspace { grid-template-columns: 1fr; box-shadow: 6px 6px 0 var(--ink); }
  .form-panel { border-right: 0; border-bottom: 1px solid var(--ink); }
  .form-panel, .preview-panel { padding: 26px 20px; }
  textarea { min-height: 180px; }
  .action-row { align-items: stretch; flex-direction: column; gap: 22px; }
  .generate-button { width: 100%; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 22px; }
}
