:root {
  color-scheme: light;
  --page: #f5f5ef;
  --surface: #fdfdf9;
  --ink: #202c24;
  --muted: #58665b;
  --line: #d9dfd4;
  --accent: #294b38;
  --soft: #edf2e8;
  --moss: #c8e0af;
  --radius: 20px;
  font-family: "Instrument Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; font-size: 15px; line-height: 1.6; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid #4a7858; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { max-width: 1200px; padding: 0 32px; min-height: 73px; display: flex; align-items: center; gap: 42px; margin: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 18px; font-weight: 750; letter-spacing: -.03em; }
.mark { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; background: var(--accent); }
.mark::before { content: ""; width: 13px; height: 13px; border: 1px solid var(--moss); border-radius: 50%; grid-area: 1 / 1; }
.mark::after { content: ""; width: 5px; height: 15px; border-radius: 80% 10% 80% 10%; background: var(--moss); transform: rotate(35deg); grid-area: 1 / 1; }
nav { display: flex; align-self: stretch; gap: 27px; }
nav a { position: relative; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 14px; white-space: nowrap; }
nav a[aria-current] { color: var(--accent); font-weight: 700; }
nav a[aria-current]::after { content: ""; position: absolute; inset: auto 0 -1px; height: 2px; background: var(--accent); }
.nav-count { padding: 0 5px; background: var(--soft); border-radius: 7px; font-size: 11px; }
.privacy { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.privacy .dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #587c55; }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.account .privacy { margin-left: 0; }
.account-btn { padding: 5px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.account-btn:hover { border-color: var(--accent); color: var(--accent); }
.account-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 700; color: var(--accent); }
#auth-form label { display: block; margin-top: 10px; font-size: 13px; }
#auth-form input { width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
.auth-error { margin: 8px 0 0; color: #b3261e; font-size: 12px; }
@media (max-width: 1080px) { .account .privacy { display: none; } }
.shell { max-width: 1200px; margin: auto; padding: 0 32px 70px; }
.hero { padding: 47px 0 30px; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 760; line-height: 1.2; letter-spacing: -.062em; }
.hero p { color: var(--muted); margin-top: 12px; font-size: 15px; }
.mode-line { display: none; align-items: center; gap: 7px; margin: -16px 0 16px; color: var(--muted); font-size: 12px; }
.mode-line .dot { width: 7px; height: 7px; border-radius: 50%; background: #587c55; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 305px); gap: 22px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-heading > label { font-size: 18px; font-weight: 700; }
.form-grid label, .stack label { min-width: 0; display: grid; gap: 5px; align-content: start; font-size: 13px; font-weight: 650; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid var(--line); background: #fbfcf8; padding: 9px 11px; border-radius: 9px; font-size: 14px; }
textarea { resize: vertical; display: block; line-height: 1.7; }
#question { padding: 15px; border-radius: 13px; font-size: 16px; min-height: 126px; }
::placeholder { color: #69766c; }
.samples { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 13px 0 18px; }
.samples > span { font-size: 12px; color: var(--muted); margin-right: 3px; }
.chip { background: var(--soft); border: 1px solid #e3ebdf; border-radius: 30px; padding: 4px 11px; color: var(--accent); font-size: 12px; }
.chip:hover, .button.secondary:hover, .button.quiet:hover { background: #e3ecdf; }
.details { border-block: 1px solid var(--line); padding: 12px 0; }
summary { color: var(--accent); font-weight: 650; }
.details summary { font-size: 13px; }
.details summary span { font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 14px; margin-top: 12px; }
.wide { grid-column: 1 / -1; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.field-hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.button { display: inline-flex; gap: 9px; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; font-weight: 650; font-size: 13px; min-height: 40px; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: #1c3928; }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--accent); }
.button.quiet { background: transparent; color: var(--muted); }
.button.danger { background: #7c3838; color: #fff; }
.button.danger:hover { background: #652929; }
.rail { display: grid; gap: 16px; }
.process { padding: 25px; border-radius: var(--radius); background: #233a2c; color: #f3f7ed; }
.process h2 { color: #f3f7ed; font-size: 18px; }
.process ol { padding: 0; list-style: none; margin: 19px 0 0; }
.process li { display: grid; grid-template-columns: 19px 1fr; gap: 10px; position: relative; padding-bottom: 16px; }
.process li:last-child { padding-bottom: 0; }
.process li:not(:last-child)::after { content: ""; width: 1px; background: #789480; position: absolute; inset: 16px auto 0 5px; }
.process li > span { width: 11px; height: 11px; margin-top: 6px; border-radius: 50%; border: 1px solid var(--moss); box-shadow: inset 0 0 0 2px #233a2c; background: var(--moss); }
.process strong { font-size: 14px; }
.process p { margin-top: 2px; color: #cfddd0; font-size: 13px; }
.review-card { padding: 19px; }
.review-card .card-heading { margin-bottom: 10px; }
.text-link { color: var(--accent); font-size: 12px; font-weight: 700; }
.text-link:hover { text-decoration: underline; }
.queue-item { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.queue-item:hover strong { text-decoration: underline; }
.empty-note { font-size: 13px; color: var(--muted); }
#result { margin-top: 18px; scroll-margin-top: 18px; }
.stale-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid #e2d9b8; border-radius: 10px; background: #fbf7e6; font-size: 13px; }
.saved-panel { display: grid; gap: 8px; padding: 14px; border: 1px solid #dce8d7; border-radius: 12px; background: var(--soft); }
.saved-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.brief-grid { display: grid; gap: 12px; }
.brief-lead { display: grid; gap: 9px; }
.brief-lead > p { font-weight: 650; }
.metadata { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.metadata span { padding: 2px 8px; border-radius: 6px; background: var(--soft); color: var(--accent); font-size: 12px; }
.metadata .meta-type { background: var(--accent); color: #fff; font-weight: 700; }
.meta-edit { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; background: var(--soft); color: var(--accent); font-size: 12px; }
.meta-edit > span { padding: 0; background: none; }
.meta-edit select { width: auto; padding: 0 1px; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; }
.meta-hint { margin-top: 2px; }
.brief-section { padding-top: 12px; border-top: 1px solid var(--line); }
.brief-section h3 { margin-bottom: 6px; }
.brief-section ul { margin: 3px 0 0; padding-inline-start: 20px; }
.brief-section li { margin: 3px 0; }
.evidence-grid, .option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(177px, 100%), 1fr)); gap: 9px; }
.inset { padding: 11px; background: #f3f6ef; border: 1px solid #e5ebe0; border-radius: 10px; overflow-wrap: anywhere; }
.inset h3 { color: var(--accent); }
.inset p { margin-top: 4px; }
.next-step { border-radius: 11px; background: var(--soft); padding: 14px; border: 1px solid #dce8d7; }
.guidance { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #f7f7ec; }
.guidance p + p { margin-top: 5px; }
.guidance a { text-decoration: underline; }
.stack { display: grid; gap: 10px; margin-top: 10px; }
.stack .button { justify-self: start; }
.journal-hero { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.journal-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; color: var(--muted); }
.journal-bar > div, .entry-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#journal-content { display: grid; gap: 12px; }
.entry { scroll-margin-top: 18px; }
.entry > summary { overflow-wrap: anywhere; }
.entry[open] > summary { margin-bottom: 13px; }
.entry-status { font-size: 12px; font-weight: 500; }
.entry-detail { display: grid; gap: 12px; }
.entry-detail p, .brief-grid p, .brief-grid li { overflow-wrap: anywhere; white-space: pre-wrap; }
.entry-actions { margin-top: 2px; }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 22px; max-width: min(420px, 92vw); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: #15291bb0; }
.dialog-actions { justify-content: end; margin-top: 16px; }
#status { position: fixed; bottom: 17px; inset-inline-end: 18px; max-width: calc(100vw - 36px); padding: 9px 15px; background: #233a2c; color: white; border-radius: 9px; z-index: 2; }
#status:empty { display: none; }
@media (max-width: 820px) {
  .header-inner, .shell { padding-inline: 22px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 540px) {
  .header-inner { min-height: 61px; gap: 19px; }
  .header-inner, .shell { padding-inline: 15px; }
  .brand { font-size: 15px; gap: 6px; }
  .mark { width: 26px; height: 26px; border-radius: 8px; }
  nav { gap: 14px; }
  nav a { font-size: 13px; }
  .header .privacy { display: none; }
  .hero { padding: 33px 0 23px; }
  .hero p { font-size: 14px; }
  .card, .process { padding: 15px; border-radius: 15px; }
  .rail { grid-template-columns: 1fr; }
  .journal-bar { align-items: start; flex-direction: column; }
  .stale-note { align-items: stretch; flex-direction: column; }
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 1080px) { .mode-line { display: flex; } }
