/* ============================================================
   买定离手的人生 · 金融导航站
   设计系统：近黑底 + 金色主色 + 多彩分类色
   ============================================================ */

:root {
  --bg: #0a0c10;
  --bg-card: #111318;
  --bg-dropdown: #13161e;
  --border: rgba(255, 255, 255, .07);
  --border-hover: rgba(240, 180, 41, .35);
  --text: #f6f9ff;
  --text-muted: #a6b2c7;
  --text-dim: #6b768c;
  --accent: #f0b429;
  --accent-dim: rgba(240, 180, 41, .12);
  --accent-border: rgba(240, 180, 41, .28);
  /* 手机端悬浮菜单专用绿色（不污染全站金色强调色） */
  --fab-green: #34d399;
  --fab-green-dim: rgba(52, 211, 153, .14);
  --fab-green-border: rgba(52, 211, 153, .34);
  /* 多彩分类色 */
  --c-gold: #f0b429;
  --c-blue: #60a5fa;
  --c-green: #34d399;
  --c-purple: #a78bfa;
  --c-red: #f87171;
  --c-orange: #fb923c;
  --up: #f87171;   /* A股惯例：涨红 */
  --down: #34d399; /* 跌绿 */
  --maxw: 1080px;
  --nav-h: 52px;
  --radius: 12px;
  --shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 8px 28px rgba(0, 0, 0, .28);
  /* 全站默认字体：圆体（macOS 圆体-简 / Windows 幼圆，圆润均匀），无圆体时回退文楷/宋体 */
  --font-song: "Yuanti SC", "YouYuan", "FZYuan-M02S", "STYuanti", "LXGW WenKai",
    "Songti SC", "STSong", "SimSun", "NSimSun", "Noto Serif SC",
    "Source Han Serif SC", sans-serif;
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-card: #ffffff;
  --bg-dropdown: #ffffff;
  --border: rgba(10, 12, 16, .08);
  --border-hover: rgba(240, 180, 41, .55);
  --text: #1a1d24;
  --text-muted: #5a6478;
  --text-dim: #8a96ac;
  --accent: #c8941a;
  --accent-dim: rgba(240, 180, 41, .16);
  --accent-border: rgba(240, 180, 41, .5);
  /* 手机端悬浮菜单专用绿色（浅色态） */
  --fab-green: #059669;
  --fab-green-dim: rgba(5, 150, 105, .14);
  --fab-green-border: rgba(5, 150, 105, .5);
  --shadow: 0 1px 3px rgba(20, 30, 50, .06), 0 6px 20px rgba(20, 30, 50, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  scrollbar-gutter: stable;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-song);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }


/* ============ NAV ============ */
nav.site-nav {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 200;
  background: rgba(10, 12, 16, .92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: .5px solid var(--border);
}
[data-theme="light"] nav.site-nav { background: rgba(244, 245, 247, .95); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; height: var(--nav-h);
  position: relative;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-coin { display: block; flex: none; filter: drop-shadow(0 0 6px rgba(240, 180, 41, .35)); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; line-height: 1.2; }
.brand-text {
  display: flex; flex-direction: column; line-height: 1.2;
  /* 网站标题随全站默认字体（圆体优先，回退文楷/宋体） */
  font-family: var(--font-song);
}
.brand-sub { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
/* 夜间模式下导航副标题「买定离手的人生」显示为金色（黄色调，呼应金币 logo） */
[data-theme="dark"] .brand-sub { color: var(--c-gold); }
.nav-links { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; padding-right: 0; }
.nav-item { position: relative; }
.nav-item > a {
  display: block; padding: 8px 13px; border-radius: 8px;
  color: var(--text-muted); font-size: 14px; font-weight: 500;
}
.nav-item > a:hover, .nav-item > a.active { color: var(--text); background: var(--accent-dim); }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px;
  background: var(--bg-dropdown); border: .5px solid var(--border);
  border-radius: 12px; padding: 8px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s, transform .16s, visibility .16s; z-index: 210;
}
.nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: 8px; color: var(--text); font-size: 12px;
}
.dropdown a:hover { background: var(--accent-dim); text-decoration: none; }
.dropdown a .d-ic { font-size: 14px; }
.dropdown a .d-meta { display: flex; flex-direction: column; line-height: 1.2; }
.dropdown a .d-tag { font-size: 9.5px; color: var(--text-muted); }

.header-actions { margin-left: 0; display: flex; align-items: center; gap: 8px; }
.search-input {
  width: 200px; max-width: 38vw; padding: 8px 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text); font-size: 13.5px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.subscribe-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 8px; font-size: 13.5px; font-weight: 600; color: #1a1206;
  background: linear-gradient(180deg, #f7c948, #f0b429);
  border: .5px solid var(--accent-border); white-space: nowrap;
}
.subscribe-btn:hover { filter: brightness(1.05); box-shadow: 0 4px 16px rgba(240, 180, 41, .35); }
.theme-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card);
  color: var(--text); font-size: 16px; cursor: pointer; transition: border-color .15s, background .15s;
}
.theme-btn:hover { border-color: var(--accent); }
.nav-toggle {
  display: none;
  width: 36px; height: 36px; place-items: center; flex: none;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card);
  color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; margin-left: 4px;
  transition: border-color .15s, background .15s;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-dim); }
.caret { display: none; }

