/* ═══════════════════════════════════════════════════════════════
   ChinaMNOs Design System v2 — 2026 refactor
   OKLCH 色彩 · 玻璃拟态 · View Transitions · 容器级动效
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────── Design tokens ─────────────── */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;

  /* 品牌主色（由 JS 按运营商动态注入 --acc / --acc-2 / --acc-deep） */
  --acc: #1890ff;
  --acc-2: #40a9ff;
  --acc-deep: #096dd9;

  /* 旧变量别名（兼容历史内联样式引用） */
  --blue: var(--acc);
  --blue2: var(--acc-2);
  --blue-dark: var(--acc-deep);
  --card: var(--surface);

  /* 亮色调色板 */
  --bg: oklch(97.2% 0.008 240);
  --bg-2: oklch(94.8% 0.012 240);
  --surface: oklch(99.3% 0.003 240);
  --surface-2: oklch(96.6% 0.009 240);
  --line: oklch(90.5% 0.014 240);
  --txt: oklch(24% 0.03 262);
  --sub: oklch(54% 0.028 252);
  --green: oklch(64% 0.16 150);
  --red: oklch(59% 0.21 27);
  --amber: oklch(72% 0.15 70);
  --purple: oklch(60% 0.17 295);

  --glass: color-mix(in oklab, var(--surface) 88%, transparent);
  --glass-strong: color-mix(in oklab, var(--surface) 96%, transparent);
  --shadow-1: 0 1px 2px oklch(20% 0.04 260 / 0.06), 0 2px 10px oklch(20% 0.04 260 / 0.05);
  --shadow-2: 0 10px 34px oklch(20% 0.06 260 / 0.13);
  --glow: 0 0 0 1px color-mix(in oklab, var(--acc) 22%, transparent),
    0 6px 24px color-mix(in oklab, var(--acc) 20%, transparent);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --topbar-h: 60px;
  --sidebar-w: 216px;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: oklch(16.5% 0.022 262);
  --bg-2: oklch(19% 0.026 262);
  --surface: oklch(22% 0.028 262);
  --surface-2: oklch(25.5% 0.032 262);
  --line: oklch(31% 0.03 262);
  --txt: oklch(93% 0.01 250);
  --sub: oklch(72% 0.02 250);
  --green: oklch(74% 0.17 150);
  --red: oklch(69% 0.19 25);
  --amber: oklch(79% 0.15 75);
  --purple: oklch(72% 0.15 295);
  --shadow-1: 0 1px 2px oklch(0% 0 0 / 0.3), 0 2px 10px oklch(0% 0 0 / 0.25);
  --shadow-2: 0 10px 34px oklch(0% 0 0 / 0.45);
  color-scheme: dark;
}

/* ─────────────── Reset & base ─────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
* {
  -webkit-tap-highlight-color: transparent;
}
/* hidden 属性语义强制：作者样式（如 .nav-item{display:flex}）不得覆盖 UA 的 display:none */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: clip;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ─────────────── 极光氛围背景（合成器友好版） ───────────────
   底图（body::before）为静态渐变，零动画零滤镜；
   流动感由 4 个 .aurora-blob 色斑承担：静态 blur 栅格化一次即缓存，
   动画只走 transform（合成器管线，每帧零重绘）。
   blob DOM 由 shell.js 启动时幂等注入；品牌色随运营商切换自动跟随。
   旧的 conic-gradient + @property 角度动画方案每帧全屏重绘，已废弃。 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1100px 760px at 18% -12%, color-mix(in oklab, var(--acc) 7%, var(--bg-2)), transparent 62%),
    radial-gradient(980px 680px at 92% 8%, color-mix(in oklab, var(--acc-2) 6%, var(--bg-2)), transparent 62%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  transition: background 0.6s var(--ease);
}
.aurora-blob {
  position: fixed;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  filter: blur(64px);
  opacity: 0.32;
  will-change: transform; /* 常驻动画元素，常驻合成层是应得的 */
  transition: background 0.6s var(--ease);
}
[data-theme="dark"] .aurora-blob { opacity: 0.4; }
.aurora-blob.b1 {
  width: 480px; height: 480px; background: var(--acc);
  top: -160px; left: -140px;
  animation: blob-drift-1 26s ease-in-out infinite;
}
.aurora-blob.b2 {
  width: 400px; height: 400px; background: var(--acc-2);
  top: 12%; right: -150px;
  animation: blob-drift-2 32s ease-in-out infinite;
}
.aurora-blob.b3 {
  width: 360px; height: 360px; background: var(--purple);
  bottom: -140px; left: 24%;
  opacity: 0.22;
  animation: blob-drift-3 29s ease-in-out infinite;
}
.aurora-blob.b4 {
  width: 300px; height: 300px; background: var(--acc-2);
  bottom: 16%; right: 14%;
  opacity: 0.18;
  animation: blob-drift-2 37s ease-in-out infinite reverse;
}
@keyframes blob-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, 55px) scale(1.12); }
}
@keyframes blob-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-80px, 45px) scale(1.08); }
}
@keyframes blob-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -55px) scale(1.15); }
}

::selection {
  background: color-mix(in oklab, var(--acc) 26%, transparent);
}

h1, h2, h3 {
  line-height: 1.3;
  text-wrap: balance;
}

button {
  font-family: inherit;
}

a {
  color: var(--acc);
}

