:root {
  --primary: #bf2c43;
  --primary-dark: #a02438;
  /* The brand accent (amber): the arrow inside the mark and the hero's warm
     wash, nothing else. It is the "horse comes home" colour, not a semantic
     one — buttons, charts and badges keep --primary, or the colour vocabulary
     the rest of the app already agrees on stops meaning anything. */
  --accent: #b8791f;
  --ink: #1f2430;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f7f7f9;
  --border: #e5e7eb;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP",
    "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* header */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
}
.header-inner {
  display: flex; justify-content: space-between; align-items: center;
  height: 56px;
}
/* The brand lockup: mark + Latin name + CJK name. The whole thing is one link,
   so it aligns on flex, not on a text baseline — a horseshoe has none. */
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none;
}
.brand-mark { width: 22px; height: 22px; flex: none; color: var(--primary); }
.brand-mark .mark-arrow { stroke: var(--accent); }
.brand-cjk {
  font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: .16em;
  border-left: 1px solid var(--border); padding-left: 8px;
}
.site-nav { display: flex; gap: 16px; align-items: center; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: var(--primary); }
.site-nav a.active { color: var(--primary); font-weight: 600; }
.site-nav .who { font-size: .9rem; color: var(--muted); }
.site-nav form { display: inline; margin: 0; }
.lang-switch { display: flex; gap: 8px; align-items: center; }
.lang-switch form { display: inline; margin: 0; }
.lang-switch button {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: .9rem; padding: 4px 8px;
}
.lang-switch .current {
  font-size: .9rem; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}

/* hero */
/* The hero carries the strongest brand note on the site: one mark and a very
   light warm wash. The gradient has already returned to --bg-soft by 62%, so
   it meets the neutral grey band below without a visible seam — the top of the
   page is simply warmer than the rest of it. */
