/* ============================================================
   NewsPulse 新闻脉搏 · T8_classic_portal 经典门户风
   红蓝配色 · 高密度多板块 · 新浪式 · 纯静态离线可用
   ============================================================ */
:root {
  --bg: #f4f5f7;
  --bg2: #ececef;
  --panel: #ffffff;
  --panel2: #f7f8fa;
  --line: #e3e5e9;
  --line2: #d0d3da;
  --ink: #1a1a1a;
  --ink2: #4a4a4a;
  --mut: #8c8c8c;
  --acc: #d0121b;
  --acc-dim: #f0b7b9;
  --acc2: #1a66b3;
  --gold: #c8860a;
  --ok: #2e8b57;
  --warn: #c8860a;
  --bad: #d0121b;
  --gray: #999999;
  --radius: 3px;
  --font: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6; min-height: 100vh; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--acc); text-decoration: underline; }
::selection { background: rgba(208, 18, 27, .15); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #c9ccd4; border-radius: 5px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- 门户头 ---------- */
.utilbar { background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--mut); }
.utilbar .wrap { display: flex; justify-content: space-between; height: 30px; align-items: center; }
.utilbar a { color: var(--mut); margin-left: 14px; }
.utilbar a:hover { color: var(--acc); }
.logobar { background: var(--panel); }
.logobar .wrap { display: flex; align-items: center; gap: 24px; height: 74px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 30px; color: var(--acc); letter-spacing: -1px; }
.brand .mark { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: var(--acc); color: #fff; font-size: 24px; font-weight: 900; }
.brand small { color: var(--ink2); font-weight: 400; font-size: 13px; letter-spacing: 4px; margin-top: 12px; }
.headsearch { display: flex; margin-left: auto; width: 380px; }
.headsearch .inp { border-radius: 3px 0 0 3px; border-right: none; }
.headsearch .btn { border-radius: 0 3px 3px 0; }
.mainnav { background: var(--acc); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.mainnav .wrap { display: flex; }
.mainnav a { color: #fff; padding: 0 26px; line-height: 42px; font-size: 15px; font-weight: 700; display: inline-block; }
.mainnav a:hover { background: rgba(0,0,0,.15); text-decoration: none; color: #fff; }
.mainnav a.on { background: rgba(0,0,0,.22); }
.syncchip { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.mainnav .syncchip { color: #ffd9da; margin-left: auto; margin-right: 12px; }

/* ---------- 通用组件 ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 16px; border-radius: var(--radius); font-size: 13px; font-family: var(--font); border: 1px solid var(--line2); background: #fff; color: var(--ink); transition: all .13s; }
.btn:hover { border-color: var(--acc); color: var(--acc); text-decoration: none; }
.btn-acc { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 700; }
.btn-acc:hover { background: #b00f17; color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--acc); border-color: var(--acc-dim); background: #fdf3f3; }
.btn-sm { padding: 3px 10px; font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 2px; font-size: 12px; border: 1px solid var(--line2); color: var(--ink2); background: #fff; white-space: nowrap; }
.badge-acc { color: #fff; background: var(--acc); border-color: var(--acc); }
.badge-ok { color: var(--ok); border-color: #b5d9c3; background: #eff8f2; }
.badge-warn { color: var(--warn); border-color: #e6d3a8; background: #fbf5e7; }
.badge-bad { color: var(--acc); border-color: var(--acc-dim); background: #fdf3f3; }
.badge-mut { color: var(--gray); border-color: var(--line2); background: var(--bg2); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; height: 38px; background: linear-gradient(#ffffff, #f6f7f9); border-bottom: 2px solid var(--acc); font-weight: 700; font-size: 15px; }
.card-h .sub { color: var(--mut); font-weight: 400; font-size: 12px; }
.card-b { padding: 12px 14px; }
.card-h .row .btn-sm { margin-left: 8px; }
.card-h a.sub { color: var(--acc2); }
.card-h a.sub:hover { color: var(--acc); }
.card-h a, .card-h .sub a, .card-h a.btn-sm { color: var(--acc2); font-weight: 400; font-size: 12px; }
.card-h a.btn-sm:hover { color: var(--acc); }

/* ---------- 统计块 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { padding: 12px 14px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--acc2); }
.stat.c-acc { border-top-color: var(--acc); }
.stat.c-gold { border-top-color: var(--gold); }
.stat .k { color: var(--mut); font-size: 12px; margin-bottom: 4px; }
.stat .v { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat .v small { font-size: 13px; color: var(--ink2); font-weight: 400; }
.stat .t { color: var(--ok); font-size: 11.5px; margin-top: 4px; }
.stat .t.down { color: var(--acc); }
.stat.c-acc .v { color: var(--acc); }
.stat.c-gold .v { color: var(--gold); }
.stat.c-acc2 .v { color: var(--acc2); }

/* ---------- 表单 ---------- */
.inp, .sel, textarea.inp { width: 100%; padding: 7px 10px; border-radius: var(--radius); font-size: 13px; font-family: var(--font); background: #fff; border: 1px solid var(--line2); color: var(--ink); transition: border-color .13s; }
.inp:focus, .sel:focus, textarea.inp:focus { outline: none; border-color: var(--acc2); box-shadow: 0 0 0 2px rgba(26, 102, 179, .12); }
.sel { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.lbl { display: block; color: var(--ink2); font-size: 12.5px; margin: 13px 0 5px; }
.lbl b { color: var(--ink); }
.hint { color: var(--mut); font-size: 12px; margin-top: 5px; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d6d9df; transition: .2s; }
.switch i::before { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + i { background: var(--acc); }
.switch input:checked + i::before { transform: translateX(16px); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); margin: 3px 14px 3px 0; cursor: pointer; }
.check input { accent-color: var(--acc); width: 14px; height: 14px; }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--ink2); font-weight: 700; font-size: 12.5px; padding: 8px 10px; background: var(--panel2); border-bottom: 2px solid var(--acc2); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fdf6f6; }

/* ---------- Tabs ---------- */
.tabbar { display: flex; border-bottom: 2px solid var(--acc); background: var(--panel); overflow-x: auto; }
.tabbar button { background: none; border: none; cursor: pointer; color: var(--ink2); font-family: var(--font); font-size: 14px; font-weight: 700; padding: 9px 20px; white-space: nowrap; border-right: 1px solid var(--line); }
.tabbar button:hover { color: var(--acc); background: var(--panel2); }
.tabbar button.on { color: #fff; background: var(--acc); }

/* ---------- 新闻条目 ---------- */
.news-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px dotted var(--line2); }
.news-item:hover { background: #fdf6f6; }
.news-item:last-child { border-bottom: none; }
.news-item .thumb { width: 86px; height: 58px; border-radius: 2px; flex: none; background: linear-gradient(135deg, #fdeeee, #eaf1f8); border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; }
.news-item h4 { font-size: 15px; font-weight: 700; line-height: 1.5; margin-bottom: 3px; }
.news-item h4 a { color: var(--ink); }
.news-item h4 a:hover { color: var(--acc); }
.news-item h4 mark { background: #fdeeee; color: var(--acc); padding: 0 2px; }
.news-item p { color: var(--ink2); font-size: 12.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 5px; font-size: 12px; color: var(--mut); }
.meta .src { color: var(--acc2); font-weight: 700; }
.news-item.vertical { display: block; }
.news-item.vertical p { margin-top: 4px; }

/* ---------- 热搜行 ---------- */
.wb-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dotted var(--line2); font-size: 13px; }
.wb-item:last-child { border-bottom: none; }
.wb-item .rk { width: 22px; height: 22px; border-radius: 2px; flex: none; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--acc2); background: #eaf1f8; }
.wb-item .rk.top { color: #fff; background: var(--acc); }
.wb-item .rk.t2 { color: #fff; background: #e8642c; }
.wb-item .rk.t3 { color: #fff; background: var(--gold); }
.wb-item .wt { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-item .wt:hover { color: var(--acc); }
.wb-item .hv { font-family: var(--mono); font-size: 12px; color: var(--mut); }
.wb-item .bar { width: 56px; height: 4px; background: var(--bg2); overflow: hidden; flex: none; border-radius: 2px; }
.wb-item .bar i { display: block; height: 100%; background: var(--acc2); }
.tagp { font-size: 11px; padding: 0 6px; border-radius: 2px; font-weight: 700; flex: none; line-height: 18px; }
.tag-热 { color: #fff; background: var(--acc); }
.tag-爆 { color: #fff; background: #e8642c; }
.tag-沸 { color: #fff; background: #c026d3; }
.tag-新 { color: #fff; background: var(--acc2); }

/* ---------- 渠道与状态 ---------- */
.ch { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 8px; border-radius: 2px; border: 1px solid var(--line2); color: var(--ink2); background: #fff; }
.ch-news { color: var(--acc2); border-color: #bcd4e8; background: #eaf1f8; }
.ch-wechat { color: var(--ok); border-color: #b5d9c3; background: #eff8f2; }
.ch-video { color: var(--acc); border-color: var(--acc-dim); background: #fdf3f3; }
.mention-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px dotted var(--line2); }
.mention-item:last-child { border-bottom: none; }
.mention-item h5 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.mention-item h5 a { color: var(--ink); }
.mention-item h5 a:hover { color: var(--acc); }
.mention-item p { color: var(--ink2); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--acc-dim); }

/* ---------- AI 问答 ---------- */
.chat-msg { display: flex; gap: 11px; margin-bottom: 18px; }
.chat-msg .avatar { width: 32px; height: 32px; border-radius: 3px; flex: none; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg.user .avatar { background: var(--bg2); border: 1px solid var(--line2); color: var(--ink2); }
.chat-msg.assistant .avatar { background: var(--acc); color: #fff; }
.chat-msg .bubble { max-width: 78%; padding: 11px 14px; border-radius: var(--radius); font-size: 14px; line-height: 1.75; }
.chat-msg.user .bubble { background: #eaf1f8; border: 1px solid #bcd4e8; }
.chat-msg.assistant .bubble { background: #fff; border: 1px solid var(--line2); }
.chat-msg .bubble strong { color: var(--acc); }
.chat-msg .bubble ol, .chat-msg .bubble ul { padding-left: 20px; margin: 5px 0; }
.chat-msg .bubble li { margin: 3px 0; }
.chat-msg .bubble .cite { color: var(--mut); font-size: 12px; }
/* bubble 内 Markdown 排版（AI 问答） */
.chat-msg .bubble h1, .chat-msg .bubble h2, .chat-msg .bubble h3, .chat-msg .bubble h4 { margin: 10px 0 6px; line-height: 1.4; }
.chat-msg .bubble h1 { font-size: 18px; }
.chat-msg .bubble h2 { font-size: 17px; }
.chat-msg .bubble h3 { font-size: 15.5px; }
.chat-msg .bubble h4 { font-size: 14.5px; }
.chat-msg .bubble p { margin: 6px 0; }
.chat-msg .bubble code { font-family: var(--mono); font-size: 12.5px; background: var(--panel2); border: 1px solid var(--line); border-radius: 2px; padding: 1px 5px; }
.chat-msg .bubble pre { background: #1f2430; color: #e8eaf0; padding: 10px 12px; border-radius: 3px; overflow-x: auto; margin: 8px 0; }
.chat-msg .bubble pre code { background: none; border: none; color: inherit; padding: 0; }
.chat-msg .bubble blockquote { border-left: 3px solid var(--acc-dim); color: var(--ink2); padding: 2px 12px; margin: 6px 0; }
.chat-msg .bubble table { border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.chat-msg .bubble th, .chat-msg .bubble td { border: 1px solid var(--line2); padding: 5px 10px; }
.chat-msg .bubble th { background: var(--panel2); }
.chat-msg .bubble hr { border: none; border-top: 1px solid var(--line2); margin: 10px 0; }
.chat-msg .bubble a { color: var(--acc2); }
.cursor { display: inline-block; width: 7px; height: 15px; background: var(--acc); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat-sources { margin-top: 10px; border-top: 1px dashed var(--line2); padding-top: 8px; }
.chat-sources .cap { font-size: 12px; color: var(--mut); margin-bottom: 6px; }
.chat-source { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink2); padding: 5px 9px; border-radius: 2px; background: var(--panel2); border: 1px solid var(--line); margin-bottom: 4px; }
.chat-source a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-source a:hover { color: var(--acc); }
.chat-source .sn { color: var(--acc); flex: none; font-weight: 700; }

/* ---------- 提供商卡片 ---------- */
.provider-card { padding: 13px 15px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.provider-card.def { border: 2px solid var(--acc); }
.provider-card .ph { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line2); }
.provider-card .ph h4 { font-size: 14.5px; flex: 1; }
.provider-card .kv { font-size: 12.5px; color: var(--ink2); display: flex; gap: 8px; padding: 2px 0; }
.provider-card .kv b { color: var(--mut); font-weight: 400; flex: none; width: 66px; }
.provider-card .kv span { font-family: var(--mono); word-break: break-all; }
.protop { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 2px; }
.protop.openai { color: #fff; background: var(--acc2); }
.protop.anthropic { color: #fff; background: var(--acc); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(0, 0, 0, .45); }
.modal.open { display: grid; }
.modal .box { width: min(560px, calc(100vw - 40px)); max-height: 88vh; overflow: auto; background: #fff; border-radius: var(--radius); box-shadow: 0 16px 50px rgba(0,0,0,.3); }
.modal .mh { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--acc); color: #fff; font-weight: 700; }
.modal .mh .x { color: rgba(255,255,255,.85); }
.modal .mb { padding: 6px 16px 16px; }
.modal .mf { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.x { background: none; border: none; color: var(--mut); font-size: 19px; cursor: pointer; }
.x:hover { color: var(--ink); }

/* ---------- 布局工具 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 320px; gap: 12px; align-items: start; }
.grid2r { display: grid; grid-template-columns: 320px 1fr; gap: 12px; align-items: start; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 16px; }
.mb12 { margin-bottom: 10px; } .mb16 { margin-bottom: 14px; }
.sec-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; margin: 14px 0 10px; padding-left: 9px; border-left: 4px solid var(--acc); }
.sec-title .sub { color: var(--mut); font-size: 12px; font-weight: 400; }
.muted { color: var(--mut); }
.small { font-size: 12px; }
.searchbar { display: flex; gap: 8px; }
.searchbar .inp { flex: 1; font-size: 14px; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 4px; justify-content: center; padding: 14px 0 4px; }
.pager a, .pager span { min-width: 30px; height: 30px; display: grid; place-items: center; padding: 0 8px; border-radius: 2px; font-size: 13px; color: var(--acc2); border: 1px solid var(--line2); background: #fff; font-family: var(--mono); }
.pager a:hover { border-color: var(--acc); color: var(--acc); text-decoration: none; }
.pager .on { color: #fff; background: var(--acc); border-color: var(--acc); font-weight: 700; }

/* ---------- 页脚 ---------- */
.footer { background: var(--bg2); border-top: 3px solid var(--acc); margin-top: 24px; padding: 16px 0 22px; color: var(--mut); font-size: 12px; text-align: center; }
.footer .wrap { display: block; }
.footer .wrap span { display: inline-block; margin: 0 12px 4px; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: calc(100vh - 70px); display: grid; place-items: center; }
.login-card { width: min(400px, calc(100vw - 40px)); padding: 0; text-align: center; border: 1px solid var(--line2); background: #fff; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.08); overflow: hidden; }
.login-card .mark { width: 100%; height: 64px; margin: 0 0 8px; display: grid; place-items: center; font-size: 24px; background: var(--acc); color: #fff; }
.login-card h2 { margin-bottom: 4px; }
.login-card .sub { color: var(--mut); font-size: 12.5px; margin-bottom: 20px; }
.login-card form { padding: 0 30px 26px; text-align: left; }

/* ---------- 语义组件 ---------- */
.ai-box { border: 1px solid var(--acc-dim); border-radius: var(--radius); background: #fff; }
.ai-box .ai-box-h { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; background: #fdf3f3; border-bottom: 1px solid var(--acc-dim); font-weight: 700; color: var(--acc); }
.ai-box .ai-box-b { padding: 12px 16px; font-size: 13.5px; color: var(--ink2); line-height: 1.8; }
.danger-card { border-color: var(--acc-dim); }

/* ---------- 管理后台布局 ---------- */
.admin-shell { display: grid; grid-template-columns: 200px 1fr; gap: 12px; align-items: start; margin-top: 14px; }
.admin-side { position: sticky; top: 56px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.admin-side .cap { color: var(--mut); font-size: 11px; padding: 10px 14px 5px; background: var(--panel2); border-bottom: 1px solid var(--line); }
.admin-side a { display: flex; align-items: center; gap: 8px; padding: 9px 14px; color: var(--ink2); font-size: 13.5px; border-left: 3px solid transparent; transition: all .12s; }
.admin-side a:hover { color: var(--acc); background: #fdf6f6; text-decoration: none; }
.admin-side a.on { color: var(--acc); border-left-color: var(--acc); background: #fdf6f6; font-weight: 700; }
.admin-side hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; }
.form-card { max-width: 760px; }
.frow { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: start; padding: 11px 0; border-bottom: 1px dotted var(--line2); }
.frow:last-child { border-bottom: none; }
.frow > label { color: var(--ink2); font-size: 13px; padding-top: 6px; }
.frow > label b { color: var(--ink); }
.frow .ctl { min-width: 0; }
.kw-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dotted var(--line2); }
.kw-row:last-child { border-bottom: none; }
.log-status { font-size: 12px; font-weight: 700; }
.log-status.ok { color: var(--ok); } .log-status.partial { color: var(--warn); }
.log-status.failed { color: var(--acc); } .log-status.skipped { color: var(--gray); }

/* ---------- 响应式（PC / 平板 / 手机四档断点） ---------- */
/* 语义布局类：模板一律用类不用内联网格列，媒体查询才能接管降列 */
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; overflow: hidden; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

html { -webkit-text-size-adjust: 100%; }

/* ≤1080 平板横 / 窄窗口 */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid2r { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
}

/* ≤900 平板竖 */
@media (max-width: 900px) {
  /* 页头：品牌 + 搜索框两行布局，移动端不再丢搜索入口 */
  .logobar .wrap { flex-wrap: wrap; height: auto; padding: 10px 16px; row-gap: 8px; }
  .headsearch { display: flex; width: 100%; margin-left: 0; order: 3; }
  /* 管理后台：侧栏变顶部横向滑动导航条 */
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-side .cap, .admin-side hr { display: none; }
  .admin-side a { white-space: nowrap; flex: none; border-left: none; border-bottom: 3px solid transparent; }
  .admin-side a.on { border-left: none; border-bottom-color: var(--acc); }
}

/* ≤760 大屏手机 */
@media (max-width: 760px) {
  /* 主导航：横向滑动不折行，隐藏同步徽标省空间 */
  .mainnav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav .wrap { flex-wrap: nowrap; }
  .mainnav a { padding: 0 16px; white-space: nowrap; flex: none; }
  .mainnav .syncchip { display: none; }
  /* 网格降列 */
  .stats, .stats-3 { grid-template-columns: 1fr 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .frow { grid-template-columns: 1fr; gap: 4px; }
  .frow > label { padding-top: 0; }
  /* 输入 16px 防 iOS 聚焦自动放大；搜索栏允许换行 */
  .inp, .sel, textarea.inp { font-size: 16px; }
  .searchbar { flex-wrap: wrap; }
  .searchbar .inp { min-width: 200px; }
  .btn { padding: 8px 14px; }
  .row { flex-wrap: wrap; }
  .card-h a.sub { padding: 8px 0 8px 10px; }  /* 「更多 →」触控点按区域 */
}

/* ≤480 小屏手机 */
@media (max-width: 480px) {
  .stats, .stats-3 { grid-template-columns: 1fr; }
  .news-item .thumb { display: none; }
  .brand { font-size: 22px; }
  .brand .mark { width: 34px; height: 34px; font-size: 18px; }
  .brand small { display: none; }
  .card-b { padding: 10px 12px; }
  .card-h { padding: 0 12px; }
  .card-h span.sub { display: none; }  /* 只藏纯文本副标题；a.sub 的「更多 →」链接必须保留 */
  .sec-title { font-size: 15px; }
  .modal .box { width: calc(100vw - 20px); }
  .utilbar { font-size: 11px; }
  .utilbar a { margin-left: 10px; }
}