/* 滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--sub) 35%, transparent) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--sub) 30%, transparent);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in oklab, var(--sub) 50%, transparent);
}

/* ─────────────── 玻璃卡片 / 面板 ─────────────── */
.card,
.panel {
  background: var(--glass);
  backdrop-filter: blur(10px) saturate(1.25);
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
  border: 1px solid color-mix(in oklab, var(--line) 82%, transparent);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
    transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
[data-theme="dark"] .card,
[data-theme="dark"] .panel {
  /* 深色下补顶部内高光：玻璃质感靠高光与边框，而非重度模糊 */
  box-shadow: var(--shadow-1), inset 0 1px 0 rgb(255 255 255 / 0.07);
}

.panel {
  padding: 22px;
  margin-bottom: 20px;
}

.panel-title,
.card-title {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-sub {
  font-size: 12px;
  color: var(--sub);
  font-weight: 400;
}

/* ─────────────── 入场动效（stagger） ─────────────── */
.rise {
  animation: rise 0.55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

/* ─────────────── 按钮 ─────────────── */
.btn {
  --btn-bg: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--txt);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.18s var(--spring), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease),
    opacity 0.2s;
}
.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.btn:active {
  transform: scale(0.96);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--acc), var(--acc-deep), var(--acc-2), var(--acc));
  color: #fff;
  box-shadow: 0 3px 12px color-mix(in oklab, var(--acc) 32%, transparent);
}
.btn.primary:hover {
  box-shadow: 0 6px 20px color-mix(in oklab, var(--acc) 42%, transparent);
}
/* 按钮 pending 态（shell/ui.js withPending）：内容隐去 + 居中转圈 + 禁点 */
@keyframes ui-spin { to { transform: rotate(360deg); } }
.btn.is-pending {
  pointer-events: none !important;
  position: relative;
  color: transparent !important;
}
.btn.is-pending svg { opacity: 0; }
.btn.is-pending::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid var(--acc);
  border-top-color: transparent;
  animation: ui-spin 0.7s linear infinite;
}
.btn.primary.is-pending::after {
  border-color: #fff;
  border-top-color: transparent;
}

.btn.ghost {
  background: color-mix(in oklab, var(--surface) 55%, transparent);
  border-color: color-mix(in oklab, var(--line) 90%, transparent);
  color: var(--txt);
}
.btn.ghost:hover {
  border-color: color-mix(in oklab, var(--acc) 45%, transparent);
  color: var(--acc);
}

.btn.soft {
  border-color: transparent;
  background: color-mix(in oklab, var(--acc) 12%, transparent);
  color: var(--acc);
}
.btn.soft:hover {
  background: color-mix(in oklab, var(--acc) 18%, transparent);
}

.btn.success {
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), color-mix(in oklab, var(--green) 70%, var(--acc-2)));
  color: #fff;
}

.btn.sm {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: var(--r-sm);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: color-mix(in oklab, var(--surface) 55%, transparent);
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s var(--spring), background 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
}
.icon-btn:hover {
  background: color-mix(in oklab, var(--acc) 14%, transparent);
  color: var(--acc);
}
.icon-btn:active {
  transform: scale(0.92);
}

/* ─────────────── 表单控件 ─────────────── */
.inp,
.sel,
input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--txt);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.3s var(--ease);
  accent-color: var(--acc);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--acc) 18%, transparent);
}
input::placeholder,
textarea::placeholder {
  color: color-mix(in oklab, var(--sub) 75%, transparent);
}
input.error,
textarea.error {
  border-color: var(--red);
  background: color-mix(in oklab, var(--red) 6%, var(--surface));
}
textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--mono);
  font-size: 13px;
}

select.sel,
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888d99' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* 搜索框 */
.search-box {
  flex: 1 1 220px;
  min-width: 160px;
}

/* 开关（checkbox → switch） */
input[type="checkbox"] {
  accent-color: var(--acc);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex: none;
}
input[type="checkbox"].switch {
  appearance: none;
  width: 38px;
  height: 22px;
  border-radius: var(--r-full);
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.25s var(--ease);
  margin: 0;
}
input[type="checkbox"].switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.3);
  transition: transform 0.28s var(--spring);
}
input[type="checkbox"].switch:checked {
  background: linear-gradient(135deg, var(--acc), var(--acc-deep));
}
input[type="checkbox"].switch:checked::before {
  transform: translateX(16px);
}

/* ─────────────── 分段控制器（segmented control） ─────────────── */
.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--r-full);
  background: color-mix(in oklab, var(--surface-2) 88%, transparent);
  border: 1px solid color-mix(in oklab, var(--line) 85%, transparent);
}
.seg-btn,
.tab-btn {
  padding: 5px 14px;
  border: none;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--sub);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.25s var(--ease),
    box-shadow 0.25s var(--ease), transform 0.15s var(--spring);
}
.seg-btn:hover,
.tab-btn:hover:not(.active) {
  color: var(--txt);
}
.seg-btn:active,
.tab-btn:active {
  transform: scale(0.95);
}
.seg-btn.active,
.tab-btn.active {
  background: var(--surface);
  color: var(--acc);
  box-shadow: var(--shadow-1);
}
[data-theme="dark"] .seg-btn.active,
[data-theme="dark"] .tab-btn.active {
  background: color-mix(in oklab, var(--acc) 22%, var(--surface));
}

/* ─────────────── 胶囊 / 标签 ─────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 12.5px;
  background: color-mix(in oklab, var(--surface) 62%, transparent);
  border: 1px solid color-mix(in oklab, var(--line) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.status-pill strong {
  color: var(--acc);
  font-variant-numeric: tabular-nums;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--sub);
  animation: pulse 2.2s ease-in-out infinite;
}
.status-dot.ok,
.dot-ok {
  background: var(--green);
  position: relative;
}
/* 扩散光圈：伪元素 transform 缩放（合成器管线），
   替代旧 box-shadow 动画（每帧重绘）；同色覆盖无视觉差异 */
