/* FeedLens 应用样式。纸面底色 + 墨绿主色 + 宋体标题，紧急度用橙/琥珀/灰三档表达。 */
:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #ece8de;
  --ink: #1a1c1a;
  --muted: #5f645f;
  --line: #ddd7ca;
  --accent: #0e5e52;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe6;
  --high: #b93c0b;  --high-bg: #fbe4d5;
  --mid: #8f5a05;   --mid-bg: #f7eac6;
  --low: #4b5563;   --low-bg: #e7e4dc;
  --pos: #166534;   --neu: #52525b;   --neg: #9f1239;
  --danger: #b42318; --danger-bg: #fde8e6;
  --warn-bg: #fbf0cf; --warn-ink: #6b4a03;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 28, 26, .05), 0 8px 24px -12px rgba(26, 28, 26, .18);
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121412; --surface: #1a1d1a; --surface-2: #232723; --ink: #ece9e1; --muted: #a3a69f; --line: #2e332e;
    --accent: #5fc2ae; --accent-ink: #0c1512; --accent-soft: #1d3a34;
    --high: #ff9a6b; --high-bg: #3d2114; --mid: #e6bd5a; --mid-bg: #37290e; --low: #b3b8bf; --low-bg: #2a2d2a;
    --pos: #74d39a; --neu: #b4b4bc; --neg: #f58aa6;
    --danger: #ff9a8f; --danger-bg: #3b1a17; --warn-bg: #33290f; --warn-ink: #f0d58a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 16px; line-height: 1.65; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .4em; border-radius: 5px; word-break: break-all; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 50; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- 顶栏 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar__inner { max-width: 1160px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand__mark { width: 28px; height: 28px; color: var(--accent); }
