/* 投标信息 · 界面样式
   设计令牌 → 排版 → 布局 → 导航 → 控件 → 筛选栏 → 表格 → 标签 → 卡片/详情 → 消息 → HTMX → 登录 → 偏好 → 响应式 */

/* ---------- 令牌 ---------- */
:root {
  color-scheme: light dark;
  --bg: #fbfaf8;
  --surface: #fff;
  --surface-2: #f6f5f3;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .14);
  --fg: #292724;
  --muted: #716d67;
  --accent: #1766b6;
  --accent-hover: #105394;
  --accent-soft: #dceafb;
  --ok: #287348;
  --ok-bg: #d9edde;
  --warn: #8a570b;
  --warn-bg: #fae7bd;
  --err: #b63335;
  --err-bg: #fdecee;
  --tag-bg: #efeeeb;
  --tag-fg: #59554f;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-2: 0 0.5rem 1.5rem rgba(0, 0, 0, .08);
  --nav-bg: #f4f3f0;
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --focus: 0 0 0 3px rgba(0, 113, 227, .28);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --surface: #22211f;
    --surface-2: #282725;
    --line: rgba(255, 255, 255, .1);
    --line-strong: rgba(255, 255, 255, .18);
    --fg: #eceae6;
    --muted: #b4afa6;
    --accent: #8cbbef;
    --accent-hover: #b6d4f5;
    --accent-soft: #233449;
    --ok: #9acfac;
    --ok-bg: #23392c;
    --warn: #e7c37d;
    --warn-bg: #3e321f;
    --err: #f1a0a0;
    --err-bg: #422628;
    --tag-bg: #302e2b;
    --tag-fg: #d0cbc3;
    --nav-bg: #22211f;
    --shadow-2: 0 0.5rem 1.5rem rgba(0, 0, 0, .4);
    --focus: 0 0 0 3px rgba(41, 151, 255, .4);
  }
  @media (prefers-contrast: more) {
    :root { --line: rgba(255, 255, 255, .35); --line-strong: rgba(255, 255, 255, .6); }
  }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(0, 0, 0, .35); --line-strong: rgba(0, 0, 0, .6); }
}

/* ---------- 基础 / 排版 ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); font-size: 100%; }
body {
  margin: 0;
  font: 0.875rem/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
  color: var(--fg);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); border-radius: 4px; }
h1 { font-size: 1.625rem; line-height: 1.4; font-weight: 650; letter-spacing: -.025em; margin: 0; overflow-wrap: anywhere; }
h2 { font-size: 0.9375rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
h2 small { font-weight: 400; margin-left: 4px; }
small, .muted-sm { font-size: 0.75rem; letter-spacing: .01em; }
b, strong { font-weight: 600; }
p { margin: 0 0 0.625rem; }
.num, td.nowrap, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.err { color: var(--err); }
.ok { color: var(--ok); }
code {
  font: 0.75rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--tag-bg); color: var(--tag-fg);
  padding: 1px 0.3125rem; border-radius: 4px;
}
main ul { padding-left: 1.125rem; margin: 0.375rem 0 0.75rem; }
main li { margin: 3px 0; }
ul.errorlist, ul.err { list-style: none; padding: 0; margin: 4px 0 0; color: var(--err); font-size: 0.75rem; }

/* ---------- 布局 ---------- */
main { max-width: 97.5rem; margin: 0 auto; padding: 1.75rem 2rem 3rem; min-width: 0; }
.page-head { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .meta { color: var(--muted); display: inline-flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.page-head .actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.page-head .meta .tag { vertical-align: middle; }
/* 标题内的月份切换箭头（到期日历）：圆形小按钮 */
.page-head h1 > a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.625rem; height: 1.625rem; margin: 0 2px; border-radius: 62.4375rem; vertical-align: 3px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg);
  font-size: 1rem; font-weight: 500; line-height: 1;
  transition: background 120ms, transform 100ms var(--ease-out);
}
.page-head h1 > a:active { transform: scale(.97); }

/* ---------- 顶部导航 ---------- */
nav.top {
  position: sticky; top: 0; z-index: 20;
  min-height: 4.5rem; padding: .75rem 2rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: box-shadow 200ms var(--ease-out);
}
nav.top.scrolled { box-shadow: 0 1px 0 var(--line), var(--shadow-1); }
nav.top a { padding: 0.5625rem 0.6875rem; border-radius: 0.5rem; color: var(--muted); white-space: nowrap; }
nav.top a:active { background: var(--line-strong); }
nav.top a.active { font-weight: 600; color: var(--accent); background: var(--accent-soft); }
nav.top .brand { display: inline-flex; align-items: center; gap: 0.625rem; flex: none; padding: 0; color: var(--fg); font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }
nav.top .brand small { display: block; color: var(--muted); font-size: 0.625rem; font-weight: 400; letter-spacing: .06em; margin-top: 1px; }
.brand-mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 0.625rem; background: #eae3f3; color: #725199; }
.brand-mark svg { width: 1.5rem; height: 1.5rem; }
.nav-links { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; min-width: 0; }
.nav-secondary-desktop { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.nav-more { display: none; }
.nav-caption { margin-left: auto; color: var(--muted); font-size: 0.75rem; }
.account-menu { position: relative; margin-left: auto; flex: none; }
.account-menu summary { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; list-style: none; padding: 0.375rem; border-radius: 0.5rem; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 0.75rem; font-weight: 600; }
.account-popover { position: absolute; right: 0; top: calc(100% + 0.625rem); width: 11.25rem; display: grid; gap: 4px; padding: 0.5rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.account-caption { padding: 0.375rem 0.625rem; color: var(--muted); font-size: 0.75rem; }
.account-popover form { border-top: 1px solid var(--line); padding-top: 4px; }
.account-popover button.link { width: 100%; justify-content: flex-start; padding: 0.625rem; color: var(--fg); }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 100; padding: 0.75rem 1.125rem; background: var(--surface); border-radius: 0.5rem; }
.skip-link:focus { top: 0.75rem; }
summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }
nav.top .spacer { flex: 1; }
nav.top .muted { padding: 0 0.375rem; }
nav.top form.inline { margin-left: 4px; }

