/* =========================================================================
   i9tv.cn — advent (老九) 粉丝社区网站主样式表
   - 主题：日间 / 夜间 双模式，使用 CSS 变量驱动
   - 切换动画：优先 View Transitions API（圆形扩散），fallback 至 CSS 全局过渡
   - 响应式：移动优先，PC 双栏，移动单栏 + 汉堡菜单
   ========================================================================= */

/* ---------- 主题变量 ---------- */
/* =============================================================
   深浅双档 Token 体系 · HIG v2（依据 docs/hig-research.md + docs/hig-contract.md v1.1，
   替代 design-system-tokens.md v1.0；T6 实施）
   约定：浅色为站点默认（:root），深色为 [data-theme="dark"]
   原则：禁纯黑纯白；层级靠明度与光影，不靠边框；分割用 hairline；
         组件过渡统一 var(--dur-base) 250ms + var(--ease-hig) cubic-bezier(0.16,1,0.3,1)
   ============================================================= */
:root {
  color-scheme: light; /* 浏览器原生控件（滚动条/表单）跟随浅色 */

  /* ── 画布与表面（HIG v2：冷灰石膏基底 + 表面恒白，层级靠明度与阴影）── */
  --canvas: #F5F5F7;             /* v4 基底：Apple 中性底（红线 C1），ΔL*≈3.4 与白卡分离 */
  --canvas-deep: #EFEFF2;        /* 页脚/加深分区 */
  --canvas-raised: #F8F8FA;      /* 侧边栏/次级画布 */
  --surface-inset: #ECECF0;      /* 内嵌井（text-3 占位 4.91:1） */
  --surface-1: #FFFFFF;          /* 卡片 / 列表项 */
  --surface-2: #FFFFFF;          /* 下拉 / Popover */
  --surface-3: #FFFFFF;          /* 对话框 / 选中态 */
  --surface-4: #F6F6F8;          /* hover 轻染层 */

  /* ── 旧名兼容映射（其余 1600 行 CSS 引用，勿删）── */
  --bg: #F5F5F7;                 /* = --canvas */
  --bg-secondary: #EFEFF2;       /* = --canvas-deep（次级表面/列表底） */
  --bg-tertiary: #FFFFFF;        /* = --surface-1（输入底/悬浮高亮） */
  --bg-elevated: #FFFFFF;        /* = --surface-2（浮层底） */
  --bg-overlay: rgba(245, 245, 247, 0.85);
  --bg-primary: #FFFFFF;         /* .form-select option 引用（旧代码补定义） */

  /* ── 文字三级（深墨，禁 #000）── */
  --text: #181A1E;
  --text-secondary: #4B5563;
  --text-tertiary: #5F6672;
  --text-on-primary: #FFFFFF;
  --text-1: #181A1E;             /* 新命名：主文字 */
  --text-2: #4B5563;             /* 新命名：次级 */
  --text-3: #5F6672;             /* 新命名：三级/占位 */
  --text-disabled: #9CA3AF;      /* 禁用（对比度豁免） */

  /* ── 细边与焦点环（分割禁止实色边框）── */
  --hairline: rgba(0, 0, 0, 0.05);            /* 微光细边（白卡 C2 精确值） */
  --hairline-strong: rgba(0, 0, 0, 0.08);     /* 输入框/控件边界 */
  --edge-glow-top: inset 0 1px 0 rgba(255, 255, 255, 0.60); /* 表面顶缘高光 */
  --edge-glow-ring: 0 0 0 1px rgba(0, 0, 0, 0.05);         /* 浮层边缘微光圈 */
  --edge-glow: inset 0 1px 0 rgba(255, 255, 255, 0.60), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --focus-ring: #2563EB;                      /* 焦点环（蓝，≥3:1） */
  --focus-ring-strong: #1D4ED8;
  --ring: 0 0 0 2px var(--canvas), 0 0 0 4px var(--focus-ring); /* 焦点光环成品 */

  /* ── 旧名兼容：边框转为半透明 hairline（清除硬框）── */
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --nav-border: rgba(0, 0, 0, 0.05);
  --nav-bg: rgba(245, 245, 247, 0.72);
  --nav-blur: saturate(180%) blur(20px);
  --card-bg: #FFFFFF;
  --card-bg-hover: #F6F6F8;

  /* ── 阴影六档（每档双层：Key 近程锐影 + Ambient 远程弥散；v4：纯黑低 α ≤0.04）── */
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.02), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.02), 0 4px 8px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.02), 0 8px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.03), 0 12px 24px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 6px 12px rgba(0, 0, 0, 0.03), 0 20px 40px rgba(0, 0, 0, 0.04);
  --shadow-xxl: 0 8px 16px rgba(0, 0, 0, 0.03), 0 28px 56px rgba(0, 0, 0, 0.04);
  --shadow-ambient: 0 12px 24px rgba(0, 0, 0, 0.04); /* 悬浮环境影（成品） */

  /* ── 品牌色（老九红 P0 #E24B4A 系；--primary* 会被 JS 主题色预设 inline 覆盖）── */
  --primary: #DC2626;
  --primary-hover: #B91C1C;
  --primary-light: #FEF2F2;
  --primary-lighter: #FEE2E2;
  --primary-rgb: 220, 38, 38;
  --brand: #DC2626;              /* 按钮/强调底 */
  --brand-hover: #B91C1C;
  --brand-active: #991B1B;
  --brand-text: #C62F2E;         /* 红字/链接 */
  --brand-identity: #E24B4A;     /* Logo/装饰大块 */
  --brand-soft-bg: #FEE2E2;
  --brand-soft-fg: #B91C1C;
  --on-brand: #FFFFFF;

  /* ── 辅助蓝与状态色（fg=文字/图标，soft=徽章底字，solid=实底按钮）── */
  --accent: #2563EB; --accent-hover: #1D4ED8; --accent-light: #DBEAFE; --accent-rgb: 37, 99, 235;
  --accent-soft-bg: #DBEAFE; --accent-soft-fg: #1D4ED8;
  --teal: #0D9488; --teal-light: #CCFBF1;
  --purple: #6D28D9; --purple-light: #EDE9FE;
  --amber: #D97706; --amber-light: #FEF3C7;
  --success: #15803D; --success-light: #DCFCE7;
  --success-fg: #15803D; --success-soft-bg: #DCFCE7; --success-solid: #15803D; --on-success: #FFFFFF;
  --warning: #92400E; --warning-light: #FEF3C7;
  --warning-fg: #92400E; --warning-soft-bg: #FEF3C7; --warning-solid: #D97706; --on-warning: #181A1E;
  --danger: #B91C1C; --danger-light: #FEE2E2;
  --danger-fg: #B91C1C; --danger-soft-bg: #FEE2E2; --danger-solid: #DC2626; --on-danger: #FFFFFF;
  --info-fg: #1D4ED8; --info-soft-bg: #DBEAFE; --info-solid: #2563EB; --on-info: #FFFFFF;

  /* ── 代码块（夜间风格，两模式通用）── */
  --code-bg: #1E1E2E;
  --code-text: #CDD6F4;

  /* ── 动效（HIG v2：组件过渡统一 250ms + cubic-bezier(0.16,1,0.3,1)；尊重 prefers-reduced-motion）── */
  --transition-duration: 0.22s;                     /* 依赖保护：admin.css L31/L564 现役引用，定义与值保留（契约 §2-4） */
  --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);/* 同上，保留现值 */
  --ease-hig: cubic-bezier(0.16, 1, 0.3, 1);        /* R5：组件过渡统一曲线（升格为标准曲线） */
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);   /* 旧名保留，值 = HIG（M3 0.2,0,0,1 废弃） */
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);      /* 进入 = HIG（旧 M3 0,0,0.2,1 废弃） */
  --ease-leave: cubic-bezier(0.4, 0, 1, 1);         /* 退场 / 消失 */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);    /* 仅页面级/主题切换（既有动画，保留） */
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 150ms; --dur-base: 250ms; --dur-slow: 350ms;

  /* ── 圆角标尺 ── */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 20px; --radius-full: 999px;
}