.brand__name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; letter-spacing: .01em; }
.brand__cn { color: var(--muted); font-size: .85rem; padding-left: 8px; border-left: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .95rem; white-space: nowrap; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.tab--ext { margin-left: auto; }
.status { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .82rem; cursor: pointer; flex-shrink: 0; max-width: 46vw; }
.status__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.status[data-mode="model"] .status__dot { background: #1f9d6b; box-shadow: 0 0 0 3px color-mix(in srgb, #1f9d6b 22%, transparent); }
.status[data-mode="demo"] .status__dot { background: #d69a0b; box-shadow: 0 0 0 3px color-mix(in srgb, #d69a0b 22%, transparent); }
.status[data-mode="offline"] .status__dot { background: var(--danger); }
.status[data-mode="static"] .status__dot { background: #3b82a0; box-shadow: 0 0 0 3px color-mix(in srgb, #3b82a0 22%, transparent); }

.banner { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 20px; font-size: .9rem; text-align: center; border-bottom: 1px solid var(--line); }

/* ---------- 版心 ---------- */
main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 36px 20px 56px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .14em; }
.headline { font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.35rem); font-weight: 700; letter-spacing: -.005em; }
.lede { margin: 14px 0 0; color: var(--muted); max-width: 46em; }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 36px; align-items: start; }
.pane--result { position: sticky; top: 84px; }

/* ---------- 输入区 ---------- */
.composer { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.composer__label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.composer__input { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 1.02rem; line-height: 1.6; padding: 12px 14px; resize: vertical; min-height: 112px; }
.composer__input--tall { min-height: 210px; font-size: .96rem; }
.composer__input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.composer__input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.composer__actions { display: flex; gap: 8px; margin-left: auto; }
.counter { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter[data-over="true"] { color: var(--danger); font-weight: 700; }
.field-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--danger-bg); color: var(--danger); font-size: .9rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; border: 1px solid transparent; padding: 10px 18px; font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; transition: transform .06s ease, background .15s ease, opacity .15s ease; min-height: 44px; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--small { padding: 6px 12px; min-height: 34px; font-size: .85rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.spinner { display: none; width: 15px; height: 15px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; animation: spin .7s linear infinite; }
.btn[data-loading="true"] .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.examples { margin-top: 22px; }
.examples__title { margin: 0 0 10px; font-size: .9rem; font-weight: 600; }
.examples__title .muted { font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: .86rem; cursor: pointer; text-align: left; max-width: 100%; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.chip-btn b { color: var(--muted); font-weight: 500; margin-right: 6px; }

/* ---------- 结果工单 ---------- */
.ticket { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); overflow: hidden; }
.ticket--empty { text-align: center; padding: 46px 22px; color: var(--muted); border-style: dashed; box-shadow: none; background: transparent; }
.ticket__art { width: 92px; height: 92px; opacity: .55; }
.ticket__hint { margin: 8px 0 4px; font-weight: 600; color: var(--ink); }
.ticket__stamp { position: absolute; right: -34px; top: 18px; transform: rotate(35deg); background: var(--warn-bg); color: var(--warn-ink); font-size: .74rem; font-weight: 700; letter-spacing: .12em; padding: 4px 44px; border: 1px solid color-mix(in srgb, var(--warn-ink) 30%, transparent); }
.ticket__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ticket__summary { font-family: var(--serif); font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 700; margin: 16px 0 6px; line-height: 1.35; }
.ticket__quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--line); color: var(--muted); font-size: .94rem; background: color-mix(in srgb, var(--surface-2) 55%, transparent); border-radius: 0 8px 8px 0; word-break: break-word; }
.ticket__fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.field { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.field__k { font-size: .74rem; color: var(--muted); letter-spacing: .08em; }
.field__v { font-weight: 700; margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.ticket__meta { margin-top: 14px; font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ticket details { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.ticket summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--muted); }
.ticket summary:hover { color: var(--ink); }
.raw { margin: 10px 0 0; padding: 12px; background: var(--surface-2); border-radius: 9px; font-family: var(--mono); font-size: .84rem; white-space: pre-wrap; word-break: break-word; }
.alert { padding: 12px 14px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: .92rem; }
.alert strong { display: block; margin-bottom: 2px; }
.compare { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .88rem; }
.compare th, .compare td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.compare th { color: var(--muted); font-weight: 500; }
.compare td.diff { color: var(--high); font-weight: 600; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: .86rem; font-weight: 700; white-space: nowrap; }
.tag--cat { background: var(--accent-soft); color: var(--accent); font-size: .95rem; padding: 6px 14px; }
.tag--urg-高 { background: var(--high-bg); color: var(--high); }
.tag--urg-中 { background: var(--mid-bg); color: var(--mid); }
.tag--urg-低 { background: var(--low-bg); color: var(--low); }
.sent { font-weight: 700; }
.sent--正面 { color: var(--pos); } .sent--中性 { color: var(--neu); } .sent--负面 { color: var(--neg); }
.meter { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; }
.meter i { width: 5px; border-radius: 2px; background: var(--line); }
.meter i:nth-child(1) { height: 7px; } .meter i:nth-child(2) { height: 11px; } .meter i:nth-child(3) { height: 16px; }
.meter[data-level="低"] i:nth-child(-n+1), .meter[data-level="中"] i:nth-child(-n+2), .meter[data-level="高"] i { background: currentColor; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 50%, var(--surface)) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.skeleton--chip { width: 110px; height: 30px; border-radius: 999px; }
.skeleton--title { height: 34px; width: 72%; margin-top: 18px; }
.skeleton--line { height: 16px; margin-top: 14px; } .skeleton--line.short { width: 55%; }
.loading-note { margin: 16px 0 0; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.explain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.explain h3 { font-family: var(--serif); font-size: 1.05rem; margin-bottom: 6px; }
.explain p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- 批量 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat__k { font-size: .8rem; color: var(--muted); }
.stat__v { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat__v small { font-family: var(--sans); font-size: .85rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.panel { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel__head h2 { font-size: 1.05rem; font-family: var(--serif); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 5.5em 1fr 2.5em; align-items: center; gap: 10px; font-size: .9rem; }
.bar__track { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 6px; background: var(--accent); min-width: 2px; transition: width .4s ease; }
.bar__n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 620px; }
.table th { text-align: left; font-size: .78rem; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table th.num { text-align: right; }
.table .orig { color: var(--muted); max-width: 26em; }
.table tr.is-best td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.table .sysname { font-family: var(--mono); font-size: .84rem; font-weight: 600; white-space: nowrap; }
.table .sysdesc { color: var(--muted); font-size: .8rem; max-width: 22em; }

/* ---------- 评测 ---------- */
.segmented { display: inline-flex; margin-top: 24px; background: var(--surface-2); border-radius: 11px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .92rem; padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.callout { margin-top: 26px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; background: var(--surface); }
.callout h3 { font-size: 1rem; margin-bottom: 6px; }
.callout ul, .callout ol { margin: 0; padding-left: 1.2em; color: var(--muted); font-size: .93rem; }
.callout li + li { margin-top: 4px; }
.hbar { display: grid; grid-template-columns: minmax(8em, 15em) 1fr 3.4em; gap: 10px; align-items: center; font-size: .86rem; }
.hbar + .hbar { margin-top: 8px; }
.hbar__name { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__fill--base { background: color-mix(in srgb, var(--muted) 55%, transparent); }

/* ---------- 关于 ---------- */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { font-family: var(--serif); font-size: 1.05rem; margin-bottom: 10px; }
.plain { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: .93rem; }
.plain li + li { margin-top: 6px; }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }

.foot { border-top: 1px solid var(--line); padding: 18px 20px 26px; text-align: center; color: var(--muted); font-size: .85rem; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.foot__sep { opacity: .5; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 11px; font-size: .92rem; box-shadow: var(--shadow); z-index: 40; max-width: calc(100vw - 32px); }

/* ---------- 窄屏 ---------- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 24px; }
  .pane--result { position: static; }
  .explain, .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  main { padding: 24px 16px 44px; }
  .topbar__inner { flex-wrap: wrap; padding: 10px 16px 6px; gap: 8px 12px; }
  .brand__cn { display: none; }
  .status { margin-left: auto; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 -6px; }
  .tab { padding: 8px 10px; font-size: .92rem; }
  .tab--ext { margin-left: 0; }
  .ticket { padding: 18px; }
  .ticket__fields { gap: 8px; }
  .field { padding: 8px 10px; }
  .composer__actions { width: 100%; }
  .composer__actions .btn--primary { flex: 1; }
  .hbar { grid-template-columns: 1fr 3.4em; }
  .hbar__name { grid-column: 1 / -1; }
  .banner { text-align: left; padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