.hero {
  text-align: center; padding: 88px 0 64px;
  background: linear-gradient(180deg, #fffaf4 0%, var(--bg-soft) 62%);
}
.brand-mark.hero-mark { width: 46px; height: 46px; margin-bottom: 18px; }
.hero h1 { font-size: 2.2rem; margin: 0 0 16px; line-height: 1.3; }
.hero .subtitle { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin: 0 auto 28px; }
.hero .demo-hint { color: var(--muted); font-size: .85rem; margin-top: 16px; }

/* buttons */
.btn {
  display: inline-block; border-radius: var(--radius); cursor: pointer;
  text-decoration: none; font-weight: 600; border: none;
}
.btn-primary {
  background: var(--primary); color: #fff; padding: 12px 32px; font-size: 1rem;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-lg { padding: 16px 48px; font-size: 1.1rem; }

/* demo */
.demo { padding: 64px 0; }
.demo h2 { font-size: 1.4rem; }
.badge {
  font-size: .7rem; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
  vertical-align: middle;
}
/* wrap: the error line below takes a full row of its own. */
.demo-form { display: flex; gap: 8px; margin: 16px 0 24px; flex-wrap: wrap; }
.demo-form input {
  flex: 1; padding: 12px 14px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.demo-form input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.chart { width: 100%; height: 380px; }

/* values */
.values { background: var(--bg-soft); padding: 64px 0; }
.modules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.module-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px;
}
.module-card h2 { margin-top: 0; font-size: 1.25rem; }
.module-card .module-tag { color: var(--muted); font-size: .95rem; margin: 0 0 14px; }
.module-card ul { margin: 0 0 16px; padding-left: 1.2em; }
.module-card li { margin: 5px 0; font-size: .95rem; }
.module-card .module-link { margin: 0; }

/* The closing CTA is one button and nothing else. It sits on white: the values
   band above it is --bg-soft, and since the "data source" band that used to
   separate them is gone, two grey bands would read as one. The white also
   frames the button, which is the last thing on the page. */
.cta { padding: 56px 0; text-align: center; }

/* footer */
.site-footer { padding: 32px 0; text-align: center; color: var(--muted); font-size: .85rem; }

/* Responsive overrides live at the end of the file: a media query adds no
   specificity, so an override written above the rule it targets loses. */

/* app pages */
/* Vertical only: a shorthand padding here would override .container's 20px
   side padding, which is what keeps the content off the screen edge below
   the 960px container width (mobile). */
.page { padding-top: 40px; padding-bottom: 72px; }
/* The product layer's way back to the account layer
   (docs/plan/ux-optimization.md §Task 4). It sits above .page-head and reads as
   a quiet aside: the page's own heading is what the eye should land on first. */
.breadcrumb { margin: 0 0 10px; font-size: .9rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 24px;
}
.panel h2 { font-size: 1.15rem; margin-top: 0; }
.panel h3 { font-size: 1rem; margin: 16px 0 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
/* A .panel-head's action keeps its own width. The heading beside it can be a
   full product title, and a flex row shrinks the form to its min-content —
   for a CJK label that is one character per line (found in the rival
   walkthrough: /rivals' unpin button rendered 21px wide). The heading wraps
   instead; it is text, and text is what should give way. */
.panel-head > form { flex: 0 0 auto; }
.panel-head .link-btn { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty {
  color: var(--muted); background: var(--bg-soft);
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center;
}
/* The keyword tab's empty state is instructions, not a one-line notice: three
   left-aligned lines (the two ways in and when the first figure arrives). */
.kw-empty { text-align: left; }
.kw-empty p { margin: 0 0 6px; }
.kw-empty p:last-child { margin-bottom: 0; }

/* 第一步引导卡 (2026-10-03 new-user walkthrough): the same skeleton as .panel
   with one primary-coloured edge, enough to read as the page's first step
   without a second component vocabulary. */
.start-card { border-left: 3px solid var(--primary); }
.start-card h2 { margin-bottom: 6px; }
.start-card > p { margin: 0 0 12px; }
.start-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.start-actions + p { margin: 8px 0 0; }
.flash-error {
  background: #fdecef; border: 1px solid #f3c7cf; color: #8c1c30;
  border-radius: var(--radius); padding: 10px 14px; margin: 16px 0 0;
}
/* The banner is always in the document (api.js unhides it); empty, it must not
   leave a gap above the page. */
.flash-error[hidden] { display: none; }
.row-error { color: #8c1c30; font-size: .82rem; }
.form-error {
  color: #8c1c30; font-size: .9rem; margin: 0 0 4px;
}
.form-error[hidden] { display: none; }
/* An action row (input + button) puts the error on a line of its own rather than
   squeezing it between the two. */
.inline-form .form-error,
.demo-form .form-error { flex-basis: 100%; }
/* A compact action row (a card's pause toggle, a keyword's own controls) has no
   slot of its own: its forms name the row or block around them with data-error,
   and the message lands on that container's next line — visible next to the
   button that was pressed, and naming the keyword it belongs to. */
.row-actions > .form-error { flex-basis: 100%; margin: 0; }
/* api.js scrolls an off-screen message into view; this keeps it clear of the
   sticky header, which would otherwise cover the line it scrolled to. */
.form-error,
.flash-error { scroll-margin-top: 78px; scroll-margin-bottom: 16px; }

/* A suggestion the product already carries: shown, because the list is what the
   product ranks for, but not offered. */
.candidate-list li.attached .kw { color: var(--muted); }
.candidate-list li.attached input[type="checkbox"] { cursor: not-allowed; }

/* ── request feedback ───────────────────────────────────────────────────── */

/* A button waiting on a response: the spinner takes its colour from the button,
   so one rule covers .btn-primary and .link-btn alike. */
button.loading::after {
  content: ""; display: inline-block; width: .7em; height: .7em;
  margin-left: .5em; vertical-align: -.05em;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
button.loading { cursor: progress; }
@keyframes spin { to { transform: rotate(360deg); } }

/* An operation that navigates: without it the browser paints white between the
   response and the new document. */
.page-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .75);
}
.page-overlay[hidden] { display: none; }
.page-overlay p { color: var(--muted); margin: 0; }
.page-overlay .spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* A chart container waiting on its data or its library. */
.chart-loading {
  color: var(--muted); font-size: .85rem; text-align: center; padding: 16px 0;
}

/* forms */
.btn-sm { padding: 6px 16px; font-size: .9rem; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0 20px; }
/* type="url" is the dashboard's add-product field; without it here the input
   falls back to its default width and the button stretches around it. */
.inline-form input[type="text"], .inline-form input[type="url"],
.inline-form input[type="search"], .inline-form input[type="date"],
.inline-form select {
  padding: 9px 12px; font-size: .95rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff;
}
.inline-form input[type="text"], .inline-form input[type="url"],
.inline-form input[type="search"] { flex: 1; min-width: 200px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; max-width: 420px; }
.stack-form > label, .field { display: flex; flex-direction: column; gap: 6px; }
.stack-form > label > span, .field span { font-size: .9rem; color: var(--muted); }
.stack-form > label.check-row { flex-direction: row; align-items: center; gap: 8px; }
/* textarea belongs here too: the ticket forms are the first stack-form to carry
   one, and a textarea neither inherits the page font nor matches a styled input
   without being told. */
.stack-form input, .stack-form textarea {
  padding: 11px 14px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
  resize: vertical;
}
.stack-form input:focus, .inline-form input:focus {
  outline: 2px solid var(--primary); outline-offset: -1px;
}
.auth-page { padding: 64px 0 96px; }
/* Sign-in and sign-up are the screens where the reader decides whether to trust
   the product, so they get a mark and not just a heading. Sized between the
   header (22) and the hero (46): it belongs to the page title, not the chrome. */
.brand-mark.auth-mark { width: 34px; height: 34px; margin-bottom: 10px; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--primary); font-size: .9rem; text-decoration: underline;
}
.link-btn.danger { color: #8c1c30; }
.row-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline; margin: 0; }
/* 删除商品是这一行里唯一不可撤销的动作，把它推到最右并用一条竖线隔开：
   它不该和旁边那个日常的「暂停」长成一个样子、挨在一起。 */
.row-actions .row-action-danger {
  margin-left: auto; padding-left: 12px; border-left: 1px solid var(--border);
}

/* tables */
/* The box a wide table scrolls inside
   (docs/plan/ux-optimization.md §Task 7). Every .data-table on a page a
   customer reads is wrapped in one of these — the keyword table, the coverage
   matrix, the analysis picker, the plan/order/ledger tables — because at 360px
   they are all wider than the screen, and a table that widens the document
   drags the header, the panels and the buttons sideways with it. Scrolling the
   table alone keeps the page still. (The admin console's tables are not wrapped:
   §四 keeps admin*.html out of this pass.) */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.analysis-level, .analysis-rivals { white-space: nowrap; }
.tag {
  font-size: .72rem; color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 2px 8px; margin-left: 6px; white-space: nowrap;
}
.rank { font-weight: 700; font-size: 1.05rem; }
.rank-good { color: #0f7b4f; }
.rank-mid { color: #9a6b00; }
.rank-low { color: var(--muted); }
.rank-none { color: var(--muted); font-weight: 400; }
/* A rank's label: the word that says which numbering space the number beside it
   belongs to ("PR" for a bought slot, the natural-rank word for an earned one).
   Muted ink and small, never on its own — it qualifies the number it precedes.
   A cell can carry two of these at once, one per figure. */
.rank-kind {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-right: 3px;
}
/* The paid-placement label adds a box: a rank the account bought rather than
   earned is the one worth marking, and the box is what marks it. */
.rank-kind.rank-paid {
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 3px;
  cursor: help;
}
/* One figure of a rank cell — its label and its number — as a unit, so that a
   line break can never strand the "PR" chip at the end of a row and leave its
   number on the next one. Two of these means the product holds two ranks at
   once, in two numbering spaces; the gap keeps them from reading as one
   number. */
.rank-fig { white-space: nowrap; }
.rank-fig + .rank-fig { margin-left: 8px; }

/* The rank view switch (2026-09-30): which numbering space the page shows at
   full strength. The other one is dimmed rather than removed. Removing it was
   the first shape of this feature and it does not survive contact with the
   data: a product standing only in the paid block has no natural rank at all,
   so a "natural" view that hid the paid figure would leave that cell empty —
   and an empty rank cell on this page means "never observed", which is a
   different statement (see rankCell in internal/handler/handler.go). Dimming
   also keeps the label, so the cell still says which space the number is from.
   The attribute the rules read is set on <html> by app.js. */
[data-rank-view="natural"] .rank-fig[data-space="paid"],
[data-rank-view="paid"] .rank-fig[data-space="natural"],
[data-rank-view="paid"] .rank-fig[data-space="page"] { opacity: .38; }

/* The switch itself, at the top of every page that shows ranks. The buttons are
   the chart tabs' own component: this is a display口径 like the 14/30-day
   window, and a second control vocabulary for the same gesture would be one
   more thing to learn. */
.rank-view { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rank-view .tabs { margin: 0; }

/* chart controls */
.days { display: flex; gap: 8px; }
.days a {
  font-size: .85rem; color: var(--muted); text-decoration: none;
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 12px;
}
.days a.active { color: #fff; background: var(--primary); border-color: var(--primary); }

/* ── item-centric views (Phase 8 markup; Phase 9 owns the full pass) ────── */
.item-cards {
  list-style: none; padding: 0; margin: 24px 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.item-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.item-card .card-head { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.item-card img { width: 72px; height: 72px; object-fit: contain; background: #f9fafb; border-radius: 6px; }
.item-card .name { font-weight: 600; }
.item-card .sparkline { height: 40px; }
.item-card .kw-list { list-style: none; padding: 0; margin: 0; }
.item-card .kw-list li {
  display: flex; justify-content: space-between; gap: 8px; padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
/* A rank that moved: up is a better (smaller) rank, hence the red. */
.item-card .up, .kw-table .up { color: #b91c1c; margin-left: 6px; }
.item-card .down, .kw-table .down { color: #15803d; margin-left: 6px; }

.item-detail .item-image { width: 160px; height: 160px; object-fit: contain; background: #f9fafb; border-radius: 8px; }
/* The keyword table (docs/features/monitoring-ux-improvements.md §4.4): what is
   left of a keyword is its state and the actions on it — the per-keyword charts
   are one merged chart per window now, below the table. */
.kw-table td { vertical-align: middle; }
/* Two links and their own error line: the actions column must not wrap into a
   stack, which would make one row taller than the rest. */
.kw-table .row-actions { flex-wrap: nowrap; }

/* 14/30-day switch above a merged chart */
.tabs { display: flex; gap: 8px; margin: 12px 0 4px; }
.tabs .tab {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 14px; font-size: .85rem; color: var(--muted); cursor: pointer;
}
.tabs .tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 商品页的三个面板（docs/refactor/two-modules.md §2.4）：一页三问 ——
   关注 / 关键词 / 记录。按钮就是上面那套区间开关（同一个 .tab 词汇），
   显隐由 app.js 按 URL hash 决定；三个面板全部由服务端渲染，因此没有脚本时
   页面与 Tab 化之前一样是完整的一长页，而不是三分之一页。
   [hidden] 的规则写出来而不是靠浏览器默认：本文件里凡是有 display 类规则的
   元素都要显式声明（.chart-note[hidden] 同理）。 */
.page-tabs { margin: 0 0 20px; flex-wrap: wrap; }
/* 关注页签上的待关注数（0 不渲染）。选中态本身就是主色实底，白底反色的徽标
   在两种状态下都读得出来 —— 实底徽标压在实底页签上会正好看不见。 */
.page-tabs .tab .badge { font-size: .72rem; padding: 0 7px; background: var(--primary); border-color: var(--primary); color: #fff; }
.page-tabs .tab.active .badge { background: #fff; border-color: #fff; color: var(--primary); }
.kw-series-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 4px 0 12px;
}
.kw-series-bar .rank-view { margin: 0; }
.kw-series-pick { display: inline-flex; align-items: center; gap: 6px; }
.kw-series-pick select {
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  color: var(--ink); font-size: .85rem; padding: 4px 10px; max-width: 260px;
}
.chart-title { font-weight: 600; font-size: .92rem; margin: 14px 0 4px; }
.tabpanel[hidden] { display: none; }
/* 面板 id 就是锚点：dashboard 卡片上的「优化」是一个 /items/{id}#optimize
   链接，浏览器与 app.js 的 scrollIntoView 都会把面板顶端对到视口顶端 ——
   而页头是 sticky 的（.site-header），落点因此被压在页头底下：读者看不见
   面板标题，也看不见自己在哪个 Tab（2026-10-03 真机走查，1280 与 360 两种
   宽度上都复现）。scroll-margin-top 是页头高度 + 面板上方的 Tab 条与间距，
   让落点停在页头下方、Tab 条完整可见，理由与 .form-error 那条相同。
   数值 = 页头 57px + Tab 条 27px + 它的下边距 20px + 一点余量（实测：少 8px
   时 Tab 条上沿就压在页头底边下）。窄屏页头会折行（≤720 时导航换行，实测
   360px 下高 117px），故断点里再给一个更大的值；宁可多留一点空白，也不要
   少留而重新压住标题。 */
.tabpanel { scroll-margin-top: 108px; }
#analysis-panel { scroll-margin-top: 68px; }

/* 优化页顶部的健康分：卡片徽章的字号在整页上下文里偏小，与诊断面板的
   .score-value 取同一量级——同一个数字在两处不该是两种重量。 */
.item-health .listing-badge { margin: 0; }
.item-health .listing-badge .badge-score { font-size: 1.8rem; }

.chart-note { margin: 0; }
.chart-note[hidden] { display: none; }

/* Shown in place of a chart whose data or library failed to load. */
.chart-error { color: var(--muted); font-size: .85rem; text-align: center; padding: 16px 0; }
/* dashboard.js hides a card's strip when the plan has no hourly data. */
.item-card .sparkline[hidden] { display: none; }

/* ── 关注卡片与施策标注（docs/refactor/two-modules.md §3.2 / §5）──────────
   一张卡 = 严重度 + 一句话结论 + 检测时间 + 可展开的证据 + 两个动作（查看 /
   知道了，卡上没有付费入口）。严重度只用左侧色条和图标颜色表达，不再加第三层
   底色：结论句本身已经写清了涨跌，再铺一层色只会让整块变吵。三档沿用现有语义
   —— 灰＝中性、琥珀＝需注意、红＝已跌出首页；绿只留给见效喜报（按类型着色，
   它自己的严重度是 info，与「涨了」「拿到 PR 位」同档）。 */
.insight-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
}
/* 控制台默认只露前几条，其余靠 hidden 折着（展开是纯前端切属性）。 */
.insight-list > li[hidden] { display: none; }
/* 展开/收起按钮：跟卡片拉开一点，别贴着最后一张卡的边框。 */
.insight-toggle { margin-top: 12px; }
.alert-card {
  border: 1px solid var(--border); border-left: 3px solid var(--muted);
  border-radius: var(--radius); padding: 12px 16px; background: #fff;
}
.alert-card[data-severity="warning"] { border-left-color: #b45309; }
.alert-card[data-severity="critical"] { border-left-color: #b91c1c; background: #fff8f8; }
.alert-card[data-type="effect_confirmed"] { border-left-color: #15803d; }
.alert-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.alert-title { margin: 0; font-weight: 600; flex: 1 1 60%; }
.alert-when { color: var(--muted); font-size: .82rem; flex: none; margin-left: auto; }
.insight-head { display: flex; gap: 8px; align-items: baseline; }
.insight-severity { font-weight: 700; line-height: 1.4; }
.alert-card[data-severity="info"] .insight-severity { color: var(--muted); }
.alert-card[data-severity="warning"] .insight-severity { color: #b45309; }
.alert-card[data-severity="critical"] .insight-severity { color: #b91c1c; }
.insight-conclusion { margin: 0; font-weight: 600; }
/* 未读（status=new）与已读的区分：标签是文字，颜色只是加重，两者都随卡片
   一起消失/撤下（app.js 在展开时把标签就地拿掉——展开即已读）。此前页面
   完全看不出哪张看过，而整块区就是「自上次查看以来的变动」。关注卡的头部
   已经有右浮的检测时间，标签跟在它后面，不再自己往右顶。 */
.insight-unread { margin-left: auto; background: var(--primary); color: #fff; border-color: var(--primary); }
.alert-head .insight-unread { margin-left: 0; }
.alert-card[data-read="true"] .insight-severity { opacity: .55; }
/* 证据区收起时只是一行「影响与证据」，展开后每类 fact 一行小字。 */
.alert-attr {
  margin: 10px 0 0; background: var(--bg-soft); border-radius: 8px;
  padding: 10px 14px; font-size: .88rem;
}
.alert-attr summary { cursor: pointer; font-weight: 600; color: var(--primary); }
.alert-facts {
  margin: 8px 0 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 2px;
  color: var(--muted); font-size: .82rem;
}
.insight-fact a { color: var(--primary); }
.alert-actions { margin-top: 12px; }
/* 对手逼近：关注页签底部折着的一块。判读口径没变（一天一轮、只看首页），
   <summary> 就是原来的分区标题；读失败时模板给它 open，坏消息不藏在折页里。 */
details.panel > summary { cursor: pointer; font-weight: 600; font-size: 1.15rem; }
details.panel[open] > summary { margin-bottom: 12px; }

/* 记录页签（docs/refactor/two-modules.md §5）：14 天动作时间线 —— 日期 + 主体
   徽标 + 一句事实 + 可选的「原因/结果」行。类型 chips 是固定的 5+1 个（全部 +
   五类），商品维度收进右侧下拉（会随对手数增长）；两维都是前端 hidden 切换，
   不重新请求服务端。 */
.scope-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.scope-chip {
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 3px 14px; font-size: .85rem; cursor: pointer;
}
.scope-chip:hover { color: var(--ink); border-color: var(--muted); }
.scope-chip.active { background: var(--bg-soft); color: var(--ink); border-color: var(--ink); font-weight: 600; }
.scope-bar .item-select { margin-left: auto; }
.scope-bar select {
  border: 1px solid var(--border); border-radius: 999px; background: #fff;
  color: var(--ink); font-size: .85rem; padding: 3px 10px; max-width: 260px;
}
.record-list { list-style: none; margin: 0; padding: 0; }
.record-list li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.record-list li:first-child { border-top: none; }
/* 行是 flex，所以「筛掉」的 hidden 得自己写规则 —— 浏览器默认的
   [hidden] { display: none } 会被上面那条 display: flex 盖掉。 */
.record-list li[hidden] { display: none; }
.record-list .r-date { flex: none; width: 46px; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; padding-top: 1px; }
.record-list .r-body { flex: 1; }
.record-list .r-body .why { display: block; color: var(--muted); font-size: .85rem; }
.record-list .r-body .r-amount { margin-left: 2px; }
.record-list .r-body .record-title-diff { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; overflow-wrap: anywhere; }
.record-title-diff .diff-label { margin-right: 4px; }
.record-title-diff .diff-arrow { margin: 0 6px; }
.record-title-diff mark.diff-old, .record-title-diff mark.diff-new {
  border-radius: 2px; padding: 0 1px; color: inherit;
}
.record-title-diff mark.diff-old { background: #fbe3e7; color: #b91c1c; }
.record-title-diff mark.diff-new { background: #e2f3e9; color: #15803d; }
.record-list .badge { cursor: pointer; }
/* 主体徽标：你 / 对手（对手那侧用告警色，扫一眼就能分出是谁的动作）。 */
.record-list .badge[data-subject="mine"] { color: var(--muted); }
.record-list .badge[data-subject="rival"] { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
/* 时间线上的删除入口：只对手动标注出现，行内的报错落在自己那行。 */
.record-list .record-delete { display: inline; margin: 0 0 0 6px; }
.record-delete button { font-size: .85rem; }
.record-list .r-body > .form-error { flex-basis: 100%; margin: 2px 0 0; }
.record-baseline { margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.record-baseline .baseline-subject { margin-right: 6px; font-weight: 600; color: var(--ink); }

.rival-watch-head { display: flex; align-items: center; gap: 8px; }
.rival-watch-list { list-style: none; margin: 0 0 12px; padding: 0; }
.rival-watch-list li {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 8px 0; border-top: 1px solid var(--border);
}
.rival-watch-list li:first-child { border-top: none; }
.rival-watch-list .link-btn { white-space: nowrap; }
.rival-watch .inline-form[hidden] { display: none; }
.rival-watch-note { margin: 0 0 8px; }

/* 施策标注：一行一条 —— 类型、日期、来源 + 展开的前后对比。 */
.annotation-list {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
/* 列表和空态都常驻，脚本只切 hidden（新增一条标注后就不刷新页面了）：
   有 display 规则就得自己写 [hidden]，否则 flex 会盖掉它。 */
.annotation-list[hidden], .annotation-empty[hidden] { display: none; }
.annotation-item { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.annotation-item:last-child { border-bottom: none; padding-bottom: 0; }
.annotation-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.annotation-type { font-weight: 600; }
.annotation-line form { display: inline; margin: 0; }
/* 这一行的报错落在行自己那行（原先落在折叠区里，关着的时候看不见）。 */
.annotation-line > .form-error { flex-basis: 100%; margin: 0; }
.annotation-compare { margin-top: 4px; font-size: .85rem; }
.annotation-compare summary { cursor: pointer; color: var(--primary); }
.annotation-compare .form-error { margin-top: 4px; }
.comparison-table { margin-top: 8px; font-size: .85rem; }
.comparison-table th[colspan] { text-align: center; }
.comparison-table td { font-variant-numeric: tabular-nums; }

.migration-banner {
  margin: 48px auto; max-width: 640px; padding: 32px; text-align: center;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
}
.pricing { margin: 32px auto; max-width: 860px; }
.pricing .plans td { font-variant-numeric: tabular-nums; }

/* ── small screens ───────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .modules { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
  .demo-form { flex-direction: column; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .data-table { font-size: .9rem; }
  /* Six nav entries do not fit beside the brand: let the header grow and wrap
     instead of crushing each label into a vertical stack. */
  .header-inner { height: auto; min-height: 56px; padding: 8px 0; flex-wrap: wrap; gap: 4px 12px; }
  .site-nav { flex-wrap: wrap; gap: 8px 12px; }
  /* On a narrow screen the CJK half of the lockup goes first: the Latin name is
     the mark of record and is enough to know whose site this is, while the
     width it frees up is what the nav entries need. */
  .brand-cjk { display: none; }
  /* The hourly strip and the merged charts carry a lot of axis labels; give the
     charts a little more room. */
  .item-detail .chart { height: 300px; }
}

/* ── small screens: the product layer's own furniture ──────────────────────
   (docs/plan/ux-optimization.md §Task 7) */
@media (max-width: 720px) {
  /* One card per row. The wall's repeat(auto-fill, minmax(280px, 1fr)) needs
     280px of container to place even one track, and a 320px phone minus the
     container's 20px gutters has 280px — one pixel of slack, and none at all
     below that. 1fr takes the floor away, so the column is the screen's width
     rather than the table's minimum. */
  .item-cards { grid-template-columns: 1fr; }

  /* The page head is one column on a phone, and a tight one: left in block
     layout its paragraphs keep the 1em top *and* bottom margins (34px between
     two lines of meta, a third of the first screen), and in a flex column none
     of them collapse. gap owns the spacing instead, and align-items:flex-start
     is what keeps the product image at its own 160px — the default stretch
     would widen it to the whole column (overriding it here rather than there,
     because the product page's .item-image is a desktop rule).

     Nothing in the head shares a line on a phone: the rank-view switch (a label
     plus three pills) is the one row in there, and it wraps before it scrolls. */
  .page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-head > *, .page-head h1 { margin: 0; }
  .page-head .rank-view { flex-wrap: wrap; }

  /* A tab bar scrolls sideways instead of wrapping or running off the screen:
     four tabs, or the rank switch's three pills beside their label, are wider
     than 360px. Same component everywhere it appears (the product page's four
     tabs, the 14/30-day switches, the rank-view switch). */
  .tabs { flex-wrap: nowrap; overflow-x: auto; }

  .kw-series-bar { flex-direction: column; align-items: flex-start; }
  .kw-series-pick { width: 100%; }
  .kw-series-pick select { max-width: none; flex: 1; }

  /* 乐天商品名可以很长（实测 360px 宽下 7 行），整块首屏会被标题吃掉。
     截到 3 行：标题的作用是让人确认「是这个商品」，不是读完它——完整标题
     在乐天页面上，链接就在下面两行处。 */
  .item-detail .page-head h1 {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* The header wraps to two or three rows down here (the nav entries move to
     their own line, measured 117px at 360px), so the desktop anchor offset
     would put a deep-linked tab panel back underneath it. Same sum as above,
     with this breakpoint's header. */
  .tabpanel { scroll-margin-top: 168px; }
  /* The rewrite panel's own deep link (§8.1's 「去优化」 lands on it) needs the
     same offset at this breakpoint. */
  #listing-rewrite { scroll-margin-top: 168px; }
  #analysis-panel { scroll-margin-top: 128px; }
}

/* ── admin console (docs/features/admin-dashboard.md §4.5) ───────────────── */
/* 卖家反馈的「最近事件」表（listing-optimization.md §8.1）：九列含邮箱、关键词
   与理由散文。CJK 可任意断行，不给宽度的话浏览器会把每列压成一字一行；给前几
   列 nowrap 加一个最小宽度，让它按 .table-scroll 横向滚动而不是挤成竖条。 */
.table-scroll .feedback-events { min-width: 960px; }
.feedback-events th, .feedback-events td { vertical-align: top; }
.feedback-events td:nth-child(-n+6), .feedback-events td:nth-child(8) { white-space: nowrap; }
/* 理由与证据两列装的是散文和 JSON：不给最小宽度的话它们会塌成一字宽。 */
.feedback-events .fb-reason { min-width: 180px; }
.feedback-events .fb-facts { min-width: 220px; }

/* Two columns of cards: each card is one metric, so the numbers can be compared
   without reading labels back and forth. The daily-active card spans the row
   because its seven-day strip needs the width. */
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; }
.admin-card { margin-bottom: 20px; }
.admin-card h2 { font-size: .95rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.stat-num { font-size: 2rem; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.admin-grid .admin-card:first-child { grid-column: 1 / -1; }
.owner { margin: 4px 0 0; overflow-wrap: anywhere; }
.owner-email { font-size: .9rem; }
.dau-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
}
.dau-day { display: flex; flex-direction: column; align-items: center; }
.dau-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.dau-label { font-size: .7rem; color: var(--muted); }

@media (max-width: 720px) {
  .admin-grid { grid-template-columns: 1fr; }
}

/* ── 套餐期限（credits 页的价格阶梯）────────────────────────────────────────
   每个期限一个按钮，按钮里两行：总价在上、折算月价与折扣在下。按钮做成
   块级两行而不是一行文字，是因为「¥282」和「合 ¥94/月 · 省 5%」回答的是两
   个不同的问题——贵不贵、划不划算——挤成一行会先看到长度而不是价格。 */
.term-list { display: flex; gap: 8px; flex-wrap: wrap; }
.term-list form { margin: 0; }
.term-list .btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  line-height: 1.25;
}
.term-price { font-weight: 600; white-space: nowrap; }
/* 「合 94/月 · 省 5%」不能断行：按钮本来就窄，断在「99」和「/月」之间
   会让折扣那一行看起来像两个数字。 */
.term-note { font-size: .75rem; white-space: nowrap; }
/* 窄屏上四个期限并排会挤成两行半个，让它们各占满一行更好读。 */
@media (max-width: 720px) {
  .term-list { flex-direction: column; align-items: stretch; }
}

/* ── 支持工单（docs/features/support-tickets.md）────────────────────────────
   线程气泡：两侧靠左右位置 + 底色区分（用户 = 品牌色描边、贴右；客服 = 灰底、贴左），
   气泡正文 pre-wrap —— 用户写几行就显示几行，不靠把换行符换成 <br>。
   署名与文案都是服务端下发的（layout.html 的 ticketthread）。 */
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bubble {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; max-width: 72%;
}
.bubble-user { align-self: flex-end; border-color: var(--primary); }
.bubble-admin { align-self: flex-start; background: var(--bg-soft); }
.bubble-meta { margin: 0 0 4px; }
.bubble-body { margin: 0; white-space: pre-wrap; }
/* 关闭工单是另一个 form（不能嵌套），单独占一行，和回复按钮隔开。 */
.close-form { margin-top: 12px; }
/* 二维码不设上限的话，运维放一张大图会把整页撑满；200px 在手机上也不会溢出。 */
.support-qr {
  width: 200px; max-width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
}

/* ── listing 优化（docs/features/listing-optimization.md §3–§8）──────────────
   三态徽标是这一块的重点：通过（绿）、待改（琥珀）、无法判定（灰 + 虚线框）
   必须一眼可分。数据读不到却长得像「已通过」，是这套界面最不能犯的错——
   §2 的「失败/缺数据不能长得一样」在诊断表上就是这三行样式。 */
.listing-score { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.score-value, .badge-score {
  font-size: 1.8rem; font-weight: 700; line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
/* 可判定项为 0 时的「—」：不是 0 分，是「没有一项能判」。 */
.score-none { color: var(--muted); font-weight: 500; }

/* 健康分的三档配色（docs/plan/ux-optimization.md §Task 6）：≥80 绿、50–79 黄、
   <50 红。卡片墙是扫着读的，分色之后「最该优化的商品」不用逐个读分数就能找到。
   分档走 data-score-band 属性而不是再挂一个类名：属性说的是「这个分数属于哪一
   档」这个事实，CSS 只是它的一种画法——测试和将来的脚本读的是同一个事实。用的
   还是本文件既有的三色词汇（.status-pass / .status-todo / .tok-missing），不
   引入第四套。没有档就没有颜色：不可判定的「—」保持 .score-none 的灰。 */
.badge-score[data-score-band="high"] { color: #15803d; }
.badge-score[data-score-band="mid"] { color: #b45309; }
.badge-score[data-score-band="low"] { color: #b91c1c; }

.listing-checklist { list-style: none; margin: 0; padding: 0; }
.finding {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.finding:last-child { border-bottom: none; }
.listing-status {
  flex: none; font-size: .75rem; font-weight: 600; line-height: 1.4;
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
}
.status-pass { color: #15803d; border-color: #86efac; background: #f0fdf4; }
.status-todo { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
/* 虚线 + 灰：无法判定既不是通过也不是待改，样子也必须谁都不像。 */
.status-unknown { color: var(--muted); border-style: dashed; background: var(--bg-soft); }
.finding-text { font-weight: 500; }
.finding-hint { flex-basis: 100%; padding-left: 4px; }

/* 卖家反馈（§8.1）。行里渲染着每种状态的控件，这里按 <li> 的 data-feedback /
   data-resolved 决定谁可见——item.js 换状态时只翻这两个属性，不重建 DOM，
   所以文案全部留在 locale 文件里。 */
.finding-actions { display: inline-flex; gap: 8px; align-items: baseline; flex: none; }
.finding-actions > * { display: none; }
/* 待改进且未标记的行才给两个按钮；已标记的行由下面各状态的选择器接管。
   按钮按 data-feedback-verdict 定位：标记控件只有这两枚，属性就是它们的身份。 */
.finding[data-status="todo"]:not([data-feedback]) .finding-actions [data-feedback-verdict="adopt"],
.finding[data-status="todo"]:not([data-feedback]) .finding-actions [data-feedback-verdict="reject"] { display: inline-block; }
.finding-actions [data-feedback-verdict="adopt"] { background: var(--primary); color: #fff; }
.finding-actions [data-feedback-verdict="adopt"]:hover { background: var(--primary-dark); }
.finding-actions [data-feedback-verdict="reject"] { background: #fff; color: var(--ink); border: 1px solid var(--border); }
.finding-actions [data-feedback-verdict="reject"]:hover { border-color: var(--muted); }
.feedback-badge {
  font-size: .75rem; font-weight: 600; line-height: 1.4;
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px;
}
.finding[data-feedback="adopt"]:not([data-resolved]) .finding-actions .is-adopt,
.finding[data-resolved="true"] .finding-actions .is-resolved {
  display: inline-block; color: #15803d; border-color: #86efac; background: #f0fdf4;
}
.finding[data-feedback="reject"]:not([data-resolved]) .finding-actions .is-reject {
  display: inline-block; color: var(--muted); background: var(--bg-soft);
}
.finding[data-feedback] .finding-actions .fb-undo { display: inline-block; }
/* 「去优化」深链是动手前的入口：只有未标记的待改进行才带路；标记过（采纳或
   不采纳）的行不再显示——表态已经发生，深链再把人拽到改写/关键词面板只会
   打断「先看完全部建议再动手」的节奏。 */
.finding[data-status="todo"]:not([data-feedback]) .finding-actions .finding-goto { display: inline-block; }
/* 请求在途：整行降透明，防连点（脚本另有 data-busy 早退）。 */
.finding[data-busy] { opacity: .65; }

/* 拒绝理由：标记生效后才出现（点「不采纳」时行会连人带理由一起移进折叠组
   并展开，卖家不会被要求解释一条已经消失的建议）。 */
.finding-reasons { display: none; flex-basis: 100%; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0 2px 4px; }
.finding[data-feedback="reject"]:not([data-resolved]) .finding-reasons { display: flex; }
.finding-reasons .reason-chip {
  font-size: .8rem; padding: 2px 10px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; cursor: pointer;
}
.finding-reasons .reason-chip[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: #fdf2f4; }
.finding-reasons .finding-reason-text {
  flex: 1; min-width: 140px; padding: 4px 10px; font-size: .85rem; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius);
}

/* 「已忽略」折叠组：拒绝的行被脚本移进来并展开；服务端渲染时默认收起。 */
.finding-ignored { margin-top: 8px; }
.finding-ignored > summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.finding-ignored .listing-checklist { margin-top: 4px; }

/* 分诊进度行：数字由脚本改写，标签是 locale 的。 */
.listing-feedback-progress { margin: 8px 0 0; color: var(--muted); font-size: .85rem; }
.listing-feedback-progress .fb-sep { margin: 0 4px; }
.listing-feedback-progress b { color: var(--ink); font-weight: 600; }
.listing-feedback-progress .fb-done { margin-left: 8px; color: #15803d; font-weight: 600; }

/* 标题类建议的「去优化」深链跳到改写面板（#optimize:listing-rewrite）：
   app.js 对目标元素直接 scrollIntoView，sticky 头会盖住面板顶，所以它也要
   和 .tabpanel 一样的偏移（数值与上面 .tabpanel 的规则一致，720 断点在下方
   媒体查询里同步）。 */
#listing-rewrite { scroll-margin-top: 108px; }

/* 覆盖矩阵：断言用词而不是符号，读者不用回头查图例；缺的词元跟在结论后面，
   「未覆盖」三个字本身说不清缺的是哪个词。 */
.listing-coverage { margin-top: 16px; }
.coverage-table { margin-top: 8px; }
.coverage-table .cov { white-space: nowrap; }
.coverage-table .cov-yes { color: #15803d; }
.coverage-table .cov-no { color: #b45309; }
.coverage-table .cov-unknown { color: var(--muted); }
.coverage-table .cov-rank { font-variant-numeric: tabular-nums; }

/* 公共词元：竞对共有而自家缺的那些用删除线标出来——同一个列表里区分「共有」
   与「你没有」，比并排两张表少读一遍。 */
.tok {
  display: inline-block; font-size: .8rem;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0 8px; margin-right: 4px; background: var(--bg-soft);
}
.tok-missing { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; text-decoration: line-through; }

.competitor-report { margin-top: 12px; }
.comp-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 0 0 8px; }
.comp-meta .tag { font-variant-numeric: normal; }
.comp-keyword { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.comp-kw { margin: 0 0 4px; font-size: .95rem; }
.comp-common, .comp-ahead, .comp-skipped { margin: 0 0 6px; }
.comp-label { margin-right: 6px; }
.comp-item { margin-right: 10px; }
.comp-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 改写候选：标题是这一块的主角，说明是附注，复制按钮贴在手边。 */
.candidate-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.candidate { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.candidate-title { margin: 0 0 6px; font-weight: 600; overflow-wrap: anywhere; }
.candidate-notes-label { display: block; }
.candidate-notes { margin: 4px 0 8px; padding-left: 20px; font-size: .85rem; color: var(--muted); }

/* 改写目标（docs/plan/listing-rewrite-v2.md §3.3/§3.4）：预览里一行一个目标
   （kind 徽标 + 一句事实），候选卡片上按同样的徽标说出它解决了哪条。徽标只
   标出动作的种类，句子说明依据——两者都读同一份 facts。 */
.goal-list-title { margin: 8px 0 4px; font-weight: 600; }
.goal-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.goal { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.goal-text { flex: 1 1 200px; }
.goal-kind { font-size: .72rem; border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; white-space: nowrap; color: var(--muted); }
.goal-kind-cover { color: #b45309; border-color: #fcd34d; background: #fffbeb; }
.goal-kind-reposition { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.candidate-solves, .candidate-evidence { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; margin: 4px 0; font-size: .85rem; }
.candidate-claim-label { margin-right: 2px; }
.solve-badge { display: inline-flex; gap: 4px; align-items: baseline; }
.evidence-chip { display: inline-block; font-size: .78rem; border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; background: var(--bg-soft); }

/* 建议历史：一行一条，结局在时间右边，已应用的那条自己带前后对比。 */
.suggestion-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.suggestion { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.suggestion:last-child { border-bottom: none; padding-bottom: 0; }
.suggestion-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tag-applied { color: #15803d; border-color: #86efac; background: #f0fdf4; }
.suggestion-title { margin: 4px 0 0; overflow-wrap: anywhere; }
/* 生成历史里折叠起来的候选：和 .annotation-compare 同一套交互——摘要一行，
   展开才占地方，候选本体复用 .candidate* 的样式。 */
.suggestion-candidates { margin-top: 4px; font-size: .85rem; }
.suggestion-candidates summary { cursor: pointer; color: var(--primary); }
.suggestion-candidates .candidate-list { margin-top: 8px; }
/* 账号级生成历史（/listing/history）：商品名占一行里的一个位置，翻页器在最下。 */
.suggestion-item { font-size: .9rem; }
.pager { display: flex; gap: 12px; align-items: baseline; margin-top: 14px; }

/* Dashboard 卡片上的健康度：和配额行同一层级的小字，不抢商品名的位置。 */
.listing-badge { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 4px 0 0; }
.listing-badge .badge-score { font-size: 1.1rem; }

/* 商品列表的筛选与排序（docs/plan/ux-optimization.md §Task 2）：搜索框 + 两个
   排序 pill + 当前筛选下的商品数。排序 pill 复用图表区间开关的样式词汇
   （.days a 的圆角描边），不引入第三套按钮长相。 */
.list-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 16px 0 4px; }
/* 控件行里的表单不再吃 .inline-form 的上下外边距，否则和 sort pill 对不齐。 */
.list-controls .inline-form { margin: 0; }
.list-controls .search-form input[type="search"] { min-width: 200px; }
.sort-tabs { display: flex; gap: 8px; }
.sort-tabs .sort-tab {
  font-size: .85rem; color: var(--muted); text-decoration: none;
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 12px;
}
.sort-tabs .sort-tab.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.list-count { margin: 0; }

/* 错误排查页（docs/features/error-diagnostics.md）：详情是键值对 + 可滚动的原始
   文本，列表是一张普通表。编号/路径/状态用等宽字体，一行行读下来能对齐。 */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.code-form label { font-size: .85rem; color: var(--muted); }
.code-form input {
  flex: 1 1 260px; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.error-fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.error-fields dt { font-size: .82rem; color: var(--muted); }
.error-fields dd { margin: 0; overflow-wrap: anywhere; }
.error-summary { max-width: 420px; overflow-wrap: anywhere; }
.tag-panic { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
/* 堆栈与错误链都靠换行表达结构，white-space 丢掉的话就成了一行。 */
.stack-trace {
  margin: 4px 0 0; padding: 10px 12px; max-height: 320px; overflow: auto;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem; white-space: pre-wrap; word-break: break-word;
}

.referral-code-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.referral-code { font-size: 1.4rem; font-weight: 700; letter-spacing: 2px; }
.referral-stats { display: flex; flex-wrap: wrap; gap: 16px 48px; }
.referral-stat .stat-num { font-size: 1.6rem; }

.rampup-word { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 8px; font-size: .85rem; }
.rampup-preference-form {
  margin: 12px 0 20px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft);
}
.rampup-preference-heading { margin: 0 0 4px; font-size: .95rem; }
.rampup-preference-group {
  margin: 12px 0 0; padding: 10px 0 0;
  border: 0; border-top: 1px solid var(--border);
}
.rampup-preference-group legend { padding: 0; font-size: .88rem; font-weight: 600; }
.rampup-preference-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.rampup-preference-option {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; font-size: .85rem; cursor: pointer; user-select: none;
}
.rampup-preference-option input { margin: 0; }
.rampup-preference-option input:checked + span { color: var(--primary); font-weight: 600; }
.rampup-preference-option:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.rampup-preference-note { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.rampup-preference-note > span { font-size: .9rem; color: var(--muted); }
.rampup-preference-note textarea {
  width: 100%; padding: 10px 12px; font-family: inherit; font-size: .95rem;
  border: 1px solid var(--border); border-radius: var(--radius); resize: vertical;
}
.rampup-preference-note textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.rampup-preference-counter { text-align: right; margin: 4px 0 0; }
.rampup-preference-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 0; }
#rampup-competitors { scroll-margin-top: 78px; }
.rampup-optimize-positioning { margin-top: 8px; }
.rampup-optimize-statement { font-size: 1.05rem; font-weight: 600; margin: 4px 0; overflow-wrap: anywhere; }
.rampup-optimize-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 4px 0; }
.rampup-optimize-meta dt { font-size: .82rem; color: var(--muted); }
.rampup-optimize-meta dd { margin: 0; overflow-wrap: anywhere; }
.rampup-optimize-group { margin-top: 10px; }
.rampup-optimize-level-baseline { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }
.rampup-optimize-level-evidence { color: #9a6b00; border-color: #fcd34d; background: #fffbeb; }
.rampup-optimize-level-positioning { color: #15803d; border-color: #86efac; background: #f0fdf4; }
.rampup-optimize-list { margin: 4px 0; padding-left: 20px; }
.rampup-optimize-suggestion { margin: 6px 0; }
.rampup-optimize-suggestion summary {
  cursor: pointer; display: flex; align-items: baseline; gap: 8px;
  padding: 6px 10px; margin: 0 -10px; border-radius: var(--radius);
  transition: background-color .15s ease;
}
.rampup-optimize-suggestion summary:hover { background: var(--bg-soft); }
.rampup-optimize-suggestion summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rampup-optimize-suggestion details[open] > summary { margin-bottom: 4px; }
.rampup-optimize-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rampup-optimize-toggle {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  align-self: center; color: var(--primary); font-size: .8rem; font-weight: 600;
}
.rampup-optimize-toggle-close { display: none; }
.rampup-optimize-suggestion details[open] .rampup-optimize-toggle-open { display: none; }
.rampup-optimize-suggestion details[open] .rampup-optimize-toggle-close { display: inline; }
.rampup-optimize-chevron {
  width: 7px; height: 7px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .15s ease;
}
.rampup-optimize-suggestion details[open] .rampup-optimize-chevron { transform: rotate(-135deg); }
.rampup-optimize-priority {
  font-size: .72rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px;
  padding: 0 7px; min-width: 22px; text-align: center; flex: none;
}
.rampup-optimize-evidence { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: .85rem; }
.rampup-optimize-evidence th, .rampup-optimize-evidence td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top;
}
.rampup-optimize-evidence th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.rampup-optimize-action { margin: 6px 0; }
.rampup-optimize-copy { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rampup-optimize-copy p { flex: 1 1 320px; margin: 0; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; overflow-wrap: anywhere; }
.rampup-optimize-facts { width: 100%; border-collapse: collapse; font-size: .85rem; }
.rampup-optimize-facts th, .rampup-optimize-facts td {
  text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap;
}
.rampup-optimize-facts thead th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.rampup-optimize-facts tbody th { font-weight: 500; color: var(--muted); font-size: .82rem; }
.rampup-optimize-facts a { color: inherit; }
.rampup-optimize-stats { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 4px 0; }
.rampup-optimize-stats dt { font-size: .82rem; color: var(--muted); }
.rampup-optimize-stats dd { margin: 0; }
.rampup-optimize-shares { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0; padding: 0; }
.rampup-optimize-tokens { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 4px 0 0; }

/* 商品 TOP 榜（docs/features/item-ranking-chart.md） */
.rankchart-headline { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rankchart-rank { font-size: 1.25rem; font-weight: 600; }
.rankchart-out { font-size: 1.05rem; font-weight: 600; color: var(--muted); }
.rankchart .up { color: #b91c1c; }
.rankchart .down { color: #15803d; }
.rankchart-entered { color: #b91c1c; font-size: .9rem; }
.rankchart-dropped { color: #15803d; font-size: .9rem; }
.rankchart-meta span { margin-right: 12px; }
.badge-rankchart { text-decoration: none; }

.gate { max-width: 860px; margin: 0 auto 24px; }
.gate-question { text-align: center; font-size: 1.35rem; margin: 0 0 6px; }
.gate-lead { text-align: center; margin: 0 0 20px; }
.gate-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.gate-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column;
}
.gate-card:hover { border-color: var(--primary); }
.gate-card .kicker { font-size: .82rem; font-weight: 600; letter-spacing: .06em; }
.kicker-rampup { color: var(--accent); }
.kicker-stable { color: #15803d; }
.gate-card h3 { margin: 6px 0 4px; font-size: 1.35rem; }
.gate-tag { color: var(--muted); font-size: .92rem; margin: 0 0 14px; }
.gate-card ul { margin: 0 0 18px; padding-left: 1.2em; flex: 1; }
.gate-card li { margin: 5px 0; font-size: .93rem; }
.gate-cta { margin-top: auto; display: grid; gap: 8px; justify-items: stretch; }
.gate-cta > p { margin: 0; text-align: center; }
.gate-cta .inline-form { margin: 4px 0 0; }
.panel.invite {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 16px; flex-wrap: wrap; background: var(--bg-soft);
}
.panel.invite p { margin: 0; font-size: .95rem; }
.panel.invite .inline-form { margin: 0; }
.panel.invite .btn { flex: none; }
@media (max-width: 760px) { .gate-cards { grid-template-columns: 1fr; } }

/* 新建稳量项目向导（docs/refactor/two-modules.md §9.1）：一步一张卡，做过的
   一步渲染成结果、没轮到的一步压暗并拦住指针。卡片里的项目栏与商品页的
   「已识别」行是同一套成分（缩略占位 / 名称 / 地址 / 徽标），所以两处的
   「这是哪一个」长得一样。 */
.step { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.step.locked { opacity: .55; pointer-events: none; }
.step-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.step-head .no {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700;
}
.step-head h2 { margin: 0; font-size: 1.1rem; }
/* 卡片里的表单在收起来时也要真的消失：.inline-form 自带 display: flex，
   不写这条 [hidden] 会被它盖掉。 */
.step [hidden] { display: none; }
.step .inline-form { margin: 0; }
.resolved {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg-soft); border-radius: 8px; padding: 12px 14px; margin-top: 12px;
}
.resolved .thumb { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg,#f3e8e0,#e9edf5); flex: none; }
.resolved-meta { flex: 1; min-width: 0; }
.resolved .name { font-weight: 600; font-size: .95rem; line-height: 1.4; }
.resolved .url { color: var(--muted); font-size: .78rem; word-break: break-all; }
.badge-ok { color: #15803d; border-color: #15803d; }
.comp-list { list-style: none; margin: 12px 0 0; padding: 0; }
.comp-list li { margin-bottom: 10px; }
.comp-list li:last-child { margin-bottom: 0; }
.step .kw-list { list-style: none; margin: 12px 0 0; padding: 0; }
.step .kw-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .9rem; }
.gen-bar .ai-title { font-weight: 600; font-size: .95rem; }

/* 向导第三、四步的部件（原型 stable-new.html 的同一套）：
   .gen-bar 是「AI 推荐 / 确认」那条虚线框，.kw-sugg 是候选词 chips 行，
   .spin 是推荐进行中的小转圈（复用已有的 @keyframes spin）。 */
.gen-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 16px 20px;
}
.gen-bar > p { margin: 0; }
.kw-sugg { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.kw-sugg button {
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 3px 14px; font-size: .85rem; cursor: pointer;
}
.kw-sugg button:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.kw-sugg button[disabled] { color: var(--muted); background: var(--bg-soft); cursor: default; }
.spin {
  display: inline-block; width: 12px; height: 12px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -1px;
}

.limitup-page .limitup-run { padding-bottom: 16px; }
.limitup-controls {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
}
.limitup-controls label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: .82rem; color: var(--muted); font-weight: 600;
}
.limitup-controls input[type="date"],
.limitup-controls input[type="number"] {
  padding: 8px 10px; font-size: .95rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff; color: var(--ink);
}
.limitup-controls input[type="date"] { min-width: 150px; }
.limitup-controls input[type="number"] { width: 82px; }
.limitup-controls input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.limitup-controls .limitup-check {
  flex-direction: row; align-items: center; gap: 6px;
  color: var(--ink); font-weight: 500; padding-bottom: 9px;
}
.limitup-status {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--bg-soft); color: var(--muted); font-size: .9rem;
  line-height: 1.6; word-break: break-word;
}
.limitup-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 4px 0 18px;
}
.limitup-meta .tag { font-size: .82rem; }
.limitup-board { margin-bottom: 18px; }
.limitup-board .panel-head { margin-bottom: 10px; }
.limitup-table { min-width: 760px; font-size: .86rem; font-variant-numeric: tabular-nums; }
.limitup-table td, .limitup-table th { white-space: nowrap; padding: 10px 6px; }
.limitup-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.limitup-name { white-space: normal !important; min-width: 120px; }
.limitup-name > span { display: block; }
.limitup-name .limitup-sub { color: var(--muted); font-size: .76rem; max-width: 240px; line-height: 1.5; margin-top: 2px; }
.limitup-stats { margin: 10px 0 0; line-height: 1.9; }
.limitup-swipe { display: none; margin: 0 0 6px; }
.limitup-all { margin-top: 12px; }
.limitup-all summary {
  cursor: pointer; font-size: .9rem; color: var(--primary); font-weight: 600;
  padding: 6px 0;
}
.limitup-note p { margin: 0; line-height: 1.8; }
@media (max-width: 720px) {
  .limitup-controls { align-items: stretch; }
  .limitup-controls label { width: 100%; }
  .limitup-controls input[type="date"],
  .limitup-controls input[type="number"] { width: 100%; }
  .limitup-controls .btn { width: 100%; }
  .limitup-swipe { display: block; }
}