/* ---------- 夜间模式 ---------- */
[data-theme="dark"] {
  color-scheme: dark;

  /* ── 画布与表面（HIG v2：岩黑基底 + 钨钢色阶 Tonal Elevation 逐级提亮）── */
  --canvas: #0D0E11;              /* v4 基底 = 红线 C3 指定（深岩黑） */
  --canvas-deep: #0A0B0E;         /* 沉浸式大背景边缘加深 */
  --canvas-raised: #121418;       /* 侧边栏 / 次级画布 = 红线指定（保留） */
  --surface-inset: #0B0C0F;       /* 内嵌井：输入框底 / 分段控件轨道 */
  --surface-1: #1E222B;           /* 卡片 / 列表项（对画布 ΔL* 9.2，粘连根治） */
  --surface-2: #232730;           /* 下拉 / Popover / 卡片 hover */
  --surface-3: #2A2E39;           /* 对话框 / 选中态 / Active */
  --surface-4: #313540;           /* 高亮上的 hover 强档 */

  /* ── 旧名兼容映射 ── */
  --bg: #0D0E11;
  --bg-secondary: #1E222B;        /* 次级表面（hover 提亮/列表底，方向向上） */
  --bg-tertiary: #232730;         /* = --surface-2（悬浮高亮） */
  --bg-elevated: #232730;         /* 浮层底 */
  --bg-overlay: rgba(13, 14, 17, 0.85);
  --bg-primary: #1E222B;          /* .form-select option 下拉底 */

  /* ── 文字三级（冷白，禁 #FFF）── */
  --text: #E6EDF3;
  --text-secondary: #929CA6;
  --text-tertiary: #87929E;
  --text-on-primary: #FFFFFF;
  --text-1: #E6EDF3;
  --text-2: #929CA6;
  --text-3: #87929E;
  --text-disabled: #5C6670;

  /* ── 细边与焦点环 ── */
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --edge-glow-top: inset 0 1px 0 rgba(255, 255, 255, 0.08); /* 顶缘反光圈（v4 统一 0.08，禁发光晕） */
  --edge-glow-ring: 0 0 0 1px rgba(255, 255, 255, 0.08);   /* 悬浮边缘微光圈（0.05 → 0.08，v4） */
  --edge-glow: var(--edge-glow-top), var(--edge-glow-ring);
  --focus-ring: #60A5FA;
  --focus-ring-strong: #60A5FA;
  --ring: 0 0 0 2px var(--surface-inset), 0 0 0 4px var(--focus-ring);

  /* ── 旧名兼容：边框转半透明 ── */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --nav-border: rgba(255, 255, 255, 0.08);
  --nav-bg: rgba(13, 14, 17, 0.72);
  --nav-blur: saturate(140%) blur(20px);
  --card-bg: #1E222B;
  --card-bg-hover: #232730;

  /* ── 阴影：黑色系环境暗影（R7 静止档降重去生硬；无任何白色光晕）── */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 2px 6px rgba(0, 0, 0, 0.20);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.32), 0 2px 8px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.40), 0 12px 24px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.45), 0 24px 48px rgba(0, 0, 0, 0.40);
  --shadow-xxl: 0 16px 32px rgba(0, 0, 0, 0.48), 0 40px 80px rgba(0, 0, 0, 0.45);
  --shadow-ambient: 0 12px 24px rgba(0, 0, 0, 0.45);

  /* ── 品牌色（深色身份红；--primary* 兜底值与 JS red 预设一致：队长 F1 方案 A 同步 #D43C3C，防 FOUC 色跳）── */
  --primary: #D43C3C;
  --primary-hover: #DA4A4A;
  --primary-light: #450A0A;
  --primary-lighter: #7F1D1D;
  --primary-rgb: 239, 68, 68;
  --brand: #E24B4A;
  --brand-hover: #ED5B5A;
  --brand-active: #C93B3A;
  --brand-solid: #D43C3C;        /* 实底按钮（白字 4.66:1，T1 §4.3） */
  --brand-solid-hover: #DA4A4A;  /* hover 提亮 6%（白字 4.15:1，仅瞬时态，T1 §4.3 注） */
  --brand-text: #ED6161;
  --brand-identity: #E24B4A;
  --brand-soft-bg: rgba(226, 75, 74, 0.14);
  --brand-soft-fg: #F08C8B;
  --on-brand: #FFFFFF;

  /* ── 辅助蓝与状态色 ── */
  --accent: #3B82F6; --accent-hover: #60A5FA; --accent-light: rgba(59, 130, 246, 0.16); --accent-rgb: 59, 130, 246;
  --accent-soft-bg: rgba(59, 130, 246, 0.16); --accent-soft-fg: #60A5FA;
  --teal: #2DD4BF; --teal-light: rgba(45, 212, 191, 0.14);
  --purple: #818CF8; --purple-light: rgba(129, 140, 248, 0.16);
  --amber: #FBBF24; --amber-light: rgba(251, 191, 36, 0.14);
  --success: #4ADE80; --success-light: rgba(74, 222, 128, 0.14);
  --success-fg: #4ADE80; --success-soft-bg: rgba(74, 222, 128, 0.14); --success-solid: #4ADE80; --on-success: #0D0E11;
  --warning: #FBBF24; --warning-light: rgba(251, 191, 36, 0.14);
  --warning-fg: #FBBF24; --warning-soft-bg: rgba(251, 191, 36, 0.14); --warning-solid: #FBBF24; --on-warning: #0D0E11;
  --danger: #F87171; --danger-light: rgba(248, 113, 113, 0.14);
  --danger-fg: #F87171; --danger-soft-bg: rgba(248, 113, 113, 0.14); --danger-solid: #F87171; --on-danger: #0D0E11;
  --info-fg: #60A5FA; --info-soft-bg: rgba(96, 165, 250, 0.16); --info-solid: #60A5FA; --on-info: #0D0E11;

  /* ── 代码块 ── */
  --code-bg: #11111B;
  --code-text: #CDD6F4;
}

/* ---------- 重置与基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background-color: var(--bg); }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 主题切换全局过渡（fallback，View Transitions API 不支持时启用）
   只对颜色属性过渡，避免影响 transform/opacity 性能
   使用非线性 spring 风格缓动，过渡更平滑 */
body.no-vt *,
body.no-vt *::before,
body.no-vt *::after {
  transition: background-color 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              fill 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* =========================================================================
   View Transitions API — 主题切换圆形扩散动画（更平滑）
   非线性缓动 cubic-bezier(0.22, 1, 0.36, 1)（ease-out-back 变体）
   ========================================================================= */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }
::view-transition-new(root) {
  animation: theme-reveal 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
::view-transition-old(root) {
  animation: theme-fade-back 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes theme-reveal {
  from { clip-path: circle(0% at var(--reveal-x, 50%) var(--reveal-y, 50%)); }
  to   { clip-path: circle(150% at var(--reveal-x, 50%) var(--reveal-y, 50%)); }
}
@keyframes theme-fade-back {
  from { opacity: 1; }
  to   { opacity: 1; }
}

/* 尊重用户"减少动画"偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

a { color: var(--accent); text-decoration: none; transition: color var(--dur-base) var(--ease-hig); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

button { font-family: inherit; cursor: pointer; }

::selection { background: rgba(var(--primary-rgb), 0.25); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ---------- 布局工具 ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-narrow { max-width: 1100px; }

main { flex: 1 0 auto; padding: 24px 0 48px; }

.row { display: flex; }
.col { flex: 1; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }  /* P1-5b：裸 .grid 单列原为隐式 auto，min-content 会把列撑破容器 */
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.section { margin-bottom: 32px; }   /* v4：旧 40px；红线 28–36 取 32 */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-strong);
}
.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .more { font-size: 13px; color: var(--text-secondary); }
.section-title .more:hover { color: var(--accent); }

.layout-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;  /* v4：旧 1fr 300px；侧栏 340px（红线 320–360 中值） */
  gap: 28px;
}
.sidebar { display: flex; flex-direction: column; gap: 20px; }

/* 侧边栏卡片文字统一优化 */
.sidebar .card {
  line-height: 1.5;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); font-weight: 500; }
.text-faint { color: var(--text-tertiary); font-weight: 500; }
.text-sm { font-size: 14px; font-weight: 500; }
.text-xs { font-size: 13px; font-weight: 500; }

/* 暗色模式下小字号文字提升可读性 */
[data-theme="dark"] .nav-link {
  color: var(--text-secondary);
  font-weight: 500;
}
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 28px; font-weight: 700; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* ---------- 导航栏 — 静止吸顶，独立于内容区过渡动画 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--nav-border);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 72px;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--primary); }
.nav-logo .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.nav-logo .logo-text { letter-spacing: -0.3px; }
.nav-logo .logo-text small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  will-change: transform;
  transition: background var(--dur-base) var(--ease-hig), color var(--dur-base) var(--ease-hig),
              opacity var(--anim-duration-leave, 280ms) var(--anim-easing-leave, cubic-bezier(0.4, 0, 1, 1)),
              max-width var(--anim-duration-leave, 280ms) var(--anim-easing-leave, cubic-bezier(0.4, 0, 1, 1)),
              padding var(--anim-duration-leave, 280ms) var(--anim-easing-leave, cubic-bezier(0.4, 0, 1, 1)),
              margin var(--anim-duration-leave, 280ms) var(--anim-easing-leave, cubic-bezier(0.4, 0, 1, 1));
}
.nav-link.nav-hidden {
  opacity: 0;
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
  overflow: hidden;
  pointer-events: none !important;
}
.nav-link:hover { background: var(--bg-secondary); color: var(--text); }
.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  /* 修复：去除 font-weight 500→600 的字重跳变 —— 字重变化会改变文字宽度，
     导致激活项右侧的导航项整体位移（布局颠簸/交互生硬）；激活态仅靠 底色 + 红色文字 区分 */
  /* HIG v2：统一 250ms HIG 曲线（C3 活规则纳入统一清单）；布局属性沿用 nav-hidden 折叠体系 */
  transition: background var(--dur-base) var(--ease-hig), color var(--dur-base) var(--ease-hig),
              opacity var(--anim-duration-leave, 280ms) var(--anim-easing-leave, cubic-bezier(0.4, 0, 1, 1)),
              max-width var(--anim-duration-leave, 280ms) var(--anim-easing-leave, cubic-bezier(0.4, 0, 1, 1)),
              padding var(--anim-duration-leave, 280ms) var(--anim-easing-leave, cubic-bezier(0.4, 0, 1, 1)),
              margin var(--anim-duration-leave, 280ms) var(--anim-easing-leave, cubic-bezier(0.4, 0, 1, 1));
}
[data-theme="dark"] .nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto; /* 移动端 nav-links 隐藏时把登录/注册/按钮推到右侧，避免左挤右空 */
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-search input {
  width: 36px;
  height: 36px;
  padding: 0 36px 0 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 13px;
  outline: none;
  opacity: 0;
  cursor: pointer;
  transition: width 0.35s var(--ease-spring), opacity var(--dur-base) var(--ease-hig), border-color var(--dur-base) var(--ease-hig);
}
.nav-search:hover input { width: 200px; opacity: 1; cursor: text; }
.nav-search input:focus { border-color: var(--primary); width: 240px; opacity: 1; }
.nav-search .search-icon {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  background: transparent;
  pointer-events: none;
  transition: color var(--dur-base) var(--ease-hig);
}
.nav-search .search-icon svg { display: block; }
.nav-search input:focus ~ .search-icon { color: var(--primary); }

/* 主题切换按钮 */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-base) var(--ease-hig), background var(--dur-base) var(--ease-hig), color var(--dur-base) var(--ease-hig);
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
.theme-toggle:active { transform: scale(0.92); }
/* 通用导航图标按钮（设置等，风格同 theme-toggle）*/
.nav-icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-secondary);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform var(--dur-base) var(--ease-hig), border-color var(--dur-base) var(--ease-hig), color var(--dur-base) var(--ease-hig), background var(--dur-base) var(--ease-hig);
  flex-shrink: 0; text-decoration: none; cursor: pointer;
}
.nav-icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.nav-icon-btn:active { transform: scale(0.92); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon {
  position: absolute;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--dur-base) var(--ease-hig), transform var(--dur-base) var(--ease-hig);
}
.theme-toggle .icon-sun svg, .theme-toggle .icon-moon svg { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0); }
:root:not([data-theme="dark"]) .theme-toggle .icon-sun { opacity: 0; transform: rotate(-90deg) scale(0); }
:root:not([data-theme="dark"]) .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

