/* ===== 挖煤办设计系统 tokens（与 猫粮站-demo.html / portal/static/tokens.css 同源）=====
   全站不出现红色：不声明 --danger 系变量，杜绝误用。阴影一律 rgba(22,42,50,α)，禁纯黑。 */
:root {
  --bg: #D8DDDF; --surface: #FFFFFF; --surface-sunk: #F1F4F5;
  --text: #152023; --text-2: #5F6E72; --text-3: #8A9498;
  --accent: #0A6570; --accent-lite: #10909C; --aqua: #72C7D8;
  --line: rgba(22,42,50,.09); --box-line: #B9C4C7;
  --shadow-rgb: 22,42,50;
  --mono: Menlo, ui-monospace, SFMono-Regular, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.na { color: var(--text-3); font-weight: 300; font-size: 12px; }
.hint { font-weight: 300; font-size: 12px; color: var(--text-3); }
[hidden] { display: none !important; }

.wrap { max-width: 1020px; margin: 0 auto; padding: 14px 14px 40px; }
body.cmp-open .wrap { padding-bottom: 112px; }

/* ===== 页头 ===== */
.site-head { display: flex; align-items: center; gap: 10px; padding: 6px 4px 16px; flex-wrap: wrap; }
.site-head .logo { width: 31.5px; height: 31.5px; display: block; flex: none; }
.site-name { white-space: nowrap; font-size: 17px; font-weight: 600; }
.site-sub { font-size: 10.5px; font-family: var(--mono); letter-spacing: 2.2px; color: var(--text-3); margin-top: 1px; }
.head-count { margin-left: auto; font-size: 12px; font-weight: 300; color: var(--text-3); white-space: nowrap; text-align: right; }
.head-count .num { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
@media (max-width: 479px) {
  .head-count { margin-left: 44px; width: 100%; order: 3; text-align: left; margin-top: 2px; }
}

/* ===== 玻璃 hero 卡（同 demo 工艺）===== */
.card-ring {
  border-radius: 22px; padding: 1.8px;
  background: linear-gradient(148deg,
    rgba(255,255,255,.98) 0%, rgba(133,212,227,.96) 18%, rgba(120,206,222,.72) 36%,
    rgba(255,255,255,.55) 56%, rgba(133,212,227,.5) 78%, rgba(255,255,255,.9) 100%);
  box-shadow: 0 2px 4px rgba(var(--shadow-rgb),.07), 0 18px 38px -14px rgba(var(--shadow-rgb),.36);
}
.glass-card {
  position: relative; overflow: hidden; border-radius: 20.2px; background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,1), inset 0 0 22px rgba(255,255,255,.7);
  padding: 20px 20px 18px;
}
.glow {
  position: absolute; left: -25%; right: -25%; top: -70px; height: 260px;
  pointer-events: none; filter: blur(34px);
  background:
    radial-gradient(closest-side, rgba(114,199,216,.5), transparent 72%) 14% 62% / 55% 78% no-repeat,
    radial-gradient(closest-side, rgba(16,144,156,.28), transparent 72%) 78% 20% / 58% 66% no-repeat;
}
.hero-line { position: relative; font-size: 17px; font-weight: 500; line-height: 1.6; max-width: 34em; }
.hero-line em { font-style: normal; font-weight: 600; color: var(--accent); }
.hero-note { position: relative; margin-top: 8px; font-size: 12.5px; font-weight: 300; color: var(--text-2); max-width: 40em; }

/* ===== 筛选面板 ===== */
.filters-card { margin: 14px 0 12px; }
.frow { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; }
.frow + .frow { border-top: 1px solid var(--line); }
.flabel {
  flex: none; width: 4.6em; padding-top: 6px; text-align: left;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); line-height: 1.4;
}
.pmtoggle { display: flex; margin-top: 6px; border-radius: 999px; overflow: hidden; border: 1px solid rgba(22,42,50,.12); width: fit-content; }
.pmtoggle button {
  border: 0; background: var(--surface-sunk); color: var(--text-2); font-size: 11px; font-weight: 400;
  padding: 4px 10px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pmtoggle button.on { background: linear-gradient(180deg, var(--accent-lite), var(--accent)); color: #fff; }

.fchips-scroll { flex: 1 1 auto; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 2px 4px; }
.fchips-scroll::-webkit-scrollbar { display: none; }
.fchips { display: flex; gap: 7px; flex-wrap: wrap; }

.fchip {
  flex: none; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(22,42,50,.1);
  background: var(--surface-sunk); color: var(--text-2); font-family: inherit; font-size: 12.5px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 2px rgba(var(--shadow-rgb),.05);
}
.fchip.on { background: linear-gradient(180deg, var(--accent-lite), var(--accent)); color: #fff; border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 8px rgba(11,101,112,.35); }
.fchip.fchip-more { background: transparent; border-style: dashed; color: var(--text-3); }
.fchip.fchip-clear { background: transparent; border-color: var(--box-line); color: var(--text-2); font-weight: 400; }

/* ===== 数据卡 / 表格 ===== */
.card {
  background: var(--surface); border-radius: 20px; padding: 16px 16px 8px;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb),.05), 0 2px 8px rgba(var(--shadow-rgb),.04);
}
.filters-card { padding: 12px 16px 14px; }
.card-h { font-size: 15px; font-weight: 600; color: var(--text-2); margin: 0 0 10px; display: flex; align-items: baseline; gap: 8px; }
.card-h .sort-note { margin-left: auto; font-size: 12px; font-weight: 300; color: var(--text-3); }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: right; font-size: 12px; font-weight: 400; color: var(--text-3);
  padding: 10px 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
thead th.l { text-align: left; }
thead th.chkcol { width: 2em; padding-right: 0; }
thead th.sortable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
thead th.sortable:hover { color: var(--accent); }
thead th.sorted { color: var(--accent); font-weight: 600; }
tbody td {
  padding: 11px 8px; border-bottom: 1px solid var(--line);
  text-align: right; font-size: 14px; white-space: nowrap;
}
tbody td.l { text-align: left; white-space: normal; }
tbody td.chkcol { text-align: center; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: rgba(114,199,216,.07); }
tbody tr:last-child td { border-bottom: 0; }
td .num, th .num { font-size: 13.5px; }
.pname { font-weight: 500; max-width: 21em; overflow: hidden; text-overflow: ellipsis; }
.pbrand { font-size: 12px; font-weight: 300; color: var(--text-3); margin-top: 2px; }
.geq { color: var(--text-3); font-size: 11px; margin-right: 1px; font-family: var(--mono); }
input.rowchk { width: 17px; height: 17px; cursor: pointer; accent-color: var(--accent); }

/* 徽章（全部中性，无红色） */
.badge {
  display: inline-block; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 7px;
  font-weight: 400; vertical-align: 1px; margin-left: 6px;
}
.b-craft { background: rgba(114,199,216,.18); color: var(--accent); }
.b-rx    { background: var(--surface-sunk); color: var(--text-2); border: 1px solid rgba(22,42,50,.1); }
.b-cn    { background: var(--surface-sunk); color: var(--text-2); border: 1px solid rgba(22,42,50,.1); }
.b-dm    { background: var(--surface-sunk); color: var(--text-2); border: 1px dashed var(--box-line); }

/* 干物质分隔行（中性灰，非红） */
.dm-divider td {
  text-align: left; font-size: 12px; font-weight: 300; color: var(--text-3);
  background: var(--surface-sunk); padding: 8px; cursor: default; white-space: normal;
}
.dm-divider:hover td { background: var(--surface-sunk); }

/* 移动端卡片列表 */
.mlist { display: none; }
.mcard { display: flex; align-items: flex-start; gap: 10px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.mcard:last-child { border-bottom: 0; }
.mcard .mchk-wrap { flex: none; padding-top: 3px; }
.mcard-body { flex: 1; min-width: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mcard-body:active { opacity: .7; }
.mcard .t { font-size: 15px; font-weight: 500; }
.mcard .b { font-size: 12px; font-weight: 300; color: var(--text-3); margin-top: 2px; }
.mcard .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mcard .chip {
  background: var(--surface-sunk); border: 1px solid rgba(22,42,50,.08); border-radius: 10px;
  padding: 5px 9px; font-size: 12px; font-weight: 300; color: var(--text-2);
}
.mcard-divider { padding: 10px 2px; font-size: 12px; font-weight: 300; color: var(--text-3); background: var(--surface-sunk); border-radius: 8px; margin: 4px 0; }

/* ===== 悬浮对比条 ===== */
.compare-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 24px rgba(var(--shadow-rgb),.18), 0 -1px 0 rgba(var(--shadow-rgb),.05);
}
@media (min-width: 720px) {
  .compare-bar { left: 50%; right: auto; transform: translateX(-50%); width: min(100% - 28px, 1020px); bottom: 16px; border-radius: 18px; box-shadow: 0 2px 4px rgba(var(--shadow-rgb),.08), 0 12px 32px -8px rgba(var(--shadow-rgb),.28); }
}
.compare-chips { flex: 1 1 auto; min-width: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.ccchip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface-sunk);
  border: 1px solid rgba(22,42,50,.08); border-radius: 999px; padding: 5px 6px 5px 12px;
  font-size: 12.5px; color: var(--text); max-width: 14em;
}
.ccchip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccx {
  flex: none; border: 0; background: rgba(22,42,50,.08); color: var(--text-2); width: 18px; height: 18px;
  border-radius: 999px; font-size: 12px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.compare-actions { flex: none; display: flex; gap: 8px; }
.btn-ghost, .btn-primary {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 0; font-size: 13px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn-ghost { background: var(--surface-sunk); color: var(--text-2); }
.btn-primary { background: linear-gradient(180deg, var(--accent-lite), var(--accent)); color: #fff; font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 8px rgba(11,101,112,.32); }
.btn-primary:disabled { opacity: .4; cursor: default; box-shadow: none; }

/* ===== toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(10px);
  background: rgba(21,32,35,.92); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 60; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 详情 / 对比 抽屉 ===== */
.ovl { position: fixed; inset: 0; background: rgba(22,42,50,.35); backdrop-filter: blur(2px);
  display: none; align-items: flex-end; justify-content: center; z-index: 50; }
.ovl.show { display: flex; }
.sheet {
  background: var(--surface); width: 100%; max-width: 660px; max-height: 88vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(var(--shadow-rgb),.3);
}
.sheet.sheet-wide { max-width: 940px; }
@media (min-width: 720px) {
  .ovl { align-items: center; }
  .sheet { border-radius: 22px; padding-bottom: 20px; }
}
.sheet-close { float: right; border: 0; background: var(--surface-sunk); color: var(--text-2);
  width: 30px; height: 30px; border-radius: 999px; font-size: 15px; cursor: pointer; }
.sheet h2 { font-size: 18px; font-weight: 600; margin: 2px 0 0; line-height: 1.4; }
.sheet .en { font-size: 13px; font-weight: 300; color: var(--text-3); margin: 2px 0 10px; }
.sheet h3 { font-size: 15px; font-weight: 600; color: var(--text-2); margin: 18px 0 6px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.kv-cell { background: var(--surface-sunk); border-radius: 10px; padding: 8px 10px; border: 1px solid rgba(22,42,50,.06); }
.kv-cell .k { font-size: 11px; color: var(--text-3); font-weight: 300; }
.kv-cell .v { font-size: 15px; font-weight: 600; font-family: var(--mono); margin-top: 1px; }
.kv-cell .v.na { font-size: 12px; font-weight: 300; font-family: inherit; }
.ing-row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ing-row:last-child { border-bottom: 0; }
.ing-row .no { font-family: var(--mono); font-size: 12px; color: var(--text-3); width: 1.6em; flex: none; padding-top: 2px; }
.ing-row .zh { min-width: 8em; }
.ing-row .en { font-weight: 300; color: var(--text-3); font-size: 13px; padding-top: 1px; }
.tag { display: inline-block; background: var(--surface-sunk); border: 1px solid rgba(22,42,50,.08);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--text-2); margin: 0 6px 6px 0; }
.notice { border-radius: 12px; background: var(--surface-sunk); padding: 10px 12px; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.notice-strong { border-left: 3px solid var(--box-line); }
.qual-raw { font-weight: 300; color: var(--text-3); margin-left: 4px; }
.src { font-size: 13px; font-weight: 300; color: var(--text-2); }
.src .num { font-size: 12px; }

/* ===== 对比表 ===== */
.ctable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; }
table.ctable { width: auto; min-width: 100%; }
.ctable th, .ctable td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; text-align: left; }
.ctable thead th { background: var(--surface-sunk); color: var(--text); font-weight: 600; border-bottom: 1px solid var(--line); }
.ctable td.ctf-name, .ctable th.ctf-name { position: sticky; left: 0; background: var(--surface-sunk); font-weight: 500; color: var(--text-2); z-index: 1; }
.ctable thead th.ctf-name { z-index: 2; }
.ctable tbody tr:last-child td { border-bottom: 0; }
.ctf-t { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: normal; max-width: 16em; }
.ctf-b { font-size: 11px; font-weight: 300; color: var(--text-3); margin-top: 2px; }

/* ===== 页脚 ===== */
footer { margin-top: 26px; text-align: center; font-size: 12px; font-weight: 300; color: var(--text-3); line-height: 2; }

/* ===== 响应式 ===== */
@media (max-width: 719px) {
  .dtable { display: none; }
  .mlist { display: block; }
  .hero-line { font-size: 15.5px; }
  .glass-card { padding: 16px 16px 14px; }
  .flabel { width: 3.6em; font-size: 12px; }
  .fchips { flex-wrap: nowrap; width: max-content; }
}
