/* ============================================================
   财经编辑部稿件站 — 左侧筛选栏 + 稿件列表/卡片 + 阅读面板
   布局与 token 沿用 github-stars-dashboard；仅系统字体；亮/暗色由 token 切换。
   无内联样式：本文件是唯一样式来源（CSP style-src 'self'）。
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --bg: #ffffff; --side: #f6f7f9; --hover: #f4f6f9; --line: #e4e7eb; --line-2: #d2d7de;
  --text: #16191d; --text-2: #4b535d; --text-3: #5f6873;
  --accent: #1e3a5f; --accent-bg: #e8edf3; --accent-text: #1e3a5f;
  --chip: #f0f2f5; --mark: #ffeeb0; --danger: #b42318;
  --shadow: 0 12px 40px rgba(16, 24, 40, .18);
  --t-alert: #b45309; --t-alert-bg: #fff4e5;
  --t-midday: #1d4ed8; --t-midday-bg: #eaf1ff;
  --t-close: #047857; --t-close-bg: #e6f6ef;
  --t-brief: #6d28d9; --t-brief-bg: #f1ebfe;
  --t-other: #4b535d; --t-other-bg: #eef0f3;
  --side-w: 280px;
  --bar-h: 0px;     /* 移动端顶部粘性栏高度，由 js/app.js 量取 */
  --vh: 100vh;
  color-scheme: light;
}
@supports (height: 100dvh) { :root { --vh: 100dvh; } }
:root[data-theme="dark"] {
  --bg: #0e1013; --side: #13161a; --hover: #171b21; --line: #22272e; --line-2: #313841;
  --text: #e8eaed; --text-2: #b3bac4; --text-3: #949daa;
  --accent: #7aa2ff; --accent-bg: rgba(122, 162, 255, .13); --accent-text: #a9c2ff;
  --chip: #1b1f25; --mark: rgba(230, 180, 69, .3); --danger: #ff8a80;
  --shadow: 0 12px 40px rgba(0, 0, 0, .6);
  --t-alert: #f6ad55; --t-alert-bg: rgba(246, 173, 85, .14);
  --t-midday: #8fb4ff; --t-midday-bg: rgba(143, 180, 255, .14);
  --t-close: #5fd3a6; --t-close-bg: rgba(95, 211, 166, .14);
  --t-brief: #c4a8ff; --t-brief-bg: rgba(196, 168, 255, .15);
  --t-other: #b3bac4; --t-other-bg: rgba(179, 186, 196, .12);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0e1013; --side: #13161a; --hover: #171b21; --line: #22272e; --line-2: #313841;
    --text: #e8eaed; --text-2: #b3bac4; --text-3: #949daa;
    --accent: #7aa2ff; --accent-bg: rgba(122, 162, 255, .13); --accent-text: #a9c2ff;
    --chip: #1b1f25; --mark: rgba(230, 180, 69, .3); --danger: #ff8a80;
    --shadow: 0 12px 40px rgba(0, 0, 0, .6);
    --t-alert: #f6ad55; --t-alert-bg: rgba(246, 173, 85, .14);
    --t-midday: #8fb4ff; --t-midday-bg: rgba(143, 180, 255, .14);
    --t-close: #5fd3a6; --t-close-bg: rgba(95, 211, 166, .14);
    --t-brief: #c4a8ff; --t-brief-bg: rgba(196, 168, 255, .15);
    --t-other: #b3bac4; --t-other-bg: rgba(179, 186, 196, .12);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.55 var(--sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sprite { position: absolute; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.sr { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: var(--vh); }
.side { position: sticky; top: 0; height: 100vh; height: var(--vh); display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); }
.side-head { padding: 22px 20px 14px; }
.facets { flex: 1; overflow-y: auto; padding: 4px 20px 20px; scrollbar-width: thin; }
.side-foot { display: flex; align-items: center; gap: 4px; padding: 12px 12px; border-top: 1px solid var(--line); min-width: 0; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { flex: none; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: var(--bg); font-size: 14px; font-weight: 700; }
:root[data-theme="light"] .brand-mark { color: #fff; }
.brand h1 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .01em; }
.brand-sub { font-size: 12px; color: var(--text-3); }
.brand-sub b { color: var(--text-2); font-weight: 600; }

/* 栏目导航：只有一个栏目时整块隐藏；PR3 加入「财经日历」后自动出现 */
.tabs { display: flex; gap: 4px; margin-top: 14px; padding: 2px; border-radius: 8px; background: var(--chip); border: 1px solid var(--line); }
.tabs:has(.tab:only-child) { display: none; }
.tab { flex: 1; height: 28px; border-radius: 6px; font-size: 13px; color: var(--text-2); }
.tab[aria-selected="true"] { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }

.search { position: relative; margin-top: 16px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { width: 100%; height: 36px; padding: 0 34px 0 32px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); outline: none; transition: border-color .15s, box-shadow .15s; }
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.search input:focus-visible { outline: 2px solid transparent; }
.search input::-webkit-search-cancel-button { display: none; }
.kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 12px/1 var(--mono); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 6px; background: var(--side); pointer-events: none; }
.search input:focus ~ .kbd, .search input:not(:placeholder-shown) ~ .kbd { display: none; }

