:root {
  --ink: #1d251f;
  --muted: #6f766f;
  --line: rgba(29, 37, 31, 0.13);
  --paper: rgba(250, 249, 244, 0.88);
  --paper-solid: #faf9f4;
  --green: #315c46;
  --green-dark: #234433;
  --sage: #dce7dc;
  --cream: #f4f1e8;
  --shadow: 0 24px 70px rgba(40, 54, 44, 0.1);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--cream); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px),
    var(--cream);
  background-size: 38px 38px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

button, textarea { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: 0;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  opacity: .55;
}

.ambient-one { top: -17rem; right: -10rem; background: radial-gradient(circle, #d5e5d7 0, rgba(213,229,215,0) 68%); }
.ambient-two { bottom: -21rem; left: -11rem; background: radial-gradient(circle, #e1d8c3 0, rgba(225,216,195,0) 68%); }

.page-shell { position: relative; z-index: 1; width: min(1440px, 100%); margin: 0 auto; padding: 0 5vw; }

.site-header {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--green); border-radius: 50%; color: var(--green); font-family: Georgia, "Songti SC", serif; font-weight: 600; }

.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.38); color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #d19b39; box-shadow: 0 0 0 4px rgba(209,155,57,.12); }
.status-pill.ready .status-dot { background: #4e8c68; box-shadow: 0 0 0 4px rgba(78,140,104,.12); }
.status-pill.missing .status-dot { background: #b95e50; box-shadow: 0 0 0 4px rgba(185,94,80,.12); }

.hero { padding: clamp(54px, 8vw, 106px) 0 54px; text-align: center; }
.hero .eyebrow { margin: 0 0 19px; color: var(--green); font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { margin: 0; font: 600 clamp(42px, 6.2vw, 82px)/1.04 Georgia, "Songti SC", serif; letter-spacing: -.055em; }
.hero h1 em { color: var(--green); font-weight: 400; }
.hero-copy { width: min(600px, 90%); margin: 25px auto 0; color: var(--muted); font-size: clamp(14px, 1.3vw, 17px); line-height: 1.9; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr); align-items: stretch; }
.editor-card { min-width: 0; min-height: 500px; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(16px); overflow: hidden; }
.card-heading { min-height: 75px; padding: 0 25px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.card-heading > div { display: flex; align-items: center; gap: 13px; }
.step-number { color: #899087; font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.card-heading h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.text-button { padding: 7px 4px; border: 0; background: none; color: #858b85; cursor: pointer; font-size: 12px; }
.text-button:hover { color: var(--ink); }

textarea, .result-content { min-height: 360px; flex: 1; width: 100%; border: 0; background: transparent; color: var(--ink); font: 400 15px/1.9 Georgia, "Songti SC", serif; }
textarea { padding: 26px; resize: none; outline: none; }
textarea::placeholder { color: #aaa99f; }

.editor-footer, .result-footer { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 25px; border-top: 1px solid var(--line); color: #8b908a; font: 400 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.privacy-note { display: flex; align-items: center; gap: 6px; }
.privacy-note svg { width: 13px; height: 13px; fill: #778078; }

.action-column { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; }
.humanize-button { width: 58px; height: 58px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--green); color: white; cursor: pointer; box-shadow: 0 12px 30px rgba(49,92,70,.24); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.humanize-button:hover { transform: translateY(-2px); background: var(--green-dark); box-shadow: 0 16px 34px rgba(49,92,70,.3); }
.humanize-button:active { transform: translateY(0); }
.humanize-button:disabled { cursor: wait; opacity: .75; }
.humanize-button svg { width: 22px; fill: currentColor; }
.humanize-button .button-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.humanize-button.loading svg { animation: pulse-arrow 1s ease-in-out infinite; }
.keyboard-hint { color: #9a9e97; font: 400 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }

.copy-button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.5); color: var(--green); cursor: pointer; font-size: 11px; font-weight: 600; transition: .2s ease; }
.copy-button:hover:not(:disabled) { border-color: rgba(49,92,70,.35); background: var(--sage); }
.copy-button:disabled { cursor: not-allowed; color: #aaa; }
.copy-button svg { width: 14px; fill: currentColor; }
.copy-button.copied { background: var(--green); color: #fff; }

.result-content { padding: 26px; white-space: pre-wrap; overflow: auto; outline: none; }
.result-content.empty { display: grid; place-items: center; color: #999d96; }
.empty-state { text-align: center; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
.empty-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border: 1px solid var(--line); border-radius: 50%; color: #8c938b; font: 400 18px/1 Georgia, "Songti SC", serif; }
.empty-state p { margin: 0 0 8px; color: #696f69; font-size: 13px; font-weight: 500; }
.empty-state > span:last-child { font-size: 11px; }

.result-card.has-result { border-color: rgba(49,92,70,.28); }
.result-card.is-loading .result-content { opacity: .55; }

.error-banner { position: fixed; z-index: 10; left: 50%; bottom: 26px; transform: translateX(-50%); width: min(580px, calc(100% - 32px)); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid rgba(158,75,60,.24); border-radius: 12px; background: #fff8f4; color: #7f392f; box-shadow: 0 18px 50px rgba(78,45,38,.18); font-size: 13px; }
.error-banner[hidden] { display: none; }
.error-banner button { flex: 0 0 auto; border: 0; background: none; color: inherit; cursor: pointer; font-size: 20px; }

.site-footer { padding: 30px 0 38px; text-align: center; color: #91968f; font-size: 10px; }
.site-footer p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes pulse-arrow { 0%,100% { transform: translateX(-2px); opacity: .7; } 50% { transform: translateX(3px); opacity: 1; } }

@media (max-width: 860px) {
  .page-shell { padding: 0 20px; }
  .workspace { grid-template-columns: 1fr; gap: 18px; }
  .action-column { min-height: 54px; }
  .humanize-button { width: auto; height: 46px; padding: 0 20px; border-radius: 999px; display: flex; gap: 10px; }
  .humanize-button .button-label { position: static; width: auto; height: auto; clip: auto; font-size: 12px; font-weight: 600; }
  .humanize-button svg { width: 17px; transform: rotate(90deg); }
  .humanize-button.loading svg { animation: none; }
  .keyboard-hint { display: none; }
  .editor-card { min-height: 440px; }
  textarea, .result-content { min-height: 300px; }
}

@media (max-width: 520px) {
  .site-header { height: 72px; }
  .status-pill { padding: 7px 10px; }
  .hero { padding: 46px 0 38px; }
  .hero h1 { font-size: 39px; }
  .hero-copy { line-height: 1.7; }
  .editor-card { border-radius: 14px; }
  .card-heading, .editor-footer, .result-footer { padding-left: 18px; padding-right: 18px; }
  textarea, .result-content { padding: 21px 18px; }
  .privacy-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
