:root {
  --ink: #28322f; --muted: #6f7b76; --paper: #fbfaf6; --cream: #f2eee3;
  --sage: #718a7b; --sage-dark: #526c5d; --sage-soft: #e4ebe5;
  --rose: #a45b62; --line: rgba(40, 50, 47, .14);
  --shadow: 0 24px 70px rgba(52, 64, 59, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background: radial-gradient(circle at 8% 4%, rgba(210,222,208,.75), transparent 32rem),
              radial-gradient(circle at 92% 88%, rgba(235,216,204,.6), transparent 30rem), var(--paper);
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}
button, textarea, select, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(880px, calc(100% - 28px)); margin: 0 auto; padding: 34px 0 56px; }
.brand { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-bottom: 26px; }
.mark {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  color: white; background: var(--sage-dark); font-family: STKaiti, KaiTi, serif; font-size: 25px;
  box-shadow: 0 8px 22px rgba(82,108,93,.25);
}
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(20px,3vw,28px); letter-spacing: .04em; }
h2 { font-size: clamp(27px,4.6vw,42px); line-height: 1.22; letter-spacing: -.02em; }
.eyebrow, .step { margin-bottom: 5px; color: var(--muted); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.ai-badge { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--sage-dark); background: rgba(255,255,255,.62); font-size: 13px; white-space: nowrap; }
.brand-actions { display: flex; align-items: center; gap: 8px; }
.mini-link { padding: 7px 4px; border: 0; color: var(--sage-dark); background: transparent; font-size: 13px; }
.card, .chat { border: 1px solid rgba(255,255,255,.72); border-radius: 28px; background: rgba(255,255,255,.78); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.card { padding: clamp(24px,6vw,54px); }
.welcome .lead { max-width: 650px; color: var(--muted); font-size: 17px; line-height: 1.8; }
.kicker { margin-bottom: 10px; color: var(--sage-dark); font-weight: 700; letter-spacing: .12em; }
.notice { margin: 26px 0 22px; padding: 18px 20px; border-left: 4px solid var(--sage); border-radius: 4px 15px 15px 4px; background: var(--sage-soft); }
.notice p { margin: 7px 0 0; color: #536159; line-height: 1.65; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; line-height: 1.45; }
.check input { width: 18px; height: 18px; accent-color: var(--sage-dark); }
.primary, .outline, .text-button { border: 0; border-radius: 14px; transition: transform .16s ease, background .16s ease, opacity .16s ease; }
.primary { width: 100%; margin-top: 22px; padding: 15px 20px; color: white; background: var(--sage-dark); font-weight: 700; }
.primary:hover { background: #435c4d; transform: translateY(-1px); }
.primary:disabled { cursor: wait; opacity: .55; transform: none; }
.outline { padding: 10px 16px; border: 1px solid var(--line); background: white; color: var(--ink); }
.text-button { display: block; margin: 15px auto 0; padding: 8px; color: var(--muted); background: transparent; }
.danger, .danger-text { color: var(--rose); }
fieldset { margin: 28px 0; padding: 0; border: 0; }
legend, .field { color: var(--muted); font-size: 14px; font-weight: 700; }
.choice-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 10px; }
.choice { display: flex; flex-direction: column; gap: 5px; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 15px; background: white; color: var(--ink); }
.choice span { color: var(--muted); font-size: 12px; }
.choice.selected { border-color: var(--sage); background: var(--sage-soft); box-shadow: inset 0 0 0 1px var(--sage); }
.field { display: block; margin: 25px 0; }
select, textarea, .field input { width: 100%; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; }
select, .field input { margin-top: 9px; padding: 13px 14px; }
.auth .lead { color: var(--muted); line-height: 1.7; }
.form-error { min-height: 22px; margin: -8px 0 0; color: var(--rose); font-size: 13px; }
.records-list { display: grid; gap: 10px; margin: 22px 0; }
.record { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.record strong { display: block; margin-bottom: 6px; }
.record span { color: var(--muted); font-size: 13px; }
.full { width: 100%; }
input[type="range"] { width: 100%; margin: 17px 0 4px; accent-color: var(--sage-dark); }
.range-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 400; }
.chat { overflow: hidden; }
.chat-top { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.chat-top h2 { margin: 0; font-size: 22px; }
.messages { min-height: 380px; max-height: 58vh; overflow-y: auto; padding: 26px; }
.message { display: flex; margin-bottom: 18px; }
.message.user { justify-content: flex-end; }
.bubble { max-width: min(640px,86%); padding: 13px 16px; border-radius: 18px; line-height: 1.7; white-space: pre-wrap; }
.assistant .bubble { border-top-left-radius: 5px; background: var(--sage-soft); }
.user .bubble { border-top-right-radius: 5px; color: white; background: var(--sage-dark); }
.typing .bubble { color: var(--muted); }
.shortcuts { display: flex; gap: 8px; overflow-x: auto; padding: 12px 22px; border-top: 1px solid var(--line); background: rgba(242,238,227,.55); }
.shortcuts button { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--sage-dark); background: white; font-size: 13px; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 16px 20px 8px; background: white; }
.composer textarea { resize: none; padding: 12px 14px; line-height: 1.55; }
.composer button { min-width: 74px; border: 0; border-radius: 14px; color: white; background: var(--sage-dark); font-weight: 700; }
.privacy-note { margin: 0; padding: 2px 22px 15px; color: var(--muted); background: white; font-size: 11px; }
.report-body { padding: 18px; border-radius: 16px; background: var(--cream); line-height: 1.8; white-space: pre-wrap; }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.report-actions .primary { margin: 0; }
dialog { width: min(540px,calc(100% - 28px)); padding: 0; border: 0; border-radius: 24px; color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(29,37,33,.55); backdrop-filter: blur(5px); }
.dialog-inner { padding: 30px; line-height: 1.7; }
.dialog-inner h2 { font-size: 28px; }
.hidden { display: none !important; }
.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; }
@media (max-width: 650px) {
  .shell { padding-top: 18px; }
  .brand { grid-template-columns: auto 1fr; }
  .brand-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .choice-grid { grid-template-columns: 1fr; }
  .messages { min-height: 52vh; padding: 18px; }
  .composer { grid-template-columns: 1fr; }
  .composer button { min-height: 45px; }
  .report-actions { grid-template-columns: 1fr; }
}