/* 小屏：隐藏汉堡按钮，导航改由右下角悬浮菜单承载 */
@media (max-width: 900px) {
  .nav-inner { justify-content: space-between; }
  .nav-toggle { display: none; }
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: auto; right: 0;
    width: max-content; min-width: 200px; max-width: 86vw; max-width: min(86vw, 320px);
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg-dropdown); border: .5px solid var(--border);
    border-radius: 0 0 12px 12px; box-shadow: var(--shadow);
    max-height: 0; overflow: hidden; opacity: 0; visibility: hidden; padding: 0 12px;
    transition: max-height .26s ease, opacity .2s, visibility .2s, padding .26s;
  }
  .nav-inner.open .nav-links {
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
    opacity: 1; visibility: visible; padding: 10px 12px 16px;
  }
  .nav-item { position: static; }
  .nav-item > a {
    display: flex; align-items: center; justify-content: flex-start; text-align: left;
    padding: 12px 10px; font-size: 15px;
  }
  .nav-item > a .caret { font-size: 11px; color: var(--text-muted); transition: transform .2s; margin-left: 4px; }
  .nav-item.open > a .caret { transform: rotate(180deg); }
  .dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; background: transparent;
    padding: 0 0 4px 6px; max-height: 0; overflow: hidden;
    transition: max-height .22s ease, padding .22s;
  }
  .nav-item.open .dropdown { max-height: 1400px; overflow: visible; padding-bottom: 8px; }
  .dropdown a { font-size: 13px; justify-content: flex-start; text-align: left; }
  .dropdown a .d-tag { font-size: 10px; }
}
.wa-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid rgba(37, 211, 102, .4); border-radius: 8px;
  background: rgba(37, 211, 102, .12); color: #25d366;
  transition: border-color .15s, background .15s, transform .15s;
}
.wa-btn:hover { border-color: #25d366; background: rgba(37, 211, 102, .22); transform: translateY(-1px); }

/* ============ TICKER ============ */
.ticker-wrap {
  border-bottom: .5px solid var(--border); padding: 8px 0; overflow: hidden;
  background: rgba(255, 255, 255, .012);
}
.ticker-track { display: inline-flex; animation: ticker 42s linear infinite; white-space: nowrap; }
.ticker-track:hover { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 0 20px;
  font-size: 13px; color: var(--text-muted); border-right: .5px solid var(--border);
}
.tk b { color: var(--text); font-weight: 600; }
.tk .up { color: var(--up); }
.tk .down { color: var(--down); }

/* ============ HERO ============ */
.hero { max-width: var(--maxw); margin: 0 auto; padding: 38px 24px 26px; position: relative; overflow: hidden; }
.hero-glow {
  position: absolute; top: -30px; left: 38%; width: 520px; height: 320px;
  background: radial-gradient(ellipse at center, rgba(240, 180, 41, .06) 0%, transparent 68%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block; margin-bottom: 14px; padding: 5px 14px;
  border: 1px solid var(--accent-border); border-radius: 999px;
  color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .5px;
}
.hero h1 {
  font-size: 30px; font-size: clamp(26px, 4.2vw, 42px); font-weight: 800; line-height: 1.18;
  letter-spacing: -.03em; color: var(--text); margin: 0 0 14px; max-width: 820px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--text-muted); font-size: 16.5px; margin: 0 0 20px; max-width: 640px; }
.hero p.hero-sub { font-size: 13.5px; line-height: 1.65; margin: 0 0 18px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px;
  border-radius: 10px; font-size: 15px; font-weight: 700; color: #1a1206;
  background: linear-gradient(180deg, #f7c948, #f0b429); border: .5px solid var(--accent-border);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 6px 20px rgba(240, 180, 41, .35); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; padding: 11px 18px;
  border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
/* 无链接「查看教程」的悬浮提示 toast */
.toast-tip {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  max-width: 86vw;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(20, 22, 28, .92);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .3px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.toast-tip.show { opacity: 1; transform: translateX(-50%) translateY(0); }
a[data-no-tutorial] { cursor: pointer; }

/* 返回顶部按钮 */
.to-top {
  position: fixed;
  right: 20px; /* 移动端置于首页按钮（bottom:66）正下方，桌面端复位右下角 */
  bottom: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 200;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, border-color .15s, background .15s;
}
.to-top:hover { border-color: var(--accent); background: var(--accent-dim); }
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* 手机端悬浮菜单按钮 + 二级菜单浮层（汉堡按钮保持不变） */
.fab-menu {
  display: none; /* 仅手机端显示，见下方 @media */
  position: fixed;
  right: 20px;
  bottom: 120px; /* 位于首页按钮（bottom:66 + 高44）上方 */
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: linear-gradient(160deg, #10b981, #047857);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(5, 150, 105, .38), var(--shadow);
  transition: border-color .15s, background .15s, transform .2s ease;
}
.fab-menu[aria-expanded="true"] { border-color: #fff; background: linear-gradient(160deg, #059669, #065f46); transform: rotate(90deg); }
[data-theme="dark"] .fab-menu { background: linear-gradient(160deg, #10b981, #059669); box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 2px 10px rgba(5, 150, 105, .3); }
[data-theme="dark"] .fab-menu[aria-expanded="true"] { background: linear-gradient(160deg, #059669, #064e3b); }
.fab-panel {
  display: none; /* 默认隐藏，媒体查询内改为显示；显隐由 .show 控制透明度/指针 */
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  width: max-content; max-width: 90vw; /* 恰好包裹主文字，小屏不溢出 */
  max-height: min(80vh, 560px);
  overflow-y: auto;
  background: linear-gradient(160deg, #10b981, #047857);
  border: .5px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(5, 150, 105, .35), 0 14px 44px rgba(0, 0, 0, .18);
  padding: 8px;
  z-index: 210;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.96);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.fab-panel.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
/* 夜间模式：绿色面板保持绿色，仅强化阴影以便与暗色页面区分 */
[data-theme="dark"] .fab-panel {
  background: linear-gradient(160deg, #10b981, #059669);
  border-color: rgba(255, 255, 255, .24);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5), 0 14px 44px rgba(0, 0, 0, .45);
}
.fab-items a {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px;
  border-radius: 8px; color: #fff; font-size: 13px; text-decoration: none;
}
.fab-items a:hover { background: rgba(255, 255, 255, .18); color: #fff; text-decoration: none; }
.fab-items a + a { border-top: .5px solid rgba(255, 255, 255, .22); border-radius: 0; }
.fab-items a .d-ic { font-size: 14px; }
.fab-items a .d-meta { display: flex; flex-direction: column; line-height: 1.2; text-align: center; align-items: center; }
.fab-items a .d-tag { font-size: 9.5px; color: rgba(255, 255, 255, .78); }
@media (max-width: 900px) {
  .fab-menu { display: grid; }
  .fab-panel { display: block; }
}
.hero-hint { margin-top: 16px; font-size: 13px; color: var(--text-dim); }

/* ============ SECTION ============ */
.section { max-width: var(--maxw); margin: 0 auto; padding: 24px 24px; }

/* 关于本站：正文整体套一层卡片边框 */
.about-frame {
  max-width: var(--maxw);
  margin: 4px auto 32px;
  padding: 8px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.about-frame .section { padding: 22px 26px; }
.about-frame .section + .section { border-top: .5px solid var(--border); }
/* 关于本站：站长寄语上方的圆形头像（站长肖像，正中央） */
.about-avatar {
  display: block;
  width: 92px; height: 92px; border-radius: 50%;
  margin: 20px auto 10px;
  object-fit: cover;
  object-position: 32% 28%;
  border: 2px solid rgba(240, 180, 41, .55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35), 0 0 0 4px rgba(240, 180, 41, .10);
  user-select: none;
}
@media (max-width: 620px) {
  .about-avatar { width: 80px; height: 80px; margin: 16px auto 8px; }
}
@media (max-width: 620px) {
  .about-frame { margin: 4px 14px 28px; border-radius: 14px; }
  .about-frame .section { padding: 20px 18px; }
}
.sec-label { font-size: 13px; color: var(--text-dim); letter-spacing: .12em; font-weight: 600; margin-bottom: 7px; }
.sec-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
#toolbox .sec-title { margin-bottom: 18px; }
.sec-title-blog { margin-bottom: 20px; }
.sec-sub { font-size: 14.5px; color: var(--text-muted); margin: 0 0 18px; }
.sec-copy { font-weight: 400; color: var(--text); font-size: 15px; font-family: var(--font-song); }

/* ============ NEEDS GRID (场景卡片) ============ */
/* 4 张场景卡始终保持同一行（minmax(0,1fr) 允许收缩不溢出） */
.needs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.need-card {
  display: flex; flex-direction: column;
  background: var(--bg-card); border: .5px solid var(--border); border-radius: 14px;
  padding: 18px 16px 16px; text-align: center; cursor: pointer; min-width: 0;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.need-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0, 0, 0, .35); text-decoration: none; }
.need-card .nc-icon-wrap {
  width: 46px; height: 46px; border-radius: 12px; align-self: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px; flex-shrink: 0;
}
.need-card .nc-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.4; margin-bottom: 8px; padding-bottom: 8px; }
.need-card .nc-divider { height: .5px; margin-bottom: 8px; opacity: .6; }
.need-card .nc-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; flex: 1; margin-bottom: 12px; }
.need-card .nc-cta { font-size: 13px; font-weight: 700; margin-top: auto; }

/* 四色主题：图标底 / 分隔线 / CTA / 悬停边框 */
.nc-au .nc-icon-wrap { background: rgba(240, 180, 41, .12); }
.nc-bl .nc-icon-wrap { background: rgba(96, 165, 250, .12); }
.nc-gr .nc-icon-wrap { background: rgba(52, 211, 153, .12); }
.nc-pu .nc-icon-wrap { background: rgba(167, 139, 250, .12); }
.nc-au .nc-divider { background: rgba(240, 180, 41, .5); }
.nc-bl .nc-divider { background: rgba(96, 165, 250, .5); }
.nc-gr .nc-divider { background: rgba(52, 211, 153, .5); }
.nc-pu .nc-divider { background: rgba(167, 139, 250, .5); }
.nc-au .nc-cta { color: #f0b429; }
.nc-bl .nc-cta { color: #60a5fa; }
.nc-gr .nc-cta { color: #34d399; }
.nc-pu .nc-cta { color: #a78bfa; }
.nc-au:hover { border-color: rgba(240, 180, 41, .38); }
.nc-bl:hover { border-color: rgba(96, 165, 250, .38); }
.nc-gr:hover { border-color: rgba(52, 211, 153, .38); }
.nc-pu:hover { border-color: rgba(167, 139, 250, .38); }

/* 浅色主题适配 */
[data-theme="light"] .need-card .nc-name { color: #1a1d24; }
[data-theme="light"] .need-card .nc-desc { color: #52586a; }
[data-theme="light"] .nc-au .nc-icon-wrap { background: rgba(240, 180, 41, .1); }
[data-theme="light"] .nc-bl .nc-icon-wrap { background: rgba(96, 165, 250, .1); }
[data-theme="light"] .nc-gr .nc-icon-wrap { background: rgba(52, 211, 153, .1); }
[data-theme="light"] .nc-pu .nc-icon-wrap { background: rgba(167, 139, 250, .1); }
[data-theme="light"] .nc-au .nc-divider { background: rgba(240, 180, 41, .6); }
[data-theme="light"] .nc-bl .nc-divider { background: rgba(96, 165, 250, .6); }
[data-theme="light"] .nc-gr .nc-divider { background: rgba(52, 211, 153, .6); }
[data-theme="light"] .nc-pu .nc-divider { background: rgba(167, 139, 250, .6); }
[data-theme="light"] .nc-au .nc-cta { color: #b45309; }
[data-theme="light"] .nc-bl .nc-cta { color: #2563eb; }
[data-theme="light"] .nc-gr .nc-cta { color: #059669; }
[data-theme="light"] .nc-pu .nc-cta { color: #7c3aed; }

/* 窄屏：保持同一行，内容紧凑适配 */
@media (max-width: 760px) {
  .needs-grid { gap: 8px; }
  .need-card { padding: 12px 10px; }
  .need-card .nc-icon-wrap { width: 36px; height: 36px; font-size: 17px; margin-bottom: 8px; }
  .need-card .nc-name { font-size: 12.5px; margin-bottom: 6px; padding-bottom: 6px; }
  .need-card .nc-desc { font-size: 11.5px; line-height: 1.55; margin-bottom: 8px; }
  .need-card .nc-divider { margin-bottom: 6px; }
  .need-card .nc-cta { font-size: 11.5px; }
}

.copy-btn {
  margin-left: auto; border: none; background: transparent; color: var(--accent);
  cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 5px;
}
.copy-btn:hover { background: rgba(240, 180, 41, .18); }
.copy-btn.ok { color: #34d399; }
[data-theme="light"] .copy-btn.ok { color: #059669; }

/* ============ SPOTLIGHT (精选) ============ */
/* 值得一读：3 张卡片等宽等高网格，占位均匀（≤760px 自动单列） */
.spotlight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sp-card {
  display: flex; overflow: hidden; background: var(--bg-card);
  border: .5px solid var(--border); border-radius: var(--radius); text-decoration: none;
  transition: border-color .18s, transform .15s;
}
.sp-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.sp-side {
  width: 56px; flex: none; display: grid; place-items: center; font-size: 24px;
  background: rgba(240, 180, 41, .04); border-right: .5px solid var(--border);
}
/* 内容纵向居中：卡片被网格拉成等高后，标题+摘要整体居中，视觉更匀称 */
.sp-body { padding: 14px 18px; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.sp-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.sp-title { font-size: 16px; font-weight: 700; color: var(--text); }
.sp-cta { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
/* 小屏：单列 + 只显示文章标题（隐藏摘要，卡片更紧凑整齐） */
@media (max-width: 760px) {
  .spotlight-grid { grid-template-columns: 1fr; }
}


/* ============ JOURNEY BANNER ============ */
.jbanner {
  background: var(--bg-card); border: .5px solid rgba(248, 113, 113, .22);
  border-radius: 16px; padding: 26px; display: flex; flex-direction: column;
  align-items: flex-start;
}
.jb-eyebrow { font-size: 13px; color: var(--c-orange); font-weight: 600; letter-spacing: .08em; }
.jb-title { font-size: 19px; font-weight: 700; color: var(--text); margin: 6px 0 6px; }
.jb-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; max-width: 560px; }
.jb-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.jb-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 12px; border-radius: 10px; background: rgba(240, 180, 41, .06);
  border: .5px solid var(--accent-border); min-width: 64px; text-align: center;
}
.jb-step .jb-n { font-size: 11.5px; color: var(--text-muted); }
.jb-step .jb-t { font-size: 14px; font-weight: 700; color: var(--text); }
.jb-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  align-self: center; margin-top: 14px; padding: 14px 22px;
  border-radius: 10px; font-weight: 700; font-size: 15px; color: #1a1206; white-space: nowrap;
  background: linear-gradient(180deg, #f7c948, #f0b429); border: .5px solid var(--accent-border);
}
.jb-cta:hover { filter: brightness(1.05); }

/* 手机端：放开自适应对齐 —— banner 居中、步骤网格自适应铺满 */
@media (max-width: 760px) {
  .jbanner { align-items: center; text-align: center; }
  .jb-eyebrow, .jb-title, .jb-desc { text-align: center; }
  .jb-desc { max-width: 100%; }
}
@media (max-width: 560px) {
  .jbanner { padding: 20px 14px; }
  .jb-title { font-size: 18px; }
  .jb-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px; width: 100%; margin-top: 12px;
  }
  .jb-step { min-width: 0; width: 100%; padding: 8px 2px; }
  .jb-step .jb-n { font-size: 11px; }
  .jb-step .jb-t { font-size: 13px; }
}

.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-item {
  display: block; padding: 20px 22px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); transition: transform .15s, border-color .15s;
}
.post-item:hover { transform: translateY(-2px); border-color: var(--border-hover); text-decoration: none; }
.post-item h3 { margin: 0 0 6px; font-size: 18px; color: var(--text); }
.post-item .excerpt { color: var(--text-muted); font-size: 14px; margin: 0 0 10px; }
.post-item .post-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 12px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-dim); color: var(--accent); font-size: 12px; }
/* 标签容器：flex 换行 + 行列间隙，避免手机端多标签换行后两行紧贴 */
.post-tags { display: inline-flex; flex-wrap: wrap; gap: 8px 6px; vertical-align: middle; align-items: center; }
/* 文章头部元信息：日期 + 标签 一起换行时也保持间隙 */
.article .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

.article {
  max-width: 820px; margin: 24px auto; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 40px;
}
.article-header { margin-bottom: 22px; border-bottom: 1px solid var(--border); padding-bottom: 18px; }
.article-header h1 { font-size: 28px; margin: 0 0 10px; letter-spacing: -.02em; color: var(--text); }
.article-header .post-meta { color: var(--text-dim); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }

/* 文章分享按钮：位于文章头部元信息行右侧，点击展开渠道面板 */
.post-share { position: relative; margin-left: auto; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--accent-dim); color: var(--accent);
  font-size: 12.5px; font-weight: 600; line-height: 1.4;
  font-family: var(--font-song);
  cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.share-btn:hover { background: var(--accent); color: #0a0c10; border-color: var(--accent-border); }
.share-btn svg { width: 13px; height: 13px; flex: none; }
.fab-ico { display: none; }
.share-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 264px; padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.post-share.open .share-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.share-panel-title { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.share-channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.share-ch {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px; border-radius: 9px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text); font-size: 11.5px; line-height: 1.2;
  font-family: var(--font-song); cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.share-ch:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-border); }
.ch-ico { font-size: 17px; line-height: 1; }
.share-ch .ch-ico svg { width: 20px; height: 20px; display: block; }
@media (max-width: 560px) {
  /* .post-share 在 mobile 下 static 化，让 fixed panel 跳出局部相对容器、相对 viewport 居中 */
  .post-share { position: static; margin-left: 0; width: 100%; margin-top: 4px; display: flex; justify-content: flex-end; }
  .share-btn { width: auto; padding: 6px 16px; font-size: 12.5px; }
  /* 面板 fixed 居中：width 写死 296（避免 headless 模拟器 ICB≠viewport 偏差），left/right:0 + margin:auto 居中 */
  .share-panel {
    position: fixed; top: 50%; left: 0; right: 0;
    width: 296px; max-width: calc(100% - 16px);
    margin: 0 auto;
    transform: translateY(calc(-50% - 6px));
  }
  .post-share.open .share-panel { transform: translateY(-50%); }
  .share-channels { gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .share-ch { padding: 9px 2px; font-size: 11px; min-width: 0; }
  .ch-ico { font-size: 16px; }
  .share-ch .ch-ico svg { width: 18px; height: 18px; }
}

/* 分享按钮浮动模式（全端生效）：紧贴文章右侧、垂直居中于视口，点击展开渠道面板（向左弹出） */
.post-share.share-floating {
  position: fixed; top: 50%; transform: translateY(-50%);
  margin-left: 0; margin-top: 0; width: auto; display: block; z-index: 80;
}
/* 默认（手机/窄屏）：仅显示分享图标，圆形悬浮胶囊 */
.post-share.share-floating .share-btn {
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  justify-content: center;
  background: var(--accent); color: #0a0c10; border-color: var(--accent-border);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
}
.post-share.share-floating .share-btn:hover { background: var(--accent); color: #0a0c10; filter: brightness(1.08); }
.post-share.share-floating .share-btn .fab-ico { display: block; line-height: 1; }
.post-share.share-floating .share-btn .fab-ico svg { width: 22px; height: 22px; display: block; }
.post-share.share-floating .share-btn .fab-txt { display: none; }
.post-share.share-floating .share-panel {
  position: absolute; top: auto; bottom: 100%; right: 0; left: auto; width: 264px; max-width: calc(100vw - 32px); margin: 0;
  transform: translateY(-6px);
}
.post-share.share-floating.open .share-panel { transform: translateY(0); }
/* 桌面端（≥901px）：竖排「分享」文字胶囊 */
@media (min-width: 901px) {
  .post-share.share-floating .share-btn {
    width: 46px; height: auto; padding: 16px 0; border-radius: 14px; flex-direction: column;
  }
  .post-share.share-floating .share-btn .fab-ico { font-size: 18px; }
  .post-share.share-floating .share-btn .fab-ico svg { width: 20px; height: 20px; }
  .post-share.share-floating .share-btn .fab-txt {
    display: block; writing-mode: vertical-rl; letter-spacing: .2em; font-size: 13px; font-weight: 700;
  }
}

/* 文章分段卡片阅读 */
.post-cards { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  transition: border-color .2s ease, transform .2s ease;
}
.post-card:hover { border-color: var(--accent-border, rgba(255,255,255,.18)); }
/* 文章内相邻卡片框（如「科学上网配置建议」与「扩展阅读」）之间留白，避免紧挨 */
.post-card + .post-card { margin-top: 22px; }
/* 文章内卡片网格（如 vircs-acgrid 住宅IP卡片）后紧跟的卡片框（如「科学上网配置建议」）之间留白 */
.acgrid + .post-card { margin-top: 22px; }
.post-card-h {
  font-size: 19px; font-weight: 700; margin: 0 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  color: var(--text); letter-spacing: -.01em;
}
.post-card .markdown-body { font-size: 15.5px; }
.post-card .markdown-body h1, .post-card .markdown-body h2,
.post-card .markdown-body h3, .post-card .markdown-body h4 { margin: .4em 0 .5em; }
.post-card .markdown-body h2 { border-bottom: none; padding-bottom: 0; }
.post-card .markdown-body > :first-child { margin-top: 0; }
.post-card .markdown-body > :last-child { margin-bottom: 0; }
/* 扩展阅读框：长链接（如 GitHub 地址）在窄屏自动换行，避免撑破卡片 */
.ext-read .markdown-body a { word-break: break-all; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .ext-read { padding: 16px 16px; }
  .ext-read .post-card-h { font-size: 17px; margin-bottom: 10px; padding-bottom: 8px; }
}
/* 文章目录（post.toc 为真时渲染在文章头部下方） */
.post-toc {
  margin: 18px 0 4px; padding: 16px 18px 14px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
}
.post-toc-h {
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 10px;
}
.post-toc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; }
.toc-link {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px; border-radius: 8px; cursor: pointer;
  font-size: 14.5px; line-height: 1.5; color: var(--text);
  transition: background .15s, color .15s;
}
.toc-link i {
  flex: none; min-width: 18px; font-style: normal; font-size: 12.5px;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.toc-link:hover { background: var(--accent-dim); color: var(--accent); }
.toc-link:hover i { color: var(--accent); }
@media (max-width: 560px) { .post-toc-list { grid-template-columns: 1fr; } }
/* 点击目录滚动时避免被吸顶栏遮挡 */
[id^="toc-sec-"], [id^="sci-toc-"] { scroll-margin-top: calc(var(--nav-h) + 56px); }
/* 科学上网文「前言」锚点：0 高度、位于正文首段上方，点击后首段正好落在阅读起点 */
.sci-anchor { display: block; height: 0; overflow: hidden; }
/* 跳转后目标章节短暂高亮 */
.toc-flash { animation: tocFlash 1.2s ease; }
@keyframes tocFlash {
  0%, 40% { background: var(--accent-dim); }
  100% { background: transparent; }
}


/* Markdown body */
.markdown-body { font-size: 16px; color: var(--text); }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { margin: 1.6em 0 .6em; line-height: 1.3; color: var(--text); }
.markdown-body h2 { border-bottom: 1px solid var(--border); padding-bottom: .3em; }
.markdown-body p { margin: .8em 0; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5em; }
.markdown-body li { margin: .3em 0; }
.markdown-body blockquote { margin: 1em 0; padding: .6em 1.1em; border-left: 4px solid var(--accent); background: var(--accent-dim); border-radius: 0 8px 8px 0; color: var(--text-muted); }
.markdown-body code { background: rgba(255,255,255,.06); padding: .15em .4em; border-radius: 5px; font-size: .9em; font-family: "SFMono-Regular", Consolas, Menlo, monospace; color: var(--text); }
.markdown-body pre { background: #0b0e13; color: #e2e8f0; padding: 18px 20px; border-radius: 12px; overflow: auto; margin: 1.2em 0; border: .5px solid var(--border); }
.markdown-body pre code { background: transparent; padding: 0; color: inherit; font-size: .88em; }
.markdown-body img { max-width: 100%; border-radius: 10px; display: block; margin: 16px auto; border: 1px solid rgba(128,128,128,.22); }
.markdown-body table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 8px 12px; }
.markdown-body th { background: var(--bg); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.markdown-body a { color: var(--accent); }
.markdown-body .reg-tip { display: block; margin: .9em 0; padding: .7em 1em; color: var(--c-red); background: rgba(248, 113, 113, .1); border-left: 3px solid var(--c-red); border-radius: 0 8px 8px 0; }
.markdown-body .red-bold { color: var(--c-red); font-weight: 700; }
[data-theme="light"] .markdown-body .red-bold { color: #dc2626; }
.article-lead { display: block; margin: 0 0 18px; padding: 14px 16px; border: 1px solid rgba(248, 113, 113, .45); border-radius: 12px; background: rgba(248, 113, 113, .1); color: var(--text); font-weight: 700; line-height: 1.6; }
.article-lead .lead-label { font-size: 18px; font-weight: 700; letter-spacing: .06em; color: var(--text); margin-bottom: 8px; }
[data-theme="light"] .article-lead { color: #1f2937; background: rgba(220, 38, 38, .07); border-color: rgba(220, 38, 38, .35); }
.article-preface { display: block; margin: 0 0 18px; padding: 14px 16px; border: 1px solid rgba(240, 180, 41, .5); border-radius: 12px; background: rgba(240, 180, 41, .1); color: var(--text); font-weight: 400; line-height: 1.7; white-space: pre-wrap; }
.article-preface .preface-label { font-size: 18px; font-weight: 700; letter-spacing: .06em; color: var(--accent); margin-bottom: 8px; }
[data-theme="light"] .article-preface { color: #1f2937; background: rgba(240, 180, 41, .08); border-color: rgba(217, 145, 12, .4); }
.markdown-body .tip-box { display: block; margin: 1em 0; padding: 14px 16px; color: var(--text); background: rgba(240, 180, 41, .1); border: 1px solid rgba(240, 180, 41, .45); border-radius: 12px; }
.markdown-body a.wa-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: filter .15s, transform .15s;
}
.markdown-body a.wa-cta:hover { filter: brightness(1.05); transform: translateY(-1px); }
.markdown-body a.wa-cta svg { display: block; }
/* 关于本站「联系方式」卡片模式：每个渠道一张横向卡片（图标 + 名称 + 账号 + 箭头） */
.markdown-body .contact-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
/* 文章末尾联系方式卡片：纵向堆叠，WhatsApp 在上、邮箱在下 */
.markdown-body .contact-cards.post-row { grid-template-columns: 1fr; }
.markdown-body .contact-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  text-decoration: none; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.markdown-body .contact-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.16); border-color: var(--accent-border); }
.markdown-body .contact-card .cc-ic { width: 46px; height: 46px; box-sizing: border-box; padding: 9px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); overflow: hidden; }
.markdown-body .contact-card .cc-ic svg { display: block; width: 100%; height: 100%; }
@media (max-width: 620px) {
  .markdown-body .contact-card .cc-ic { width: 40px; height: 40px; padding: 8px; border-radius: 10px; }
}
@media (max-width: 440px) {
  .markdown-body .contact-cards { grid-template-columns: 1fr; }
}
.markdown-body .contact-card .cc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.markdown-body .contact-card .cc-t { font-family: var(--font-song); font-weight: 700; font-size: 15px; }
.markdown-body .contact-card .cc-d { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.markdown-body .contact-card .cc-intro { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; opacity: .92; }
.markdown-body .contact-card .cc-ar { flex: none; color: var(--text-dim); font-size: 18px; transition: transform .15s, color .15s; }
.markdown-body .contact-card:hover .cc-ar { transform: translateX(3px); color: var(--accent); }
.markdown-body .contact-card.wa:hover { border-color: #25D366; }
.markdown-body .contact-card.mail:hover { border-color: #3B82F6; }
.markdown-body .contact-card.x:hover { border-color: rgba(255,255,255,.4); }
.markdown-body .contact-card.yt:hover { border-color: #FF0000; }
.markdown-body .contact-card.link:hover { border-color: #0088cc; }
/* 商务邮箱卡片：复制 / 发送邮件 按钮 */
.markdown-body .contact-card .cc-actions { display: flex; flex-direction: column; gap: 6px; margin-left: auto; flex: none; }
.markdown-body .contact-card .cc-btn {
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1;
  padding: 7px 13px; border-radius: 10px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  transition: border-color .18s, background .18s, color .18s, transform .12s;
  white-space: nowrap;
}
.markdown-body .contact-card .cc-btn:hover { border-color: #3B82F6; color: #3B82F6; }
.markdown-body .contact-card .cc-btn:active { transform: translateY(1px); }
.markdown-body .contact-card .cc-btn.cc-copy.copied { border-color: #25D366; color: #25D366; }
.markdown-body .contact-card .cc-btn.cc-send { background: #3B82F6; border-color: #3B82F6; color: #fff; }
.markdown-body .contact-card .cc-btn.cc-send:hover { background: #2f74e0; border-color: #2f74e0; color: #fff; }
@media (max-width: 620px) {
  .markdown-body .contact-card .cc-btn { padding: 6px 11px; font-size: 12px; }
}
.markdown-body a.reg-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 22px; border-radius: 999px;
  background: var(--accent); color: #1a1206;
  font-weight: 700; text-decoration: none;
  transition: filter .15s, transform .15s;
}
.markdown-body a.reg-cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
.markdown-body .reg-code {
  display: inline-block; margin-top: 10px;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(240, 180, 41, .12);
  border: 1px dashed rgba(240, 180, 41, .5);
  color: var(--accent); font-weight: 600; font-size: 13px;
}
.markdown-body .reg-code b { font-family: "SFMono-Regular", Consolas, Menlo, monospace; letter-spacing: .05em; }

/* ============ FOOTER ============ */
.site-footer { border-top: .5px solid var(--border); margin-top: 60px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 18px 24px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-inner-center { justify-content: center; }
.footer-inner p { margin: 0; font-size: 13px; color: var(--text-dim); }
.footer-soc { display: flex; gap: 14px; }
.footer-soc-center { justify-content: center; padding: 8px 24px 0; }
.footer-soc a { color: var(--text-muted); font-size: 13px; }
.footer-soc a:hover { color: var(--accent); }
.footer-disclaimer {
  text-align: center; font-size: 12px; color: var(--text-dim);
  padding: 0 24px 16px; line-height: 1.6;
}

.empty { text-align: center; color: var(--text-dim); padding: 60px 0; }
.empty a { color: var(--accent); }

.back-home {
  display: inline-block; padding: 11px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--text);
  border: 1px solid var(--border); background: none; text-decoration: none;
}
.back-home:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
/* 文章底部「返回文章列表 / 返回首页」两个按钮：居中并列 */
.post-back-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: var(--maxw); margin: 0 auto; padding: 18px 24px 44px; }

/* ============ 工具库 ============ */
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.cat-tab {
  font-size: 14px; font-weight: 600; padding: 5px 13px; border-radius: 20px;
  border: .5px solid var(--border); background: none; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.cat-tab.on, .cat-tab:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-border); }

/* ===== 首页「新人必备工具」：二级菜单吸顶横滑（参考加密Web3 页内导航） ===== */
/* 保留「单卡片区切换分类」：仅二级菜单吸顶横滑，点击原地切换卡片 */
.toolbox-stage { position: relative; }
.toolbox-pin { /* 不再钉住整块，回归普通流式容器 */ }

/* 二级菜单：吸顶 + 横向可滑动（与加密Web3 页内导航一致的滑动体验） */
.toolbox-pin .cat-tabs {
  position: -webkit-sticky; position: sticky;
  top: var(--nav-h);
  z-index: 120;
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 0 18px;
  padding: 10px 0;
  background: rgba(10, 12, 16, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: .5px solid var(--border);
}
.toolbox-pin .cat-tabs::-webkit-scrollbar { display: none; }
.toolbox-pin .cat-tabs .cat-tab { flex: none; }
.cat-tabs-ind {
  position: absolute; bottom: 0; left: 0;
  height: 2px; width: 0;
  background: var(--accent); border-radius: 2px;
  transition: left .3s cubic-bezier(.22,1,.36,1), width .3s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}
.cat-tab { transition: background .25s, color .25s, border-color .25s; white-space: nowrap; }
.more-wrap { display: flex; justify-content: center; margin-top: 14px; }

/* 浅色主题下吸顶菜单底色 */
[data-theme="light"] .toolbox-pin .cat-tabs { background: rgba(244, 245, 247, .95); }
.more-wrap.hid { display: none; }
.more-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; border-radius: 999px;
  border: 1px solid var(--accent-border); background: var(--accent-dim);
  color: var(--accent); font-weight: 600; font-size: 14px; text-decoration: none;
  transition: filter .15s ease, transform .15s ease, background .15s ease, color .15s ease;
}
.more-btn:hover { filter: brightness(1.06); transform: translateY(-1px); background: var(--accent); color: #fff; }
[data-theme="light"] .more-btn:hover { color: #fff; }

.acgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.ac {
  background: var(--bg-card); border: .5px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; min-width: 0; position: relative;
  transition: border-color .18s, transform .18s;
}
.ac:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.ac.hid { display: none; }
.ac-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.ac-logo {
  width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; flex-shrink: 0; border: .5px solid; overflow: hidden;
  background: var(--accent-dim); color: var(--accent); border-color: var(--accent-border);
}
.ac-logo-img {
  width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; border-radius: 8px;
  align-self: center; background: transparent;
}
/* 纯白底 logo（如 OKX）只在亮色主题下反色，避免在浅色卡片上消失 */
[data-theme="light"] .ac-logo-img.invert-on-light { filter: invert(1); }
/* 深色 logo（如 1inch 新版黑标）在夜间主题下反相为白，避免在深色卡片上消失 */
[data-theme="dark"] .ac-logo-img.invert-on-dark,
[data-theme="dark"] .dex-logo-img.invert-on-dark { filter: invert(1); }
.ac-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.ac-region { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; line-height: 1.3; }
.ac-tag { font-size: 13px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; white-space: pre-line; }
.ac-founded { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.ac-perks {
  position: absolute; top: 10px; right: 10px; max-width: 66%; display: flex;
  flex-direction: column; gap: 6px; align-items: flex-end; z-index: 2; text-align: right;
}
.ac-perk {
  display: inline-block; max-width: 100%; text-align: right;
  font-size: 11.5px; font-weight: 700; line-height: 1.25; color: #34d399;
  background: rgba(52, 211, 153, .12); border: .5px solid rgba(52, 211, 153, .35);
  padding: 2px 7px; border-radius: 999px;
}
[data-theme="light"] .ac-perk { color: #059669; background: rgba(5, 150, 105, .1); border-color: rgba(5, 150, 105, .3); }
.ac-perk.red { color: #f87171; background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); }
.ac-perk.white { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); }
[data-theme="light"] .ac-perk.red { color: #dc2626; background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .3); }
[data-theme="light"] .ac-perk.white { color: #fff; background: rgba(15, 18, 24, .78); border-color: rgba(15, 18, 24, .5); }
.ac-perk-lines { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.ac-perk-line {
  align-self: flex-start; text-align: left;
  font-size: 11.5px; font-weight: 700; line-height: 1.3; color: #34d399;
  background: rgba(52, 211, 153, .12); border: .5px solid rgba(52, 211, 153, .35);
  padding: 3px 9px; border-radius: 8px;
}
.ac-perk-line.red { color: #f87171; background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .35); }
.ac-perk-line.white { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); }
[data-theme="light"] .ac-perk-line { color: #059669; background: rgba(5, 150, 105, .1); border-color: rgba(5, 150, 105, .3); }
[data-theme="light"] .ac-perk-line.red { color: #dc2626; background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .3); }
[data-theme="light"] .ac-perk-line.white { color: #fff; background: rgba(15, 18, 24, .78); border-color: rgba(15, 18, 24, .5); }
.ac-code {
  display: flex; align-items: center; justify-content: space-between; gap: 5px;
  background: rgba(255, 255, 255, .03); border: .5px solid var(--border); border-radius: 6px;
  padding: 5px 9px; margin-bottom: 10px;
}
[data-theme="light"] .ac-code { background: rgba(0, 0, 0, .03); }
.ac-cl { font-size: 13px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; }
.ac-cv { font-size: 14px; font-weight: 700; font-family: "SFMono-Regular", Consolas, Menlo, monospace; letter-spacing: .04em; color: #ef4444; flex: 1; text-align: center; overflow-wrap: anywhere; word-break: break-word; }
.ac-cv.plain { font-size: 13px; font-weight: 400; font-family: inherit; letter-spacing: normal; color: var(--text-dim); text-align: center; flex: 1; }
[data-theme="light"] .ac-cv { color: #b45309; }
.ac-cp {
  font-size: 13px; font-weight: 700; padding: 2px 7px; border-radius: 3px; white-space: nowrap;
  border: .5px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05);
  color: var(--text-muted); cursor: pointer; transition: all .12s;
}
.ac-cp:hover, .ac-cp.ok { background: rgba(52, 211, 153, .15); color: #34d399; border-color: rgba(52, 211, 153, .3); }
[data-theme="light"] .ac-cp { background: rgba(0, 0, 0, .05); border-color: rgba(0, 0, 0, .1); color: #52586a; }
.ac-no {
  font-size: 13px; color: var(--text-dim); background: rgba(255, 255, 255, .02);
  border: .5px solid var(--border); border-radius: 6px; padding: 5px 9px; margin-bottom: 10px; text-align: center;
}
.ac-btn {
  display: block; text-align: center; font-size: 14px; font-weight: 700; padding: 7px 0; border-radius: 7px;
  background: var(--accent); color: #0a0c10; text-decoration: none; margin-top: auto;
  transition: opacity .15s;
}
.ac-btn:hover { opacity: .88; }
.ac-btn.ac-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
/* 文章正文（.markdown-body）里的卡片按钮：被 `.markdown-body a{color:var(--accent)}`（特异度 0,1,1）覆盖成金色，与按钮背景同色不可见。用更高特异度 (0,2,0) 显式恢复深色文字。 */
.markdown-body .ac-btn { color: #0a0c10; }

/* 科学上网文章内嵌工具卡：固定 2 列，阅读更聚焦 */
/* 文章内嵌机场卡片：桌面每行 5 张，移动端自适应（3 / 2 / 1 列）。
   特异度 (0,2,0) 高于通用 .acgrid / .broker-acgrid 媒体查询，确保响应式始终生效 */
.broker-acgrid.vpn-acgrid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 900px) {
  .broker-acgrid.vpn-acgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .broker-acgrid.vpn-acgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .broker-acgrid.vpn-acgrid .ac { padding: 14px 10px; }
  .broker-acgrid.vpn-acgrid .ac-tag { font-size: 12px; line-height: 1.35; }
  .broker-acgrid.vpn-acgrid .ac-btn { padding: 6px 16px; font-size: 13px; margin-top: 12px; }
}
@media (max-width: 400px) {
  .broker-acgrid.vpn-acgrid { grid-template-columns: 1fr; }
  .broker-acgrid.vpn-acgrid .ac { padding: 16px 12px; }
}
/* 机场卡片：按钮恰好包住文字（非满宽），卡片内居中（特异度 (0,3,0) 压过通用 .broker-acgrid .ac-btn 满宽规则） */
.broker-acgrid.vpn-acgrid .ac-btn {
  width: auto; display: inline-block; padding: 7px 18px; align-self: center;
}
/* Vircs 单卡网格：与前面机场卡同款 .ac 卡槽，单卡时左对齐、宽度与机场卡协调（auto-fill 不撑满整行） */
.broker-acgrid.vircs-acgrid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
/* 静态住宅IP和VPS购买：按钮恰好包住文字（非满宽），卡片内居中 */
.broker-acgrid.vircs-acgrid .ac-btn {
  width: auto; display: inline-block; padding: 7px 18px; align-self: center;
}
/* 移动端：卡片网格与按钮自适应屏幕 */
@media (max-width: 560px) {
  .broker-acgrid.vircs-acgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .broker-acgrid.vircs-acgrid .ac { padding: 14px 10px; }
  .broker-acgrid.vircs-acgrid .ac-tag { font-size: 12px; line-height: 1.35; }
  .broker-acgrid.vircs-acgrid .ac-btn { padding: 6px 16px; font-size: 13px; margin-top: 12px; }
}
@media (max-width: 400px) {
  .broker-acgrid.vircs-acgrid { grid-template-columns: 1fr; }
  .broker-acgrid.vircs-acgrid .ac-btn { align-self: center; }
}
/* 科学上网文章：常用的代理协议工具（跨境番外篇 9 个工具），桌面每行 5 张，移动端自适应 */
.acgrid.proxy-acgrid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
/* 代理工具卡片：按钮恰好包住文字（非满宽），卡片内居中（特异度 (0,3,0) 压过通用 .exchange-grid .ac-btn 满宽规则） */
.acgrid.proxy-acgrid .ac-btn {
  width: auto; display: inline-block; padding: 7px 18px; align-self: center;
}
@media (max-width: 900px) { .acgrid.proxy-acgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) {
  .acgrid.proxy-acgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .acgrid.proxy-acgrid .ac { padding: 14px 10px; }
  .acgrid.proxy-acgrid .ac-tag { font-size: 12px; line-height: 1.35; }
  .acgrid.proxy-acgrid .ac-btn { padding: 6px 16px; font-size: 13px; margin-top: 12px; }
}
@media (max-width: 400px) {
  .acgrid.proxy-acgrid { grid-template-columns: 1fr; }
  .acgrid.proxy-acgrid .ac { padding: 16px 12px; }
}

/* 文章内嵌的软件下载卡片（MT4 / MT5）：与「交易券商精选」使用完全相同的 ac 卡片体系（同一 .broker-acgrid 容器规则），
   唯一差异：固定 2 列（不论屏幕宽度），因为文章里只有两张卡。 */
.mt-acgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 16px;
}
.mt-acgrid .ac { padding: 14px 12px; align-items: center; text-align: center; }
.mt-acgrid .ac-hd { flex-direction: column; text-align: center; gap: 7px; margin-bottom: 8px; }
/* 文章 markdown 容器里的 logo 不要再被 .markdown-body img 覆盖样式 */
/* MT4/MT5 用紧凑方形图标（橙底圆角方块 + 白色数字），自带底色，无需白底 chip */
.mt-acgrid .ac-logo-img {
  width: 52px; height: 52px; object-fit: contain; border-radius: 13px;
  align-self: center; background: transparent; border: none; margin: 0; display: inline-block;
}
[data-theme="light"] .mt-acgrid .ac-logo-img { background: transparent; padding: 0; }
.mt-acgrid .ac-tag { font-size: 12px; line-height: 1.35; margin-top: 2px; }
.mt-acgrid .ac-perks { position: static; max-width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; margin: 0 0 8px; }
.mt-acgrid .ac-perk-line { align-self: center; text-align: center; }
.mt-acgrid .ac-code { flex-direction: column; gap: 4px; padding: 7px 8px; }
.mt-acgrid .ac-cv, .mt-acgrid .ac-cv.plain { text-align: center; }
.mt-acgrid.acgrid .ac-btn { width: auto; display: inline-block; padding: 8px 20px; margin-top: 12px; color: #0a0c10; text-decoration: none; }
[data-theme="light"] .mt-acgrid .ac-btn { color: #0a0c10; }
/* corner 角标：右上角 */
.mt-acgrid .ac.corner-perk .ac-perks {
  position: absolute; top: 0; right: 0; margin: 0; max-width: 58%;
  flex-direction: column; flex-wrap: nowrap; justify-content: flex-start;
  align-items: flex-end; text-align: right; z-index: 3;
}
.mt-acgrid .ac.corner-perk .ac-hd { margin-top: 24px; }
@media (max-width: 560px) { .mt-acgrid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .acgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .acgrid { grid-template-columns: 1fr; }
}

/* 交易券商精选 / 交易所：竖版卡片（高 > 宽），与工具箱 4 列网格区分 */
.broker-acgrid, .home-acgrid, .exchange-grid { gap: 10px; }
.home-acgrid { grid-template-columns: repeat(4, 1fr); }
/* 交易券商精选正常显示每行 4 张，卡片间距加大、卡片略收窄 */
.broker-acgrid { grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 16px; }
/* 交易所分区同款竖版 4 列、间距 18px（复用 .ac 卡体系） */
.exchange-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
/* 跨境通讯页（#/esim）下所有卡片网格：每行 5 张，并做手机端自适应（esim-acgrid 专属，不影响 crypto/bank 页的 .exchange-grid） */
.acgrid.esim-acgrid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 900px) {
  .acgrid.esim-acgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .acgrid.esim-acgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .acgrid.esim-acgrid .ac { padding: 14px 10px; }
  .acgrid.esim-acgrid .ac-tag { font-size: 12px; line-height: 1.35; }
  .acgrid.esim-acgrid .ac-logo { width: 40px; height: 40px; border-radius: 9px; }
}
@media (max-width: 400px) {
  .acgrid.esim-acgrid { grid-template-columns: repeat(2, 1fr); }
}
.broker-acgrid .ac, .home-acgrid .ac, .exchange-grid .ac { padding: 14px 12px; align-items: center; text-align: center; }
.broker-acgrid .ac-hd, .home-acgrid .ac-hd, .exchange-grid .ac-hd { flex-direction: column; text-align: center; gap: 7px; margin-bottom: 8px; }
.broker-acgrid .ac-perks, .home-acgrid .ac-perks, .exchange-grid .ac-perks { position: static; max-width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; margin: 0 0 8px; }
.broker-acgrid .ac-perk-line, .home-acgrid .ac-perk-line, .exchange-grid .ac-perk-line { align-self: center; text-align: center; }
.broker-acgrid .ac-tag, .home-acgrid .ac-tag, .exchange-grid .ac-tag { font-size: 12px; line-height: 1.35; }
.broker-acgrid .ac-code, .home-acgrid .ac-code, .exchange-grid .ac-code { flex-direction: column; gap: 4px; padding: 7px 8px; }
.broker-acgrid .ac-cv, .broker-acgrid .ac-cv.plain, .home-acgrid .ac-cv, .home-acgrid .ac-cv.plain, .exchange-grid .ac-cv, .exchange-grid .ac-cv.plain { text-align: center; }
.broker-acgrid .ac-btn, .home-acgrid .ac-btn, .exchange-grid .ac-btn { width: 100%; padding: 8px 0; }
/* 显式 corner:true 的角标（如 Exness「🔥 站主主力」/ 交易所「🔥 站主自用」）在竖版卡片中仍固定在右上角 */
.broker-acgrid .ac.corner-perk .ac-perks, .home-acgrid .ac.corner-perk .ac-perks, .exchange-grid .ac.corner-perk .ac-perks {
  position: absolute; top: 0; right: 0; margin: 0; max-width: 58%;
  flex-direction: column; flex-wrap: nowrap; justify-content: flex-start;
  align-items: flex-end; text-align: right; z-index: 3;
}
/* corner 角标存在时，把 logo + 名称整体下移一行，避免与右上角角标紧挨 */
.broker-acgrid .ac.corner-perk .ac-hd, .home-acgrid .ac.corner-perk .ac-hd, .exchange-grid .ac.corner-perk .ac-hd {
  margin-top: 24px;
}
@media (max-width: 760px) {
  .broker-acgrid, .home-acgrid, .exchange-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .broker-acgrid, .home-acgrid, .exchange-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ CRYPTO 指南页 ============ */
.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.section-heading h2 { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.section-count { font-size: 12px; color: var(--text-dim); background: rgba(255, 255, 255, .05); border: .5px solid var(--border); padding: 2px 10px; border-radius: 20px; }
.section-sub { font-size: 14px; color: var(--text-muted); margin: 0 0 18px; }
.sec-sub-link { color: var(--accent); text-decoration: none; border-bottom: 1px dashed var(--accent-border); cursor: pointer; }
.sec-sub-link:hover { color: var(--accent); filter: brightness(1.08); border-bottom-style: solid; }
.section-empty {
  padding: 26px 20px; text-align: center; font-size: 14px; color: var(--text-muted);
  background: var(--bg-card); border: 1px dashed var(--border); border-radius: 12px;
}

/* 交易所分区附加：星级 / 教程链接居中（.ac 卡体系由上方 .broker-acgrid 规则统一接管） */
.exchange-grid .stars { justify-content: center; margin-bottom: 8px; }
.ac-tutorial { display: block; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-top: 8px; text-decoration: none; cursor: pointer; }
.ac-tutorial:hover { color: var(--accent); }

.cb-note {
  font-size: 13px; line-height: 1.7; color: var(--text-muted);
  background: var(--accent-dim); border: .5px solid var(--accent-border);
  border-radius: 10px; padding: 10px 14px; margin: 0 0 14px;
}
.bank-pending {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-card); border: .5px dashed var(--border);
  border-radius: 999px; padding: 8px 14px;
}
.exchange-grid .bank-pending { display: block; width: 100%; text-align: center; margin-top: auto; }

/* 跨境通讯页内粘性子导航 */
.esim-subnav {
  position: -webkit-sticky; position: sticky; top: var(--nav-h); z-index: 120;
  background: rgba(10, 12, 16, .92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: .5px solid var(--border);
}
.esim-subnav-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; gap: 10px; padding: 10px 24px;
  justify-content: center;
  overflow-x: auto; scrollbar-width: none;
}
.esim-subnav-inner::-webkit-scrollbar { display: none; }
.esim-subnav-link {
  flex: none; padding: 7px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none;
  color: var(--text-muted); background: var(--bg-card); border: .5px solid var(--border);
  transition: color .15s, border-color .15s, background .15s;
}
.esim-subnav-link:hover { color: var(--text); border-color: var(--c-gold); }
.esim-subnav-link.on {
  color: #0a0c10; background: var(--c-gold); border-color: var(--c-gold); font-weight: 700;
}
/* 点击子导航滚动时避免被吸顶栏遮挡 */
[id^="esim-sec-"] { scroll-margin-top: calc(var(--nav-h) + 56px); }
[id^="crypto-sec-"] { scroll-margin-top: calc(var(--nav-h) + 56px); }
[id^="bank-sec-"] { scroll-margin-top: calc(var(--nav-h) + 56px); }
[data-theme="light"] .esim-subnav { background: rgba(244, 245, 247, .95); }
[data-theme="light"] .esim-subnav-link.on { color: #1a1a1a; }

/* DEX 板块二级筛选菜单（现货/AMM · 永续合约/Perp） */
.dex-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.dex-filter-tab {
  flex: none; padding: 7px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  color: var(--text-muted); background: var(--bg-card); border: .5px solid var(--border);
  transition: color .15s, border-color .15s, background .15s;
}
.dex-filter-tab:hover { color: var(--text); border-color: var(--c-gold); }
.dex-filter-tab.active {
  color: #0a0c10; background: var(--c-gold); border-color: var(--c-gold); font-weight: 700;
}
[data-theme="light"] .dex-filter-tab.active { color: #1a1a1a; }

/* 小屏：二级页子导航可左右滑动（修复 justify-content:center 导致左侧标签不可达） */
@media (max-width: 760px) {
  .esim-subnav-inner {
    justify-content: flex-start;
    padding: 10px 14px;
    -webkit-overflow-scrolling: touch;
  }
}

/* 星级 */
.stars { display: flex; align-items: center; gap: 2px; margin-bottom: 10px; }
.star { font-size: 14px; color: #3a4152; }
.star.on { color: var(--accent); }
.star.half { color: var(--accent); opacity: .75; }
.star-score { font-size: 12.5px; color: var(--text-muted); margin-left: 4px; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--accent-dim); color: var(--accent); border: .5px solid var(--accent-border); }


/* 邀请码框 */
.invite-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .04); border: .5px solid rgba(255, 255, 255, .1);
  border-radius: 7px; padding: 7px 10px; margin-bottom: 12px;
}
[data-theme="light"] .invite-box { background: rgba(0, 0, 0, .04); border-color: rgba(0, 0, 0, .08); }
.invite-label { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.invite-code { font-size: 13px; font-weight: 700; color: #f87171; font-family: "SFMono-Regular", Consolas, Menlo, monospace; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="light"] .invite-code { color: #b45309; }
.invite-box .copy-btn {
  margin-left: auto; flex: none; border: .5px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 3px 9px; border-radius: 6px;
}
.invite-box .copy-btn:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-dim); }
.invite-box .copy-btn.copied { border-color: rgba(74, 222, 128, .4); color: #4ade80; background: rgba(74, 222, 128, .08); }

/* DEX 卡 */
.dex-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dex-card {
  background: var(--bg-card); border: .5px solid var(--border); border-radius: 14px;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.dex-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.dex-card-front { padding: 16px 16px 14px; cursor: pointer; position: relative; }
.dex-main-badge {
  position: absolute; top: 0; right: 0; z-index: 1;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #1a1206;
  background: linear-gradient(180deg, #f7c948, #f0b429); border: .5px solid var(--accent-border);
}
.dex-logo-row { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.dex-logo {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; flex: none;
  border: .5px solid;
}
.dex-logo-img { width: 22px; height: 22px; object-fit: contain; display: block; }
.dex-name-wrap { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.dex-name { font-size: 15px; font-weight: 700; color: var(--text); }
.dex-chain { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.dex-type-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; margin-bottom: 9px;
}
.dex-desc { font-size: 13px; color: var(--text-muted); line-height: 1.65; margin: 0 0 10px; }
.dex-info-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dex-toggle-btn {
  flex: none; font-size: 12px; color: var(--accent); background: var(--accent-dim);
  border: .5px solid var(--accent-border); border-radius: 7px; padding: 6px 11px; cursor: pointer;
}
.dex-toggle-btn:hover { background: rgba(240, 180, 41, .2); }
.dex-visit-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text);
  border: 1px solid var(--border); white-space: nowrap;
}
.dex-visit-btn:hover { border-color: var(--accent); color: var(--accent); }
/* DEX 卡片：手机端(≤400px) 让「查看官方」按钮显示在「钱包支持」上方，其他尺寸保持左右并排不变 */
@media (max-width: 400px) {
  .dex-info-toggle { flex-direction: column; align-items: stretch; gap: 8px; }
  .dex-visit-btn { order: -1; }
}
.dex-info-panel {
  max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease;
  border-top: 0 solid var(--border);
}
.dex-info-panel.open { max-height: 520px; border-top-width: .5px; padding: 14px 16px 16px; }
.dex-info-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.dex-wallet-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 0 0 12px; }
.dex-wtag { font-size: 11px; color: var(--text-muted); background: rgba(255, 255, 255, .05); border: .5px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.dex-wtag.key { color: var(--accent); background: var(--accent-dim); border-color: var(--accent-border); }
.dex-cex-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.7; margin: 0; }

/* 手机端：每行最多显示 2 张卡片（固定 2 列，桌面仍为 4 张） */
@media (max-width: 760px) {
  .dex-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .nav-inner { gap: 8px; }
  .hero h1 { font-size: 27px; }
  .article { padding: 24px 18px; }
}

/* ============ 新手路径指南（#/guide）============ */
.guide-hero {
  max-width: 1100px; margin: 0 auto; padding: 44px 24px 8px; text-align: center;
}
.guide-hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; margin: 12px 0 10px; color: var(--text); }
.guide-hero .hero-sub { color: var(--text-muted); font-size: 15.5px; }
.guide-back { color: var(--accent); font-size: 14px; margin-left: 6px; text-decoration: none; }
.guide-back:hover { text-decoration: underline; }

/* 指南页：左右两栏，左侧目录吸顶，右侧点选切换显示 */
.guide-layout {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 40px; max-width: 1100px; margin: 0 auto;
  padding: 24px 24px 80px; align-items: start;
}
.guide-side {
  position: sticky; top: calc(var(--nav-h) + 20px);
  border-right: 1px solid var(--border); padding-right: 18px;
}
.guide-toc { display: flex; flex-direction: column; gap: 4px; }
.guide-toc-title {
  font-size: 16px; font-weight: 800; color: var(--text);
  padding: 0 10px 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.guide-toc-link {
  padding: 8px 10px; border-radius: 8px; color: var(--text-muted);
  font-size: 14.5px; line-height: 1.45; text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.guide-toc-link:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.guide-toc-link.active { color: var(--accent); background: rgba(240, 180, 41, .1); font-weight: 700; }

.guide-content { min-height: 60vh; }
.guide-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px; margin-bottom: 24px;
}
.guide-head h1 { font-size: 24px; font-weight: 800; margin: 0 0 8px; color: var(--text); }
.guide-sub { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin: 0; }
.guide-section { padding: 24px 0; }
.guide-h2 { font-size: 22px; font-weight: 800; margin: 0 0 10px; color: var(--text); }
.guide-lead { color: var(--text-muted); font-size: 15.5px; line-height: 1.7; margin: 0 0 14px; }
.guide-subh { font-size: 17px; font-weight: 700; color: var(--c-green); margin: 24px 0 12px; }
.guide-subnote { color: var(--text-muted); font-size: 14.5px; line-height: 1.75; margin: 0 0 16px; }
.guide-subsubh { font-size: 15.5px; font-weight: 700; color: var(--text); margin: 20px 0 10px; }
.guide-toolgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 20px; }
.guide-toolcard {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255, 255, 255, .03); text-decoration: none; color: inherit;
}
.guide-toolcard:hover { border-color: var(--accent); }
.gt-top { display: flex; flex-direction: row; align-items: center; gap: 10px; width: 100%; }
.gt-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; flex: none; }
.gt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gt-name { font-size: 15px; font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.gt-arrow { color: var(--accent); font-size: 13px; }
.gt-alias { font-size: 13px; color: var(--text-muted); }
.gt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0; }
.gt-tag {
  font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 6px;
  font-weight: 700; border: 1px solid transparent;
}
.gt-ios { color: #4aa3ff; background: rgba(74, 163, 255, .12); border-color: rgba(74, 163, 255, .3); }
.gt-android { color: #34d399; background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .3); }
.gt-windows { color: #fb923c; background: rgba(251, 146, 60, .14); border-color: rgba(251, 146, 60, .35); }
.gt-macos { color: #c084fc; background: rgba(192, 132, 252, .14); border-color: rgba(192, 132, 252, .35); }
.gt-linux { color: #fbbf24; background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .35); }
.gt-iphone { color: #38bdf8; background: rgba(56, 189, 248, .14); border-color: rgba(56, 189, 248, .35); }
.gt-ipad { color: #818cf8; background: rgba(129, 140, 248, .14); border-color: rgba(129, 140, 248, .35); }
.gt-mac { color: #f472b6; background: rgba(244, 114, 182, .14); border-color: rgba(244, 114, 182, .35); }
.gt-appletv { color: #2dd4bf; background: rgba(45, 212, 191, .14); border-color: rgba(45, 212, 191, .35); }
.gt-desktop { color: #f0b429; background: rgba(240, 180, 41, .12); border-color: rgba(240, 180, 41, .3); }
.gt-cex { color: #60a5fa; background: rgba(96, 165, 250, .14); border-color: rgba(96, 165, 250, .35); }
.gt-dex { color: #c084fc; background: rgba(192, 132, 252, .14); border-color: rgba(192, 132, 252, .35); }
.guide-box {
  margin: 16px 0 20px; padding: 14px 16px;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; background: rgba(240, 180, 41, .04);
  color: var(--text); font-size: 14.5px; line-height: 1.7;
}
.guide-list { margin: 0 0 18px; padding-left: 20px; }
.guide-list li { margin: 8px 0; line-height: 1.65; color: var(--text); }
.guide-steps { margin: 0 0 18px; padding-left: 22px; counter-reset: step; list-style: none; }
.guide-steps li {
  position: relative; margin: 7px 0; padding: 0; line-height: 1.6;
  color: var(--text); font-size: 13.5px;
}
.guide-steps li::before {
  content: counter(step) ". "; counter-increment: step;
  font-weight: 700; color: var(--text);
}
.guide-cta {
  display: inline-block; padding: 10px 18px; border-radius: 10px;
  background: linear-gradient(180deg, #f7c948, #f0b429); color: #1a1206;
  font-weight: 700; font-size: 14.5px; text-decoration: none;
}
.guide-cta:hover { filter: brightness(1.05); }

@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 120px 1fr;
    gap: 16px; padding: 14px 14px 60px;
  }
  .guide-side {
    position: sticky; top: calc(var(--nav-h) + 12px);
    border-right: 1px solid var(--border); padding-right: 10px;
    max-height: calc(100vh - var(--nav-h) - 40px); overflow-y: auto;
  }
  .guide-toc-title { font-size: 14px; padding: 0 6px 8px; }
  .guide-toc-link { font-size: 13px; padding: 7px 8px; white-space: normal; }
  .guide-head h1 { font-size: 20px; }
  .guide-head { padding-bottom: 12px; margin-bottom: 18px; }
  /* 手机端工具卡片：单行铺满，避免右侧窄栏内两列过挤 */
  .guide-toolgrid { grid-template-columns: 1fr; gap: 10px; }
  .guide-toolcard { padding: 10px 12px; gap: 10px; }
  .gt-logo { width: 36px; height: 36px; border-radius: 9px; }
  .gt-name { font-size: 14px; }
  .gt-alias { font-size: 12px; }
}

/* ============ 风险提示弹窗 ============ */
.risk-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(6, 8, 12, .72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .28s ease, visibility .28s ease;
}
.risk-mask.show { opacity: 1; visibility: visible; pointer-events: auto; }
.risk-modal {
  position: relative;
  width: 100%; width: min(560px, 100%);
  max-height: 88vh; overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 18px;
  padding: 30px 30px 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  transform: translateY(14px) scale(.98);
  transition: transform .28s ease;
}
.risk-mask.show .risk-modal { transform: translateY(0) scale(1); }
.risk-icon { font-size: 34px; line-height: 1; text-align: center; margin-bottom: 10px; }
.risk-title {
  text-align: center; font-size: 22px; font-weight: 800;
  color: var(--accent); margin: 0 0 16px; letter-spacing: .5px;
}
.risk-subtitle {
  text-align: center; font-size: 15px; font-weight: 600;
  color: var(--text-dim, #aab2c0); margin: 0 0 16px; letter-spacing: .3px;
}

/* ===== 旧版 iOS Safari（< 14.1）不支持 flex gap 的回退 =====
   iOS 12 及更早的 Safari 会忽略 flex 的 gap，导致元素贴在一起甚至重叠。
   下面先强制把所有受影响容器的 flex gap 归零（!important），再用子元素外边距模拟原间距；
   现代浏览器与旧浏览器都只走 margin 一条路径，间距一致、不会出现双间距。
   （grid 的 gap 在 iOS 10.3+ 已支持，故 .nav-grid/.needs-grid/.acgrid/.dex-grid 不在名单内。） */

/* 1) 关闭所有受影响容器的 flex gap */
.brand, .nav-links, .dropdown a, .header-actions, .subscribe-btn, .tk,
.hero-btns, .btn-primary, .btn-ghost, .fab-items a, .sp-top, .jb-steps,
.post-item .post-meta, .article-header .post-meta, .footer-inner,
.footer-soc, .cat-tabs, .toolbox-pin .cat-tabs, .esim-subnav-inner, .ac-hd,
.ac-code, .section-heading, .dex-filter, .stars,
.dex-logo-row, .dex-info-toggle, .dex-wallet-tags, .more-btn,
.invite-box, .ac-perks, .ac-perk-lines, .nav-inner,
.broker-acgrid .ac-hd, .home-acgrid .ac-hd, .exchange-grid .ac-hd,
.broker-acgrid .ac-code, .home-acgrid .ac-code, .exchange-grid .ac-code,
.post-list, .post-cards {
  gap: 0 !important;
}

/* 2) 横向主轴间距（行内），按原 gap 值分组 */
.brand > * + *, .header-actions > * + *, .btn-primary > * + *, .sp-top > * + *,
.footer-inner > * + *, .section-heading > * + *,
.dex-info-toggle > * + *, .jb-steps > * + *, .dex-filter > * + *,
.invite-box > * + *, .nav-inner > * + * { margin-left: 8px; }

.dropdown a > * + *, .esim-subnav-inner > * + * { margin-left: 10px; }

.subscribe-btn > * + *, .tk > * + *, .btn-ghost > * + *, .cat-tabs > * + *,
.toolbox-pin .cat-tabs > * + *, .more-btn > * + * { margin-left: 6px; }

.ac-hd > * + *, .dex-logo-row > * + * { margin-left: 9px; }

.ac-code > * + *, .dex-wallet-tags > * + * { margin-left: 5px; }

.hero-btns > * + *, .post-item .post-meta > * + * { margin-left: 12px; }

.article-header .post-meta > * + *, .footer-soc > * + * { margin-left: 14px; }

.nav-links > * + * { margin-left: 4px; margin-top: 2px; }

/* 悬浮菜单项图标在右（row-reverse），间距用 margin-right 模拟 */
.fab-items a > * + * { margin-right: 10px; }

/* 3) 纵向主轴间距（column），按原 gap 值分组
   注：.spotlight-grid 已改为 grid（gap 在 iOS 10.3+ 原生支持），不再需要 margin 回退 */
.post-list > * + * { margin-top: 14px; }
.post-cards > * + * { margin-top: 16px; }
.ac-perk-lines > * + * { margin-top: 6px; }
.ac-perks > * + * { margin-top: 6px; }

/* 4) 小屏卡片竖排时，把横向间距清零、改用纵向间距 */
@media (max-width: 760px) {
  .broker-acgrid .ac-hd > * + *, .home-acgrid .ac-hd > * + *, .exchange-grid .ac-hd > * + * {
    margin-left: 0; margin-top: 7px;
  }
  .broker-acgrid .ac-code > * + *, .home-acgrid .ac-code > * + *, .exchange-grid .ac-code > * + * {
    margin-left: 0; margin-top: 4px;
  }
}
.risk-body { font-size: 14px; line-height: 1.75; color: var(--text); }
.risk-body > p { margin: 0 0 12px; }
.risk-body ul { margin: 0 0 12px; padding-left: 20px; }
.risk-body li { margin: 0 0 9px; color: var(--text-muted); }
.risk-body li b { color: var(--text); font-weight: 700; }
.risk-btn {
  display: block; width: 100%; margin-top: 20px;
  padding: 13px 18px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #1a1305;
  font-size: 15px; font-weight: 800; letter-spacing: .3px;
  transition: filter .15s ease, transform .15s ease;
}
.risk-btn:hover { filter: brightness(1.08); }
.risk-btn:active { transform: translateY(1px); }
[data-theme="light"] .risk-btn { color: #fff; }

/* 风险提示弹窗：手机端自适应优化（≤560px 收紧遮罩/弹窗内边距与字号，避免小屏文案过挤；≤400px 极窄屏再收一档，均不影响桌面） */
@media (max-width: 560px) {
  .risk-mask { padding: 12px; }
  .risk-modal {
    padding: 22px 18px 20px; border-radius: 14px; max-height: 90vh;
  }
  .risk-icon { font-size: 30px; margin-bottom: 8px; }
  .risk-title { font-size: 19px; margin-bottom: 12px; }
  .risk-subtitle { font-size: 13.5px; margin-bottom: 12px; }
  .risk-body { font-size: 13.5px; line-height: 1.7; }
  .risk-body > p { margin-bottom: 10px; }
  .risk-body li { margin-bottom: 8px; }
  .risk-btn { margin-top: 16px; padding: 12px 16px; font-size: 14.5px; }
}
@media (max-width: 400px) {
  .risk-mask { padding: 10px; }
  .risk-modal { padding: 18px 14px 16px; border-radius: 12px; }
  .risk-title { font-size: 18px; }
  .risk-body { font-size: 13px; }
}

/* 文章内嵌 MT4/MT5 卡片：放在文件最末尾，保证覆盖 .acgrid/.broker-acgrid 默认的 4 列网格，固定 2 列 */
.mt-acgrid { grid-template-columns: repeat(2, 1fr) !important; }
@media (max-width: 560px) { .mt-acgrid { grid-template-columns: 1fr !important; } }

/* Forex 交易页：券商卡片末尾插入的《券商使用指南》对应小节（默认折叠，点击展开） */
.ac-guide-details { margin-top: 14px; text-align: left; }
.ac-guide-toggle {
  cursor: pointer; user-select: none; list-style: none;
  font-size: 12px; font-weight: 700; color: var(--accent);
  padding: 10px 0 6px; border-top: 1px dashed var(--border);
}
.ac-guide-toggle::-webkit-details-marker { display: none; }
.ac-guide-toggle::after { content: " ▾"; font-size: 10px; }
.ac-guide-details[open] .ac-guide-toggle::after { content: " ▴"; }
.ac-guide {
  margin-top: 0; padding-top: 4px; text-align: left;
  font-size: 13px; line-height: 1.7; color: var(--text-muted);
}
.ac-guide h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 12px 0 6px; }
.ac-guide h3:first-child { margin-top: 2px; }
.ac-guide p { margin: 6px 0; }
.ac-guide ul, .ac-guide ol { margin: 6px 0; padding-left: 20px; }
.ac-guide li { margin: 3px 0; }
.ac-guide img { max-width: 100%; border-radius: 8px; margin: 8px 0; display: block; }
.ac-guide a { color: var(--accent); }
/* 展开后末尾「收起」按钮：仅在 details 展开时可见（内容区随折叠隐藏） */
.ac-guide-collapse {
  display: block; margin: 14px auto 2px; padding: 7px 20px;
  font-size: 12px; font-weight: 700; line-height: 1;
  color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: 999px;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.ac-guide-collapse:hover { background: var(--accent); color: #fff; }

/* 《券商使用指南》文章内：每个券商小节末尾插入的对应券商卡（居中 + 自适应宽度） */
.post-broker-card { margin-top: 18px; display: flex; justify-content: center; }
.post-broker-card .acgrid.broker-acgrid {
  margin-top: 0;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 440px;
}
.post-broker-card .ac { width: 100%; }

/* ===== 全站搜索：悬浮按钮 + 居中浮层 ===== */
/* 搜索按钮：位于汉堡按钮（fab-menu）上方 */
.fab-search {
  display: none; /* 仅手机端显示，见下方 @media */
  position: fixed;
  right: 20px;
  bottom: 174px; /* 汉堡按钮（bottom:120 + 高44）再上方 */
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: linear-gradient(160deg, #f0b429, #d99a12);
  color: #1a1306;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(240, 180, 41, .4), var(--shadow);
  transition: transform .2s ease, border-color .15s, background .15s;
}
.fab-search:hover { border-color: #fff; transform: scale(1.05); }
.fab-search[aria-expanded="true"] { background: linear-gradient(160deg, #fff, #f0b429); transform: rotate(90deg); }
[data-theme="dark"] .fab-search { box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 2px 10px rgba(240, 180, 41, .3); }

/* 首页按钮：位于汉堡按钮（bottom:76）下方，与返回顶部（左下）分置两侧 */
.fab-home {
  display: none; /* 仅手机端显示，见下方 @media */
  position: fixed;
  right: 20px;
  bottom: 66px; /* 汉堡按钮（bottom:120）下方，返回顶部（bottom:12）上方 */
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: linear-gradient(160deg, #3b82f6, #1d4ed8);
  color: #fff;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(59, 130, 246, .4), var(--shadow);
  transition: transform .2s ease, border-color .15s, background .15s;
}
.fab-home:hover { border-color: #fff; transform: scale(1.05); }
[data-theme="dark"] .fab-home { box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 2px 10px rgba(59, 130, 246, .35); }

/* 居中浮层 */
.search-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  z-index: 400;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.search-overlay.show { opacity: 1; pointer-events: auto; }
.search-modal {
  width: min(560px, 92vw);
  max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  overflow: hidden;
  transform: translateY(14px) scale(.98);
  transition: transform .2s ease;
}
.search-overlay.show .search-modal { transform: translateY(0) scale(1); }
.search-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-ic { color: var(--accent); flex: 0 0 auto; }
.search-modal .search-input {
  flex: 1 1 auto; min-width: 0; max-width: none; width: auto;
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font-song); font-size: 16px;
}
.search-input::placeholder { color: var(--text-dim); }
.search-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 18px; line-height: 1;
  padding: 4px 6px; border-radius: 8px;
}
.search-close:hover { color: var(--text); background: var(--bg); }
.search-results { overflow-y: auto; padding: 8px; flex: 1; }
.search-hint {
  padding: 10px 16px; font-size: 11px; color: var(--text-dim);
  border-top: 1px solid var(--border); text-align: center;
}
.search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  cursor: pointer; text-decoration: none; color: var(--text);
}
.search-item:hover { background: var(--bg); }
.search-item .si-badge {
  flex: 0 0 auto; font-size: 10px; padding: 2px 8px; border-radius: 999px;
  font-weight: 600;
}
.search-item .si-badge.tool { background: rgba(240, 180, 41, .15); color: var(--accent); }
.search-item .si-badge.post { background: rgba(16, 185, 129, .15); color: #10b981; }
.search-item .si-body { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.search-item .si-title { font-size: 14px; font-weight: 600; }
.search-item .si-sub { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 32px 16px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* 点击搜索结果后，在对应分类页高亮定位到的卡片 */
.ac.search-flash {
  outline: 2px solid var(--accent); outline-offset: 3px;
  animation: searchFlash 1.3s ease;
}
@keyframes searchFlash {
  0% { box-shadow: 0 0 0 0 rgba(240, 180, 41, .55); }
  100% { box-shadow: 0 0 0 16px rgba(240, 180, 41, 0); }
}

@media (max-width: 900px) {
  .fab-search { display: grid; }
  .fab-home { display: grid; }
}

/* 文章评论区（自建：Cloudflare Workers + D1） */
.post-comments {
  margin: 32px 0 8px;
  padding-top: 22px;
  border-top: 1px solid var(--line, #e6e1d6);
}
.comments-title { font-size: 17px; font-weight: 700; color: var(--text); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.comments-count { font-size: 13px; font-weight: 600; color: var(--gold, #f0b429); background: rgba(240,180,41,.12); border-radius: 20px; padding: 1px 9px; }
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.comments-loading, .comments-empty { color: var(--text-dim); font-size: 13.5px; padding: 6px 0; }
.comment-item { background: var(--bg-soft, rgba(255,255,255,.04)); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; }
.comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.comment-name { font-weight: 700; font-size: 14px; color: var(--text); }
.comment-time { font-size: 12px; color: var(--text-dim); }
.comment-body { font-size: 14px; line-height: 1.65; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; flex-direction: column; gap: 10px; }
.cmt-name, .cmt-content { width: 100%; box-sizing: border-box; background: var(--bg-soft, rgba(255,255,255,.04)); border: 1px solid var(--border); border-radius: 10px; color: var(--text); padding: 10px 12px; font-size: 14px; font-family: inherit; }
.cmt-name:focus, .cmt-content:focus { outline: none; border-color: var(--gold, #f0b429); }
.cmt-content { min-height: 84px; resize: vertical; }
.cmt-actions { display: flex; align-items: center; gap: 12px; }
.cmt-msg { font-size: 13px; color: var(--text-dim); margin-right: auto; }
.cmt-submit { background: linear-gradient(180deg,#f7c948,#f0b429); color: #1a1206; border: none; border-radius: 10px; padding: 9px 20px; font-size: 14px; font-weight: 700; cursor: pointer; }
.cmt-submit:hover { filter: brightness(1.05); }

/* 微信扫码分享弹层：iOS 无法拉起微信 App 时的兜底方案 */
.qr-modal-mask {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
  padding: 20px;
}
.qr-modal-mask.open { display: flex; }
.qr-modal {
  position: relative; width: 300px; max-width: 86vw;
  background: var(--bg-card); border: .5px solid var(--border); border-radius: 16px;
  padding: 22px 20px 18px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.qr-modal-close {
  position: absolute; top: 8px; right: 10px; width: 30px; height: 30px;
  border: none; background: transparent; color: var(--text-dim); font-size: 18px;
  cursor: pointer; border-radius: 8px; line-height: 1;
}
.qr-modal-close:hover { background: var(--bg-soft, rgba(255,255,255,.08)); }
.qr-modal-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.qr-modal-box {
  width: 200px; height: 200px; margin: 0 auto 12px; background: #fff;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  padding: 8px; box-sizing: border-box; overflow: hidden;
}
.qr-modal-box img, .qr-modal-box canvas { max-width: 100% !important; height: auto !important; display: block; }
.qr-modal-box .qr-fallback { padding: 10px; word-break: break-all; font-size: 12px; color: #333; line-height: 1.5; }
.qr-modal-tip { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }

