  :root {
    /* colors */
    --bg: #0f1419;
    --panel: #161b22;
    --panel-2: #1c232c;
    --border: #2a323d;
    --border-soft: #232a34;
    --text: #e6edf3;
    --text-2: #c9d1d9;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-2: #79c0ff;
    --alert: #f0883e;
    --new: #3fb950;
    --warn: #d2a8ff;
    --policy: #d2a8ff;
    --domestic: #58a6ff;
    --international: #79c0ff;
    --shadow: 0 1px 3px rgba(0,0,0,.4);

    /* type scale — 别再写 14.5/12.5 这种数 */
    --fs-xs: 11px;       /* 元信息、徽章 */
    --fs-sm: 12px;       /* 次级、来源、时间 */
    --fs-base: 13px;     /* 卡片正文、列表 */
    --fs-md: 14px;       /* 卡片标题、tab、按钮 */
    --fs-lg: 16px;       /* 区块标题 */
    --fs-xl: 18px;       /* 页面 hero 标题 */
    --fs-2xl: 20px;      /* 品牌名 */

    /* line-height */
    --lh-tight: 1.35;
    --lh-snug: 1.5;
    --lh-normal: 1.65;

    /* spacing scale */
    --gap-1: 4px;
    --gap-2: 8px;
    --gap-3: 12px;
    --gap-4: 16px;
    --gap-5: 24px;
    --gap-6: 32px;
  }
  @media (prefers-color-scheme: light) {
    :root {
      --bg: #f6f8fa;
      --panel: #ffffff;
      --panel-2: #f0f3f6;
      --border: #d0d7de;
      --border-soft: #e4e8ee;
      --text: #1f2328;
      --muted: #57606a;
      --accent: #0969da;
      --accent-2: #0550ae;
      --alert: #bc4c00;
      --new: #1a7f37;
      --warn: #6639ba;
      --policy: #6639ba;
      --domestic: #0969da;
      --international: #0550ae;
      --shadow: 0 1px 3px rgba(0,0,0,.06);
    }
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI",
                 "Helvetica Neue", Helvetica, "Microsoft YaHei", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  ::selection { background: var(--accent); color: #fff; }
  a { color: var(--accent); }
  .container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

  /* ─── Header ─────────────────────────────────── */
  header {
    border-bottom: 1px solid var(--border);
    background: rgba(15, 20, 25, .85);
    position: sticky; top: 0; z-index: 20;
    backdrop-filter: saturate(150%) blur(10px);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
  }
  @media (prefers-color-scheme: light) {
    header { background: rgba(246, 248, 250, .85); }
  }
  .top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; gap: 16px;
  }
  .brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .brand .logo {
    width: 40px; height: 40px; flex-shrink: 0;
    object-fit: contain;
  }
  .brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
  .brand-name {
    font-weight: 700; font-size: var(--fs-xl); color: var(--text);
    letter-spacing: 0.5px;
    white-space: nowrap;
  }
  .brand-slogan {
    font-size: var(--fs-xs); color: var(--muted); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .brand .live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--new); box-shadow: 0 0 8px var(--new);
    display: inline-block; margin-right: 4px;
    vertical-align: middle;
    animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .3; }
  }
  .head-actions { display: flex; align-items: center; gap: 6px; }
  .head-actions .updated { color: var(--muted); font-size: var(--fs-sm); margin-right: 8px; }
  .btn-icon {
    background: transparent; color: var(--text); border: 1px solid var(--border);
    border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: var(--fs-sm);
    line-height: 1; display: inline-flex; align-items: center; gap: 4px;
    transition: all .15s;
  }
  .btn-icon:hover { background: var(--panel-2); border-color: var(--accent); color: var(--accent); }

  /* ─── Toolbar ────────────────────────────────── */
  .toolbar {
    display: flex; gap: 10px; align-items: center;
    padding: 0 0 12px; flex-wrap: wrap;
  }
  .tabs { display: flex; gap: 4px; flex-wrap: wrap; }
  .tab {
    background: var(--panel); color: var(--text);
    border: 1px solid var(--border); border-radius: 999px;
    padding: 5px 12px; cursor: pointer; font-size: var(--fs-sm);
    transition: all .15s; line-height: 1.4;
    display: inline-flex; align-items: center; gap: 5px;
  }
  .tab:hover { background: var(--panel-2); }
  .tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .tab .badge-count {
    background: var(--panel-2); color: var(--muted);
    padding: 0 6px; border-radius: 999px; font-size: var(--fs-xs);
    min-width: 18px; text-align: center;
  }
  .tab.active .badge-count { background: rgba(255,255,255,.25); color: #fff; }
  .search {
    flex: 1; min-width: 200px;
    background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 12px; color: var(--text); font-size: var(--fs-base); outline: none;
  }
  .search:focus { border-color: var(--accent); }

  main { padding: 16px 0 64px; }

  /* ─── Sections ───────────────────────────────── */
  .section { margin-bottom: 28px; }
  .section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin: 0 0 12px; gap: 12px;
    padding-bottom: 8px; border-bottom: 1px solid var(--border-soft);
  }
  .section-head .title {
    font-size: var(--fs-lg); font-weight: 600; color: var(--text);
    display: flex; gap: 8px; align-items: baseline;
  }
  .section-head .title .icon {
    color: var(--accent); font-weight: 400;
    line-height: 1;
  }
  .section-head .sub { font-size: var(--fs-sm); color: var(--muted); }

  /* ─── Price cards ────────────────────────────── */
  .prices {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  .price-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px; padding: 11px 13px;
    box-shadow: var(--shadow);
  }
  .price-card h3 {
    margin: 0 0 8px; font-size: var(--fs-sm); font-weight: 600;
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    padding-bottom: 6px; border-bottom: 1px solid var(--border-soft);
  }
  .price-card h3 .unit { color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }
  .price-row {
    display: flex; align-items: baseline; justify-content: space-between;
    padding: 4px 0; font-size: var(--fs-base);
  }
  .price-row .name { color: var(--text); flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
  .price-row .val { font-weight: 600; font-variant-numeric: tabular-nums;
    display: flex; align-items: baseline; gap: 4px; }
  .trend-up   { color: #e34935; }
  .trend-down { color: var(--new); }
  .trend-flat { color: var(--muted); }
  .price-hint { margin-top: 6px; color: var(--muted); font-size: var(--fs-xs);
    padding-top: 6px; border-top: 1px dashed var(--border-soft); }

  /* ─── Price news list ────────────────────────── */
  .pn-list { display: grid; gap: 4px; }
  .pn {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 8px; padding: 7px 12px; font-size: var(--fs-base);
    display: flex; gap: 10px; align-items: center;
  }
  .pn .tag {
    background: var(--panel-2); color: var(--alert); border-radius: 4px;
    padding: 1px 6px; font-size: var(--fs-xs); flex-shrink: 0; font-weight: 500;
  }
  .pn a {
    color: var(--text); text-decoration: none; flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .pn a:hover { color: var(--accent); }
  .pn .time { color: var(--muted); font-size: var(--fs-xs); flex-shrink: 0; }

  /* ─── Stats ──────────────────────────────────── */
  .stats {
    color: var(--muted); font-size: var(--fs-sm);
    display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px;
  }
  .stats b { color: var(--text); font-weight: 600; }
  .stats .alert-count { color: var(--alert); }

  /* ─── News cards ─────────────────────────────── */
  .list { display: grid; gap: 10px; }
  .card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px 16px 10px;
    transition: border-color .15s, transform .15s;
    box-shadow: var(--shadow);
  }
  .card:hover { transform: translateY(-1px); }
  .card:hover { border-color: var(--accent); }
  .card.alert { border-left: 3px solid var(--alert); }
  .card.fav   { border-left: 3px solid var(--warn); }
  .card-head {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-bottom: 8px; font-size: var(--fs-xs);
  }
  .badge {
    padding: 2px 8px; border-radius: 4px; font-size: var(--fs-xs);
    border: 1px solid var(--border); font-weight: 500;
    line-height: 1.4;
  }
  .badge.cat-policy        { color: var(--policy);        border-color: var(--policy); }
  .badge.cat-domestic      { color: var(--domestic);      border-color: var(--domestic); }
  .badge.cat-international { color: var(--international); border-color: var(--international); }
  .badge.new   { background: var(--new); color: #fff; border-color: var(--new); }
  .source { color: var(--muted); }
  .time   { color: var(--muted); margin-left: auto; }

  .card a.title {
    color: var(--text); text-decoration: none; font-weight: 600;
    font-size: var(--fs-lg); line-height: var(--lh-snug); display: block;
    margin-bottom: 2px;
    letter-spacing: 0.1px;
  }
  .card a.title:hover { color: var(--accent); }
  .card .summary {
    color: var(--text-2, var(--muted));
    font-size: var(--fs-base); line-height: var(--lh-normal); margin-top: 6px;
    overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  .card .kw { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
  .card .kw span {
    background: var(--panel-2); color: var(--alert); border-radius: 4px;
    padding: 2px 8px; font-size: var(--fs-xs); font-weight: 500;
  }

  /* Card action bar */
  .actions {
    margin-top: 10px; padding-top: 8px;
    border-top: 1px solid var(--border-soft);
    display: flex; gap: 2px; justify-content: flex-end;
    flex-wrap: wrap;
  }
  .act {
    background: transparent; color: var(--muted); border: none;
    cursor: pointer; font-size: var(--fs-sm); padding: 5px 10px;
    border-radius: 6px; line-height: 1;
    display: inline-flex; align-items: center; gap: 5px;
    transition: all .15s;
  }
  .act:hover { background: var(--panel-2); color: var(--text); }
  .act.fav-on { color: var(--warn); font-weight: 600; }
  .act svg { width: 14px; height: 14px; }

  /* ─── Toast ──────────────────────────────────── */
  .toast {
    position: fixed; left: 50%; bottom: 32px;
    transform: translateX(-50%) translateY(20px);
    background: var(--text); color: var(--bg);
    padding: 8px 16px; border-radius: 6px; font-size: var(--fs-base);
    opacity: 0; pointer-events: none;
    transition: all .25s; z-index: 100;
    box-shadow: 0 6px 20px rgba(0,0,0,.3);
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ─── Modal (comments) ───────────────────────── */
  .modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 50; padding: 60px 16px 16px;
    overflow-y: auto;
  }
  .modal-backdrop.show { display: flex; }
  .modal {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; width: 100%; max-width: 720px;
    padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
  }
  .modal-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 12px; margin-bottom: 12px;
  }
  .modal-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; line-height: 1.4; }
  .modal-head .close {
    background: transparent; color: var(--muted); border: none;
    cursor: pointer; font-size: 22px; padding: 0 4px; line-height: 1;
  }
  .modal-head .close:hover { color: var(--text); }
  .modal-body { font-size: var(--fs-base); }
  .modal-body .source-link {
    margin-bottom: 14px; color: var(--accent); font-size: var(--fs-base);
    word-break: break-all;
  }
  .modal-body .giscus-disabled {
    background: var(--panel); border: 1px dashed var(--border);
    border-radius: 8px; padding: 16px; color: var(--muted);
    font-size: var(--fs-base); line-height: 1.7;
  }
  .modal-body .giscus-disabled code {
    background: var(--panel-2); padding: 1px 6px; border-radius: 3px;
    color: var(--accent); font-size: var(--fs-sm);
  }

  /* ─── Misc ───────────────────────────────────── */
  .empty, .loading {
    text-align: center; padding: 40px 20px; color: var(--muted);
    background: var(--panel); border: 1px dashed var(--border); border-radius: 10px;
  }
  .loading::after {
    content: "..."; animation: dots 1.4s infinite;
  }
  @keyframes dots {
    0%, 20%   { content: "."; }
    40%       { content: ".."; }
    60%, 100% { content: "..."; }
  }
  footer {
    text-align: center; padding: 24px 16px;
    color: var(--muted); font-size: var(--fs-sm); border-top: 1px solid var(--border);
  }
  footer code {
    background: var(--panel); padding: 1px 6px; border-radius: 4px;
    border: 1px solid var(--border); font-size: var(--fs-xs);
  }

  /* ─── 专栏入口卡片 ───────────────────────────────── */
  .columns {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
  .column-card {
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px;
    text-decoration: none; color: var(--text);
    display: flex; flex-direction: column; gap: 6px;
    transition: all .15s; box-shadow: var(--shadow);
    border-left-width: 3px;
  }
  .column-card:hover { border-color: var(--accent); transform: translateY(-2px); }
  .col-policy        { border-left-color: var(--policy); }
  .col-domestic      { border-left-color: var(--domestic); }
  .col-international { border-left-color: var(--international); }
  .col-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); font-weight: 600; }
  .col-policy        .col-icon { color: var(--policy); }
  .col-domestic      .col-icon { color: var(--domestic); }
  .col-international .col-icon { color: var(--international); }
  .col-desc { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
  .col-meta { color: var(--muted); font-size: var(--fs-sm); margin-top: auto; padding-top: 6px; }
  .col-meta b { color: var(--accent); font-size: var(--fs-lg); font-weight: 700; }

  /* ─── 专栏页特定 ─────────────────────────────────── */
  .page-hero {
    background: var(--panel); border: 1px solid var(--border);
    border-left-width: 4px; border-radius: 10px;
    padding: 16px 20px; margin-bottom: 20px;
    box-shadow: var(--shadow);
  }
  .page-hero.cat-policy        { border-left-color: var(--policy); }
  .page-hero.cat-domestic      { border-left-color: var(--domestic); }
  .page-hero.cat-international { border-left-color: var(--international); }
  .page-hero.cat-favorites     { border-left-color: var(--warn); }
  .page-hero.cat-home          { border-left-color: var(--new); }
  .page-hero h1 {
    margin: 0; font-size: var(--fs-xl); font-weight: 700;
    display: flex; align-items: center; gap: 10px;
    letter-spacing: 0.2px;
  }
  .page-hero p {
    margin: 8px 0 0; color: var(--muted);
    font-size: var(--fs-base); line-height: var(--lh-normal);
  }

  /* 关键词筛选条 */
  .kw-bar {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin: 0 0 16px;
  }
  .kw-chip {
    background: var(--panel); color: var(--text);
    border: 1px solid var(--border); border-radius: 999px;
    padding: 4px 12px; cursor: pointer; font-size: var(--fs-sm);
    transition: all .15s; line-height: 1.4;
    display: inline-flex; align-items: center; gap: 5px;
  }
  .kw-chip:hover { background: var(--panel-2); border-color: var(--accent); color: var(--accent); }
  .kw-chip.active {
    background: var(--accent); color: #fff; border-color: var(--accent);
    font-weight: 600; box-shadow: 0 0 0 3px rgba(88,166,255,.15);
  }

  /* ─── Responsive ──────────────────────────────────
     窄屏（≤640）：头部紧凑、搜索独占一行、tab 横向滚不换行
  ─────────────────────────────────────────────────── */
  @media (max-width: 640px) {
    .container { padding: 0 14px; }
    .top { padding: 10px 0; gap: 8px; }
    .brand .logo { width: 34px; height: 34px; }
    .brand-name { font-size: var(--fs-lg); letter-spacing: 0.3px; }
    .brand-slogan { font-size: 10px; }
    .head-actions .updated { display: none; }
    .toolbar { padding-bottom: 10px; gap: 8px; flex-direction: column; align-items: stretch; }
    .tabs {
      flex-wrap: nowrap; overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      padding-bottom: 2px;
    }
    .tabs::-webkit-scrollbar { display: none; }
    .tab { flex-shrink: 0; }
    .search { width: 100%; min-width: 0; }
    .section-head { flex-wrap: wrap; gap: 4px; }
    .section-head .sub { font-size: var(--fs-xs); }
    .card { padding: 12px 14px 8px; }
    .card a.title { font-size: var(--fs-md); }
    .actions { justify-content: space-between; }
    .act span { display: none; }   /* 窄屏只留图标，省空间 */
    .act svg { width: 16px; height: 16px; }
    .pn { padding: 8px 10px; gap: 8px; }
    .pn .time { display: none; }
    .price-card { padding: 12px; }
    .columns { gap: 8px; }
    .column-card { padding: 14px; }
    .page-hero { padding: 14px 16px; }
    .page-hero h1 { font-size: var(--fs-lg); }
    .kw-bar { gap: 5px; margin-bottom: 14px; }
    .kw-chip { padding: 3px 10px; font-size: var(--fs-xs); }
  }

  /* 中等屏（641-960）：保持卡片紧凑 */
  @media (min-width: 641px) and (max-width: 960px) {
    .prices { grid-template-columns: repeat(2, 1fr); }
  }