/* 主题色菜单（折叠：触发器按钮 + 弹出面板，点击展开显示全部色点）*/
.color-menu { position: relative; flex-shrink: 0; }
.color-trigger {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s var(--transition-timing), border-color 0.2s, background 0.2s;
}
.color-trigger:hover { border-color: var(--primary); }
.color-trigger:active { transform: scale(0.92); }
.color-trigger-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1), inset 0 0 0 2px rgba(255,255,255,0.45);
  transition: background 0.4s var(--transition-timing);
}
/* 弹出面板 */
.color-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 224px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-elevated, var(--bg-secondary));
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.94);
  transform-origin: top right;
  transition: opacity 0.22s cubic-bezier(0.22,1,0.36,1),
              transform 0.22s cubic-bezier(0.22,1,0.36,1),
              visibility 0.22s;
  z-index: 200;
}
.color-menu.open .color-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.color-panel-title {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.color-panel .color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  justify-self: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
  transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), border-color 0.2s;
}
.color-panel .color-dot:hover { transform: scale(1.18); }
.color-panel .color-dot.active {
  border-color: var(--text);
  transform: scale(1.12);
}
.color-panel .color-dot.active:hover { transform: scale(1.2); }
.color-panel .color-dot-custom { position: relative; overflow: hidden; }
.color-panel .color-dot-custom .color-dot-custom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 0 2px rgba(255,255,255,0.85), 0 0 2px rgba(0,0,0,0.45);
  pointer-events: none;
}
.color-custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.color-custom-label { flex: 1; }
.color-custom-row input[type="color"] {
  width: 40px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.color-confirm-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.color-confirm-btn:hover { background: var(--primary); color: #fff; }
.color-confirm-btn:active { transform: scale(0.94); }
.color-confirm-btn.has-pending { animation: colorPendingPulse 1.5s ease-in-out infinite; }
@keyframes colorPendingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(var(--primary-rgb), 0); }
}
/* 移动端：面板右对齐收窄，避免溢出屏幕 */
@media (max-width: 768px) {
  .color-panel { min-width: 180px; right: -4px; }
  .color-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .color-panel .color-dot { width: 22px; height: 22px; }
}

/* 用户头像/登录按钮 */
.btn-login {
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--dur-base) var(--ease-hig), transform var(--dur-fast) var(--ease-hig);
}
.btn-login:hover { background: var(--primary-hover); }
.btn-login:active { transform: scale(0.96); }

.nav-user {
  position: relative;
}
.nav-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: background var(--dur-base) var(--ease-hig);
}
.nav-user-trigger:hover { background: var(--bg-tertiary); }

/* 通知红点 */
.nav-user-trigger.has-notify::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid #fff;
}
.nav-notify-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}
.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.nav-user-name { font-size: 14px; font-weight: 500; color: var(--text); }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-base) var(--ease-hig), transform var(--dur-base) var(--ease-hig), visibility var(--dur-base);
  z-index: 200;
}
.nav-user.open .user-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.user-menu-header .name { font-weight: 600; font-size: 14px; }
.user-menu-header .role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: transparent;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  transition: background var(--dur-base) var(--ease-hig), color var(--dur-base) var(--ease-hig);
}
.user-menu-item:hover { background: var(--bg-secondary); color: var(--text); }
.user-menu-item.danger:hover { color: var(--danger); background: var(--danger-light); }

.nav-burger {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  align-items: center;
  justify-content: center;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  transition: background var(--dur-base) var(--ease-hig), border-color var(--dur-base) var(--ease-hig), color var(--dur-base) var(--ease-hig), transform var(--dur-fast) var(--ease-hig), box-shadow var(--dur-base) var(--ease-hig);
  white-space: nowrap;
}
/* HIG v2：按压语义 scale(0.98)（无位移），替换旧 translateY(1px) 下移 */
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-secondary); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-tertiary); border-color: var(--border-strong); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.95); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: box-shadow var(--dur-base) var(--ease-hig), transform var(--dur-base) var(--ease-hig);
  will-change: transform;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card > h3:first-child {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px 0;
}
.card > * + * {
  margin-top: 6px;
}
.card > .btn + .btn {
  margin-top: 6px;
}
.card > .text-xs:last-child,
.card > .text-sm:last-child {
  margin-bottom: 0;
}

.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.card-body { color: var(--text-secondary); font-size: 14px; }

/* ---------- 徽章/标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-teal { background: var(--teal-light); color: var(--teal); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-p0 { background: #fef2f2; color: #dc2626; }
.badge-p1 { background: #fef3c7; color: #d97706; }
.badge-p2 { background: #dbeafe; color: #2563eb; }
.badge-p3 { background: #f1f5f9; color: #64748b; }
[data-theme="dark"] .badge-p0 { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-p1 { background: #422006; color: #fcd34d; }
[data-theme="dark"] .badge-p2 { background: #172554; color: #93c5fd; }
[data-theme="dark"] .badge-p3 { background: #1e293b; color: #94a3b8; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-hig), color var(--dur-base) var(--ease-hig), border-color var(--dur-base) var(--ease-hig);
}
.tag:hover { color: var(--primary); border-color: var(--primary); }
.tag.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
}
.dot-live { background: var(--danger); box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.5); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* ---------- 直播状态卡 ---------- */
.stream-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-hig), transform var(--dur-base) var(--ease-hig);
}
.stream-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-2px);
}
.stream-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}
.stream-card .stream-cover {
  width: 96px;
  height: auto;
  min-height: 96px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.stream-card .stream-cover img { display: block; border-radius: 10px; }
.stream-card .stream-info { flex: 1; min-width: 0; position: relative; align-self: center; }
.stream-card .stream-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}
.stream-card .stream-meta { display: flex; gap: 14px; font-size: 13px; opacity: 0.92; flex-wrap: wrap; }
.stream-card .stream-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  margin-right: 8px;
}
.stream-card-offline {
  background: var(--card-bg);
  border: 2px solid var(--border);
  color: var(--text);
  box-shadow: none;
}
.stream-card-offline .stream-cover { background: var(--bg-secondary); }

/* ---------- 赛事/比赛行 ---------- */
.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  transition: box-shadow var(--dur-base) var(--ease-hig), transform var(--dur-base) var(--ease-hig);
}
.match-row:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.match-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
}
.match-team.right { justify-content: flex-end; }
.match-team-logo {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--bg-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
}
.match-vs {
  padding: 4px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 56px;
  text-align: center;
}
.match-score {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.match-meta { font-size: 12px; color: var(--text-tertiary); display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 90px; }
.match-live { color: var(--danger); font-weight: 600; }

/* ---------- 外设卡 ---------- */
.periph-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-hig), transform var(--dur-base) var(--ease-hig), border-color var(--dur-base) var(--ease-hig);
  display: flex;
  flex-direction: column;
}
.periph-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.periph-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-tertiary);
  position: relative;
}
.periph-cover .laoji-flag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.periph-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.periph-name { font-size: 15px; font-weight: 600; color: var(--text); }
.periph-brand { font-size: 12px; color: var(--text-tertiary); }
.periph-rating { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.stars { color: var(--amber); letter-spacing: 1px; }
.periph-price { margin-top: auto; font-weight: 700; color: var(--primary); font-size: 14px; }

/* ---------- 视频网格 ---------- */
.video-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-hig), transform var(--dur-base) var(--ease-hig);
  display: flex;
  flex-direction: column;
}
.video-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.video-cover {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e1e2e, #313244);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}
.video-duration {
  position: absolute;
  bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.video-body { padding: 10px 12px; }
.video-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.video-meta { font-size: 12px; color: var(--text-tertiary); display: flex; gap: 10px; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--dur-base) var(--ease-hig), box-shadow var(--dur-base) var(--ease-hig);
}
.form-textarea { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

/* form-select 美化：自定义箭头 + 圆角选项 */
.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}
.form-select:hover {
  border-color: var(--text-tertiary);
  background-color: var(--bg-secondary);
}
.form-select option {
  padding: 10px 14px;
  background: var(--bg-primary);
  color: var(--text);
  font-size: 14px;
}
.form-hint { font-size: 13px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 4px; font-weight: 500; }

.input-group { display: flex; align-items: stretch; }
.input-group .form-input { border-radius: 0 8px 8px 0; }
.input-group .input-addon {
  padding: 0 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card-bg); }
.table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-secondary); }

/* ---------- Markdown 渲染 ---------- */
.markdown { line-height: 1.75; color: var(--text); }
.markdown h1, .markdown h2, .markdown h3 { font-weight: 700; margin: 1.2em 0 0.5em; line-height: 1.3; }
.markdown h1 { font-size: 24px; }
.markdown h2 { font-size: 20px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.markdown h3 { font-size: 17px; }
.markdown p { margin: 0.6em 0; }
.markdown ul, .markdown ol { margin: 0.6em 0; padding-left: 24px; }
.markdown li { margin: 0.25em 0; }
.markdown code {
  background: var(--bg-secondary);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
}
.markdown pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px 18px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.8em 0;
  font-size: 13px;
  line-height: 1.5;
}
.markdown pre code { background: none; color: inherit; padding: 0; }
.markdown blockquote {
  border-left: 3px solid var(--primary);
  padding: 4px 16px;
  margin: 0.8em 0;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 0 6px 6px 0;
}
.markdown a { color: var(--accent); text-decoration: underline; }
.markdown table { width: 100%; border-collapse: collapse; margin: 0.8em 0; }
.markdown th, .markdown td { border: 1px solid var(--border); padding: 8px 12px; }
.markdown th { background: var(--bg-secondary); }
.markdown img { max-width: 100%; border-radius: 6px; margin: 0.6em 0; }

/* ---------- 版本历史/diff ---------- */
.diff-line { font-family: "SF Mono", Consolas, monospace; font-size: 13px; padding: 1px 10px; white-space: pre-wrap; word-break: break-all; }
.diff-add { background: var(--success-light); color: var(--success); }
.diff-del { background: var(--danger-light); color: var(--danger); }
.diff-context { color: var(--text-secondary); }