.status-dot.ok::after,
.dot-ok::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-ring 2.4s ease-out infinite;
  pointer-events: none;
}
.status-dot.warn,
.dot-warn {
  background: var(--amber);
}
.status-dot.err,
.dot-err {
  background: var(--red);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.55; }
  70% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.status-dot-inline {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 5px;
  background: var(--sub);
}
.status-dot-inline.ok { background: var(--green); }
.status-dot-inline.warn { background: var(--amber); }
.status-dot-inline.err { background: var(--red); }

.chip {
  font-size: 12px;
  padding: 3px 11px;
  border-radius: var(--r-full);
  font-weight: 600;
  letter-spacing: 0.2px;
}
.chip.add { background: var(--green); color: #fff; }
.chip.del { background: var(--red); color: #fff; }
.chip.mod { background: var(--acc); color: #fff; }

/* ─────────────── 表格 ─────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in oklab, var(--line) 80%, transparent);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  position: sticky;
  top: 0;
  /* sticky 表头滚动时逐帧重采样背后内容，故用高不透明度替代 blur */
  background: color-mix(in oklab, var(--surface-2) 97%, transparent);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--sub);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.table td {
  padding: 9px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 65%, transparent);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.table tbody tr {
  transition: background 0.18s var(--ease);
}
.table tbody tr:hover {
  background: color-mix(in oklab, var(--acc) 6%, transparent);
}
.table tbody tr:last-child td {
  border-bottom: none;
}

/* ─────────────── Markdown 表格（md.js 渲染的 .md-tbl） ─────────────── */
.md-tbl {
  /* 窄容器（公告/推广弹窗）内横向滚动而非撑破布局 */
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: fit-content;
  max-width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
  border: 1px solid color-mix(in oklab, var(--line) 80%, transparent);
  border-radius: var(--r-md);
  font-size: 0.95em;
}
.md-tbl th,
.md-tbl td {
  padding: 6px 12px;
  border-bottom: 1px solid color-mix(in oklab, var(--line) 65%, transparent);
  border-right: 1px solid color-mix(in oklab, var(--line) 65%, transparent);
  text-align: left; /* 分隔行 :---: 对齐以单元格内联样式覆盖 */
  overflow-wrap: anywhere;
}
.md-tbl th:last-child,
.md-tbl td:last-child {
  border-right: none;
}
.md-tbl th {
  background: color-mix(in oklab, var(--surface-2) 97%, transparent);
  font-weight: 600;
  color: var(--sub);
  white-space: nowrap;
}
.md-tbl tbody tr:last-child td {
  border-bottom: none;
}

/* ─────────────── 侧边导航（Tabs 组件宿主） ─────────────── */
.app-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--r-md);
  background: none;
  color: var(--sub);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: color 0.2s var(--ease), background 0.25s var(--ease),
    transform 0.15s var(--spring);
}
.nav-item:hover {
  color: var(--txt);
  background: color-mix(in oklab, var(--surface-2) 80%, transparent);
}
.nav-item:active {
  transform: scale(0.98);
}
.nav-item.active {
  color: var(--acc);
  font-weight: 650;
}
.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--sub);
  font-size: 15px;
  flex: none;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    box-shadow 0.3s var(--ease), transform 0.3s var(--spring);
}
.nav-icon svg {
  width: 17px;
  height: 17px;
}
.nav-item.active .nav-icon {
  background: linear-gradient(135deg, var(--acc), var(--acc-deep));
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 14px color-mix(in oklab, var(--acc) 38%, transparent);
}
.nav-indicator {
  position: absolute;
  left: 8px;
  right: 8px;
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--acc) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--acc) 16%, transparent);
  z-index: -1;
  opacity: 0;
  transition: top 0.38s var(--spring), height 0.38s var(--spring), opacity 0.3s;
  pointer-events: none;
}
.app-nav.has-active .nav-indicator {
  opacity: 1;
}
.sidebar-divider {
  height: 1px;
  margin: 10px 14px;
  background: linear-gradient(to right, transparent, var(--line), transparent);
}

/* ─────────────── 视图切换 ─────────────── */
.view {
  display: none;
}
.view.active {
  display: block;
  animation: view-in 0.4s var(--ease);
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ─────────────── 模态框（<dialog>） ─────────────── */
dialog.modal {
  border: none;
  border-radius: var(--r-xl);
  padding: 0;
  /* 全局 reset 的 * { margin: 0 } 会覆盖 UA 的 dialog[open] margin:auto，
     导致弹窗贴左上角——必须显式恢复居中 */
  margin: auto;
  max-width: 520px;
  width: calc(100% - 40px);
  background: var(--surface);
  color: var(--txt);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
dialog.modal[open] {
  animation: modal-in 0.42s var(--spring);
}
dialog.modal.modal-closing {
  animation: modal-out 0.22s ease forwards;
}
dialog.modal::backdrop {
  background: oklch(12% 0.03 262 / 0.45);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  animation: backdrop-in 0.3s ease;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.94);
  }
}
@keyframes modal-out {
  to {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
}
@keyframes backdrop-in {
  from { opacity: 0; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--acc), var(--acc-deep));
  color: #fff;
}
.modal-head #modalTitle {
  font-size: 15.5px;
  font-weight: 650;
}
.modal-close {
  flex: none;
  background: rgb(255 255 255 / 0.18);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  margin-left: 10px;
  transition: background 0.2s, transform 0.15s var(--spring);
}
.modal-close:hover {
  background: rgb(255 255 255 / 0.32);
}
.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow: auto;
  font-size: 14px;
}
/* ofv 场景类：弹窗内含下拉浮层（如检测弹窗的省份选择器）时放开两层 overflow 裁剪，
   否则 absolute 下拉被 body 滚动裁剪/被 dialog 圆角裁剪。仅限内容高度可控的弹窗使用 */
