:root {
  --bg: #fbfbfc;
  --surface: #ffffff;
  --sunken: #f6f6f8;
  --line: #e8e9ec;
  --line-soft: #f2f2f5;
  --ink: #1b1c1f;
  --ink-2: #3a3d44;
  --muted: #5f636c;
  --faint: #6b6f78;
  --accent: #4f5bd5;
  --accent-ink: #3b46b8;
  --accent-soft: #e9eaf8;
  --amber-ink: #94470c;
  --amber-soft: #fdf1e3;
  --green-ink: #1f6b43;
  --green-soft: #e6f4ec;
  --danger: #b42318;
  --gutter: clamp(32px, 6vw, 96px);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.is-hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 13px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.login-card h1 { margin: 16px 0 6px; font-size: 22px; letter-spacing: -0.01em; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #e2e3e7; border-radius: 9px; background: var(--surface); color: var(--ink); }
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.form-error { min-height: 18px; margin: 0 0 10px; color: var(--danger); font-size: 13px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--sunken); color: var(--ink); }
.btn svg { flex: none; width: 14px; height: 14px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2c2e33; color: #fff; }
.btn-wide { width: 100%; height: 40px; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { flex: none; width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; border: 1px solid #ececef; border-radius: 7px; background: var(--surface); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 12px; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; }
svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px max(var(--gutter), calc((100% - 1536px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 22px; height: 22px; display: block; flex: none; }
.search { position: relative; flex: 1 1 360px; max-width: 560px; }
.search label { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--sunken); color: var(--faint); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.search svg { width: 15px; height: 15px; }
.search-results { position: absolute; left: 0; right: 0; top: 42px; max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(20, 20, 30, .12); }
.search-group { padding: 8px 0; border-top: 1px solid var(--line-soft); }
.search-group:first-child { border-top: 0; }
.search-group h3 { margin: 0; padding: 4px 14px; font-size: 12px; font-weight: 500; color: var(--faint); }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 14px; border: 0; background: none; text-align: left; }
.search-item:hover { background: var(--sunken); }
.search-item small { margin-left: auto; color: var(--faint); white-space: nowrap; }
.search-empty { padding: 14px; color: var(--faint); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.account { position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.menu { position: absolute; z-index: 40; min-width: 180px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(20, 20, 30, .14); }
.menu-right { right: 0; top: 40px; }
.menu p { margin: 4px 8px 8px; font-size: 12px; color: var(--faint); word-break: break-all; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: none; text-align: left; }
.menu button:hover { background: var(--sunken); }
.menu hr { margin: 6px 0; border: 0; border-top: 1px solid var(--line-soft); }

/* Main */
/* The lists take up to 1536px; the side gutter grows with the window, so a
   laptop (14" MacBook Pro, about 1512px) keeps some air at the sides and a
   wide screen centres them. The top bar's contents line up with them. */
.page { max-width: calc(1536px + 2 * var(--gutter)); margin: 0 auto; padding: 24px var(--gutter) 72px; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 10px 12px 12px; border-bottom: 2px solid transparent; color: var(--faint); font-weight: 500; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .count { font-family: var(--mono); font-size: 12px; color: #8a8e97; }
.count:empty { display: none; }
button.tab { border-top: 0; border-left: 0; border-right: 0; background: none; cursor: pointer; font: inherit; font-weight: 500; }
.tab .chevron { width: 12px; height: 12px; }
.admin-menu { position: fixed; min-width: 200px; }
.menu a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.menu a:hover, .menu a[aria-current] { background: var(--sunken); }
.menu a[aria-current] { font-weight: 600; }
.menu .count { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); }
.tab-sep { width: 1px; height: 18px; margin: 0 8px; background: #e2e3e7; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f1f1f4; color: var(--faint); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0 14px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 8px; background: #f1f1f4; }
.segmented button { height: 28px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 500; font-size: 13px; white-space: nowrap; }
/* Six time ranges fit a phone only with less padding; past that they scroll. */
@media (max-width: 760px) {
  .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented button { flex: 1 0 auto; padding: 0 8px; }
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 20, 30, .08); }
.select { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); font-size: 13px; color: var(--muted); }
.select select { border: 0; background: transparent; font-weight: 500; color: var(--ink); }
.summary { margin: 0 0 0 auto; font-size: 13px; color: var(--faint); }
.summary strong { color: var(--ink); font-family: var(--mono); font-weight: 600; }

/* List */
.list { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.row, .list-head { display: grid; grid-template-columns: 188px minmax(0, 1fr) 112px 132px 104px 124px; gap: 16px; align-items: center; padding: 0 20px; }
.list-head { padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid #efeff2; font-size: 12px; color: #8a8e97; }
.row { min-height: 52px; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row.judged { background: #fcfcfd; }
.row.judged .kw { color: var(--muted); font-weight: 400; }
.row.judged .actions { opacity: .75; }
/* 刚看过: the row last acted on, a light tint and a thin bar, text unchanged. */
.row.seen { background: #f2f3fc; box-shadow: inset 3px 0 0 #8f97e3; }
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.kw-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kw { min-width: 0; padding: 4px 0; border: 0; background: none; color: var(--ink); font-weight: 500; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw:hover { color: var(--accent-ink); }
.chip { flex: none; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f3f3f6; color: var(--muted); white-space: nowrap; }
.note { min-width: 0; font-size: 12px; color: #8a8e97; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cell-num { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.cell-num small { color: #8a8e97; }
.cell-time { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.mark { justify-self: start; height: 28px; padding: 0 10px; border: 1px dashed #d5d6dc; border-radius: 7px; background: var(--surface); color: var(--faint); font-weight: 500; font-size: 12px; }
.mark:hover { border-style: solid; color: var(--ink); }
.status { justify-self: start; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 0; border-radius: 7px; font-size: 12px; font-weight: 500; }
.status-todo { background: var(--accent-soft); color: var(--accent-ink); }
.status-todo_no_data { background: var(--surface); color: var(--accent-ink); box-shadow: inset 0 0 0 1px #c8ccf1; }
.status-blog { background: #f3ecfb; color: #5f3a96; }
.status-watching { background: var(--amber-soft); color: var(--amber-ink); }
.status-done { background: var(--green-soft); color: var(--green-ink); }
.status-skip { background: #f1f1f4; color: var(--muted); }
.status-undecided { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px #d5d6dc; }
.status-not_target { background: #fbecea; color: #9b2c20; }
.divider { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: #fafafb; border-bottom: 1px solid var(--line-soft); font-size: 12px; color: #8a8e97; }
.empty { padding: 48px 20px; text-align: center; color: var(--faint); }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 15px; }
.more { display: flex; justify-content: center; padding: 14px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 14px; }
.pager .btn:disabled { opacity: .45; cursor: default; }
.chip-btn { border: 0; cursor: pointer; }
.chip-btn:hover { background: var(--accent-soft); color: var(--accent-ink); }
.chip-bot { border-radius: 6px; }
/* 已做's page: opens in a new tab. In a full row it gives way first, down to
   its icon, so the keyword keeps its room; the full address is its title. */
.chip-link { display: inline-flex; align-items: center; gap: 4px; flex: 0 1000 auto; min-width: 28px; max-width: 220px; overflow: hidden; background: var(--green-soft); color: var(--green-ink); text-decoration: none; }
.chip-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip-link:hover { color: var(--green-ink); text-decoration: underline; }
.chip-link svg { flex: none; width: 12px; height: 12px; stroke: currentColor; }
.chip-warn { background: var(--amber-soft); color: var(--amber-ink); }
.chip-faint { background: transparent; color: #a3a6ad; }
.chip-site { background: var(--green-soft); color: var(--green-ink); }
.chip-site-add { background: none; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }
/* A 待定 word's candidate sites: like a plan, but not decided yet. */
.chip-site-candidate { background: none; color: var(--green-ink); outline: 1px dashed currentColor; outline-offset: -1px; }
.plan-form { display: flex; flex-direction: column; gap: 2px; }
/* The popover is a .menu, whose buttons are bare rows: this one is the form's button. */
.menu .plan-form .btn-primary { justify-content: center; margin-top: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.menu .plan-form .btn-primary:hover { background: #2c2e33; }
.plan-site { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.plan-site:hover { background: var(--sunken); }
.plan-site span { display: flex; flex-direction: column; font-size: 13px; }
.plan-site small { color: var(--faint); font-size: 12px; }
.judges-pop { width: min(440px, calc(100vw - 16px)); max-height: 70vh; overflow: auto; padding: 12px; }
.judges-pop h3 { display: flex; flex-direction: column; gap: 2px; margin: 0 4px 8px; font-size: 13px; }
.judges-pop h3 small { font-weight: 400; color: var(--faint); overflow-wrap: anywhere; }
.judge-item { padding: 10px 4px; border-top: 1px solid var(--line-soft); }
.judge-item > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.judge-item small { margin-left: auto; color: var(--faint); font-size: 12px; }
.judges-pop .btn { width: 100%; justify-content: center; margin-top: 8px; }
.mark-filter select:disabled { opacity: .5; }
.footnote { margin: 12px 4px 0; font-size: 12px; color: #8a8e97; }
.status-menu { width: 168px; }
.status-menu .swatch { width: 10px; height: 10px; border-radius: 3px; }
.status-menu.with-note { width: 280px; }
.menu-note { display: grid; gap: 6px; padding: 2px 4px 4px; }
.menu-note textarea { width: 100%; min-height: 72px; padding: 8px 10px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); resize: vertical; }
.menu-note input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); }
.menu-note input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.menu-note textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.menu-note small { font-size: 12px; color: var(--faint); }
.menu-note-actions { display: flex; justify-content: flex-end; gap: 6px; }
.menu .menu-note-actions .btn { width: auto; min-height: 32px; justify-content: center; border: 1px solid #e2e3e7; background: var(--surface); }
.menu .menu-note-actions .btn-primary { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Watched sites */
.site-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.site-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }
.site-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--faint); }
.site-chip button:hover { background: var(--sunken); color: var(--ink); }

/* Drawer */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 30, .18); }
.drawer { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg); box-shadow: -12px 0 40px rgba(20, 20, 30, .12); }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-body { flex: 1; overflow: auto; padding: 20px; }
.drawer h2 { margin: 6px 0 12px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; word-break: break-word; }
.badge { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }
.badge-muted { background: #f1f1f4; color: var(--muted); }
.meta { font-size: 12px; color: #8a8e97; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.stats div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.stats dt { font-size: 12px; color: #8a8e97; }
.stats dd { margin: 4px 0 0; font: 500 20px var(--mono); }
.card { margin-bottom: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.card h3 small { margin-left: 8px; font-weight: 400; color: #8a8e97; font-size: 12px; }
.spellings { display: flex; flex-wrap: wrap; gap: 8px; }
.spellings span { font-size: 13px; padding: 5px 10px; border-radius: 7px; background: #f3f3f6; }
.spellings small { color: #8a8e97; }
.judge { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 6px; margin-bottom: 12px; }
.judge button { height: 38px; padding: 0 6px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); font-weight: 500; white-space: nowrap; }
.judge button[aria-pressed="true"].todo { background: var(--accent-soft); border-color: #c8ccf1; color: var(--accent-ink); font-weight: 600; }
.judge button[aria-pressed="true"].todo_no_data { border-color: #a9b0ea; color: var(--accent-ink); font-weight: 600; }
.judge button[aria-pressed="true"].blog { background: #f3ecfb; border-color: #cdb6ec; color: #5f3a96; font-weight: 600; }
.judge button[aria-pressed="true"].done { background: var(--green-soft); border-color: #a7d3b8; color: var(--green-ink); font-weight: 600; }
.judge button[aria-pressed="true"].watching { background: var(--amber-soft); border-color: #e9b57a; color: var(--amber-ink); font-weight: 600; }
.judge button[aria-pressed="true"].skip { background: #ececef; border-color: #d5d6dc; color: var(--ink-2); font-weight: 600; }
.judge button[aria-pressed="true"].undecided { border-color: #9a9ea7; font-weight: 600; }
.judge button[aria-pressed="true"].not_target { background: #fbecea; border-color: #eab3ab; color: #9b2c20; font-weight: 600; }
.judge-actions { display: flex; gap: 8px; justify-content: flex-end; }
.team { list-style: none; margin: 0; padding: 0; }
.team > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.team > li:first-child { border-top: 0; }
.team .who { display: flex; align-items: center; gap: 8px; }
.team .who time { margin-left: auto; font-size: 12px; color: #8a8e97; }
/* A note, in the drawer and in 其他人的判断: its own lines, labels set apart. */
.note-body { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: var(--sunken); color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.note-text p { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; margin: 0; }
.note-text p > span:only-child { grid-column: 1 / -1; }
.note-text .note-gap { height: 6px; }
.note-key { color: var(--ink); font-weight: 600; white-space: nowrap; }
.note-key::after { content: "："; }
.note-text ul { margin: 2px 0; padding-left: 18px; list-style: disc; }
.note-text li { margin: 2px 0; }
.note-text li > span:first-child.note-key { margin-right: 6px; }
.note-text a { color: var(--accent-ink); overflow-wrap: anywhere; text-decoration: none; }
.note-text a:hover { text-decoration: underline; }
.note-text span { overflow-wrap: break-word; }
/* Numbered items split out of one long line: each its own row, label first. */
.note-text ol.note-items { margin: 6px 0 2px; padding-left: 20px; }
.note-text ol.note-items li { margin: 0 0 6px; padding-left: 2px; overflow-wrap: break-word; }
.note-text ol.note-items li:last-child { margin-bottom: 0; }
.note-text ol.note-items li::marker { color: var(--faint); font-size: 12px; }
.note-item-key { color: var(--ink); font-weight: 600; }
.note-text p.note-tail { margin-top: 8px; }
/* grok-bot's "a | b | c" parts: one row each, a hairline between them. */
.note-text ul.note-pipes { list-style: none; padding-left: 0; margin: 0; }
.note-text ul.note-pipes li { margin: 0; padding: 5px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.note-text ul.note-pipes li:first-child { border-top: 0; padding-top: 0; }
.note-text p + ul.note-checks { margin-top: 2px; }
.note-text ul.note-checks { list-style: none; padding-left: 0; margin: 2px 0 0; }
.note-text ul.note-checks li { margin: 0 0 4px; }
.note-aside { color: var(--faint); font-size: 12px; }
.note-item-sep { color: var(--ink); }
.note-body.is-folded .note-text { max-height: calc(1.65em * 8); overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.note-body .note-toggle { display: inline; width: auto; min-height: 0; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--accent-ink); font-size: 12px; font-weight: 500; cursor: pointer; }
.initial { width: 28px; height: 28px; border-radius: 50%; background: #eef0f3; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.timeline > li:first-child { border-top: 0; }
.timeline .site { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 500; }
.timeline a.page-link { display: block; margin-top: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grok-sources { list-style: none; margin: 8px 0 0; padding: 0; }
.grok-sources a.page-link { display: block; margin-top: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* In the popover, not the menu's tall link rows. */
.judges-pop .grok-sources a.page-link { min-height: 0; margin: 0; padding: 3px 0; border-radius: 0; color: var(--accent-ink); }
.judges-pop .grok-sources a.page-link:hover { background: none; text-decoration: underline; }
.sites-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--accent-ink); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.sites-btn:hover { text-decoration-style: solid; }
.site-pages { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; }
.site-pages li { display: flex; align-items: center; gap: 8px; padding: 3px 0; min-width: 0; }
.judges-pop .site-pages a.page-link { min-height: 0; margin: 0; padding: 0; border-radius: 0; color: var(--accent-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.judges-pop .site-pages a.page-link:hover { background: none; text-decoration: underline; }
.site-pages.new-site-list li { display: block; padding: 4px 0; }
.site-pages.new-site-list a.page-link { display: block; }
.timeline details { margin-top: 6px; font-size: 12px; color: var(--muted); }
.timeline summary { cursor: pointer; }
.timeline details ul { margin: 6px 0 0; padding: 0; list-style: none; }
.timeline details li { display: flex; gap: 8px; padding: 3px 0; min-width: 0; }
.timeline details li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang { flex: none; font: 500 11px var(--mono); padding: 1px 5px; border-radius: 4px; background: #f1f1f4; color: var(--muted); }

dialog.modal { width: min(420px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 14px; }
dialog.modal::backdrop { background: rgba(20, 20, 30, .28); }
dialog.modal h2 { margin: 0 0 6px; font-size: 18px; }
dialog.modal p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
dialog.queries-modal { width: min(1100px, calc(100% - 32px)); }
/* AI 工具接入说明 (MCP): tabs per tool, numbered steps, copyable code. */
.mcp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px 0; font-size: 13px; color: var(--muted); }
.mcp-line code { padding: 2px 8px; border-radius: 6px; background: var(--sunken); color: var(--ink); font: 12px var(--mono); overflow-wrap: anywhere; }
dialog.mcp-modal { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 0; display: none; flex-direction: column; }
dialog.mcp-modal[open] { display: flex; }
.mcp-head { position: relative; padding: 20px 56px 14px 24px; border-bottom: 1px solid var(--line); }
.mcp-head p { margin: 0; }
.mcp-x { position: absolute; top: 14px; right: 14px; font-size: 20px; }
.mcp-body { flex: 1; overflow-y: auto; padding: 18px 24px; font-size: 14px; line-height: 1.7; }
.mcp-body code { padding: 1px 6px; border-radius: 5px; background: var(--sunken); font: 12px var(--mono); overflow-wrap: anywhere; }
dialog.mcp-modal .mcp-warn { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; }
.mcp-warn code { background: rgba(255, 255, 255, .5); }
.mcp-tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.mcp-tab { padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.mcp-tab[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.mcp-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.mcp-steps > li { position: relative; min-width: 0; padding: 0 0 14px 38px; counter-increment: step; }
.mcp-steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; line-height: 24px; text-align: center; }
.mcp-code { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); }
.mcp-code pre { flex: 1; min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 var(--mono); }
.mcp-code .btn { flex: none; }
.mcp-usage { margin-top: 6px; padding: 12px 16px; border-radius: 10px; background: var(--sunken); font-size: 13px; }
.mcp-usage h3 { margin: 0 0 6px; font-size: 14px; }
dialog.mcp-modal .mcp-usage p { margin: 0 0 4px; color: var(--ink-2); }
.mcp-foot { display: flex; justify-content: flex-end; padding: 12px 24px; border-top: 1px solid var(--line); }
.queries-scroll { overflow-x: auto; }
.queries-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.queries-table th, .queries-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.queries-table th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.queries-table td small { display: block; color: var(--muted); }
.queries-table td.doable { color: var(--accent-ink); font-weight: 500; }

.toasts { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; }
.toast { padding: 10px 14px; border-radius: 9px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(20, 20, 30, .2); }
.toast.error { background: var(--danger); }

@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  .brand span { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .page { padding: 12px 16px 64px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tab { white-space: nowrap; }
  .summary { flex-basis: 100%; margin: 0; }
  .list-head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "kw time" "num vol" "actions status"; gap: 8px; padding: 12px 14px; }
  .row .cell-vol { grid-area: vol; justify-self: end; }
  .row .kw-cell { grid-area: kw; }
  /* grok 推荐: the word on its own line, its chips under it. */
  .row.grok-row .kw-cell { flex-wrap: wrap; row-gap: 4px; }
  .row.grok-row .kw { flex-basis: 100%; }
  .row .cell-time { grid-area: time; justify-self: end; }
  .row .cell-num { grid-area: num; font-size: 12px; color: var(--muted); }
  .row .actions { grid-area: actions; }
  .row .status, .row .mark { grid-area: status; justify-self: end; min-height: 36px; }
  .icon-btn { width: 38px; height: 36px; }
  .drawer { width: 100%; border-left: 0; }
  .judge button { height: 46px; }
}

/* Super administrator views */
body:not([data-role="super_admin"]) .admin-only,
body[data-role="super_admin"] .member-only { display: none !important; }
.admin-grid { display: grid; gap: 16px; }
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.subnav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.subnav a:hover { background: var(--sunken); color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--sunken); color: var(--ink); font-weight: 600; }
.rule-form textarea { min-height: 96px; padding: 8px 10px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); font-family: var(--mono); font-size: 12px; resize: vertical; }
.admin-item.off { opacity: .55; }
.fold > summary { padding: 12px 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; cursor: pointer; }
.token-once { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; }
.token-once code { flex: 1 1 260px; min-width: 0; padding: 8px 10px; border-radius: 8px; background: var(--sunken); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.item-message { flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; white-space: normal; color: #8a8e97; font-size: 12px; }
.admin-section { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.admin-section > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.admin-section > header h2 { margin: 0; font-size: 15px; }
.admin-section > header span { color: var(--faint); font-size: 12px; }
.admin-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.admin-section > header + .admin-item { border-top: 0; }
.admin-item .what { flex: 1 1 320px; min-width: 0; }
.admin-item .what strong { display: block; }
.admin-item .what p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.admin-item .what small { color: #8a8e97; font-size: 12px; word-break: break-all; }
.admin-item .do { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-empty { padding: 14px 18px; color: var(--faint); font-size: 13px; }
.digest { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0; padding: 14px 18px; }
.digest div { padding: 10px 12px; border-radius: 9px; background: var(--sunken); }
.digest dt { font-size: 12px; color: var(--faint); }
.digest dd { margin: 4px 0 0; font: 500 18px var(--mono); }
.manage { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.manage-list { flex: 1 1 280px; min-width: 0; }
.manage-detail { flex: 999 1 520px; min-width: 0; }
.site-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 14px; border: 0; border-top: 1px solid var(--line-soft); background: none; text-align: left; }
.site-row:hover, .site-row[aria-current="true"] { background: var(--sunken); }
.site-row small { margin-left: auto; color: var(--faint); }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; margin: 0; padding: 14px 18px; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; min-width: 0; word-break: break-all; }
.rule { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.rule code, .admin-item code { font-family: var(--mono); font-size: 12px; background: var(--sunken); padding: 2px 6px; border-radius: 5px; }
.rule.off { opacity: .55; }
.rule-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.rule-form input, .rule-form select { height: 34px; padding: 0 10px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); }
.rule-form input[name="path"] { flex: 1 1 200px; }
/* A select or input inside a labelled .select pill has no box of its own. */
.rule-form .select select, .rule-form .select input { height: auto; padding: 0; border: 0; background: transparent; }
.rule-form .select input { width: 64px; color: var(--ink); font-weight: 500; }
.rule-form input[type="file"] { height: auto; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; }
.rule-form input[type="file"]::file-selector-button { height: 34px; margin-right: 10px; padding: 0 12px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f1f1f4; color: var(--muted); }
.tag-warn { background: var(--amber-soft); color: var(--amber-ink); }
.tag-include { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 760px) { .kv { grid-template-columns: 1fr; } }

.list-head.pioneer-row, .row.pioneer-row { grid-template-columns: minmax(0, 1fr) 120px 100px 90px 96px; }
@media (max-width: 760px) {
  .row.pioneer-row { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: none; }
  .row.pioneer-row > .kw-cell, .row.pioneer-row > button { grid-column: 1 / -1; grid-area: auto; }
  .row.pioneer-row > .cell-num { grid-area: auto; }
}

/* AI 记录: two status cards, the log, then folded settings. */
.ai-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.ai-card { display: flex; flex-direction: column; }
.ai-card > header { align-items: center; }
.ai-card > header .tag { margin-left: auto; }
.tag-on { background: #e6f4ea; color: #1e6b34; }
.card-body { flex: 1; padding: 14px 18px 4px; }
.card-note { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.card-note strong, .facts strong { color: var(--ink); }
.warn-text { color: var(--amber-ink); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 13px; }
.facts div { display: contents; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.usage { display: inline-block; width: 72px; height: 6px; border-radius: 3px; background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.usage span { display: block; height: 100%; background: var(--accent); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 16px; }
.fold { border-top: 1px solid var(--line-soft); }
.fold > summary { padding: 10px 18px; color: var(--muted); font-size: 13px; cursor: pointer; }
.settings > summary, .ai-log > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; }
.settings > summary::-webkit-details-marker, .ai-log > summary::-webkit-details-marker { display: none; }
.settings > summary::before, .ai-log > summary::before { content: "›"; display: inline-block; color: var(--faint); font-size: 18px; line-height: 1; transition: transform .15s; }
.settings[open] > summary::before, .ai-log[open] > summary::before { transform: rotate(90deg); }
.settings > summary h2, .ai-log > summary h2 { margin: 0; font-size: 15px; }
.settings > summary span, .ai-log > summary span { color: var(--faint); font-size: 12px; }
.settings-group { padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.settings-group h3 { margin: 0; font-size: 14px; }
.settings-group > p { margin: 2px 0 12px; color: var(--faint); font-size: 12px; }
.settings-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.settings-form label.wide { grid-column: span 2; }
.settings-form input { height: 34px; padding: 0 10px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; min-width: 0; }
.settings-form textarea { padding: 8px 10px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; min-width: 0; resize: vertical; }
.settings-form .settings-result { grid-column: 1 / -1; margin: 0; }
.settings-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.btn-quiet { border-color: transparent; color: var(--danger); }
.settings-result { margin: 10px 0 0; color: var(--faint); font-size: 12px; }
@media (max-width: 760px) {
  .ai-cards { grid-template-columns: 1fr; }
  .settings-form { grid-template-columns: 1fr 1fr; }
}

/* Search volume: a number, the twelve-month line, and ↑ when rising. */
.cell-vol { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.cell-vol.faint { color: #a3a6ad; font-family: inherit; font-size: 12px; }
.spark { flex: none; overflow: visible; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.up { color: #1e6b34; font-weight: 600; }
.vol-lang + .vol-lang { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.vol-lang h4 { margin: 0 0 6px; font-size: 13px; }
.vol-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 3px 0; font-size: 13px; }
.vol-line .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-quiet-ink { margin-left: auto; border-color: transparent; color: var(--accent-ink); }
.btn-quiet-ink:hover { background: var(--accent-soft); color: var(--accent-ink); }
.settings-group { scroll-margin-top: 120px; transition: background .4s; }
.settings-group.flash { background: var(--accent-soft); }
.settings > summary h2::after { content: "点开修改"; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 500; vertical-align: 2px; }
.settings[open] > summary h2::after { content: none; }
.volume-range input { width: 64px; height: 26px; padding: 0 6px; border: 1px solid #e2e3e7; border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; }
.volume-range input::placeholder { color: #a3a6ad; font-weight: 400; }
.volume-range span { color: var(--faint); }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); background: var(--sunken); font-size: 13px; color: var(--muted); }
.bulk-bar span { flex: 1 1 320px; }
.backup-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }
.backup-box span { flex: 1 1 320px; }

/* 油猴词: the word, its badges, tags and analysis wrap inside the keyword cell. */
.row.us-row { padding-top: 8px; padding-bottom: 8px; }
.row.us-row .kw-cell { flex-wrap: wrap; row-gap: 4px; }
.us-analysis { flex-basis: 100%; min-width: 0; font-size: 12px; color: var(--muted); }
.us-analysis summary { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-analysis[open] summary { white-space: normal; }
.us-analysis p { margin: 4px 0; color: var(--ink-2); overflow-wrap: anywhere; }
.us-analysis p strong { margin-right: 6px; font-weight: 600; }
.cell-vol.us-sw { flex-direction: column; align-items: flex-start; gap: 0; font-size: 12px; line-height: 1.4; }
.us-tags { position: relative; }
.us-tags summary { cursor: pointer; list-style: none; }
.us-tags summary::-webkit-details-marker { display: none; }
.us-tag-list { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; display: flex; flex-direction: column; gap: 6px; min-width: 180px; max-height: 280px; overflow-y: auto; padding: 10px 12px; border: 1px solid #e2e3e7; border-radius: 8px; background: var(--surface); box-shadow: 0 6px 20px rgba(20, 22, 30, .08); }
.us-tag-list label { display: flex; align-items: center; gap: 6px; color: var(--ink-2); white-space: nowrap; }
.us-search input { width: 140px; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink-2); }
.us-hidden { padding: 12px 20px; font-size: 12px; }
@media (max-width: 760px) {
  .row.us-row .kw { flex-basis: 100%; }
  .us-search { flex: 1 1 100%; white-space: nowrap; }
  .us-search input { flex: 1; width: auto; min-width: 0; }
  /* Opens in place under its label: floating, it would run past the screen's edge. */
  .us-tags { display: block; flex: 1 1 100%; height: auto; }
  .us-tags summary { line-height: 32px; }
  .us-tag-list { position: static; min-width: 0; margin: 0 0 8px; padding: 0; border: 0; box-shadow: none; }
}
.judge-link { margin-bottom: 10px; }
.judge-link-row { display: flex; gap: 6px; }
.judge-link-row input { flex: 1; min-width: 0; }
.judge-link-row .btn { flex: none; }

/* 管理 → 关键词合并 */
.kwm-drop { display: grid; gap: 4px; place-items: center; margin: 16px 18px 18px; padding: 32px 16px; border: 1.5px dashed #d5d6dc; border-radius: 10px; background: var(--sunken); color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; }
.kwm-drop strong { color: var(--ink); font-size: 14px; }
.kwm-drop:hover, .kwm-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.kwm-scroll { overflow-x: auto; padding: 0 10px 8px; }
.kwm-error { color: var(--danger); }