.version-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.version-item:last-child { border-bottom: none; }
.version-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
}
.version-num.current { background: var(--primary); color: #fff; font-size: 0; }
.version-num.current svg { display: block; }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-text { font-size: 14px; }

/* ---------- 加载骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 37%, var(--bg-secondary) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s var(--ease-spring) infinite;
  border-radius: 6px;
}
@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none !important;
}
.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  pointer-events: auto;
  animation: toast-in 250ms var(--ease-hig);   /* HIG v2：0.3s --transition-timing → 250ms HIG（契约 §7-8） */
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.warn { border-left: 3px solid var(--warning); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- 通知条 ---------- */
.notice-bar {
  background: var(--primary-light);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
}
.notice-bar .close { margin-left: auto; cursor: pointer; color: var(--text-tertiary); }

/* ---------- 页脚 ---------- */
.footer {
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 0 20px;
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.footer-col h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.footer-col a { display: block; color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.footer-col a:hover { color: var(--primary); }
.footer-brand .nav-logo { margin-bottom: 12px; }
.footer-brand p { font-size: 13px; color: var(--text-tertiary); max-width: 320px; }
.footer-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom .icp a { color: var(--text-tertiary); }
.footer-bottom .icp a:hover { color: var(--primary); }

/* ---------- 页面头部 ---------- */
.page-header {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.page-header .desc { color: var(--text-secondary); font-size: 14px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-tertiary); }

/* ---------- 评分 ---------- */
.rating-input { display: inline-flex; gap: 4px; }
.rating-input .star {
  font-size: 22px;
  color: var(--border-strong);
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-hig), transform var(--dur-base) var(--ease-hig);
  user-select: none;
}
.rating-input .star:hover { transform: scale(1.15); }
.rating-input .star.active { color: #f59e0b; }
.rating-input .star:hover { transform: scale(1.15); }
.rating-input .star.on { color: var(--amber); }

/* ---------- 工具类:透传/圆角等 ---------- */
.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }
.no-underline { text-decoration: none; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: none; }
.hr-thick { height: 2px; background: var(--border); }

/* ---------- 移动端适配 ---------- */
.mobile-only { display: none; }

@media (max-width: 1024px) {
  .layout-2col { grid-template-columns: minmax(0, 1fr); }   /* P1-5b：裸 1fr 的隐性 min-content 会在 320 档把整页撑宽 */
  .sidebar { order: 2; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
  .nav-search input { width: 140px; }
  .nav-search input:focus { width: 180px; }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  main { padding: 16px 0 32px; }
  .nav-inner { height: 64px; gap: 12px; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    padding: 16px;
    gap: 4px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
    z-index: 99;
  }
  .nav-links.open .nav-link { width: 100%; padding: 12px 14px; font-size: 15px; }
  .nav-burger { display: inline-flex; }
  .nav-search { display: none; }
  .nav-search.open {
    display: flex;
    position: fixed;
    top: 56px; left: 0; right: 0;
    padding: 12px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav-search.open input { width: 100%; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }   /* P1-5b：同上，防 min-content 撑宽 */
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .mobile-only { display: block; }
  .desktop-only { display: none !important; }

  .section-title h2 { font-size: 18px; }
  .page-header h1 { font-size: 20px; }
  .stream-card { flex-direction: column; align-items: flex-start; text-align: left; }
  .stream-card .stream-cover, .stream-card .stream-cover img { width: 100% !important; max-height: 200px; height: auto !important; }
  .match-row { flex-wrap: wrap; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .toast-container { right: 12px; left: 12px; }
  .toast { max-width: none; }
}

@media (max-width: 480px) {
  .grid-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* P1-5b：同上 */
  .card { padding: 16px; }
  .stream-card .stream-title { font-size: 16px; }
}

/* ---------- 打印 ---------- */
@media print {
  .nav, .footer, .nav-actions, .sidebar { display: none !important; }
}

/* =========================================================================
 * 用户系统样式（注册/登录/资料/权限）
 * ========================================================================= */

/* 登录/注册 Tab */
.auth-tabs { display:flex; gap:0; margin-bottom:20px; border-bottom:1px solid var(--border); }
.auth-tab { flex:1; padding:10px; background:none; border:none; border-bottom:2px solid transparent; color:var(--text-secondary); font-size:15px; font-weight:600; cursor:pointer; transition:color var(--dur-base) var(--ease-hig), border-color var(--dur-base) var(--ease-hig); }
.auth-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.auth-tab:hover { color:var(--text); }

/* 密码强度条 */
.pwd-strength { display:flex; align-items:center; gap:10px; margin-top:8px; }
.pwd-strength-bar { flex:1; height:6px; border-radius:3px; background:var(--border); overflow:hidden; }
.pwd-strength-fill { height:100%; width:0; border-radius:3px; transition:width 0.3s cubic-bezier(0.22,1,0.36,1), background var(--dur-base) var(--ease-hig); }
.pwd-strength-label { font-size:12px; font-weight:600; min-width:24px; text-align:right; transition:color var(--dur-base) var(--ease-hig); }

/* 平台绑定输入（注册页） */
.platform-bind-list { display:flex; flex-direction:column; gap:8px; }
.platform-bind-item { display:flex; align-items:center; gap:10px; }
.platform-bind-icon { width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.platform-bind-item .platform-bind-input { flex:1; }

/* 平台展示（资料页）圆角方形卡片 */
.platform-display-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.platform-tile { display:flex; flex-direction:column; align-items:center; gap:6px; padding:16px 12px; border-radius:14px; background:var(--bg-elevated, var(--bg-secondary)); border:1px solid var(--border); text-decoration:none; color:var(--text); transition:transform var(--dur-base) var(--ease-hig), border-color var(--dur-base) var(--ease-hig), box-shadow var(--dur-base) var(--ease-hig), background-color var(--dur-base) var(--ease-hig); cursor:pointer; position:relative; overflow:hidden; }
/* 夜间模式：已绑定平台 tile 背景变灰（HIG v2：过渡统一 250ms HIG，去重旧 0.2s/0.4s 双条目） */
[data-theme="dark"] .platform-tile { background:#374151; border-color:#4b5563; }
[data-theme="dark"] .platform-tile:hover { background:#4b5563; }
.platform-tile::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--p-color, var(--primary)); }
.platform-tile:hover { transform:translateY(-2px); border-color:var(--p-color, var(--primary)); box-shadow:var(--shadow-lg); }
.platform-tile-icon { width:44px; height:44px; border-radius:12px; background:var(--p-color, var(--primary)); display:flex; align-items:center; justify-content:center; font-size:22px; }
.platform-tile-label { font-size:13px; font-weight:600; }
.platform-tile-uid { font-size:11px; color:var(--text-tertiary); font-family:monospace; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.platform-tile-empty { opacity:0.65; border-style:dashed; }
.platform-tile-empty:hover { opacity:1; }

/* Steam 信息卡片 */
.steam-card .steam-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.steam-info-item { padding:12px; border-radius:10px; background:var(--bg-secondary); }
.steam-info-value { font-size:18px; font-weight:700; color:var(--primary); margin-top:4px; }

/* 头像选择网格 */
.avatar-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:8px; }
.avatar-option { width:100%; aspect-ratio:1; border-radius:50%; border:3px solid transparent; cursor:pointer; font-size:22px; display:flex; align-items:center; justify-content:center; transition:transform var(--dur-base) var(--ease-hig), border-color var(--dur-base) var(--ease-hig); padding:0; }
.avatar-option:hover { transform:scale(1.1); }
.avatar-option.active { border-color:var(--text); transform:scale(1.08); }
@media (max-width:768px) { .avatar-grid { grid-template-columns:repeat(4,1fr); } }

/* 用户组徽章 — 颜色由 JS 内联样式动态注入，级联仅保留骨架 */
.badge-group { font-size:11px; padding:2px 8px; border-radius:4px; font-weight:600; display:inline-block; line-height:1.5; }

@keyframes modal-in { from { opacity: 0; transform: scale(0.95) translateY(-12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes modal-out { from { opacity: 1; transform: scale(1) translateY(0); } to { opacity: 0; transform: scale(0.95) translateY(-12px); } }
@keyframes overlay-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ---------- 公告 ---------- */
.announce-bar {
  animation: ann-slide-in .35s var(--ease-spring);
}
.announce-bar + .announce-bar {
  border-top: 1px solid rgba(0,0,0,0.06);
}
[data-theme="dark"] .announce-bar + .announce-bar {
  border-top-color: rgba(255,255,255,0.06);
}
@keyframes ann-slide-in {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
.ann-sidebar { margin-top: 18px; }
.ann-sidebar-item:last-child { border-bottom: none !important; }

/* 平台品牌 icon 容器（PNG + 主题背景；GitHub 日间 invert 让白图标变深色适配白背景） */
.platform-brand { display:inline-flex; align-items:center; justify-content:center; padding:8px; border-radius:10px; background:#fff; line-height:0; }
.platform-brand img { display:block; }
[data-theme="dark"] .platform-brand { background:#374151; }
/* Steam 固定白背景（不受日/夜影响） */
.platform-brand.steam, [data-theme="dark"] .platform-brand.steam { background:#fff !important; }
/* GitHub dark 图标：日间 invert(1) 让白图标变深色，夜间原样（白图标配黑背景） */
.platform-brand.github img { filter: invert(1); }
[data-theme="dark"] .platform-brand.github img { filter: none; }

/* 简介展示 */
.bio-display { min-height:40px; font-size:14px; line-height:1.7; }
.bio-display p { margin:0; word-break:break-word; }

/* 导航头像容器 */
.nav-user-avatar-wrap { display:inline-flex; align-items:center; }
.nav-user-avatar-wrap .avatar-img { border:2px solid var(--border); }

/* 表单错误提示 */
.form-error { padding:10px 12px; border-radius:8px; background:rgba(239,68,68,0.1); border:1px solid rgba(239,68,68,0.3); color:#dc2626; font-size:13px; margin-top:6px; }
[data-theme="dark"] .form-error { color:#fca5a5; }
.form-error.hidden { display:none; }

/* =========================================================================
 * 密码可见性切换（小眼睛图标 + 斜线动画）
 * ========================================================================= */
.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pwd-input-wrap .form-input {
  padding-right: 44px;
}
.pwd-eye {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-tertiary);
  border-radius: 6px;
  padding: 0;
  transition: color var(--dur-base) var(--ease-hig);
  -webkit-tap-highlight-color: transparent;
}
.pwd-eye:hover { color: var(--text-secondary); }
.pwd-eye:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
/* 斜线：静态状态定义（动画由 Web Animations API 驱动）
 * 默认（密码隐藏）：斜线可见  stroke-dashoffset: 0
 * .revealed（密码可见）：斜线隐藏  stroke-dashoffset: 30 */
.eye-slash-line {
  stroke-dasharray: 30;
  stroke-dashoffset: 0;
  will-change: stroke-dashoffset;
}
.pwd-eye.revealed .eye-slash-line {
  stroke-dashoffset: 30;
}

/* =========================================================================
 * 注册步骤流程（2 步：账号信息 → 绑定/邀请码）
 * ========================================================================= */

/* 步骤指示器 */
.reg-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.reg-step-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.reg-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-tertiary);
  /* HIG v2（C3）：全库唯一 transition:all → 枚举视觉子集（background-color/border-color/color/box-shadow），
     避免把固定宽高拉入过渡产生跳变 */
  transition: background-color var(--dur-base) var(--ease-hig),
              border-color var(--dur-base) var(--ease-hig),
              color var(--dur-base) var(--ease-hig),
              box-shadow var(--dur-base) var(--ease-hig);
}
.reg-step-dot-wrap.active .reg-step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.reg-step-dot-wrap.done .reg-step-num {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.reg-step-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 400;
  transition: color var(--dur-base) var(--ease-hig);
  white-space: nowrap;
}
.reg-step-dot-wrap.active .reg-step-label {
  color: var(--primary);
  font-weight: 600;
}
.reg-step-dot-wrap.done .reg-step-label {
  color: #22c55e;
}
.reg-step-line {
  width: 48px;
  height: 2px;
  background: var(--border);
  margin: 0 10px 22px 10px;
  border-radius: 1px;
  transition: background var(--dur-base) var(--ease-hig);
}
.reg-step-line.done {
  background: #22c55e;
}

/* 步骤面板容器 */
.reg-steps-wrapper {
  position: relative;
}
.reg-step {
  /* 默认可见 */
}
.reg-step-hidden {
  display: none;
}

/* 步骤切换动画 */
.reg-step.anim-slide-out-left {
  animation: reg-step-out-left 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.reg-step.anim-slide-in-right {
  animation: reg-step-in-right 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.reg-step.anim-slide-out-right {
  animation: reg-step-out-right 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.reg-step.anim-slide-in-left {
  animation: reg-step-in-left 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes reg-step-out-left {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-28px); }
}
@keyframes reg-step-in-right {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes reg-step-out-right {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(28px); }
}
@keyframes reg-step-in-left {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 下一步按钮微交互 */
#regNextBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 轻量抖动（校验失败反馈） */
@keyframes reg-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.reg-shake {
  animation: reg-shake 0.4s var(--ease-spring);
}

/* 移动端适配 */
@media (max-width: 480px) {
  .reg-step-line {
    width: 32px;
    margin: 0 6px 22px 6px;
  }
  .reg-step-num {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .reg-step-label {
    font-size: 10px;
  }
}

/* 减弱动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .reg-step.anim-slide-out-left,
  .reg-step.anim-slide-in-right,
  .reg-step.anim-slide-out-right,
  .reg-step.anim-slide-in-left {
    animation: none !important;
  }
  .reg-step.anim-slide-out-left,
  .reg-step.anim-slide-out-right {
    opacity: 0;
  }
  .eye-slash-line {
    will-change: auto;
  }
}

/* btn-block */
.btn-block { display:block; width:100%; }
.btn-lg { padding:10px 20px; font-size:15px; }

/* 草稿箱 */
.draft-empty { text-align:center; padding:32px 16px; }
.draft-empty-icon { font-size:36px; opacity:0.5; }
.draft-item { display:flex; gap:12px; align-items:flex-start; padding:14px 0; border-bottom:1px solid var(--border); }
.draft-item:last-child { border-bottom:none; }
.draft-item-main { flex:1; min-width:0; }
.draft-item-head { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.draft-item-actions { display:flex; flex-direction:column; gap:6px; flex-shrink:0; }
.draft-badge { display:inline-block; padding:1px 8px; border-radius:10px; font-size:11px; font-weight:600; line-height:18px; }
.draft-badge-edit { background:var(--primary-light); color:var(--primary); border:1px solid rgba(var(--primary-rgb),0.3); }
.draft-badge-new { background:var(--success-light); color:var(--success); border:1px solid rgba(var(--success),0.3); }
@media (max-width:600px) {
  .draft-item { flex-direction:column; }
  .draft-item-actions { flex-direction:row; align-self:flex-end; }
}

/* =========================================================================
   ==== HIG 视觉升级 v3 — 覆盖层（T6 单层化就地升级；勿在旧区块中重复修改组件）====
   说明：本区块以「等优先级 + 后置」方式重绘组件视觉，只改
   边框 / 阴影 / 颜色 / 背景 / 过渡，不动布局尺寸指标（padding/grid 列数/圆角
   标尺以外的几何）。依据 docs/hig-contract.md v1.1（T6 实施，取代
   design-system-tokens.md v1.0 / v2 覆盖层）。
   - 动效：组件过渡统一 var(--dur-base) 250ms + var(--ease-hig) cubic-bezier(0.16,1,0.3,1)；
     布局属性（width/max-width/padding/margin 等）与按压反馈（--dur-fast 150ms）按契约 §3-2/§3-4 例外。
   - M 节：本轮新增规则（模态/纯展示卡 hover 豁免、.nav-pressing、user-menu 退出过渡、
     徽章/表格行/Toast 过渡）。
   - 色彩值以 docs/color-contract-v4.md 为准（v4 轮更新，T6 engineer 执行）。
   回滚方式：删除本区块（v3 覆盖层）即整体回滚至旧组件区 v1 视觉 + HIG v2 变量块。
   ========================================================================= */

/* ---------- A. 全局：选区 / 滚动条 / 焦点环 ---------- */

/* 选区：品牌色 20% 透明 */
::selection { background: rgba(var(--primary-rgb), 0.20); }

/* 滚动条：surface-3 滑块；浅色 surface-3 恒白不可见 → 改用规范阴影墨色 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
:root:not([data-theme="dark"]) ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.16); }
:root:not([data-theme="dark"]) ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.30); }

/* 全局焦点环（键盘导航；输入框另有 --ring 光晕版，见 G 节） */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- B. 卡片（去 2px 硬框 → 1px hairline；hover 按 T1 配方） ---------- */

.card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);           /* 旧：2px solid var(--border)，已覆盖 */
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-hig),
              box-shadow var(--dur-base) var(--ease-hig),
              border-color var(--dur-base) var(--ease-hig),
              background-color var(--dur-base) var(--ease-hig);
}
/* 浅色：Key + Ambient 双层 + translateY(-2px)，表面不动 */
.card:hover {
  transform: translateY(-2px);
  background: var(--surface-1);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03), 0 12px 24px rgba(0, 0, 0, 0.04);
}
/* 深色：hover = 上移一档 surface-2（契约 §4.3 废弃 color-mix 公式）+ 黑色环境暗影加深
   + 极弱顶缘反光圈（禁发白光晕）；位移与浅色统一 -2px（契约 §3-5） */
[data-theme="dark"] .card {
  background: var(--surface-1);
  border-color: var(--hairline);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .card:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.10);      /* hover 强化态微光边（v4 状态阶梯） */
  box-shadow: var(--edge-glow), 0 12px 24px rgba(0, 0, 0, 0.45);
}

/* 卡片类一致性：match-row / 离线流卡 同步去 2px 硬框 */
.match-row { border: 1px solid var(--hairline); }
.stream-card-offline { border: 1px solid var(--hairline); }

/* ---------- C. 区块标题（去 2px 分割线 → 纯留白 + 品牌红竖条） ---------- */

.section-title {
  border-bottom: none;                /* 旧：2px solid var(--border-strong)，已删除 */
  position: relative;
}
.section-title::before {
  content: "";
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--brand-identity);  /* 老九红 P0 #E24B4A */
  flex-shrink: 0;
  margin-right: 8px;
}

/* ---------- D. 导航（hairline 微光细边 + 毛玻璃 + tonal pill 高亮） ---------- */

.nav {
  border-bottom: 1px solid var(--hairline);     /* 旧：1px solid var(--nav-border) */
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
}
/* 导航项：默认透明；hover 用浅色墨染（T1 §3.3） */
.nav-link:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
/* 选中：tonal pill（浅 6% 墨填充 + 文字高亮，无下划线/无描边） */
.nav-link.active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  font-weight: 600;
}
[data-theme="dark"] .nav-link:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
[data-theme="dark"] .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* ---------- E. 按钮（微光阴影 + surface 色阶 hover，去生硬边框对比） ---------- */

.btn {
  transition: background var(--dur-base) var(--ease-hig),
              border-color var(--dur-base) var(--ease-hig),
              color var(--dur-base) var(--ease-hig),
              transform var(--dur-fast) var(--ease-hig),
              box-shadow var(--dur-base) var(--ease-hig);
}
/* 主按钮：hover 加柔和品牌色微光（0.28 级），active 收回 */
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(var(--primary-rgb), 0.28);
}
.btn-primary:active { box-shadow: none; }
[data-theme="dark"] .btn-primary:hover {
  box-shadow: var(--edge-glow-top),
              0 4px 14px rgba(var(--primary-rgb), 0.30),
              0 8px 20px rgba(0, 0, 0, 0.40);
}
/* 次级：surface 色阶 hover，边框不加重 */
.btn-secondary {
  background: var(--surface-1);
  border-color: var(--hairline);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-4); border-color: rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .btn-secondary {
  background: var(--surface-2);
  border-color: var(--hairline);
}
[data-theme="dark"] .btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--hairline);
}
/* 描边：45% 品牌色半透明，hover 浅染 */
.btn-outline { border-color: rgba(var(--primary-rgb), 0.45); background: transparent; }
.btn-outline:hover { background: var(--primary-light); border-color: rgba(var(--primary-rgb), 0.45); }
/* 幽灵：透明 + 墨染/白染 hover */
.btn-ghost:hover { background: rgba(0, 0, 0, 0.05); color: var(--text); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
/* 危险：用阴影微光替代 brightness 滤镜；深色实底配墨字（T1 §4.3） */
.btn-danger:hover {
  filter: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(220, 38, 38, 0.30);
}
[data-theme="dark"] .btn-danger { color: var(--on-danger); }
[data-theme="dark"] .btn-danger:hover {
  box-shadow: 0 4px 14px rgba(248, 113, 113, 0.30), 0 8px 20px rgba(0, 0, 0, 0.40);
}
/* 成功：深色实底配墨字（#4ADE80 上白字对比不足） */
.btn-success:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(21, 128, 61, 0.28);
}
[data-theme="dark"] .btn-success { color: var(--on-success); }
[data-theme="dark"] .btn-success:hover {
  box-shadow: 0 4px 14px rgba(74, 222, 128, 0.28), 0 8px 20px rgba(0, 0, 0, 0.40);
}
/* 导航登录按钮：同主按钮微光 */
.btn-login {
  transition: background var(--dur-base) var(--ease-hig),
              transform var(--dur-fast) var(--ease-hig),
              box-shadow var(--dur-base) var(--ease-hig);
}
.btn-login:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.28);
}

/* ---------- F. 悬浮面板（.user-menu：surface-2 + shadow-xl + hairline） ---------- */

.user-menu {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px) scale(0.98);
  transition: opacity var(--dur-base) var(--ease-hig),
              transform var(--dur-base) var(--ease-hig),
              visibility var(--dur-base);
}
.nav-user.open .user-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
[data-theme="dark"] .user-menu {
  background: var(--surface-2);
  box-shadow: var(--edge-glow), var(--shadow-xl);   /* 微光圈补边界感知 */
}
.user-menu-header { border-bottom: 1px solid var(--hairline); }
.user-menu-item {
  transition: background var(--dur-base) var(--ease-hig),
              color var(--dur-base) var(--ease-hig);
}
.user-menu-item:hover { background: var(--surface-4); color: var(--text); }
[data-theme="dark"] .user-menu-item:hover { background: var(--surface-3); }
.user-menu-item.danger:hover { background: var(--danger-light); color: var(--danger); }

/* ---------- G. 表单（hairline-strong 边 + inset 井底 + --ring 焦点光圈） ---------- */

.form-input, .form-select, .form-textarea {
  border: 1px solid var(--hairline-strong);
  background: var(--surface-inset);
  transition: border-color var(--dur-base) var(--ease-hig),
              box-shadow var(--dur-base) var(--ease-hig),
              background-color var(--dur-base) var(--ease-hig);
}
.form-input:focus, .form-select:focus, .form-textarea:focus,
.form-input:focus-visible, .form-select:focus-visible, .form-textarea:focus-visible {
  border-color: transparent;
  box-shadow: var(--ring);      /* 2px 衬底间隙 + 4px 焦点环，替代硬边框变色 */
  outline: none;
}
.form-select option { background: var(--bg-primary); }
[data-theme="dark"] .form-select option { background: var(--surface-1); color: var(--text); }

/* ---------- H. 分段控件（Apple Segmented：auth-tabs 改为 pill 容器） ---------- */

.auth-tabs {
  gap: 2px;
  padding: 2px;
  border-bottom: none;                    /* 旧：1px solid var(--border)，已删除 */
  border-radius: 10px;
  background: var(--surface-inset);       /* 轨道 = 内嵌井 */
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .auth-tabs { box-shadow: inset 0 1px 1.5px rgba(0, 0, 0, 0.18); }
.auth-tab {
  border: none;
  border-radius: 8px;                     /* = 外圆角 − padding */
  background: none;
  color: var(--text-secondary);
  transition: color var(--dur-base) var(--ease-hig),
              background-color var(--dur-base) var(--ease-hig),
              box-shadow var(--dur-base) var(--ease-hig);
}
.auth-tab:hover { color: var(--text); }
/* 选中 = 抬升段：浅色白面 + 阴影；深色 surface-3 + 微光细圈 */
.auth-tab.active {
  color: var(--text);
  background: var(--surface-3);
  border-bottom-color: transparent;       /* 清掉旧下划线指示 */
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .auth-tab.active {
  background: var(--surface-3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* ---------- I. 一致性扩展（边框/背景类，同属「只改视觉」范围） ---------- */

/* 表格外框与行 hover 改用 hairline / 色阶（行 hover 0.06 与 T1 §3.3 一致） */
.table-wrap { border: 1px solid var(--hairline); }
[data-theme="dark"] .table tr:hover td { background: var(--surface-2); }
/* Toast 边改 hairline */
.toast { border: 1px solid var(--hairline); }
/* 页脚：按 T1 用画布加深层 */
.footer { background: var(--canvas-deep); border-top: 1px solid var(--hairline); }
/* 平台绑定 tile（深色）：旧硬编码灰 #374151 改为 surface 色阶 */
[data-theme="dark"] .platform-tile { background: var(--surface-2); border-color: var(--hairline); }
[data-theme="dark"] .platform-tile:hover { background: var(--surface-3); }
[data-theme="dark"] .platform-brand { background: var(--surface-2); }

/* ---------- J. 图标按钮（主题切换/设置/取色）：hover 用 surface 色阶替代全红描边 ---------- */

.theme-toggle, .nav-icon-btn, .color-trigger {
  border-color: var(--hairline-strong);
}
.theme-toggle:hover, .nav-icon-btn:hover, .color-trigger:hover {
  background: var(--surface-4);
  border-color: rgba(var(--primary-rgb), 0.4);
}
[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .nav-icon-btn:hover,
[data-theme="dark"] .color-trigger:hover {
  background: var(--surface-3);
}

/* ---------- L. T4 修复：T3 QA 报告闭环（F1 需修 + P2 采纳项） ---------- */
/* 依据：T3 审查报告（0 阻断 / 1 需修 / 9 建议）。本节含 F1 修复与采纳的 P2 项，
   不采纳/跳过的项及理由见任务 output。 */

/* F1（需修 · 队长决策方案 A，仅限 red 预设）：深色主按钮/登录按钮白字对比度 ——
   旧值 #EF4444=3.76:1、hover #F87171=2.77:1，均 <4.5 AA。
   修复：config.js red 预设 darkPrimary→#d43c3c（白字 4.66:1）、darkHover→#da4a4a（白字 4.15:1，
   T1 §4.3 注明的 hover 瞬时边缘态，队长已确认可接受）；main.css dark 兜底 --primary/--primary-hover
   已同步（上方变量块）。实底/hover 颜色由 JS 注入的 --primary* 自动生效，本节不再钉背景，
   仅补 T1 的 active 深色与流卡常驻渐变（流卡非 hover 瞬态，13px meta 白字需 ≥4.5）。 */
[data-theme="dark"][data-color="red"] .btn-primary:active,
[data-theme="dark"][data-color="red"] .btn-login:active,
[data-theme="dark"]:not([data-color]) .btn-primary:active,
[data-theme="dark"]:not([data-color]) .btn-login:active {
  background: var(--brand-active);              /* #C93B3A，白字 5.04:1（T1 §4.3） */
}
/* 流卡常驻渐变：brand-solid→brand-active，白字全程 ≥4.5（4.66 / 5.04）；offline 卡除外 */
[data-theme="dark"][data-color="red"] .stream-card:not(.stream-card-offline),
[data-theme="dark"]:not([data-color]) .stream-card:not(.stream-card-offline) {
  background: linear-gradient(135deg, var(--brand-solid), var(--brand-active));
}

/* P2-1（采纳）：深色 .badge-accent 用 --accent-soft-fg #60A5FA（4.23→6.1:1） */
[data-theme="dark"] .badge-accent { color: var(--accent-soft-fg); }

/* P2-2（采纳）：残留 2px 边框降 1px hairline-strong（reg-step-num / avatar-img）；
   .reg-step-line 装饰线 2px→1px（装饰线粗细，不涉布局）。
   .hr-thick 不采纳：类名语义即“厚分割线”，且色已转 rgba 半透明，不再生硬。 */
.reg-step-num { border: 1px solid var(--hairline-strong); }
.nav-user-avatar-wrap .avatar-img { border: 1px solid var(--hairline-strong); }
.reg-step-line { height: 1px; }

/* P2-3（采纳）：深色浮层补边缘微光圈（T1 §4.2 边界感知要求） */
[data-theme="dark"] .color-panel {
  box-shadow: var(--edge-glow), 0 12px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.30);
}
[data-theme="dark"] .toast {
  box-shadow: var(--edge-glow), var(--shadow-lg);
}

/* P2-4（采纳）：浅色 red 预设 .btn-outline 红字 4.46→5.04（--brand-text #C62F2E，T1 §1.5）；
   F1 值变更后深色 red 的 --primary(#D43C3C) 作文字在 surface-1 上仅 3.63:1，
   深色同改 --brand-text #E85555（surface-1 上 4.72:1，T1 §1.5），red 预设限定 */
:root:not([data-theme="dark"])[data-color="red"] .btn-outline { color: var(--brand-text); }
[data-theme="dark"][data-color="red"] .btn-outline { color: var(--brand-text); }

/* P2-6（采纳）：注册步骤 done 态绿 #22c55e 白字 2.2:1（预存）→ 实底 #15803D（白字 5.02:1）；
   标签/连线用 var(--success)（浅 #15803D 4.85 / 深 #4ADE80 9.7） */
.reg-step-dot-wrap.done .reg-step-num {
  background: #15803D;
  border-color: #15803D;
  color: #FFFFFF;
}
.reg-step-line.done { background: var(--success); }
.reg-step-dot-wrap.done .reg-step-label { color: var(--success); }

/* ---------- M. v3 契约新增（T6）：动效统一配套规则（契约 §7-4/5/6/7） ---------- */

/* M1 · C4 模态豁免（契约 §3-7/§7-4）：对话框内 .card hover 不浮起（transform:none），
   避免确认框/视频投稿弹窗整体上浮与 modal-in 重触发 2px 跳变；深色同步豁免 hover 底/边反馈 */
.i9tv-overlay .card:hover,
#videoSubmitModal .card:hover {
  transform: none;
}
[data-theme="dark"] .i9tv-overlay .card:hover,
[data-theme="dark"] #videoSubmitModal .card:hover {
  background: var(--surface-1);
  border-color: var(--hairline);
}

/* M2 · C5 纯展示卡豁免（契约 §3-7/§7-4，方案 c）：无交互子元素的 .card hover 不浮起
   （可点面板才浮起）；含 a/button/input/select/textarea/[tabindex] 的卡维持 -2px；
   不支持 :has() 的旧浏览器退化为现状（全部浮起），接受 */
.card:not(:has(a, button, input, select, textarea, [tabindex])):hover {
  transform: none;
}

/* M3 · 导航按压反馈（契约 §3-4/§7-5，R5 合法例外 ≈80ms）：由 AppNavigator.js
   切换 .nav-pressing 类驱动，无 inline transition/transform 残留 */
.nav-pressing {
  transform: scale(0.96);
  transition: transform 80ms var(--ease-hig);
}

/* M4 · 用户菜单退场过渡（契约 §3-4/§7-6）：进入 250ms HIG（F 节）/ 退出 200ms ease-exit */
.nav-user:not(.open) .user-menu {
  transition: opacity 200ms var(--ease-exit),
              transform 200ms var(--ease-exit),
              visibility 200ms;
}

/* M5 · 无 transition 组件新增声明（契约 §7-7/C7）：徽章/表格行/Toast
   按 §2.6 工程注枚举视觉子集（background-color/border-color/color/box-shadow/transform/opacity），
   禁加布局属性 */
.badge,
.table tr:hover td,
.toast {
  transition: background-color var(--dur-base) var(--ease-hig),
              border-color var(--dur-base) var(--ease-hig),
              color var(--dur-base) var(--ease-hig),
              box-shadow var(--dur-base) var(--ease-hig),
              transform var(--dur-base) var(--ease-hig),
              opacity var(--dur-base) var(--ease-hig);
}

/* ---------- K. 动效偏好（prefers-reduced-motion：关闭装饰性过渡） ---------- */

@media (prefers-reduced-motion: reduce) {
  .card, .btn, .btn-login, .nav-link, .user-menu, .user-menu-item, .auth-tab,
  .form-input, .form-select, .form-textarea, .platform-tile {
    transition: none !important;
  }
}

/* =========================================================================
   ==== v4 布局与占位契约（T2）· 文件末尾追加章节（回滚 = 删除本区块）====
   依据：docs/v4-contract.md §3.3（骨架占位体系）/ §3.4（首页未开播直播栏压缩）。
   - 填充复用既有 .skeleton（L1290 基础类，token 驱动）；shimmer = 既有 1.4s
     var(--ease-spring) 豁免循环（hig-contract §3-3），不新增时长/曲线；
   - 本区块不触碰 .skeleton 基础类本体、v3 覆盖层 A–M 节、K 节与既有 @media 规则；
   - 深色骨架覆写仅覆 background-image（对抗审查 R1），保留基础类 background-size:400% 与动画。
   ========================================================================= */

/* ---------- 骨架占位布局类（§3.3） ---------- */

/* 近期赛事：横向骨架行（镜像 .match-row：padding 14px 16px / 队徽 28px / VS chip 56px） */
.sk-match { display:flex; align-items:center; gap:12px; min-height:56px; padding:14px 16px;
  background:var(--surface-1); border:1px solid var(--hairline); border-radius:10px; }
.sk-logo { width:28px; height:28px; border-radius:6px; flex-shrink:0; }
.sk-line { height:12px; border-radius:6px; flex-shrink:1; }
.sk-line-xs { height:10px; }
.sk-chip { width:56px; height:26px; border-radius:6px; flex-shrink:0; }

/* 老九严选：2×2 卡（镜像 .periph-card：封面 140px + body 14px 16px） */
.sk-periph { display:flex; flex-direction:column; background:var(--surface-1);
  border:1px solid var(--hairline); border-radius:12px; overflow:hidden; }
.sk-cover-fixed { height:140px; border-radius:0; flex-shrink:0; }
.sk-periph .sk-body { padding:14px 16px; display:flex; flex-direction:column; gap:10px; }

/* 最新视频：16:9 卡（镜像 .video-card：16:9 封面 + body 10px 12px） */
.sk-video { display:flex; flex-direction:column; background:var(--surface-1);
  border:1px solid var(--hairline); border-radius:10px; overflow:hidden; }
.sk-cover-169 { aspect-ratio:16/9; border-radius:0; }
.sk-video .sk-body { padding:10px 12px; display:flex; flex-direction:column; gap:8px; }

/* 空数据静止态 + 减弱动画（scoped，不触碰 K 节） */
.sk-static .skeleton { animation:none; }
@media (prefers-reduced-motion: reduce) {
  #matchList .skeleton, #periphList .skeleton, #videoList .skeleton { animation:none; }
}

/* 深色骨架覆写（对抗审查 R1 修订：base 与 surface-1 容器同色 → 提升到 surface-2/surface-3。
   仅覆 background-image，保留基础类 background-size:400% 与 1.4s 动画） */
[data-theme="dark"] .skeleton {
  background-image: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
}

/* ---------- 首页未开播直播栏压缩（§3.4，72px 紧凑条；仅 #streamCard） ---------- */
/* border/背景继承 token，禁止写死色值（裁决 R6）；缩略图底按裁决 R2 用 --surface-inset */

#streamCard .stream-card-offline { padding:12px 16px; gap:12px; }
#streamCard .stream-card-offline .stream-cover {
  width:48px; min-height:48px; max-height:48px; border-radius:8px;
  background:var(--surface-inset);               /* 裁决 R2：双模式可见的凹陷井 */
  border:1px solid var(--hairline);              /* 色彩专家可选增强：强化 48px 井边缘 */
  display:flex; align-items:center; justify-content:center;
}
#streamCard .stream-card-offline .stream-cover::after {
  content:"💤"; font-size:20px; line-height:1; color:var(--text-tertiary);
}
/* =========================================================================
   QA T7 小修复：#streamCard 开播→停播/ERROR 状态转换时 JS 幂等缓存不清空封面，
   残留 img/SVG 会溢出 width:48px 井并压住标题区 → 离线态隐藏子元素，💤 ::after
   为伪元素不受影响；恢复开播时类移除即恢复显示，URL 变化走 JS 重绘（与 sk- 骨架无关）。
   ========================================================================= */
#streamCard .stream-card-offline .stream-cover > * { display:none; }
#streamCard .stream-card-offline .stream-title {
  font-size:15px; font-weight:600; margin-bottom:2px; -webkit-line-clamp:1; line-height:1.4;
}
#streamCard .stream-card-offline .stream-meta { font-size:12px; gap:10px; }
@media (max-width: 768px) {
  #streamCard .stream-card-offline { flex-direction:row; align-items:center; text-align:left; }
  #streamCard .stream-card-offline .stream-cover {
    width:48px !important; min-height:48px !important; max-height:48px !important; height:48px !important;
  }
}

/* ---------- 视频栏目切换动效修复：入场动画合成层预提（仅作用于视频页 main，
   避免动画期间大面积重绘导致掉帧；与 modules/videos.js 侧延迟渲染配合） ---------- */
body[data-page-key="videos"] main {
  will-change: transform, opacity;
}

/* =========================================================================
   P1-5 · 移动端导航横向溢出修复（仅 ≤480px 手机档，桌面/平板零改动）
   -------------------------------------------------------------------------
   问题：.nav-logo / .nav-actions 均为 flex-shrink:0，按钮尺寸固定（40/40/97/38），
        .container 左右各 16px padding + .nav-inner gap 12px，内容总宽 398px；
        375px 视口可用 375，实测 .nav-actions 右缘到 382（375 档溢出 16~23px，
        390 档溢出 1px），出现横向滚动（scrollWidth 382 > clientWidth 375）。
   方案：只收窄手机档的间距/控件尺寸，并隐藏 logo 副标题（保留主品牌名与 logo 块），
        导航内容总宽 398 → 309（登出）/ 333（登录态，昵称超长时省略号截断），
        375/390 两档分别余 42px / 47px；不新增、不隐藏任何功能按钮。
   实测（scrollWidth / clientWidth，浏览器 375/390/768 三档）：
        375 → 375/375　390 → 390/390　768 → 758/758（视口 768，含 10px 滚动条）
   ========================================================================= */
@media (max-width: 480px) {
  .nav-inner { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .nav-logo { gap: 8px; min-width: 0; }
  .nav-logo .logo-text { font-size: 18px; }
  .nav-logo .logo-text small { display: none; }   /* 副标题让位，主品牌名保留 */
  .nav-actions { gap: 6px; }
  .nav-icon-btn,
  .theme-toggle { width: 36px; height: 36px; }
  .nav-burger { width: 36px; height: 36px; }
  .btn-login { height: 34px; padding: 0 10px; font-size: 12px; }
  /* 登录态：昵称过长时省略，避免 .nav-user-trigger 撑宽 */
  .nav-user-trigger { padding: 2px 6px 2px 2px; gap: 6px; }
  .nav-user-name { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* 超窄档（≤359px，如 320 设备）兜底：只留 logo 方块，给导航按钮让出空间
   （导航自身仍不溢出；320 档若仍有横向滚动，来自页面内容而非导航） */
@media (max-width: 359px) {
  .nav-logo .logo-text { display: none; }
}

/* ---------- 直播页：未登录订阅提示（就地提示，不跳转） ---------- */
.sub-login-hint {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning-solid);
  border-radius: 10px;
  background: var(--warning-soft-bg);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  max-width: 420px;
}
.sub-login-hint-text { color: var(--text-primary); opacity: 0.92; }
.sub-login-hint-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.sub-login-hint[hidden] { display: none; }

/* =========================================================================
   P1-5b · 移动端内容溢出（栅格 min-content）+ 汉堡菜单搜索入口
   -------------------------------------------------------------------------
   ① 320px 溢出根因（已定位）：#matchList 等「裸 .grid」单列原为隐式 auto 列，
      列宽取子项 max-content（.sk-match = 326px），整页 scrollWidth 342 > 320；
      .layout-2col 在 ≤1024 用裸 1fr 同理会把整列撑到 325.6px。
      已在 .grid / .layout-2col / .grid-2..4 / .grid-auto 定义处改为 minmax(0,1fr)，
      此处补栅格子项 min-width:0 允许内容收缩——不使用 overflow-x:hidden 掩盖。
   ② 搜索入口：≤768px 时桌面 .nav-search 被隐藏（见上方 mobile 段），
      改为在汉堡菜单顶部提供一行搜索；提交时调用 common.js 的 runNavSearch()，
      与桌面输入框共用同一逻辑（videos/peripherals 页派发 i9tv:nav-search 就地搜索，
      其余页按 nav.searchTarget 跳转），未新增第二套搜索。
   ========================================================================= */

/* 汉堡菜单内搜索行：仅 ≤768px 菜单展开时显示（桌面不受影响）
   注意 .nav-links.open 是 align-items:center 的列 flex，必须显式拉满宽度 */
.nav-links-search { display: none; width: 100%; align-self: stretch; flex-shrink: 0; align-items: center; gap: 8px; margin-bottom: 8px; }
.nav-links-search input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--dur-base) var(--ease-hig);
}
.nav-links-search input::placeholder { color: var(--text-tertiary); }
.nav-links-search input:focus { border-color: var(--primary); }
.nav-links-search-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--text-on-primary);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-base) var(--ease-hig), transform var(--dur-fast) var(--ease-hig);
}
.nav-links-search-btn:hover { background: var(--primary-hover); }
.nav-links-search-btn:active { transform: scale(0.96); }