/* ---------- 控件 ---------- */
input, select, textarea {
  height: 2.375rem; padding: 0 0.625rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg);
  font: inherit; font-size: 0.875rem;
  transition: border-color 120ms ease;
}
textarea { height: auto; min-height: 4rem; padding: 0.5rem 0.625rem; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid transparent; border-color: var(--accent); box-shadow: var(--focus);
}
input[type=checkbox], input[type=radio] {
  height: auto; width: auto; padding: 0; margin: 0; border: 0;
  accent-color: var(--accent);
}
input[type=hidden] { display: none; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.375rem; padding: 0 0.875rem;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--fg);
  font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: transform 100ms var(--ease-out), background 120ms, border-color 120ms;
}
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button:focus-visible, .btn:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); }
.btn-primary, .primary, form.filters button[type=submit], form.filters button:not([type]) {
  background: #1766b6; border-color: #1766b6; color: #fff;
}
button.link {
  height: 2rem; padding: 0 0.5rem; border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--accent); font-weight: 400;
}
button.link:active { background: var(--line-strong); }
/* 密度开关（aria-pressed）：标签恒为「紧凑」，按下态只换色不换字重，避免抖动 */
button.link[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); }   /* 开关按下态用描边表示，不占用 hover/active 的底色反馈 */
.card > form > button.link { justify-self: start; }
label.check {
  display: inline-flex; align-items: center; gap: 0.375rem;
  height: 2.375rem; padding: 0 0.625rem;
  border: 1px solid var(--line-strong); border-radius: 62.4375rem;
  background: var(--surface);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background 120ms;
}
label.check:active { background: var(--line-strong); }
label.check:has(input:checked) { border-color: var(--accent); color: var(--accent); }
form.inline { display: inline-flex; align-items: center; gap: 0.375rem; vertical-align: middle; }