dialog.modal.ofv {
  overflow: visible;
  max-height: min(88vh, 640px);
}
dialog.modal.ofv .modal-head {
  border-radius: var(--r-xl) var(--r-xl) 0 0;   /* overflow 放开后头部渐变需自持圆角 */
}
.modal-body.ofv {
  overflow: visible;
  max-height: none;
}
.modal-foot {
  padding: 12px 20px;
  text-align: right;
  border-top: 1px solid var(--line);
}
/* 弹窗附加按钮区（如变更详情的名称/概要复制），与主按钮同行靠左 */
.modal-foot-extra {
  display: inline-flex;
  gap: 8px;
  margin-right: 10px;
  vertical-align: middle;
}

/* ─────────────── 数据加载遮罩 ─────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.loading-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.loading-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid color-mix(in oklab, var(--acc) 16%, transparent);
  border-top-color: var(--acc-2);
  animation: spin 0.8s linear infinite;
  position: relative;
}
/* 双环中心标识字：反向旋转抵消父级圆环的 spin 保持正立，颜色与圆环转动弧同色、无动效 */
.loading-spinner .loading-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--acc-2);
  animation: spin 0.8s linear infinite reverse;
}
.loading-spinner::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--acc-deep);
  opacity: 0.55;
  animation: spin 0.6s linear infinite reverse;
}
.loading-text {
  font-size: 14px;
  color: var(--sub);
  font-weight: 500;
  letter-spacing: 0.6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
/* 弹跳点：数据加载遮罩与启动屏的三点错峰动画（reduced-motion 由全局规则接管） */
.loading-dots,
.boot-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
}
.loading-dots span,
.boot-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acc-2);
  animation: loading-bounce 1.1s ease-in-out infinite;
}
.loading-dots span:nth-child(2),
.boot-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3),
.boot-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes loading-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* ─────────────── 骨架屏 ─────────────── */
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(
    100deg,
    var(--surface-2) 40%,
    color-mix(in oklab, var(--surface-2) 50%, var(--surface)) 50%,
    var(--surface-2) 60%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ─────────────── 通用状态 ─────────────── */
.loading {
  color: var(--sub);
  text-align: center;
  padding: 32px 0;
  font-size: 14px;
}
.empty {
  color: var(--sub);
  text-align: center;
  padding: 32px 0;
  font-size: 14px;
}

.count-hint {
  font-size: 12.5px;
  color: var(--sub);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pager button {
  min-width: 36px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--txt);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s, transform 0.15s var(--spring),
    box-shadow 0.2s;
}
.pager button:hover:not(:disabled) {
  border-color: var(--acc);
  color: var(--acc);
  box-shadow: 0 2px 10px color-mix(in oklab, var(--acc) 18%, transparent);
}
.pager button:active:not(:disabled) {
  transform: scale(0.95);
}
.pager button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pager .page-info {
  font-size: 13px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}
.pager .pg {
  min-width: 36px;
  padding: 0 10px;
}
.pager .pg.on {
  background: linear-gradient(135deg, var(--acc), var(--acc-deep));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in oklab, var(--acc) 35%, transparent);
}
.pager .pg-dots {
  min-width: 22px;
  padding: 0 3px;
  color: var(--sub);
  text-align: center;
  font-weight: 600;
  letter-spacing: 1px;
}

.num-ticker {
  font-variant-numeric: tabular-nums;
}

/* ─────────────── Tooltip ─────────────── */
.tooltip,
.prov-tip {
  position: fixed;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--txt);
  background: var(--glass-strong);
  border: 1px solid color-mix(in oklab, var(--line) 90%, transparent);
  backdrop-filter: blur(8px) saturate(1.3);
  -webkit-backdrop-filter: blur(8px) saturate(1.3);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--spring);
  pointer-events: none;
  white-space: nowrap;
}
.tooltip.show,
.prov-tip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ─────────────── View Transitions（页面/路由切换） ─────────────── */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: vt-out 0.24s ease both;
  }
  ::view-transition-new(root) {
    animation: vt-in 0.34s var(--ease) both;
  }
}
@keyframes vt-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ─────────────── 启动屏 ─────────────── */
.boot {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity 0.4s ease, visibility 0.4s;
}
.boot.hide {
  opacity: 0;
  visibility: hidden;
}
.boot-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--acc), var(--acc-deep), var(--purple));
  background-size: 220% 220%;
  animation: boot-hue 3s var(--ease) infinite alternate;
  box-shadow: 0 10px 40px color-mix(in oklab, var(--acc) 40%, transparent);
}
@keyframes boot-hue {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}
.boot-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 1px;
}
.boot-bar {
  width: 140px;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--line);
}
.boot-sub {
  font-size: 12.5px;
  color: var(--sub);
  letter-spacing: 0.5px;
  opacity: 0.85;
}
.boot-bar span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--acc), var(--acc-2));
  animation: boot-slide 1.1s var(--ease) infinite;
}
@keyframes boot-slide {
  from { transform: translateX(-120%); }
  to { transform: translateX(360%); }
}