@media (max-width: 768px) {
  .layout-2col > *, .grid > * { min-width: 0; }
  .nav-links.open .nav-links-search { display: flex; }

  /* P1-5b 附带修复：.nav 上的 backdrop-filter 会让 position:fixed 后代以「导航自身」为
     包含块，原 `.nav-links.open { bottom:0 }` 因此把菜单高度算成导航高度（实测仅 33px，
     菜单项被 overflow-y 裁掉、搜索行只剩一半）。改为显式视口高度，保留毛玻璃与既有 top。 */
  .nav-links.open {
    bottom: auto;
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
  }
}

/* =========================================================================
   P1-5c · 下拉兜底：自定义 listbox + 原生 option 显式配色
   -------------------------------------------------------------------------
   背景：原生 <select> 的选项弹层由浏览器/系统绘制，在跨域 iframe（DSH 侧边栏
   预览）里会被裁切，深色主题下也可能出现白底白字；`appearance:none` 只改控件
   外观，不影响弹层。
   方案：peripheral-edit 模块把 select 升级为「button + 绝对定位 listbox」（JS 见
   assets/js/modules/peripheral-edit.js 的 upgradeSelect），原生 select 仍留在 DOM
   作为唯一值载体（.value / querySelectorAll('select') 读写保持不变）。
   另外这里补齐 .form-select 的 option 显式色值与 color-scheme，保证其他页面
   仍用原生 select 时同样不会白底白字。
   ========================================================================= */
