:root {
  color-scheme: light;
  --bg: #faf8f5;
  --surface: #f4f0ea;
  --text: #24211e;
  --muted: #756f68;
  --line: #ded8d1;
  --primary: #292623;
  --focus: #8c7764;
  --error: #9b3f3f;
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.page-shell { width: min(100% - 40px, 1120px); min-height: 100dvh; margin: auto; display: grid; grid-template-rows: auto 1fr auto; }
.site-header { height: 80px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; font-weight: 650; letter-spacing: .04em; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.header-actions { display: flex; gap: 24px; align-items: center; }
.header-actions a, .text-link, footer a { color: var(--muted); font-size: 14px; text-decoration: none; }
.header-actions a:hover, .text-link:hover, footer a:hover { color: var(--text); }
.text-button { min-height: 44px; padding: 0; border: 0; color: var(--muted); background: none; cursor: pointer; }
.text-button:hover { color: var(--text); }
main { display: grid; place-items: center; padding: 48px 0 96px; }
.question-view { width: min(100%, 640px); text-align: center; }
.date { margin: 0 0 28px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 40px); font-weight: 500; line-height: 1.35; letter-spacing: -.03em; }
.rule { width: 72px; height: 1px; margin: 30px auto 42px; background: var(--line); }
.answer-field { position: relative; }
textarea { width: 100%; min-height: 220px; resize: vertical; padding: 24px 24px 42px; border: 1px solid var(--line); border-radius: 16px; outline: 0; color: var(--text); background: var(--surface); font-size: 17px; line-height: 1.75; transition: border-color 160ms, box-shadow 160ms; }
textarea::placeholder { color: #999189; }
textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(140 119 100 / 16%); }
.counter { position: absolute; right: 18px; bottom: 14px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.counter.near-limit { color: var(--error); }
.public-option { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; color: var(--muted); font-size: 14px; line-height: 1.6; text-align: left; cursor: pointer; }
.public-option input { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--primary); }
.form-error { min-height: 24px; margin: 8px 0 0; color: var(--error); font-size: 14px; }
.primary-button { min-width: 220px; min-height: 52px; display: inline-grid; place-items: center; margin-top: 20px; padding: 0 24px; border: 1px solid var(--primary); border-radius: 12px; color: var(--bg); background: var(--primary); font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background 160ms, transform 160ms; }
.primary-button:hover { background: #403c38; }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { opacity: .38; cursor: not-allowed; }
.privacy-note { margin-top: 18px; color: var(--muted); font-size: 13px; }
.privacy-note .text-button { min-height: 32px; font-size: inherit; }
.loading { padding: 50px 0; color: var(--muted); }
.spinner { width: 30px; height: 30px; display: inline-block; border: 1px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 1.2s linear infinite; }
.loading p { margin: 22px 0 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.result { text-align: left; animation: enter 240ms cubic-bezier(.22,1,.36,1); }
.answer-quote { margin: 0 0 52px; color: var(--muted); font-size: 17px; line-height: 1.75; text-align: center; }
.result-block { padding: 42px 0; border-top: 1px solid var(--line); }
.eyebrow { margin: 0 0 18px; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .08em; }
.echo { margin: 0; font-size: clamp(24px, 4vw, 28px); line-height: 1.7; }
.resonance-number { margin-right: 10px; font-size: 48px; font-weight: 600; font-variant-numeric: tabular-nums; }
.resonance-copy { color: var(--muted); }
.resonance-bar, .topic-bar { overflow: hidden; background: var(--line); }
.resonance-bar { height: 5px; margin: 20px 0 12px; }
.resonance-bar span, .topic-bar span { height: 100%; display: block; background: var(--primary); }
.explain { min-height: 32px; font-size: 13px; }
.topic-row { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: center; margin-top: 17px; }
.topic-bar { height: 7px; border-radius: 9px; }
.topic-bar span { border-radius: inherit; }
.echo-space { margin-top: 30px; padding: 34px; border: 1px solid #e5ded5; border-radius: 24px; background: linear-gradient(145deg, #f7f3ed, #f2ece5); }
.echo-space-header { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; }
.echo-space-header .eyebrow { margin-bottom: 10px; }
.echo-space-header h2 { margin: 0; font-size: 24px; font-weight: 500; line-height: 1.45; letter-spacing: -.02em; }
.echo-expiry { flex: 0 0 auto; padding: 6px 10px; border: 1px solid #d9cfc4; border-radius: 999px; color: var(--muted); background: rgb(250 248 245 / 65%); font-size: 12px; letter-spacing: .08em; }
.echo-space-copy { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.gathering-form { margin-top: 26px; padding: 18px; border: 1px solid #ded5cc; border-radius: 16px; background: rgb(250 248 245 / 78%); transition: border-color 160ms, box-shadow 160ms; }
.gathering-form:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(140 119 100 / 12%); }
.echo-compose-field { position: relative; }
.gathering-form textarea { min-height: 94px; padding: 2px 2px 26px; border: 0; border-radius: 0; background: transparent; box-shadow: none; resize: none; font-size: 15px; }
.gathering-form textarea:focus { box-shadow: none; }
.echo-compose-field > span { position: absolute; right: 2px; bottom: 2px; color: #9a9289; font-size: 12px; font-variant-numeric: tabular-nums; }
.gathering-form > div:last-child { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.gathering-status { color: var(--muted); font-size: 13px; line-height: 1.5; }
.echo-submit { min-height: 40px; padding: 0 15px; border: 0; border-radius: 10px; color: var(--bg); background: var(--primary); cursor: pointer; }
.echo-submit:hover { background: #403c38; }
.echo-submit:disabled { opacity: .45; cursor: default; }
.echo-submit span { margin-left: 6px; }
.echo-list-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 36px; padding-bottom: 12px; border-bottom: 1px solid #ddd4ca; color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.echo-list { display: grid; gap: 12px; margin-top: 14px; }
.echo-empty { margin: 12px 0 2px; color: var(--muted); font-size: 14px; line-height: 1.7; text-align: center; }
.publish-notice { margin: 18px 0 0; padding: 12px 14px; border-left: 2px solid var(--focus); color: var(--muted); background: var(--surface); font-size: 14px; line-height: 1.6; }
.echo-card { position: relative; padding: 20px 20px 16px 46px; border: 1px solid rgb(222 216 209 / 85%); border-radius: 16px; background: rgb(250 248 245 / 74%); transition: border-color 160ms, transform 160ms; }
.echo-card:hover { border-color: #cec3b8; transform: translateY(-1px); }
.echo-mark { position: absolute; top: 14px; left: 18px; color: #b9aa9b; font-family: Georgia, serif; font-size: 36px; line-height: 1; }
.echo-card > p { margin: 0; font-size: 15px; line-height: 1.8; }
.echo-reactions { display: flex; gap: 10px; margin-top: 18px; }
.echo-reactions button { min-height: 34px; padding: 0 11px; border: 1px solid #ddd4ca; border-radius: 999px; color: var(--muted); background: transparent; font-size: 13px; cursor: pointer; }
.echo-reactions button:hover:not(:disabled) { color: var(--text); border-color: var(--focus); }
.echo-reactions button:disabled { opacity: .55; cursor: default; }
.echo-reactions span { font-variant-numeric: tabular-nums; }
.result-ending { margin: 42px 0 18px; color: var(--muted); text-align: center; }
.support-prompt { margin: 0 0 26px; color: var(--muted); font-size: 14px; text-align: center; }
.support-prompt a { color: var(--text); text-underline-offset: 3px; }
.result-actions { text-align: center; }
.secondary-button { min-height: 48px; padding: 0 22px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: transparent; cursor: pointer; }
.safety { max-width: 560px; margin: auto; padding: 36px; border: 1px solid var(--line); border-radius: 16px; text-align: left; }
.safety h2 { margin: 0 0 18px; font-size: 28px; line-height: 1.4; }
.safety p { line-height: 1.75; }
.safety small { display: block; margin-top: 24px; color: var(--muted); }
.support-main { place-items: start center; }
.support-page { width: min(100%, 720px); }
.support-page h1 { text-align: left; }
.support-intro { max-width: 620px; margin: 28px 0 48px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.urgent-support { padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.urgent-support h2, .support-section h2 { margin: 0 0 16px; font-size: 22px; line-height: 1.45; }
.urgent-support p, .support-section p, .grounding-list { line-height: 1.8; }
.urgent-support a:not(.primary-button), .support-section a { color: var(--text); font-weight: 600; text-underline-offset: 3px; }
.urgent-support small { display: block; margin-top: 20px; color: var(--muted); }
.support-section { padding: 44px 0; border-bottom: 1px solid var(--line); }
.grounding-list { margin: 0; padding-left: 24px; }
.grounding-list li + li { margin-top: 8px; }
.support-note { color: var(--muted); font-size: 14px; }
.support-section blockquote { margin: 24px 0; padding: 18px 20px; border-left: 2px solid var(--focus); background: var(--surface); font-size: 17px; line-height: 1.8; }
.support-ending { margin: 48px 0 0; color: var(--muted); font-size: 18px; text-align: center; }
footer { min-height: 72px; display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
footer .text-button { font-size: inherit; }
dialog { width: min(100% - 40px, 520px); padding: 32px; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: var(--bg); box-shadow: 0 24px 80px rgb(36 33 30 / 18%); }
dialog::backdrop { background: rgb(36 33 30 / 32%); }
.dialog-close { width: 44px; height: 44px; float: right; border: 0; color: var(--muted); background: transparent; font-size: 28px; cursor: pointer; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 0; font-size: 20px; }
.share-dialog canvas { width: min(100%, 270px); display: block; margin: 24px auto; border: 1px solid var(--line); }
.share-option { display: flex; gap: 10px; align-items: center; }
.share-option input { width: 18px; height: 18px; accent-color: var(--primary); }
.share-warning { color: var(--muted); font-size: 13px; }
.share-dialog .primary-button { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgb(140 119 100 / 40%); outline-offset: 3px; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 600px) {
  .site-header { height: 64px; }
  .header-actions { gap: 14px; }
  .header-actions a { font-size: 13px; }
  main { place-items: start center; padding: 52px 0 72px; }
  .date { margin-bottom: 20px; text-align: left; }
  h1 { text-align: left; }
  .rule { width: 48px; margin: 24px 0 32px; }
  textarea { min-height: 180px; padding: 20px 20px 40px; font-size: 16px; }
  .primary-button { width: 100%; }
  .answer-quote { text-align: left; }
  .result-block.echo-space { margin-inline: -4px; padding: 22px 16px; border-radius: 20px; }
  .echo-space-header { position: relative; display: block; }
  .echo-space-header .eyebrow { min-height: 30px; padding-right: 92px; }
  .echo-space-header h2 { font-size: 20px; line-height: 1.5; }
  .echo-expiry { position: absolute; top: -2px; right: 0; }
  .echo-space-copy { margin-top: 10px; font-size: 13px; }
  .gathering-form { margin-top: 20px; padding: 14px; }
  .gathering-form textarea { min-height: 78px; font-size: 14px; }
  .gathering-form > div:last-child { gap: 10px; }
  .gathering-status { min-width: 0; }
  .echo-submit { min-width: 116px; min-height: 38px; }
  .echo-list-heading { margin-top: 28px; }
  .echo-list { gap: 10px; }
  .echo-card { padding: 16px 14px 14px 38px; }
  .echo-mark { top: 12px; left: 14px; font-size: 31px; }
  .echo-reactions { flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  .echo-reactions button { min-height: 32px; padding-inline: 10px; font-size: 12px; }
  .result-block { padding: 36px 0; }
  .safety { padding: 24px; }
  .urgent-support { padding: 22px; }
  .urgent-support .primary-button { width: 100%; padding: 0 14px; }
  dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 20px 20px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