/* ---------- facets ---------- */
.group { padding-top: 18px; }
.group-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: .04em; }
.group-h small { font-weight: 400; font-size: 12px; letter-spacing: 0; }
.sub-h { margin: 10px 0 2px; padding: 0 8px; font-size: 12px; font-weight: 500; color: var(--text-3); }

.opt { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 4px 8px; margin: 1px 0; border-radius: 6px; text-align: left; color: var(--text-2); transition: background .12s, color .12s; }
.opt:hover { background: var(--hover); color: var(--text); }
.opt[aria-pressed="true"] { background: var(--accent-bg); color: var(--accent-text); font-weight: 550; }
.opt .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .wd { color: var(--text-3); font-size: 12px; margin-left: 6px; }
.opt .cnt { font-size: 12px; color: var(--text-3); }
.opt[aria-pressed="true"] .cnt, .opt[aria-pressed="true"] .wd { color: var(--accent-text); }
.opt.zero { color: var(--text-3); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: currentColor; }
.opt .dot { color: var(--t-other); }
.opt .dot.t-close_full { color: var(--t-close); } .opt .dot.t-close_midday { color: var(--t-midday); }
.opt .dot.t-alert { color: var(--t-alert); } .opt .dot.t-data_brief { color: var(--t-brief); }

.datepick { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 0 8px; font-size: 12px; color: var(--text-3); }
.datepick input { height: 30px; max-width: 150px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); color: var(--text); }
.body-status { margin: 4px 8px 0; font-size: 12px; color: var(--text-3); min-height: 18px; }
.body-status progress { display: block; width: 100%; height: 4px; margin-bottom: 4px; accent-color: var(--accent); }

.seg { display: flex; padding: 2px; border-radius: 8px; background: var(--chip); border: 1px solid var(--line); }
.seg button { flex: 1; height: 26px; padding: 0 12px; border-radius: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }

.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 7px; color: var(--text-2); transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.foot-meta { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.switch { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
@media (hover: hover) { .switch:hover { background: var(--hover); color: var(--text); } }
.switch .track { position: relative; width: 28px; height: 16px; border-radius: 8px; background: var(--text-3); transition: background-color .2s ease; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); transition: transform .2s ease; }
.switch[aria-pressed="true"] { color: var(--text); }
.switch[aria-pressed="true"] .track { background: var(--accent); }
.switch[aria-pressed="true"] .track::after { transform: translateX(12px); }

/* ---------- main / filter bar ---------- */
.main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.list-col { min-width: 0; padding-bottom: 24px; }
.filterbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 56px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.fstate { flex: 1 1 240px; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fctl { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-left: auto; }
.count { font-size: 13px; color: var(--text-2); margin-right: 6px; }
.count b { font-size: 15px; color: var(--text); font-weight: 650; }
.fchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 26px; padding: 0 4px 0 9px; border-radius: 6px; background: var(--accent-bg); color: var(--accent-text); font-size: 12px; }
.fchip .k { opacity: .8; flex: none; }
.fchip .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip button { position: relative; flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; color: inherit; }
.fchip button:hover { background: rgba(127, 127, 127, .18); }
.clear { font-size: 12px; color: var(--text-2); padding: 4px 8px; border-radius: 6px; }
.clear:hover { color: var(--text); background: var(--hover); }
.pstat { font-size: 12px; color: var(--text-3); }

.notice { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 12px 24px 0; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--side); font-size: 13px; color: var(--text-2); }
.notice .link { margin-left: auto; padding: 2px 8px; border-radius: 6px; color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 类型标签 ---------- */
.tag { display: inline-block; flex: none; padding: 0 7px; height: 20px; border-radius: 4px; font-size: 12px; line-height: 20px; font-weight: 500; background: var(--t-other-bg); color: var(--t-other); white-space: nowrap; }
.tag.t-alert { background: var(--t-alert-bg); color: var(--t-alert); }
.tag.t-close_midday { background: var(--t-midday-bg); color: var(--t-midday); }
.tag.t-close_full { background: var(--t-close-bg); color: var(--t-close); }
.tag.t-data_brief { background: var(--t-brief-bg); color: var(--t-brief); }
.flag { flex: none; height: 20px; padding: 0 6px; border: 1px dashed var(--line-2); border-radius: 4px; color: var(--text-3); font-size: 12px; line-height: 18px; white-space: nowrap; }

/* ---------- 列表 / 卡片 ---------- */
.sec { scroll-margin-top: 0; }
.sec-h { position: sticky; top: 0; z-index: 3; display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 8px 24px; background: var(--side); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text); }
.sec-h .n { color: var(--text-3); font-weight: 400; }