.form-select { color-scheme: light; }
[data-theme="dark"] .form-select { color-scheme: dark; }
.form-select option {
  background-color: var(--bg-primary);
  color: var(--text);
}
[data-theme="dark"] .form-select option {
  background-color: #1E222B;   /* 兜底硬值：深色原生弹层不依赖变量解析 */
  color: #E6EDF3;
}
.form-select option:checked {
  background-color: var(--primary);
  color: var(--text-on-primary);
}

/* 自定义下拉（.cselect）：结构与原生 select 视觉对齐 */
.cselect { position: relative; width: 100%; min-width: 0; }
.cselect > select { display: none; }   /* 值载体，不参与布局 */

.cselect-btn {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  background-color: var(--surface-inset);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: border-color var(--dur-base) var(--ease-hig), box-shadow var(--dur-base) var(--ease-hig);
}
.cselect-btn:hover { border-color: var(--text-tertiary); }
/* 兜底箭头：不依赖 background-image，任何主题/环境下都能看到 */
.cselect-btn { position: relative; }
.cselect-btn::after {
  content: '';
  position: absolute;
  right: 13px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.cselect-label:empty::before { content: '请选择'; color: var(--text-tertiary); }
.cselect-btn:focus-visible { border-color: transparent; box-shadow: var(--ring); }
.cselect.open .cselect-btn { border-color: transparent; box-shadow: var(--ring); }
.cselect-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cselect-label--placeholder { color: var(--text-tertiary); }

.cselect-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 300;             /* 高于卡片 hover 层，低于导航（1000） */
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 300px;        /* 7 项 × 38px + padding，无需滚动即可看全 */
  overflow-y: auto;
  overscroll-behavior: contain;
  display: none;
}
.cselect.open .cselect-menu { display: block; }
/* 下方空间不足（矮视口 / 侧边栏 iframe / 表单位于页面底部）时向上展开 */
.cselect--up .cselect-menu {
  top: auto;
  bottom: calc(100% + 6px);
}
.cselect-item {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cselect-item.hover { background: var(--bg-secondary); }
.cselect-item[aria-selected="true"] { color: var(--primary); font-weight: 600; }
.cselect-item[aria-selected="true"].hover { background: var(--primary-light); }
[data-theme="dark"] .cselect-item[aria-selected="true"].hover { background: rgba(255, 255, 255, 0.08); }

/* 紧凑变体：价格行里的「平台 / 币种」下拉 */
.cselect--sm { width: auto; flex-shrink: 0; }
.cselect--sm .cselect-btn {
  height: 36px;
  padding: 0 24px 0 8px;
  font-size: 13px;
  background-position: right 6px center;
  background-size: 14px;
}
.cselect--sm .cselect-menu { min-width: 120px; right: auto; }
.cselect--sm .cselect-item { font-size: 13px; padding: 7px 9px; }

/* =========================================================================
   用户悬浮卡（头像/昵称 → 个人主页）  依赖 assets/js/user-card.js
   ========================================================================= */
[data-user-uid], [data-user-name] { cursor: pointer; }
.user-pop {
  position: absolute;
  z-index: 3000;
  width: 280px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-elevated, var(--bg-secondary));
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  animation: userPopIn 0.16s ease-out;
}
.user-pop.hidden { display: none; }
@keyframes userPopIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.user-pop-head { display: flex; align-items: center; gap: 10px; }
.user-pop-avatar {
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 50%; overflow: hidden;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.user-pop-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-pop-name { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3; }
.user-pop-uid { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.user-pop-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.user-pop-badge { font-size: 11px; line-height: 1; padding: 4px 8px; border-radius: 999px; font-weight: 600; }
.user-pop-badge.tone-admin { background: rgba(220, 38, 38, 0.14); color: #ef4444; }
.user-pop-badge.tone-wiki { background: rgba(59, 130, 246, 0.16); color: #3b82f6; }
.user-pop-badge.tone-editor { background: rgba(16, 185, 129, 0.16); color: #10b981; }
.user-pop-badge.tone-verified { background: rgba(139, 92, 246, 0.16); color: #8b5cf6; }
.user-pop-badge.tone-custom { background: rgba(245, 158, 11, 0.16); color: #f59e0b; }
.user-pop-bio {
  margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.user-pop-bio.is-empty { color: var(--text-tertiary); }
.user-pop-link { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--primary); text-decoration: none; }
.user-pop-link:hover { text-decoration: underline; }

/* Markdown 图片（评论/正文） */
.md-img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 8px 0; }

/* =========================================================================
   评论框（大输入区 + 浅色工具条 + @提及面板 + 表情包面板）
   ========================================================================= */
.comment-editor { position: relative; }
.comment-textarea {
  min-height: 117px;
  resize: vertical;
  line-height: 1.7;
}
.comment-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.comment-editor.is-active .comment-tools,
.comment-editor:focus-within .comment-tools { opacity: 1; pointer-events: auto; }
.comment-tool {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.comment-tool:hover { background: var(--bg-tertiary); color: var(--text); }
.comment-tool-hint { margin-left: auto; font-size: 11px; color: var(--text-tertiary); }

.mention-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  width: 260px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  overflow: hidden;
  z-index: 40;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}
.mention-item.active, .mention-item:hover { background: var(--bg-tertiary); }
.mention-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
}
.mention-name { font-weight: 500; }
.mention-uid { margin-left: auto; font-size: 11px; color: var(--text-tertiary); }
.mention-empty { padding: 10px 12px; font-size: 12px; color: var(--text-tertiary); }

.sticker-panel {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  max-height: 180px;
  overflow: auto;
}

.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-body { padding-left: 32px; font-size: 14px; }
.comment-del {
  margin-left: auto; background: none; border: 0;
  color: var(--text-tertiary); font-size: 12px; cursor: pointer;
}
.comment-del:hover { color: var(--danger); }

/* @提及链接：正常蓝色（普通链接色） */
.comment-body a[href*="profile.html?uid="],
.markdown a[href*="profile.html?uid="] { color: #3b82f6; font-weight: 500; }

/* 原生下拉在深浅主题下的系统配色（避免白底白字/弹层异常） */
.form-select { color-scheme: light; }
[data-theme="dark"] .form-select { color-scheme: dark; }
[data-theme="dark"] .form-select option { background: var(--bg-primary); color: var(--text); }


/* EasyMDE 主题适配（编辑器深浅色统一） */
.EasyMDEContainer .CodeMirror {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
}
.editor-toolbar {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  opacity: 1;
}
.editor-toolbar button { color: var(--text-secondary) !important; }
.editor-toolbar button:hover,
.editor-toolbar button.active {
  background: var(--bg-tertiary);
  color: var(--text) !important;
  border-color: var(--border);
}
.editor-toolbar i.separator { border-left: 1px solid var(--border); border-right: none; }
.editor-statusbar { color: var(--text-tertiary); }
[data-theme="dark"] .EasyMDEContainer .CodeMirror { background: var(--bg-secondary); }
[data-theme="dark"] .editor-toolbar { background: var(--bg-secondary); }

/* Wiki 正文极简编辑器 + 居中语法 */
.wiki-editor-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.md-center { text-align: center; }

/* Wiki 可视化编辑器（contenteditable） */
.wiki-wysiwyg {
  min-height: 281px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text);
  line-height: 1.8;
  outline: none;
  overflow-y: auto;
}
.wiki-wysiwyg:focus { border-color: var(--border); box-shadow: none; outline: none; }
.wiki-wysiwyg h1 { font-size: 1.6em; font-weight: 700; margin: 0.6em 0 0.3em; }
.wiki-wysiwyg h2 { font-size: 1.3em; font-weight: 700; margin: 0.5em 0 0.25em; }
.wiki-wysiwyg p { margin: 0.3em 0; }
.wiki-wysiwyg .md-center { text-align: center; }

/* 正文长串/无空格文本自动换行，避免横向撑破 */
.markdown, .wiki-wysiwyg, .md-center { overflow-wrap: anywhere; word-break: break-word; }


/* 详情页：规格参数/正文标题居中，规格内容左上对齐 */
.section-title--center { justify-content: center; position: relative; }
.section-title--center h2 { text-align: center; }
.section-title--center #versionInfo { position: absolute; right: 0; }
.specs-table td, .specs-table th { text-align: left; }
.specs-table { width: 100%; }

/* 评论区：输入框始终压在卡片底部，不在评论列表中间 */
#commentsSection .card { display: flex; flex-direction: column; }
#commentsSection #commentList { flex: 0 0 auto; }
#commentsSection #commentForm { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }

/* 评论工具条默认不占位（原来 opacity:0 仍占高度，缩小输入框后露出空白） */
.comment-tools { display: none; }
.comment-editor.is-active .comment-tools,
.comment-editor:focus-within .comment-tools { display: flex; opacity: 1; pointer-events: auto; }


/* 统一 section 标题：左对齐 + 垂直居中（正文/规格参数/评论一致） */
.section-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 34px;
  margin-bottom: 16px;
  padding: 0 0 10px;
  border-bottom: 2px solid var(--border-strong);
}
.section-title h2 {
  margin: 0;
  line-height: 1.25;
  text-align: left;
}
.section-title #versionInfo,
.section-title .text-faint.text-xs {
  margin-left: auto;
}

/* 详情页：标题卡片与下方「规格参数」之间留白（原来标题紧贴卡片，视觉上粘在一起） */
#headerCard { margin-bottom: 48px; }
@media (max-width: 720px) {
  #headerCard { margin-bottom: 32px; }
}
/* ---------- 表情包广场：横向自动铺满（2026-11-22） ---------- */
.sticker-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); align-items: start; }
@media (max-width: 720px) { .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
@media (max-width: 420px) { .sticker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 表情包卡片：hover 显示「⋯」，菜单常驻隐藏 */
.lib-card:hover .sticker-more,
.sticker-more:focus { opacity: 1 !important; }
.sticker-menu.hidden { display: none !important; }