/* ─────────────── 指针追踪 3D 倾斜卡（.tilt） ───────────────
   shell/ui.js initTilt() 以事件委托写入 --rx/--ry/--mx/--my，
   此处负责视觉：卡片 3D 倾斜 + spotlight 边框光（mask 技巧）。
   动态注入的元素自动生效（委托绑定在页面根容器上）。 */
.tilt {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  transform: perspective(950px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.16s ease-out, box-shadow 0.3s var(--ease),
    border-color 0.3s var(--ease);
  /* 不设常驻 will-change：避免每张卡永久占用合成层，
     transform 过渡时浏览器会按需临时提升 */
}
.tilt::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    280px circle at var(--mx, 50%) var(--my, 50%),
    var(--acc),
    transparent 70%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
  z-index: 1;
}
.tilt:hover::before {
  opacity: 0.85;
}
.tilt:hover {
  box-shadow: 0 18px 44px oklch(20% 0.06 260 / 0.16),
    0 4px 14px color-mix(in oklab, var(--acc) 12%, transparent);
}

/* ─────────────── 磁性按钮（.magnetic） ───────────────
   使用独立 transform 属性 translate（与 transform 互不覆盖，
   这是 CSS Individual Transform Properties 特性），
   shell/ui.js initMagnetic() 委托写入 --mtx/--mty */
.magnetic {
  translate: var(--mtx, 0px) var(--mty, 0px);
  transition: translate 0.28s var(--spring), transform 0.18s var(--spring),
    box-shadow 0.25s var(--ease);
}

/* ─────────────── 滚动驱动入场（Scroll-Driven Animations） ───────────────
   animation-timeline: view() —— 元素滚入视口时播放入场动画。
   仅在浏览器支持且用户未禁用动效时启用；不支持的浏览器自动忽略，
   元素保持默认可见。各模块按选择器在自身样式表中启用。 */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