/* ---------- 筛选栏 ---------- */
form.filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  padding: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  margin-bottom: 0.875rem;
}
form.filters .search { position: relative; display: flex; flex: 1 1 16.25rem; min-width: 13.75rem; }
form.filters .search input { width: 100%; padding-right: 2.125rem; }
/* 键位提示：贴在输入框右侧内部；聚焦后隐藏；触屏（无 hover 能力）没有键盘，不显示 */
form.filters .search kbd {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  height: 1.125rem; min-width: 1.125rem; padding: 0 0.3125rem;
  border: 1px solid var(--line-strong); border-radius: 4px;
  background: var(--surface-2); color: var(--muted);
  font: 0.6875rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  pointer-events: none;
}
form.filters .search:focus-within kbd { display: none; }
@media (hover: none) {
  form.filters .search kbd { display: none; }
  form.filters .search input { padding-right: 0.625rem; }   /* kbd 已隐藏，别留死区 */
}
form.filters > a, form.filters details.more > summary {
  display: inline-flex; align-items: center; height: 2rem; padding: 0 0.625rem;
  border-radius: var(--radius-sm); color: var(--accent);
}
form.filters > a:active, form.filters details.more > summary:active { background: var(--line-strong); }
/* 「更多筛选」折叠组：占满整行；summary 当链接用（去掉原生三角，用 ▾/▴ 文本）；展开不做动画（高频，height 动画代价高） */
form.filters details.more { flex-basis: 100%; }
form.filters details.more > summary {
  cursor: pointer; user-select: none; -webkit-user-select: none;
  list-style: none;
}
form.filters details.more > summary::-webkit-details-marker { display: none; }
form.filters details.more > summary::after { content: "▾"; margin-left: 4px; }
form.filters details.more[open] > summary::after { content: "▴"; }
form.filters details.more > summary:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); }
form.filters details.more .more-body { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
/* 当前筛选药丸行 */
p.active { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin: 0 0 0.875rem; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 1.25rem; padding: 0 0.5rem; border-radius: 62.4375rem;
  background: var(--tag-bg); color: var(--tag-fg);
  font-size: 0.75rem; font-weight: 500; line-height: 1; white-space: nowrap;
  max-width: 100%; overflow: hidden;
  transition: background 120ms;
}
.chip .chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* 窄屏下省略号落在文字上，✕ 始终可见 */
.chip > span[aria-hidden] { flex: none; }
.chip:active { background: var(--line-strong); }
.chip:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); border-radius: 62.4375rem; }  /* 压过 a:focus-visible 的 4px，聚焦时仍是胶囊 */
/* 触屏命中区：必须写在基础 .chip 之后——媒体查询不加特异性，靠源码顺序压过 */
@media (hover: none) {
  .chip { height: 1.75rem; padding: 0 0.75rem; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
p.chips { margin: 0 0 0.875rem; line-height: 2; }
p.chips a {
  display: inline-block; padding: 0 0.5625rem; border-radius: 62.4375rem;
  background: var(--tag-bg); color: var(--tag-fg);
  font-size: 0.75rem; line-height: 1.25rem; margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
p.chips a:active { background: var(--line-strong); }
p.chips a.on { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }   /* 状态计数：当前选中的那一档 */

/* ---------- 表格 ---------- */
.table-wrap {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-1);
  overflow-x: auto;
  margin-bottom: 4px;
}
table.list { width: 100%; border-collapse: separate; border-spacing: 0; }
table.list th {
  position: static;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.75rem; font-weight: 600; letter-spacing: .02em;
  padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--line);
  text-align: left; white-space: nowrap;
}
table.list tr:first-child th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
table.list tr:first-child th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
table.list td {
  padding: 0.875rem; border-bottom: 1px solid var(--line);
  vertical-align: top; overflow-wrap: anywhere;
}
table.list tr:last-child td { border-bottom: 0; }
table.list tr:last-child td:first-child { border-bottom-left-radius: calc(var(--radius) - 1px); }
table.list tr:last-child td:last-child { border-bottom-right-radius: calc(var(--radius) - 1px); }
table.list td a { color: var(--fg); font-weight: 500; }
/* 数字列的表头与内容同向；选择器优先级须高于 table.list th 的默认左对齐。 */
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
table.list td[colspan] { text-align: center; padding: 2rem; color: var(--muted); }
table.list td[colspan] a { color: var(--accent); }               /* 空状态里的「清空筛选」要像个链接 */
table.list td.region { min-width: 5.5em; }                        /* 三字区名不折成两行；长名（开发区）照常换行 */
table.list td.name { min-width: 13em; }                           /* 校名列：12 列同挤时别被压成一列字 */
table.list td.name .tag { white-space: nowrap; }
/* 长教育集团名保留可读列宽；空间不足交给表格容器滚动。 */
table.school-table td.school-group { min-width: 12em; width: 12em; white-space: normal; }
table.school-table td.school-footprint { min-width: 8em; }
table.school-table td.school-customer { min-width: 6em; }
/* 名录表 12 列在 1280 宽下装不下：这一张表允许横向滚动，表头相应不吸顶（sticky 需要滚动祖先是视口） */
.table-wrap.scroll { overflow-x: auto; }
.table-wrap.scroll table.list th { position: static; }
table.list td form.inline { gap: 0.375rem; }
table.list td form.inline input, table.list td form.inline select { height: 1.75rem; }
table.list td form.inline button { height: 1.75rem; padding: 0 0.625rem; }
table.list td small.muted { display: inline-block; }
table.list td small.code { display: block; margin-top: 2px; font-variant-numeric: tabular-nums; }   /* 标题下的项目编号：同名合同公告（电子卖场订单）靠它分开 */
/* 紧凑密度（html.dense，按钮 #density 切换、localStorage 记忆）：切换不做过渡——低频，且 padding 动画会触发整表重排 */
html.dense table.list { font-size: 0.8125rem; }
html.dense table.list th { padding: 0.375rem 0.75rem; }
html.dense table.list td { padding: 0.3125rem 0.75rem; }
html.dense table.list td[colspan] { padding: 1.5rem 0.75rem; }   /* 空状态留白：紧凑态也别贴边 */
@media (min-width: 961px) {
  /* 长表格始终在自己的容器内滚动，避免撑宽详情页和整个视口。 */
  .table-wrap { overflow-x: auto; }
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center;
  height: 1.25rem; padding: 0 0.5rem; border-radius: 62.4375rem;
  font-size: 0.75rem; font-weight: 500; line-height: 1;
  background: var(--tag-bg); color: var(--tag-fg);
  white-space: nowrap; vertical-align: text-bottom;
}
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.err { background: var(--err-bg); color: var(--err); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.muted { background: var(--tag-bg); color: var(--muted); }
.cats { letter-spacing: .06em; font-weight: 500; white-space: nowrap; }

/* ---------- 卡片 / 详情 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 1.125rem 1.25rem; margin-bottom: 1rem;
}
.card.narrow { max-width: 23.75rem; }
.card > form { display: grid; gap: 0.5rem; }
.card > form + form { margin-top: 0.625rem; }
.card label { display: block; margin-bottom: 0.625rem; font-size: 0.75rem; color: var(--muted); }
.card > form label { margin-bottom: 0; }
.card label > input:not([type=checkbox]), .card label > select, .card label > textarea { margin-top: 4px; }
.card input:not([type=checkbox]):not([type=hidden]), .card select, .card textarea { width: 100%; }
.card label > input[type=checkbox] { margin-left: 0.375rem; vertical-align: -1px; }
.card p { margin: 0 0 0.5rem; }
.card p:last-child { margin-bottom: 0; }
.card > span.muted { display: block; }
.card > span.muted + form { margin-top: 0.625rem; }
.card > form + span.muted, .card > form + p.note { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.card p.note + p.note { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
form.card .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 4px; }
form.card .actions a { padding: 0 0.375rem; }
.card.muted { color: var(--muted); }
#preview > :is(p, ul):not(.err, .muted) { color: var(--fg); }
dl.kv { display: grid; grid-template-columns: 7em 1fr; gap: 0.375rem 0.75rem; margin: 0; }
dl.kv.card { gap: 0.75rem 1rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
dl.kv ul.sources { margin: 0; padding-left: 1rem; }
dl.kv ul.sources li { margin: 2px 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.grid2 > * > h2:first-child { margin-top: 0; }
.grid2 > * { min-width: 0; }
article.content {
  background: var(--surface); border: 1px solid var(--line);
  padding: 1rem 1.25rem; border-radius: var(--radius);
  max-width: 100%; overflow-x: auto; line-height: 1.7;
}
article.content img { max-width: 100%; height: auto; }
article.content pre { white-space: pre-wrap; margin: 0; font: inherit; }
article.content table { max-width: 100%; }
article.content.empty { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  /* 抓取的原文按原样保持浅色，避免站方内联样式在暗色下失真；无正文的空卡片不强制浅色 */
  article.content:not(.empty) { background: #fff; color: #1d1d1f; border-color: transparent; color-scheme: light; }
}
.pager { display: flex; gap: 0.5rem; align-items: center; margin: 0.875rem 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager a {
  display: inline-flex; align-items: center; height: 1.875rem; padding: 0 0.75rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg); font-weight: 500;
  transition: background 120ms, transform 100ms var(--ease-out);
}
.pager a:active { transform: scale(.97); }
p.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin: 0 0 0.875rem; color: var(--muted); }
p.summary .tag { color: var(--tag-fg); }
p.syntax { margin-top: 0.75rem; }
/* 同一采购：合并记录与可能相关（默认收起、灰字，需要时才看） */
details.merges { margin: -4px 0 0.75rem; font-size: 0.8125rem; }
/* 待确认卡片的「都不是」：summary 当按钮用，展开成补号窗口（贴链接补上 / 没找到号） */
details.none-match { margin: 0.625rem 0 0; }
details.none-match > summary { display: inline-flex; align-items: center; height: 1.75rem; padding: 0 0.625rem; border-radius: 0.5rem;
  background: var(--tag-bg); cursor: pointer; list-style: none; font-size: 0.8125rem; user-select: none; }
details.none-match > summary::-webkit-details-marker { display: none; }
details.none-match > summary:active { background: var(--line-strong); }
details.none-match > summary:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus); }
details.none-match .none-match-body { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
details.none-match .none-match-body form.filters { margin: 0; }
details.merges > summary { cursor: pointer; color: var(--muted); width: max-content; }
details.merges ul { margin: 0.375rem 0 0; }
div.hints { font-size: 0.8125rem; margin: -4px 0 0.75rem; }   /* 用 div 不用 p：<form> 开标签会让浏览器提前闭合 <p> */
.card p.warn-note { background: var(--warn-bg); color: var(--warn); padding: 0.5rem 0.625rem; border-radius: var(--radius-sm); }

/* ---------- 消息 ---------- */
ul.messages { margin: 0 0 0.75rem; padding: 0; list-style: none; }
ul.messages li {
  padding: 0.625rem 0.875rem; margin-bottom: 0.375rem; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  animation: rise 200ms var(--ease-out);
}
ul.messages li.error { background: var(--err-bg); color: var(--err); border-color: transparent; }
ul.messages li.success { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
ul.messages li.warning { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
@keyframes rise { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- HTMX 反馈 ---------- */
/* 局部换入：新片段先以 opacity:0 进来（htmx-added），下一帧移除后按过渡淡入。
   #claim-panel 不在此列——它走下面的 View Transitions，叠加会双重淡入 */
#notes, #preview, [id^="disc-"] { transition: opacity 150ms var(--ease-out); }
.htmx-added { opacity: 0; }
form.htmx-request { cursor: progress; }
form.htmx-request button { opacity: .6; pointer-events: none; }

/* ---------- 认领面板换入（View Transitions） ----------
   hx-swap="outerHTML transition:true"：htmx 在支持的浏览器里用 document.startViewTransition 包裹换入，
   settle 后再截新快照（htmx-added 已移除）；不支持的浏览器原样换入、无动画。
   形变锚点：未认领态的主按钮 ↔ 已认领态的状态文字，同名 claim-state；同一时刻页面上只有其一。
   只动面板：root 的 old/new 时长归零，避免整页交叉淡入。 */
#claim-panel { view-transition-name: claim-panel; }
#claim-panel > form:not(.followup-form) > .primary, #claim-panel .claim-state { view-transition-name: claim-state; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0s; }
::view-transition-group(claim-panel) { animation-duration: 150ms; animation-timing-function: var(--ease-out); }
::view-transition-old(claim-panel), ::view-transition-new(claim-panel) { animation-duration: 150ms; }
::view-transition-group(claim-state) { animation-duration: 200ms; animation-timing-function: var(--ease-out); }
/* 快照按 contain 缩放、不横向拉伸（UA 默认把新快照拉到旧盒宽度，会闪一个放大的「跟进中」）；退出 120ms 快于进入 200ms */
::view-transition-old(claim-state), ::view-transition-new(claim-state) { width: 100%; height: 100%; object-fit: contain; }
::view-transition-old(claim-state) { animation: vt-out 120ms var(--ease-out) both; }
::view-transition-new(claim-state) { animation: vt-in 200ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ---------- 登录 ---------- */
.login-wrap { min-height: calc(100vh - 7.25rem); display: grid; place-items: center; }
.card.login { width: 22.5rem; max-width: 100%; padding: 1.75rem 1.5rem 1.5rem; margin: 0; }
.card.login h1 { text-align: center; font-size: 1.5rem; }
.card.login .sub { display: block; text-align: center; margin: 4px 0 1.25rem; }
.card.login label { margin-bottom: 0.75rem; }
.card.login input { height: 2.5rem; }
.card.login button { width: 100%; height: 2.5rem; margin-top: 4px; }
.card.login .err { margin-bottom: 0.75rem; padding: 0.5rem 0.625rem; border-radius: var(--radius-sm); background: var(--err-bg); }

/* ---------- 系统偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  /* 只去位移，保留透明度淡入；颜色/透明度过渡与按下缩放保留 */
  @keyframes rise { from { opacity: 0; } }
  nav.top { transition: none; }
  /* 认领面板：不做位置/尺寸形变，只留 old/new 的淡入淡出 */
  ::view-transition-group(claim-state) { animation-duration: 0s; }
  ::view-transition-group(claim-panel) { animation-duration: 0s; }
}
@media (prefers-reduced-transparency: reduce) {
  nav.top { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid2 { grid-template-columns: 1fr; }
  /* 窄屏下 .table-wrap 是滚动容器：表头吸顶无效且会被 top 推下来，改为静态；给表格最小宽度让列不至于挤成一列字 */
  table.list th { position: static; }
  table.list { min-width: 53.75rem; }
}
@media (max-width: 720px) {
  main { padding: 0.75rem; }
  nav.top { height: auto; flex-wrap: wrap; padding: 0.5rem 0.75rem; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 0.375rem; }
  .page-head .actions { margin-left: 0; }
  dl.kv { grid-template-columns: 1fr; gap: 2px 0; }
  dl.kv dd { margin-bottom: 0.375rem; }
  form.filters .search { min-width: 0; flex-basis: 100%; }
  .login-wrap { min-height: calc(100vh - 4.5rem); }
}

/* ---------- 悬停（仅精确指针；触屏不留“粘住”的 hover 态） ---------- */
@media (hover: hover) and (pointer: fine) {
  nav.top a:hover { background: var(--tag-bg); text-decoration: none; }
  button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
  .btn-primary:hover, .primary:hover, form.filters button[type=submit]:hover, form.filters button:not([type]):hover {
    background: #184aa8; border-color: #184aa8;
  }
  button.link:hover { background: var(--tag-bg); }
  label.check:hover { background: var(--surface-2); }
  form.filters > a:hover, form.filters details.more > summary:hover { background: var(--tag-bg); text-decoration: none; }
  .chip:hover { background: var(--line); text-decoration: none; }   /* 悬停一级，:active 再到 --line-strong */
  p.chips a:hover { background: var(--line-strong); text-decoration: none; }
  table.list tbody tr:hover td { background: var(--surface-2); }
  table.list td a:hover { color: var(--accent); text-decoration: none; }
  .pager a:hover { background: var(--surface-2); text-decoration: none; }
  .page-head h1 > a:hover { background: var(--surface-2); text-decoration: none; }
}

/* 联系人块（采购人页 / 学校页）：一行一个，姓名 电话 · 最近日期 */
dl.kv dd.contacts > span { display: inline-block; line-height: 1.5; }

/* ---------- 工作台：标题、筛选与结果 ---------- */
.workspace-head { align-items: center; margin-bottom: 1.5rem; gap: 1.25rem; }
.eyebrow { color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: .08em; margin-bottom: 4px; }
.page-description { color: var(--muted); margin: 0.4375rem 0 0; font-size: 0.8125rem; }
.workspace-head .actions .btn { gap: 0.75rem; }
.workspace-head .meta { font-variant-numeric: tabular-nums; }
form.notice-filters { gap: 1rem; padding: 1.25rem; }
.filter-search-row { display: flex; align-items: center; gap: 0.75rem; width: 100%; }
form.notice-filters .search { flex: 1; min-width: 0; }
form.notice-filters .search input { height: 2.625rem; background: var(--surface-2); padding-left: 0.875rem; }
.filter-search-row button { height: 2.625rem; padding: 0 1.375rem; }
.filter-search-row > a { white-space: nowrap; font-size: 0.8125rem; padding: 0.625rem 4px; }
.filter-fields { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0.75rem; width: 100%; }
.filter-field { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; flex: 1 1 8.75rem; }
.filter-field > span { font-size: 0.75rem; font-weight: 500; color: var(--muted); }
.filter-field > :is(select, input) { width: 100%; min-width: 0; }
.filters > .filter-field { flex: 0 1 8.75rem; }
form.filters:has(> .filter-field) { align-items: flex-end; }
form.notice-filters details.more { border-top: 1px solid var(--line); padding-top: 0.625rem; }
form.notice-filters details.more > summary { padding-left: 0; height: 1.625rem; font-size: 0.75rem; color: var(--muted); }
form.notice-filters details.more .more-body { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 0.75rem; margin-top: 1rem; }
.filter-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.results-head { display: flex; justify-content: space-between; align-items: center; margin: 1.5rem 0 0.75rem; gap: 0.75rem; }
.results-head > div { display: flex; align-items: center; flex-wrap: wrap; gap: 0.625rem; }
.results-head h2 { margin: 0; font-size: 0.9375rem; }
.result-count { padding: 2px 0.5625rem; border-radius: 0.375rem; color: var(--accent); background: var(--accent-soft); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.results-order { font-size: 0.75rem; }
.results-head #density { color: var(--muted); border: 1px solid var(--line-strong); background: var(--surface); padding: 0 0.75rem; }
.results-head #density[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.notice-table { table-layout: fixed; min-width: 72.5rem; }
.notice-table th:nth-child(1) { width: 6.25rem; }
.notice-table th:nth-child(2) { width: 30%; }
.notice-table th:nth-child(3) { width: 7rem; }
.notice-table th:nth-child(4) { width: 5.9375rem; }
.notice-table th:nth-child(5) { width: 5.5rem; }
.notice-table th:nth-child(7) { width: 5.625rem; }
.notice-table th:nth-child(8) { width: 6.5625rem; }
.notice-table th:nth-child(9) { width: 5.5rem; }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.notice-table .notice-title > a { font-weight: 600; line-height: 1.65; }
.notice-table .notice-title > .tag { margin-top: 0.3125rem; }
.notice-table .notice-date, .notice-table .notice-source { font-size: 0.75rem; }
.notice-source > span { display: block; color: var(--muted); overflow-wrap: anywhere; }
.notice-table .notice-budget { font-weight: 600; }
.notice-table .notice-purchaser small { margin-top: 4px; }
.family-label { font-size: 0.75rem; color: var(--muted); }
.family-tender { color: var(--accent); }
.family-award, .family-contract { color: var(--ok); }
.family-intent { color: var(--warn); }
.category-names { font-size: 0.75rem; letter-spacing: 0; color: var(--muted); }
.category-names > span { display: block; margin-bottom: 3px; }
.empty-state { padding: 1.25rem 0; max-width: 22.5rem; margin: auto; text-align: center; }
.empty-icon { display: grid; place-items: center; margin: 0 auto 0.75rem; width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; background: var(--surface-2); font-size: 1.75rem; }
.empty-state strong { display: block; color: var(--fg); font-size: 0.9375rem; }
.empty-state p { font-size: 0.8125rem; margin: 0.5rem 0 0.875rem; }
.pager { justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; font-size: 0.75rem; margin-top: 1.125rem; }
.pager-controls { display: flex; align-items: center; gap: 0.75rem; }
.pager a, .pager-disabled { height: 2.125rem; padding: 0 0.75rem; display: inline-flex; align-items: center; }
.pager-disabled { border: 1px solid var(--line); border-radius: var(--radius-sm); opacity: .55; }
.chip { height: 1.75rem; padding: 0 0.625rem; }
p.chips a { padding: 0.3125rem 0.75rem; border-radius: 0.5rem; margin-bottom: 4px; }

/* ---------- 详情与跟进 ---------- */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.75rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); }
.detail-head { align-items: flex-start; justify-content: space-between; margin-bottom: 1.5rem; }
.detail-summary { flex: 1; min-width: 0; }
.detail-head h1 { font-size: 1.5rem; line-height: 1.5; margin-bottom: 0.625rem; }
.detail-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.detail-actions a { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 0.75rem; border: 1px solid var(--line-strong); border-radius: 0.5rem; background: var(--surface); font-size: 0.8125rem; }
.field-label { display: block; margin-bottom: 0.375rem; font-size: 0.75rem; color: var(--muted); }
.followup-form textarea { min-height: 6rem; }
#notes { scroll-margin-top: 6rem; }
#notes:focus { outline: 2px solid var(--accent); outline-offset: 4px; }
.grid2 aside > ul { padding: 0.875rem 1.125rem 0.875rem 1.875rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.grid2 aside > ul li { margin: 0 0 0.75rem; line-height: 1.7; }
.grid2 aside > ul li:last-child { margin-bottom: 0; }
.request-error { position: sticky; top: 5rem; z-index: 10; padding: 0.75rem 1rem; margin-bottom: 1rem; color: var(--err); background: var(--err-bg); border: 1px solid currentColor; border-radius: var(--radius-sm); }
form.wechat-manual-form { min-width: 0; max-width: 100%; flex: 1 1 20rem; }
form.wechat-manual-form > input:not([type=hidden]) { min-width: 0; max-width: 100%; flex: 1 1 15rem; }
.card.login { width: 25rem; padding: 2.25rem; box-shadow: var(--shadow-2); }
.login-eyebrow { text-align: center; color: var(--accent); font-size: 0.75rem; letter-spacing: .08em; }
.card.login .sub { font-size: 0.75rem; margin: 0.625rem 0 1.75rem; line-height: 1.6; }
.card.login :is(input, button) { height: 2.75rem; }

/* ---------- 窄屏：导航独立一行，公告变成可直接阅读的卡片 ---------- */
@media (min-width: 1181px) {
  form.notice-filters { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr); }
  .filter-search-row { align-self: end; }
  form.notice-filters .filter-search-row input, .filter-search-row button { height: 2.375rem; }
  .filter-search-row button { padding: 0 0.875rem; }
  .filter-fields { flex-wrap: nowrap; }
  .filter-fields .filter-field { flex: 1; }
  .filter-fields .check { flex: none; font-size: 0.75rem; }
  form.notice-filters details.more { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  nav.top { flex-wrap: wrap; gap: 0; padding: 0.75rem 1.5rem 0; }
  .nav-links { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; padding: 0.625rem 0; margin-top: 0.375rem; scrollbar-width: thin; }
  .nav-links a { flex: none; }
  .account-menu { margin-left: auto; }
  #notes { scroll-margin-top: 8.75rem; }
  .request-error { top: 7.875rem; }
}
@media (max-width: 720px) {
  main { padding: 1.375rem 1rem 2.25rem; }
  .table-wrap.scroll::before { content: "左右滑动，查看完整信息"; display: block; padding: 0.5625rem 0.875rem; color: var(--muted); font-size: 0.75rem; border-bottom: 1px solid var(--line); }
  nav.top { padding: 0.625rem 1rem 0; min-height: 0; }
  nav.top .brand { font-size: 0.9375rem; }
  nav.top .brand small { font-size: 0.5625rem; }
  .brand-mark { width: 2rem; height: 2rem; }
  .nav-links { gap: 2px; margin-top: 0.375rem; padding: 0.5rem 0; }
  nav.top .nav-links a { padding: 0.5rem 0.75rem; font-size: 0.8125rem; }
  .account-name { display: none; }
  .workspace-head { align-items: flex-start; gap: 0.875rem; margin-bottom: 1.25rem; }
  h1 { font-size: 1.5rem; }
  .page-description { font-size: 0.75rem; }
  .workspace-head .actions { flex-wrap: wrap; gap: 0.5rem; }
  .workspace-head .actions > a { font-size: 0.75rem; }
  form.notice-filters { padding: 0.875rem; gap: 0.875rem; }
  .filter-search-row { flex-wrap: wrap; gap: 0.625rem; }
  form.notice-filters .search { flex-basis: 100%; }
  .filter-search-row button { flex: 1; height: 2.375rem; }
  .filter-search-row > a { padding: 0.5rem 0.75rem; }
  .filter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .filter-fields > .check { grid-column: 1 / -1; width: max-content; }
  form.notice-filters details.more .more-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters > .filter-field { flex: 1 1 40%; }
  input, select, textarea { font-size: 1rem; }
  .results-head { margin-top: 1.375rem; }
  .results-order { display: none; }
  .notice-table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.notice-table { display: block; min-width: 0; width: 100%; }
  .notice-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .notice-table tbody { display: block; }
  table.notice-table .notice-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.625rem 0.75rem; padding: 1rem; margin-bottom: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  table.notice-table .notice-row td { padding: 0; border: 0; border-radius: 0; min-width: 0; font-size: 0.75rem; background: transparent; }
  .notice-table .notice-date { order: 1; align-self: center; }
  .notice-table .notice-claim { order: 2; text-align: right; }
  .notice-table .notice-title { order: 3; grid-column: 1 / -1; margin: 2px 0 4px; }
  .notice-table .notice-title > a { font-size: 0.9375rem; }
  .notice-table .notice-title small.code { margin-top: 0.375rem; font-size: 0.6875rem; }
  .notice-table .notice-family { order: 4; }
  .notice-table .notice-category { order: 5; text-align: right; }
  .notice-table .region { order: 6; }
  .notice-table .notice-budget { order: 7; text-align: right; }
  .notice-table .notice-purchaser { order: 8; grid-column: 1 / -1; }
  .notice-table .notice-source { order: 9; grid-column: 1 / -1; }
  .notice-table :is(.region, .notice-budget, .notice-purchaser, .notice-source)::before { content: attr(data-label); margin-right: 0.5rem; color: var(--muted); font-weight: 400; }
  .notice-table .notice-source > span { display: inline; }
  html.dense table.notice-table .notice-row { padding: 0.75rem; gap: 0.375rem 0.625rem; }
  .notice-table td[colspan] { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  .pager { justify-content: center; }
  .page-range { width: 100%; text-align: center; }
  .pager-controls { gap: 0.5rem; }
  .pager a, .pager-disabled { padding: 0 0.625rem; min-height: 2.5rem; }
  .detail-head h1 { font-size: 1.3125rem; }
  .card { padding: 1rem; }
  dl.kv.card { grid-template-columns: 1fr; gap: 4px; }
  dl.kv.card dd { margin-bottom: 0.625rem; }
  dl.kv.card dd:last-child { margin-bottom: 0; }
  .card.login { padding: 1.75rem 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  button:active, .btn:active, .pager a:active, .page-head h1 > a:active { transform: none; }
}
@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root { --line: rgba(255, 255, 255, .35); --line-strong: rgba(255, 255, 255, .6); }
}

/* ---------- Apple Design 细节：可缩放文字、统一图标与触摸导航 ---------- */
.icon { width: 1.125rem; height: 1.125rem; display: inline-block; flex: none; vertical-align: -.2em; }
.btn, .pager a, .pager-disabled { gap: .375rem; }
.chip .icon { width: .75rem; height: .75rem; }
.empty-icon .icon { width: 1.5rem; height: 1.5rem; }
.account-menu summary > .icon { width: .875rem; height: .875rem; }
nav.top .brand small { font-size: .6875rem; }
.filter-search-row, .filter-fields > * { min-width: 0; }
.filter-search-row button { flex-shrink: 0; }
.followup-form > *, .card > form > * { min-width: 0; }
.account-popover { max-width: calc(100vw - 2rem); }
.account-menu:not([open]) .account-popover, .nav-more:not([open]) .nav-more-popover { display: none; }
#notes, #main-content { scroll-margin-top: calc(var(--nav-height, 4.5rem) + 1rem); }

@media (pointer: coarse), (max-width: 720px) {
  button, button.link, .btn, label.check, input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select,
  .filter-search-row button, .pager a, .pager-disabled, .page-head h1 > a,
  table.list td form.inline :is(input, select, button) { min-height: 2.75rem; }
  button, .btn, .page-head h1 > a { min-width: 2.75rem; }
  button, .btn { white-space: normal; line-height: 1.35; padding-top: .45rem; padding-bottom: .45rem; }
  .page-head h1 > a { width: 2.75rem; }
  .chip { min-height: 2.75rem; }
  form.filters > a, .filter-search-row > a, form.filters details.more > summary, p.chips a,
  .detail-actions a, .account-menu summary, .account-popover a, .breadcrumb a { min-height: 2.75rem; display: inline-flex; align-items: center; }
  .account-menu summary { min-width: 2.75rem; }
  p.chips a { margin-right: .5rem; margin-bottom: .5rem; }
  .account-popover a { width: 100%; }
}
@media (max-width: 720px) {
  .nav-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; overflow: visible; width: 100%; padding: .25rem 0 .5rem; }
  .nav-links > a, .nav-more summary { min-width: 0; min-height: 2.75rem; display: flex; align-items: center; justify-content: center; text-align: center; white-space: normal; overflow-wrap: anywhere; padding: .5rem .125rem; font-size: .8125rem; line-height: 1.4; border-radius: .5rem; }
  nav.top .nav-links > a { padding: .5rem .125rem; }
  .nav-secondary-desktop, .desktop-label { display: none; }
  .nav-more { display: block; min-width: 0; }
  .nav-more summary { gap: 2px; list-style: none; cursor: pointer; color: var(--muted); }
  .nav-more summary::-webkit-details-marker { display: none; }
  .nav-more .icon { width: .75rem; height: .75rem; }
  .nav-more.is-active > summary, .nav-more[open] > summary { color: var(--accent); background: var(--accent-soft); }
  .nav-more-popover { position: absolute; top: calc(100% + .25rem); right: 0; width: min(18rem, calc(100vw - 2rem)); display: grid; padding: .5rem; gap: .25rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-2); }
  nav.top .nav-more-popover a { min-height: 2.75rem; display: flex; align-items: center; padding: .625rem .75rem; white-space: normal; font-size: .875rem; }
  .nav-caption { max-width: 45%; text-align: right; }
  nav.top .brand { min-width: 0; max-width: 100%; }
  nav.top .brand > span:last-child { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .brand-mark { flex-shrink: 0; }
  nav.top .nav-links > a, .nav-more summary { word-break: break-all; }
  nav.top .nav-links > a { display: block; align-content: center; white-space: normal; }
  .nav-more summary { flex-wrap: wrap; }
  .notice-table .notice-claim { min-width: 0; white-space: normal; }
  .notice-table .notice-claim .tag { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .notice-table .notice-date, .notice-table .notice-budget, .notice-table .category-names { white-space: normal; overflow-wrap: anywhere; }
  .filter-search-row { gap: .5rem; }
  .filter-checks .check { max-width: 100%; height: auto; white-space: normal; padding: .5rem .625rem; }
  .pager-controls { flex-wrap: wrap; justify-content: center; }
}


/* ---------- 业务工作台：温和纸面与语义颜色 ---------- */
:root {
  --category-canteen: #663497; --category-canteen-bg: #eadcf7;
  --category-meal: #14675a; --category-meal-bg: #d2eee4;
  --category-food: #354e99; --category-food-bg: #dfe7ff;
  --shadow-1: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --category-canteen: #ceb3e6; --category-canteen-bg: #352b40;
    --category-meal: #a0d1c8; --category-meal-bg: #233b36;
    --category-food: #b2c3ef; --category-food-bg: #2b344a;
  }
  .brand-mark { background: #352b40; color: #ceb3e6; }
}
h1 { letter-spacing: -.015em; font-weight: 700; }
h2 { font-size: 1rem; }
.page-description { line-height: 1.75; }
nav.top a.active { color: var(--fg); background: var(--line); }
.tag { border-radius: .25rem; }
.tag.info { background: var(--accent-soft); color: var(--accent); }
.category-names { display: inline-flex; flex-wrap: wrap; gap: .25rem; white-space: normal; }
.category-names > span { display: inline-flex; align-items: center; margin: 0; padding: .2rem .375rem; border-left: 3px solid currentColor; border-radius: .25rem; line-height: 1.4; white-space: nowrap; }
.category-canteen { color: var(--category-canteen); background: var(--category-canteen-bg); }
.category-meal { color: var(--category-meal); background: var(--category-meal-bg); }
.category-food { color: var(--category-food); background: var(--category-food-bg); }
table.list tbody tr:hover > td { background: var(--surface-2); }
table.list td { line-height: 1.65; }
.notice-claim .tag { max-width: 100%; height: auto; min-height: 1.25rem; padding-top: .2rem; padding-bottom: .2rem; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
table.list th { font-weight: 500; letter-spacing: 0; }
p.chips a { border-radius: .375rem; }
p.chips a.count-warn { background: var(--warn-bg); color: var(--warn); }
p.chips a.count-info { background: var(--accent-soft); color: var(--accent); }
p.chips a.count-ok { background: var(--ok-bg); color: var(--ok); }
.reading-page { max-width: 87.5rem; }
.reading-page .detail-head { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.reading-page .grid2 { grid-template-columns: minmax(0, 2.2fr) minmax(17rem, 1fr); gap: 2rem; }
.reading-page .grid2 > div > dl.kv.card { background: transparent; border: 0; border-radius: 0; padding: 0 0 1.5rem; gap: .875rem 1.25rem; line-height: 1.75; }
.reading-page .grid2 aside { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.reading-page .grid2 aside > ul { border: 0; background: transparent; padding: 0 0 0 1.125rem; }
.reading-page article.content { padding: 1.5rem; line-height: 1.85; }
.reading-page .grid2 > div > h2 { margin-top: 2rem; margin-bottom: .75rem; }
.reading-page #notes .note { line-height: 1.8; padding-top: 1rem; margin-top: 1rem; }
@media (max-width: 960px) {
  .reading-page .grid2 { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .reading-page .grid2 aside { padding-left: 0; border-left: 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .reading-page .grid2 > div > dl.kv.card { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .reading-page article.content { padding: 1rem; }
}

/* 分类入口同时充当配色说明，可直接切换现有业务筛选。 */
.business-switcher { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0; }
.business-switcher .switcher-label { color: var(--muted); font-size: .75rem; margin-right: .25rem; }
.business-switcher a { display: inline-flex; align-items: center; gap: .375rem; min-height: 2rem; padding: .375rem .75rem; font-size: .8125rem; font-weight: 500; line-height: 1.4; border-radius: .375rem; border: 1px solid transparent; }
.business-switcher a::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.business-switcher .category-all { background: var(--tag-bg); color: var(--tag-fg); }
.business-switcher a[aria-current="true"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.business-switcher a:hover { text-decoration: none; border-color: currentColor; }
p.chips a:is(.count-warn, .count-info, .count-ok)::before { content: ""; display: inline-block; width: .375rem; height: .375rem; margin-right: .375rem; border-radius: 50%; background: currentColor; vertical-align: .1em; }
@media (pointer: coarse), (max-width: 720px) {
  .business-switcher a { min-height: 2.75rem; }
  .business-switcher .switcher-label { flex-basis: 100%; }
}