.list { list-style: none; margin: 0; padding: 0; }
.row { position: relative; padding: 14px 24px; border-bottom: 1px solid var(--line); transition: background .1s; }
.row:hover, .row:focus-within { background: var(--hover); }
.row.is-open { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 4px; font-size: 12px; color: var(--text-3); }
.meta .when { font-variant-numeric: tabular-nums; }
.name { display: block; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.name:focus-visible { outline: none; }
.name:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.row:hover .name { color: var(--accent-text); }
.desc { margin: 4px 0 0; font-size: 13px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.desc.empty { color: var(--text-3); font-style: italic; }

.main[data-view="card"] .cards { list-style: none; margin: 0; padding: 20px 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.main[data-view="card"] .sec .cards { padding: 16px 24px 24px; }
.main[data-view="card"] .row { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 0; }
.main[data-view="card"] .row:hover, .main[data-view="card"] .row:focus-within { background: var(--hover); border-color: var(--line-2); }
.main[data-view="card"] .row.is-open { background: var(--accent-bg); border-color: var(--accent); box-shadow: none; }
.main[data-view="card"] .name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.main[data-view="card"] .desc { -webkit-line-clamp: 3; }
.main[data-view="list"] .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main[data-view="list"] .desc { -webkit-line-clamp: 1; }

/* ---------- 单日手风琴（首页默认最近一天 / 选了某一天；标题行点击展开全文） ---------- */
.acc-h { margin: 0; font: inherit; }
.acc-toggle { width: 100%; padding: 0; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.row.acc .acc-toggle::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--text-3); transition: transform .12s; }
.row.acc.is-expanded .acc-toggle::before { content: "▾"; }
.row.acc.is-expanded { background: var(--bg); border-bottom-color: var(--line-2); }
.row.acc.is-expanded .name { white-space: normal; -webkit-line-clamp: unset; display: block; font-size: 18px; color: var(--text); }
.row.acc.is-expanded .name::after { display: none; } /* 展开项不再用整行遮罩，避免挡住正文选择与链接 */
.row.acc .acc-body { position: relative; z-index: 2; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.row.acc .acc-body > :first-child { margin-top: 0; }
.row.acc .acc-body p { margin: 0 0 12px; }
.row.acc .acc-body h1, .row.acc .acc-body h2, .row.acc .acc-body h3, .row.acc .acc-body h4 { margin: 22px 0 8px; line-height: 1.4; }
.row.acc .acc-body h1 { font-size: 20px; } .row.acc .acc-body h2 { font-size: 18px; } .row.acc .acc-body h3 { font-size: 16px; }
.row.acc .acc-body ul, .row.acc .acc-body ol { padding-left: 22px; margin: 0 0 12px; }
.row.acc .acc-body blockquote { margin: 0 0 12px; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-2); color: var(--text-2); }
.row.acc .acc-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.row.acc .acc-body code { font: 13px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--chip); }
.row.acc .acc-body pre { margin: 0 0 12px; padding: 12px 14px; overflow-x: auto; border-radius: 8px; background: var(--chip); }
.row.acc .acc-body img { max-width: 100%; height: auto; }
.row.acc .acc-body .table-wrap { margin: 0 0 12px; overflow-x: auto; }
.row.acc .acc-body table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.row.acc .acc-body th, .row.acc .acc-body td { padding: 6px 12px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.row.acc .acc-body th { background: var(--side); font-weight: 600; }
.row.acc .disclaimer { position: relative; z-index: 2; margin-top: 20px; }
.main[data-view="card"] .row.acc.is-expanded { grid-column: 1 / -1; }
.main[data-view="card"] .row.acc.is-expanded:hover { background: var(--bg); }

.empty-state { padding: 80px 24px; text-align: center; color: var(--text-2); }
.empty-state h2 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); font-size: 13px; margin-top: 14px; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--bg); border-color: transparent; width: 100%; height: 44px; justify-content: center; font-weight: 600; }
:root[data-theme="light"] .btn.primary { color: #fff; }
.skel, .skel-card { background: linear-gradient(90deg, transparent, var(--hover), transparent) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel { height: 84px; border-bottom: 1px solid var(--line); }
.skel-card { height: 132px; border: 1px solid var(--line); border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.footer { margin-top: 24px; padding: 14px 24px 0; border-top: 1px solid var(--line); text-align: center; font-size: 12px; color: var(--text-3); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; margin: 0; padding: 8px 14px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 13px; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }

/* ---------- 阅读面板 ---------- */
.reader { display: flex; flex-direction: column; min-width: 0; background: var(--bg); border-left: 1px solid var(--line); }
.reader-bar { display: flex; align-items: center; gap: 4px; flex: none; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.reader-bar .spacer { flex: 1; }
.rbtn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 7px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.rbtn:hover { background: var(--hover); color: var(--text); }
.rbtn:disabled { opacity: .4; cursor: default; background: none; color: var(--text-2); }
.rbtn.close { padding: 0 8px; }
.reader-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 36px 48px; overscroll-behavior: contain; }
.reader-scroll:focus-visible { outline: none; }
.reader-article { max-width: 72ch; margin: 0 auto; }
.reader-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.reader-head h2 { margin: 8px 0 0; font-size: 24px; line-height: 1.4; font-weight: 650; overflow-wrap: anywhere; }
.reader-head h2:focus-visible { outline: none; }
.reader-head .meta { margin: 0; font-size: 13px; }
.reader-state { padding: 40px 0; text-align: center; color: var(--text-2); }
.reader-state.err { color: var(--danger); }
.reader-skel { height: 14px; margin: 12px 0; border-radius: 4px; background: linear-gradient(90deg, var(--chip), var(--hover), var(--chip)) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }

.md-body { font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.md-body > :first-child { margin-top: 0; }
.md-body p { margin: 0 0 12px; }
.md-body strong { font-weight: 650; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 22px 0 8px; line-height: 1.4; }
.md-body h1 { font-size: 20px; } .md-body h2 { font-size: 18px; } .md-body h3 { font-size: 16px; } .md-body h4 { font-size: 15px; }
.md-body ul, .md-body ol { padding-left: 22px; margin: 0 0 12px; }
.md-body li { margin-bottom: 4px; }
.md-body blockquote { margin: 0 0 12px; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-2); color: var(--text-2); }
.md-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.md-body code { font: 13px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--chip); }
.md-body pre { margin: 0 0 12px; padding: 12px 14px; overflow-x: auto; border-radius: 8px; background: var(--chip); }
.md-body pre code { padding: 0; background: none; }
.md-body hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.md-body img { max-width: 100%; height: auto; }
.md-body .table-wrap { margin: 0 0 12px; overflow-x: auto; }
.md-body table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.md-body th, .md-body td { padding: 6px 12px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.md-body th { background: var(--side); font-weight: 600; }
.disclaimer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); line-height: 1.6; }

.m-only, .scrim, .sheet-h, .sheet-f { display: none; }

/* ---------- 桌面：列表 + 阅读双栏 ---------- */
@media (min-width: 1100px) {
  .main[data-reader="open"] { grid-template-columns: minmax(0, 1fr) minmax(460px, 52%); }
  .main[data-reader="open"] .reader { position: sticky; top: 0; height: 100vh; height: var(--vh); }
  .main[data-reader="open"] .cards { grid-template-columns: minmax(0, 1fr); }
  .reader .back { display: none; }
}
/* ---------- 窄桌面/平板：阅读面板覆盖主区 ---------- */
@media (max-width: 1099px) {
  .reader { position: fixed; top: 0; right: 0; bottom: 0; left: var(--side-w); z-index: 30; border-left: 0; }
  body.reading { overflow: hidden; }
  .reader .close { display: none; }
  .reader-scroll { padding: 24px 28px 48px; }
}
@media (max-width: 1023px) {
  :root { --side-w: 248px; }
}

/* ---------- 手机 ---------- */
@media (max-width: 767px) {
  .app { display: block; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  body.sheet { overflow: hidden; }
  body.sheet .side { z-index: 10000; }
  .side-head { padding: 10px 16px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px 6px; align-items: center; }
  .side-head .tabs { grid-column: 1 / -1; margin: 0; }
  .side-head .search { grid-column: 1 / -1; margin: 0; }
  .search input { height: 44px; font-size: 16px; }
  .brand-sub { display: none; }
  .brand h1 { font-size: 14px; }
  .m-only { display: inline-grid; }
  .filter-btn { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; background: var(--bg); }
  .filter-btn .badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
  :root[data-theme="dark"] .filter-btn .badge { color: #0e1013; }
  .icon-btn { width: 44px; height: 44px; }
  .kbd { display: none; }

  /* 底部筛选抽屉 */
  .facets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2; max-height: 84vh; max-height: calc(var(--vh) * .84); padding: 0 20px; background: var(--bg); border-radius: 16px 16px 0 0; box-shadow: var(--shadow); transform: translateY(105%); visibility: hidden; overscroll-behavior: contain; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s .28s; }
  body.sheet .facets { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 1; background: rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.sheet .scrim { opacity: 1; pointer-events: auto; }
  .sheet-h { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1; padding: 14px 0 6px; background: var(--bg); }
  .sheet-h::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-2); }
  .sheet-h h2 { margin: 6px 0 0; font-size: 16px; }
  .sheet-f { display: block; position: sticky; bottom: 0; padding: 12px 0 16px; background: var(--bg); border-top: 1px solid var(--line); margin-top: 18px; }
  .sheet-f .btn { margin: 0; }
  .side-foot { display: none; }
  .datepick input { height: 44px; max-width: 170px; font-size: 16px; }

  /* >=44px 触控目标 */
  .opt, .switch, .clear { min-height: 44px; }
  .seg button { height: 44px; }
  .tab { height: 40px; }
  .fchip button::before { content: ""; position: absolute; inset: -12px -4px; }
  .rbtn { height: 44px; padding: 0 12px; }

  .filterbar { gap: 4px 8px; padding: 6px 16px; min-height: 56px; }
  .fstate { flex-basis: 100%; }
  .fctl { width: 100%; justify-content: space-between; margin-left: 0; gap: 8px; }
  .seg button { padding: 0 10px; }
  .sec { scroll-margin-top: var(--bar-h); }
  .sec-h { top: var(--bar-h); padding: 8px 16px; }
  .row { padding: 14px 16px; }
  .main[data-view="card"] .cards, .main[data-view="card"] .sec .cards { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 16px 16px; }
  .notice { margin: 12px 16px 0; }
  .footer { padding: 14px 16px 0; }

  /* 阅读面板：全屏 */
  .reader { left: 0; height: 100vh; height: var(--vh); bottom: auto; }
  .reader-bar { padding: 4px 8px; gap: 0; }
  .reader-bar .rbtn span { white-space: nowrap; }
  #rawLink span { display: none; }
  .reader-scroll { padding: 20px 16px 48px; }
  .reader-head h2 { font-size: 21px; }
  .md-body { font-size: 16px; }
}
@media (max-width: 479px) {
  .reader-bar .rbtn:not(.back) span { display: none; }
  .reader-bar .rbtn:not(.back) { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 财经日历 ----------
   类名与 js/calendar-view.js 的 v3 DOM 一致。只使用已有 token，不改上面的规则。 */

body[data-page="calendar"] #main { display: none; }
body[data-page="calendar"] .side .search,
body[data-page="calendar"] .side .facets,
body[data-page="calendar"] .side .scrim,
body[data-page="calendar"] .side .filter-btn { display: none; }
/* 筛选项拿掉后，把页脚顶回侧栏底部，避免贴到页签下面 */
body[data-page="calendar"] .side-foot { margin-top: auto; }

/* 两个页签在 280px 侧栏里不换行。flex:1 时对称 padding 不改变文字居中。 */
.tab { white-space: nowrap; padding: 0 8px; }

.cal-main { display: block; min-width: 0; max-width: 100%; }
.cal-col {
  width: min(960px, 100%);
  margin-inline: auto;
  padding: 20px 24px;
  min-width: 0;
  max-width: 100%;
}

.cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.cal-h {
  flex: none;
  max-width: 100%;
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cal-range {
  flex: none;
  max-width: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cal-nav {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
.cal-nav .btn { margin-top: 0; flex: none; min-width: 0; max-width: 100%; justify-content: center; }
.cal-nav button:disabled,
.cal-nav button:disabled:hover {
  opacity: .45;
  cursor: not-allowed;
  background: var(--bg);
}

.cal-notice {
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cal-doc {
  max-width: 760px;
  margin-top: 16px;
  padding-bottom: 48px;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.cal-doc table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
.cal-doc img { max-width: 100%; height: auto; }
.cal-doc pre { overflow-x: auto; }
.cal-doc.cal-loading {
  padding: 56px 16px;
  text-align: center;
}

.cal-state { text-align: center; padding: 56px 16px; min-width: 0; }
.cal-state-t {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cal-state-s {
  margin: 6px 0 14px;
  font-size: 13px;
  color: var(--text-3);
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 767px) {
  .cal-col { padding-left: 16px; padding-right: 16px; min-width: 0; }
  .cal-nav { flex-wrap: nowrap; }
  .cal-nav .btn { flex: 1; }
}

/* ---------- 日历历史记录 ----------
   桌面 #calHist 在侧栏占满剩余高度；手机 .cal-hist-m 在主区顶部。
   类名与 js/calendar-view.js 一致。 */

/* 日历页收起稿件计数；.side-foot 里的主题按钮保留 */
body[data-page="calendar"] .brand-sub,
body[data-page="calendar"] .side-foot .foot-meta { display: none; }

.cal-hist {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 4px 12px 8px;
}
/* display:flex 会盖过 UA 的 [hidden]；类+属性高于单独的 .cal-hist */
.cal-hist[hidden] { display: none; }
body:not([data-page="calendar"]) .cal-hist { display: none; }

.cal-hist-h {
  flex: none;
  margin: 0;
  padding: 8px 8px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-3);
}
.cal-hist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.cal-hist-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 2px;
  width: 100%;
  min-width: 0;
  margin: 2px 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  text-align: left;
}
.cal-hist-w {
  order: 1;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.cal-hist-r {
  order: 3;
  flex: 1 0 100%;
  min-width: 0;
  font-size: 12px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
@media (hover: hover) {
  .cal-hist-item:hover { background: var(--hover); }
}
.cal-hist-item.is-current,
.cal-hist-item[aria-current="true"] {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
}
.cal-hist-item.is-current .cal-hist-w,
.cal-hist-item[aria-current="true"] .cal-hist-w { color: var(--accent-text); }
/* 轮廓沿用文件顶部 :focus-visible */
.cal-hist-item:focus-visible,
.cal-hist-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 桌面不显示手机历史条 */
.cal-hist-m { display: none; }

@media (max-width: 767px) {
  .cal-hist { display: none !important; }
  .cal-hist-m {
    display: block;
    margin: 0 0 14px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .cal-hist-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
  }
  .cal-hist-t {
    flex: none;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .cal-hist-cur {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-2);
    text-align: right;
  }
  /* 右侧小三角：收起向下，展开向上。不用图片。 */
  .cal-hist-toggle::after {
    content: "";
    flex: none;
    align-self: center;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-3);
  }
  .cal-hist-toggle[aria-expanded="true"]::after {
    border-top: 0;
    border-bottom: 5px solid var(--text-3);
  }
  .cal-hist-panel {
    margin-top: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--side);
    max-height: 50vh;
    max-height: min(50vh, 360px);
    overflow-y: auto;
    padding: 4px;
  }
  .cal-hist-panel[hidden] { display: none; }
  .cal-hist-panel .cal-hist-item { min-height: 44px; align-content: center; }
  .cal-hist-m button { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}