/* ─────────────── 无障碍：减少动效 ─────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body::before {
    animation: none;
  }
  .aurora-blob {
    animation: none;
  }
}

/* ─────────────── 移动端性能降级：关闭昂贵特效 ─────────────── */
@media (max-width: 820px) {
  /* 小屏直接隐藏 blob（参考项目做法），静态底图足够 */
  .aurora-blob {
    display: none;
  }
  .topbar,
  .sidebar-overlay,
  .panel,
  .toolbar,
  .list,
  .stat-card,
  .heatmap-tile,
  .tl-body-pad,
  .notes-body,
  .rank-row,
  .carrier-switch,
  .seg-btn,
  dialog {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* 抽屉式侧边栏仅在打开时短暂覆盖静止页面，恢复磨砂不影响滚动性能；
     提高底色不透明度，为不支持 backdrop-filter 的环境兜底，防止透见后方文字。
     注意：须挂在 .sidebar.open 上（双类特异性），否则会被模块样式表中
     后加载的 .sidebar 基础背景（80%）覆盖 */
  .sidebar.open {
    background: var(--glass-strong);
    backdrop-filter: blur(14px) saturate(1.3);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
  }
}

/* ─────────────── 顶栏功能下拉菜单（.apps-menu） ───────────────
   tariff 顶栏"功能"按钮的下拉面板：导航栏模式（nav-item 复用
   theme.css 侧边导航样式）。开关逻辑见 tariff.js onRootClick。 */
.apps-menu {
  position: relative;
}
.apps-caret {
  margin-left: -3px;
  transition: transform 0.28s var(--ease);
}
.apps-caret svg {
  width: 13px;
  height: 13px;
}
.apps-menu.open .apps-caret {
  transform: rotate(180deg);
}
.apps-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 212px;
  max-width: calc(100vw - 24px); /* 防水平溢出视口（窄屏/靠左挂载时） */
  max-height: calc(100dvh - 88px); /* 防底部溢出视口，超出内滚 */
  overflow-y: auto;
  padding: 7px;
  display: grid;
  gap: 2px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid color-mix(in oklab, var(--line) 82%, transparent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.28s var(--spring);
  z-index: 99;
}
.apps-menu.open .apps-dropdown {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.apps-dropdown .nav-item {
  border-radius: var(--r-sm);
  padding: 8px 10px;
}
.apps-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  padding: 0 8px;
  border-radius: var(--r-full);
  color: #fff;
  background: linear-gradient(135deg, var(--acc), var(--acc-deep));
}
.apps-coming {
  padding: 6px 10px 4px;
  font-size: 11.5px;
  color: color-mix(in oklab, var(--sub) 80%, transparent);
  text-align: center;
  letter-spacing: 0.3px;
}

/* 窄屏：仅留图标（对齐 topbar 既有紧凑化约定） */
@media (max-width: 640px) {
  .apps-menu .apps-label,
  .apps-menu .apps-caret {
    display: none;
  }
}
/* 小屏性能降级：下拉面板实底化（同 ≤820px 约定） */
@media (max-width: 820px) {
  .apps-dropdown {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ─────────────── NoticeGate 公告/警告弹窗（shell/notice.js，body 直下） ─────────────── */
.ng-mask {
  position: fixed;
  inset: 0;
  z-index: 9300; /* 公告可关闭，低于登录弹窗(9999) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: oklch(12% 0.03 262 / 0.5);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  animation: ng-in 0.25s ease;
}
/* must（强制同意）压过一切交互层（含登录弹窗） */
.ng-mask.ng-must {
  z-index: 10000;
}
.ng-mask.ng-out {
  animation: ng-out 0.18s ease forwards;
}
@keyframes ng-in {
  from { opacity: 0; }
}
@keyframes ng-out {
  to { opacity: 0; }
}
.ng-modal {
  width: min(560px, 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: ng-pop 0.32s var(--spring, cubic-bezier(0.34, 1.56, 0.64, 1));
}
@keyframes ng-pop {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
}
.ng-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--acc), var(--acc-deep));
  color: #fff;
}
.ng-head-t {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
/* must（警告）：琥珀警示色调，与公告（主题色）区分 */
.ng-must .ng-head {
  background: linear-gradient(135deg, var(--amber, #e8a23c), #c77f1a);
}
.ng-body {
  padding: 18px 20px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.8;
}
/* mini Markdown 内容样式（notice.js 已转义后生成） */
.ng-body p {
  margin: 0 0 10px;
}
.ng-body p:last-child {
  margin-bottom: 0;
}
.ng-body h3,
.ng-body h4,
.ng-body h5 {
  margin: 14px 0 8px;
  font-weight: 700;
}
.ng-body h3:first-child,
.ng-body h4:first-child,
.ng-body h5:first-child {
  margin-top: 0;
}
.ng-body h3 { font-size: 16.5px; }
.ng-body h4 { font-size: 15px; }
.ng-body h5 { font-size: 14px; color: var(--sub); }
.ng-body ul,
.ng-body ol {
  margin: 0 0 10px;
  padding-left: 22px;
}
.ng-body li {
  margin: 4px 0;
}
.ng-body a {
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ng-body code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  background: color-mix(in oklab, var(--acc) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--acc) 18%, transparent);
  border-radius: 6px;
  padding: 1px 6px;
}
.ng-body b {
  font-weight: 700;
}
.ng-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.ng-skip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  font-size: 13px;
  color: var(--sub);
  cursor: pointer;
  user-select: none;
}
.ng-skip input {
  width: 15px;
  height: 15px;
  accent-color: var(--acc);
  cursor: pointer;
}
@media (max-width: 640px) {
  .ng-mask {
    padding: 14px;
  }
  .ng-modal {
    max-height: 84vh;
    border-radius: 14px;
  }
  .ng-body {
    padding: 14px 16px;
    font-size: 13.5px;
  }
  .ng-head {
    padding: 12px 16px;
  }
}

/* ═══════════════ 资费对比 + 我的收藏 ═══════════════ */
.cmp-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cmp-tb-item { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sub); }
.cmp-tb-gap { flex: 1; }
.cmp-prov {
  padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--txt); font-size: 13px; cursor: pointer;
}
.cmp-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.cmp-chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--sub); font-size: 12.5px; font-weight: 650;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.cmp-chip:hover { border-color: var(--acc); color: var(--acc); }
.cmp-chip.on {
  border-color: var(--acc); background: color-mix(in oklab, var(--acc) 12%, transparent);
  color: var(--acc); font-weight: 750;
}
.cmp-search {
  flex: 1; min-width: 180px; max-width: 280px;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--txt); font-size: 13px;
}
.cmp-search:focus { outline: none; border-color: var(--acc); }
.cmp-grid { display: grid; gap: 12px; align-items: start; }   /* 列数 = 所选运营商数，JS 动态设置模板 */
.cmp-col {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; min-height: 120px;
}
.cmp-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.cmp-col-n { font-size: 12px; color: var(--sub); }
.cmp-col-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.cmp-badge {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 750; color: #fff; line-height: 1.5;
}
.cmp-badge.c-cmcc { background: #1a73e8; }
.cmp-badge.c-cucc { background: #d93025; }
.cmp-badge.c-ctcc { background: #0b8f9f; }
.cmp-badge.c-cbn  { background: #b07d10; }
.cmp-badge.c-imp  { background: #7c5cd6; display: inline-flex; align-items: center; gap: 5px; }
.cmp-badge.c-imp svg { width: 13px; height: 13px; }
.cmp-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px;
  background: var(--surface-2); transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.cmp-card:hover { border-color: color-mix(in oklab, var(--acc) 45%, transparent); box-shadow: 0 2px 10px color-mix(in oklab, var(--acc) 12%, transparent); }
.cmp-card.on {
  border-color: var(--acc);
  background: color-mix(in oklab, var(--acc) 10%, var(--surface-2));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--acc) 35%, transparent), 0 3px 12px color-mix(in oklab, var(--acc) 18%, transparent);
}
/* 已选态名称前置圆形 ✓ 徽章（文字流内不越界，滚动容器裁剪安全） */
.cmp-card.on .cmp-card-name::before {
  content: "✓";
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--acc); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  margin-right: 5px; vertical-align: -3px;
}
.cmp-card-name {
  font-size: 13px; font-weight: 650; color: var(--txt); line-height: 1.45;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.cmp-card-top { display: flex; align-items: flex-start; gap: 2px; }
.cmp-card-top .cmp-card-name { flex: 1; min-width: 0; }
.cmp-card-top .copy-btn { width: 24px; height: 24px; margin-top: -2px; }
.cmp-card-top .copy-btn svg { width: 14px; height: 14px; }
.cmp-card-vals { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; font-size: 11.5px; color: var(--sub); }
.cmp-card-vals .v-fee { color: var(--acc); font-weight: 750; }
.cmp-card-tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px; }
.cmp-colth-detail { margin-top: 3px; font-size: 11px; padding: 2px 8px; }
.cmp-selbar {
  position: sticky; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 9px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0,0,0,.16); font-size: 13px; color: var(--txt);
}
.fav-topbar { margin-bottom: 14px; }
.cmp-selbar-n { color: var(--acc); }
.cmp-mask {
  position: fixed; inset: 0; z-index: 9600;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center; padding: 5vh 14px 14px;
}
.cmp-mask.open { display: flex; }
.cmp-layer {
  width: 100%; max-width: 980px; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28); overflow: hidden;
  animation: cmp-pop .18s ease;
}
.cmp-layer-sm { max-width: 560px; }
@keyframes cmp-pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.cmp-layer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line); flex: none;
}
.cmp-layer-title { display: inline-flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 800; color: var(--txt); }
.cmp-layer-title svg { width: 16px; height: 16px; color: var(--acc); }
.cmp-layer-acts { display: inline-flex; align-items: center; gap: 8px; }
.cmp-close { background: none; border: none; color: var(--sub); font-size: 22px; line-height: 1; cursor: pointer; }
.cmp-close:hover { color: var(--txt); }
.cmp-layer-body { overflow: auto; padding: 14px 16px; }
.cmp-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.cmp-table th, .cmp-table td {
  border: 1px solid var(--line); padding: 7px 10px; text-align: left;
  vertical-align: top; overflow-wrap: anywhere;
}
.cmp-table th { background: var(--surface-2); color: var(--sub); font-weight: 650; white-space: nowrap; }
.cmp-table td { color: var(--txt); min-width: 150px; }
.cmp-rowhead { min-width: 72px; }
.cmp-namerow td { font-weight: 750; }
.cmp-diff td { background: color-mix(in oklab, var(--amber) 13%, transparent); }
.cmp-diff th { color: var(--amber); }
.cmp-same td { color: var(--sub); }
.cmp-nodiff { text-align: center; padding: 24px !important; color: var(--sub); }
.cmp-colth { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.cmp-colth-p { font-size: 11px; font-weight: 400; opacity: .85; }
.cmp-tag {
  display: inline-flex; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 750; line-height: 1.6;
}
.cmp-tag.imp { background: color-mix(in oklab, var(--amber) 22%, transparent); color: var(--amber); }
.cmp-tag.fav { background: color-mix(in oklab, var(--acc) 18%, transparent); color: var(--acc); }
.cmp-import-tip { margin: 0 0 10px; font-size: 12.5px; color: var(--sub); line-height: 1.7; }
.cmp-import-ta {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 180px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--txt); font-size: 12.5px; font-family: inherit; line-height: 1.7;
}
.cmp-import-ta:focus { outline: none; border-color: var(--acc); }
.cmp-import-fb { margin-top: 10px; font-size: 12.5px; line-height: 1.7; }
.cmp-fb-ok { color: var(--green); }
.cmp-fb-bad { color: var(--red); }
.cmp-import-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.cmp-imp-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
}
.cmp-imp-name { flex: 1; min-width: 0; font-size: 13px; color: var(--txt); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.cmp-imp-fee { font-size: 12px; color: var(--acc); font-weight: 700; flex: none; }
.cmp-imp-del { background: none; border: none; color: var(--red); cursor: pointer; padding: 3px; display: flex; }
.cmp-imp-del svg { width: 14px; height: 14px; }
/* 我的收藏 */
.fav-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  margin-bottom: 14px; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.fav-toolbar .act-search { flex: 1 1 180px; min-width: 150px; max-width: 300px; margin: 0; }
.fav-toolbar .sel { width: auto; min-width: 108px; margin: 0; }
@media (max-width: 860px) {
  .fav-toolbar { flex-wrap: wrap; }
  .fav-toolbar .act-search { flex: 1 1 100%; max-width: none; }
}
/* 资费对比工具栏：两行布局（行1 选择+搜索 / 行2 排序+筛选+操作） */
.cmp-tb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.cmp-tb-row + .cmp-tb-row { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.cmp-tb-row .cmp-search { flex: 0 0 auto; width: 240px; max-width: 45vw; }
.cmp-tb-row .topbar-prov { margin: 0; }
.cmp-tb-left { margin-right: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cmp-toolbar .filter-bar { flex: 1 1 auto; }
.cmp-toolbar .filter-bar .sort-bar { flex: 0 0 auto; }
.cmp-tb-div { flex: none; width: 1px; align-self: stretch; margin: 2px 4px; background: color-mix(in oklab, var(--green) 35%, transparent); }
/* 单运营商列：容器仍占满全宽，列内卡片改 auto-fill 多列网格填满宽度（避免单条拉满整行的空洞）；
   非卡片子元素（分页器/空态/加载）跨全行；窄屏 auto-fill 自然退化单列 */
.cmp-grid:has(.cmp-col:only-child) .cmp-col-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; align-content: start; }
.cmp-grid:has(.cmp-col:only-child) .cmp-col-body > *:not(.cmp-card) { grid-column: 1 / -1; }
/* 手机端窄屏：对比列纵向堆叠（!important 覆盖 JS inline 的横向 N 列网格）；
   排序占一行，竖分隔线变为横分隔线占满整行，把筛选组推到下一行 */
@media (max-width: 860px) {
  .cmp-grid { grid-template-columns: 1fr !important; }
  /* 筛选/排序按钮组窄屏改单行横向滑动（参考总览分类分布 bd-list 的滑动手感），不再换行 */
  .cmp-toolbar .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cmp-toolbar .filter-bar::-webkit-scrollbar { display: none; }
  .cmp-toolbar .filter-bar > * { flex: 0 0 auto; }   /* 按钮保持自然宽度不被压缩 */
  /* 竖分隔线恢复竖状随行滚动（上方 100% 占行的规则会让横滑出现"分页"断点） */
  .cmp-toolbar .cmp-tb-div { flex: 0 0 auto; width: 1px; height: 20px; align-self: center; margin: 0 4px; }
}
.fav-group { margin-bottom: 20px; }
.fav-group-title { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; font-size: 14.5px; font-weight: 750; color: var(--txt); }
.fav-group-n { font-size: 12px; font-weight: 400; color: var(--sub); }
.fav-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
/* 对比列分页器（与资费列表分页交互一致） */
.cmp-pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; }
.cmp-pg {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--sub);
  font-size: 11.5px; padding: 3px 10px; border-radius: 8px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cmp-pg:hover:not(:disabled) { border-color: var(--acc); color: var(--acc); }
.cmp-pg:disabled { opacity: .4; cursor: default; }
.cmp-pg-n { font-size: 11.5px; color: var(--sub); }
/* 收藏卡片复用资费列表 tcard 设计语言，仅追加左色条/指针/删除按钮适配 */
.fav-tcard { cursor: pointer; border-left: 4px solid var(--line); transition: border-color .15s; }
.fav-tcard.c-cmcc { border-left-color: #1a73e8; }
.fav-tcard.c-cucc { border-left-color: #d93025; }
.fav-tcard.c-ctcc { border-left-color: #0b8f9f; }
.fav-tcard.c-cbn  { border-left-color: #b07d10; }
.fav-tcard:hover { border-color: var(--acc); border-left-color: var(--acc); }
.fav-tcard .tc-actions { display: inline-flex; align-items: center; gap: 6px; }
.fav-del {
  background: none; border: none; color: var(--sub); cursor: pointer;
  padding: 3px; display: flex; border-radius: 6px; transition: color .15s, background .15s;
}
.fav-del:hover { color: var(--red); background: color-mix(in oklab, var(--red) 10%, transparent); }
.fav-del svg { width: 14px; height: 14px; }
.fav-prov-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--sub); border: 1px solid var(--line);
}
.fav-st-tag { font-weight: 700; }
.fav-modal {
  width: 100%; max-width: 520px; max-height: 80vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--acc);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.28); overflow: hidden;
  animation: cmp-pop .18s ease;
}
.fav-modal.fm-cmcc { border-top-color: #1a73e8; }
.fav-modal.fm-cucc { border-top-color: #d93025; }
.fav-modal.fm-ctcc { border-top-color: #0b8f9f; }
.fav-modal.fm-cbn  { border-top-color: #b07d10; }
.fm-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 9px 14px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.fm-head .cmp-close { margin-left: 2px; font-size: 19px; }
/* 弹窗头部操作按钮组：复制名称/概要/分享（margin-left:auto 推右，关闭按钮跟在其后） */
.fm-acts { margin-left: auto; display: inline-flex; align-items: center; gap: 0; flex: none; }
.fm-acts .copy-btn { opacity: 0.7; }
.fm-acts .copy-btn:hover { opacity: 1; }
.fm-titlebar {
  display: flex; align-items: baseline; gap: 12px;
  padding: 10px 14px 0; border-bottom: none;
}
.fm-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 800; color: var(--txt); line-height: 1.5; overflow-wrap: anywhere; }
.fm-price { flex: none; font-size: 15px; font-weight: 800; color: var(--acc); overflow-wrap: anywhere; }
.fm-sub {
  padding: 0 14px 2px; font-size: 11.5px; color: var(--sub);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.fm-sub-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--sub); opacity: .55; }
.fm-quick {
  display: flex; flex-wrap: wrap; gap: 5px 6px;
  padding: 6px 14px 10px; border-bottom: 1px solid var(--line);
}
.fm-quick span {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--sub);
}
.fm-quick .fm-t { border-style: dashed; opacity: .85; }
.fm-body { overflow: auto; padding: 8px 14px 12px; }
.fm-row {
  display: flex; gap: 12px; padding: 5px 2px;
  border-bottom: 1px dashed var(--line); align-items: flex-start;
}
.fm-body .fm-row:last-child { border-bottom: none; }
.fm-row .k { flex: none; width: 82px; font-size: 11.5px; color: var(--sub); padding-top: 1px; }
.fm-row .v { flex: 1; min-width: 0; font-size: 12.5px; color: var(--txt); line-height: 1.6; overflow-wrap: anywhere; }
.fm-row.sem-data .k { color: var(--green); font-weight: 650; }
.fm-row.sem-call .k { color: #1a73e8; font-weight: 650; }
.fm-row.sem-broadband .k { color: #8e44ad; font-weight: 650; }
.fm-row.sem-online .k { color: var(--green); font-weight: 650; }
.fm-row.sem-offline .k { color: var(--red); font-weight: 650; }
.fm-notes { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.fm-note { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.fm-note .nk { font-size: 11px; font-weight: 750; color: var(--acc); margin-bottom: 2px; }
.fm-note .nv { font-size: 12px; color: var(--txt); line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.fm-empty { color: var(--sub); font-size: 12.5px; padding: 6px 0; line-height: 1.7; }
.cmp-more {
  display: block; width: 100%; margin-top: 2px; padding: 7px 8px;
  border: 1px dashed var(--line); border-radius: 8px; background: none;
  color: var(--sub); font-size: 11.5px; cursor: pointer; text-align: center;
  transition: border-color .15s, color .15s;
}
.cmp-more:hover { border-color: var(--acc); color: var(--acc); }
@media (max-width: 960px) {
  .cmp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cmp-grid { grid-template-columns: 1fr; }
  .cmp-col-body { max-height: 340px; }
}
