/* ==========================================================================
   UIBBS Design Tokens
   论坛 / 社区 UI 设计系统 ——  foundational layer
   所有颜色、字号、间距、圆角、阴影、动效均在此定义，组件层只引用变量。
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------- 品牌色 */
  /* 主色：克制的信息蓝，长期阅读不疲劳 */
  --brand-50:  #EEF4FF;
  --brand-100: #D9E5FF;
  --brand-200: #B8CCFF;
  --brand-300: #8FACFF;
  --brand-400: #6085FB;
  --brand-500: #3A66F0;  /* 主色 */
  --brand-600: #2A4FD1;  /* hover */
  --brand-700: #2140AC;  /* active */
  --brand-800: #1C3589;

  /* -------------------------------------------------------------- 中性色阶 */
  /* 用于文字、边框、背景，带一点冷调，和主色同源 */
  --ink-0:   #FFFFFF;
  --ink-25:  #FBFCFE;
  --ink-50:  #F6F8FB;
  --ink-75:  #F1F4F9;
  --ink-100: #EAEFF6;
  --ink-200: #DCE3ED;
  --ink-300: #C3CDDB;
  --ink-400: #98A3B4;
  --ink-500: #6E7A8C;
  --ink-600: #525C6D;
  --ink-700: #3A4353;
  --ink-800: #262E3A;
  --ink-900: #161C25;

  /* ------------------------------------------------------------ 语义功能色 */
  --success-50:  #E7F7F0;
  --success-100: #C6EEDD;
  --success-500: #12A87A;
  --success-600: #0C8A62;

  --warning-50:  #FEF4E5;
  --warning-100: #FCE7C4;
  --warning-500: #DF8A0B;
  --warning-600: #B76F06;

  --danger-50:   #FDECEC;
  --danger-100:  #FAD3D4;
  --danger-500:  #E0454C;
  --danger-600:  #BC363C;

  --info-50:  #EEF4FF;
  --info-500: #3A66F0;

  /* ---------------------------------------------------------- 游戏化 / 激励 */
  /* 签到、钱包、抽奖、红包、会员等级使用，与主色区分开 */
  --gold-50:  #FFF7E6;
  --gold-100: #FFEDC7;
  --gold-400: #F3C263;
  --gold-500: #DBA020;
  --gold-600: #B4801A;

  --vip-purple: #7C5CFF;
  --vip-pink:   #F0549C;
  --vip-cyan:   #14B8C6;

  /* ------------------------------------------------------------ 语义化别名 */
  --bg-body:        var(--ink-50);
  --bg-surface:     var(--ink-0);
  --bg-subtle:      var(--ink-75);
  --bg-muted:       var(--ink-100);
  --bg-hover:       var(--ink-75);
  --bg-active:      var(--ink-100);

  --text-strong:    var(--ink-900);
  --text-default:   var(--ink-800);
  --text-muted:     var(--ink-500);
  --text-subtle:    var(--ink-400);
  --text-invert:    #FFFFFF;

  --border-subtle:  var(--ink-100);
  --border-default: var(--ink-200);
  --border-strong:  var(--ink-300);

  --focus-ring: 0 0 0 3px rgba(58, 102, 240, 0.18);
  --focus-ring-danger: 0 0 0 3px rgba(224, 69, 76, 0.16);

  /* ----------------------------------------------------------------- 字体 */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
               "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "SF Mono", Menlo, Consolas,
               "Liberation Mono", "Courier New", monospace;
  --font-serif: "Noto Serif SC", "Songti SC", Georgia, serif;

  /* 字号阶梯 —— 正文 15px 起步，论坛长文友好 */
  --fs-2xs: 11px;
  --fs-xs:  12px;
  --fs-sm:  13px;
  --fs-md:  14px;
  --fs-base:15px;
  --fs-lg:  16px;
  --fs-xl:  18px;
  --fs-2xl: 20px;
  --fs-3xl: 24px;
  --fs-4xl: 28px;
  --fs-5xl: 34px;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* 行高 */
  --lh-tight:  1.25;
  --lh-snug:   1.4;
  --lh-normal: 1.6;
  --lh-relaxed:1.75;  /* 正文长文 */

  --ls-tight: -0.015em;
  --ls-normal: 0;

  /* ----------------------------------------------------------------- 间距 */
  --sp-0:  0;
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* ----------------------------------------------------------------- 圆角 */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-2xl:  22px;
  --r-full: 999px;

  /* ----------------------------------------------------------------- 阴影 */
  --shadow-xs: 0 1px 2px rgba(22, 28, 37, 0.04);
  --shadow-sm: 0 1px 3px rgba(22, 28, 37, 0.06), 0 1px 2px rgba(22, 28, 37, 0.04);
  --shadow-md: 0 4px 12px rgba(22, 28, 37, 0.07), 0 1px 3px rgba(22, 28, 37, 0.04);
  --shadow-lg: 0 12px 28px rgba(22, 28, 37, 0.09), 0 2px 6px rgba(22, 28, 37, 0.04);
  --shadow-xl: 0 24px 52px rgba(22, 28, 37, 0.14);
  --shadow-brand: 0 6px 18px rgba(58, 102, 240, 0.24);
  --shadow-gold:  0 8px 22px rgba(219, 160, 32, 0.26);

  /* ----------------------------------------------------------------- 动效 */
  --ease-out:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast:  120ms;
  --dur-base:  180ms;
  --dur-slow:  320ms;

  /* ------------------------------------------------------------- 布局常量 */
  --header-h: 60px;
  --appbar-h: 52px;                 /* 手机端 App 导航栏高度 */
  --tabbar-h: 54px;                 /* 手机端底部标签栏高度（不含安全区） */
  --tabbar-btn: 52px;               /* 中间凸起「+」按钮直径 */
  --tabbar-lift: 16px;              /* 「+」按钮浮出标签栏上沿的高度 */
  --ptr-h: 64px;                    /* 下拉刷新触发距离 */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --container: 1240px;
  --sidebar-l: 208px;
  --sidebar-r: 300px;
  --z-header: 100;
  --z-dropdown: 200;
  --z-sticky: 300;
  --z-drawer: 400;
  --z-modal: 500;
  --z-toast: 600;
}

/* ==========================================================================
   Dark Theme —— 通过 <html data-theme="dark"> 切换
   ========================================================================== */
[data-theme="dark"] {
  --brand-50:  #17233F;
  --brand-100: #1B2C51;
  --brand-200: #22406F;
  --brand-300: #2F5CA8;
  --brand-400: #4A7DE8;
  --brand-500: #5B8CF5;
  --brand-600: #7AA4FF;
  --brand-700: #9DBBFF;
  --brand-800: #C3D6FF;

  --ink-0:   #0F131A;
  --ink-25:  #141922;
  --ink-50:  #171D27;
  --ink-75:  #1D2430;
  --ink-100: #232B39;
  --ink-200: #2E3846;
  --ink-300: #3E4A5C;
  --ink-400: #6A7688;
  --ink-500: #8B97A8;
  --ink-600: #A6B1C0;
  --ink-700: #C2CBD7;
  --ink-800: #DCE2EB;
  --ink-900: #F1F4F8;

  --success-50:  #102A22;
  --success-100: #17453A;
  --success-500: #2FBE8E;
  --success-600: #5BD3A8;

  --warning-50:  #2E2210;
  --warning-100: #453315;
  --warning-500: #F0A62F;
  --warning-600: #FFC163;

  --danger-50:   #2E1517;
  --danger-100: #451E21;
  --danger-500: #EF5A61;
  --danger-600: #FF7E84;

  --gold-50:  #2C2110;
  --gold-100: #403014;
  --gold-400: #E9B64A;
  --gold-500: #F3C263;
  --gold-600: #FFD98A;

  --bg-body:        #0C1016;
  --bg-surface:     var(--ink-0);
  --bg-subtle:      var(--ink-25);
  --bg-muted:       var(--ink-75);
  --bg-hover:       var(--ink-75);
  --bg-active:      var(--ink-100);

  --text-strong:    var(--ink-900);
  --text-default:   var(--ink-700);
  --text-muted:     var(--ink-400);
  --text-subtle:    var(--ink-400);

  --border-subtle:  var(--ink-100);
  --border-default: var(--ink-200);
  --border-strong:  var(--ink-300);

  --focus-ring: 0 0 0 3px rgba(91, 140, 245, 0.28);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 26px 60px rgba(0, 0, 0, 0.6);
  --shadow-brand: 0 6px 18px rgba(91, 140, 245, 0.3);
  --shadow-gold:  0 8px 22px rgba(243, 194, 99, 0.26);
}
/* ==========================================================================
   UIBBS Base —— reset / typography / utilities
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-default);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" on, "lnum" on;
  transition: background-color var(--dur-base) var(--ease-in-out),
              color var(--dur-base) var(--ease-in-out);
}

/* 主题切换时避免整页闪烁 */
.theme-transition *, .theme-transition *::before, .theme-transition *::after {
  transition: background-color var(--dur-base) var(--ease-in-out),
              border-color var(--dur-base) var(--ease-in-out),
              color var(--dur-base) var(--ease-in-out) !important;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-sm); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--brand-500);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--brand-600); }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: none; cursor: pointer; padding: 0; }
textarea { resize: vertical; }

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--sp-6) 0;
}

code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }
kbd {
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  padding: 1px 6px;
  font-size: var(--fs-xs);
  color: var(--text-default);
}

/* hidden 属性必须生效（组件常带 display:flex/grid，会覆盖 UA 样式） */
[hidden] { display: none !important; }

/* --------------------------------------------------------------- 焦点可见性 */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

::selection {
  background: rgba(58, 102, 240, 0.18);
  color: var(--text-strong);
}

/* ------------------------------------------------------------------ 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--ink-300) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--ink-300);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); background-clip: content-box; }

/* ==========================================================================
   图标系统
   ========================================================================== */
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke-width: 1.75;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 14px; height: 14px; stroke-width: 2; }
.icon--lg { width: 22px; height: 22px; }
.icon--xl { width: 28px; height: 28px; stroke-width: 1.5; }
.icon--fill { fill: currentColor; stroke: none; }

/* ==========================================================================
   工具类 Utilities
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
@media (min-width: 768px) { .container { padding-inline: var(--sp-6); } }

.u-flex { display: flex; }
.u-inline-flex { display: inline-flex; }
.u-grid { display: grid; }
.u-items-center { align-items: center; }
.u-items-start { align-items: flex-start; }
.u-items-end { align-items: flex-end; }
.u-justify-between { justify-content: space-between; }
.u-justify-center { justify-content: center; }
.u-justify-end { justify-content: end; }
.u-gap-1 { gap: var(--sp-1); }
.u-gap-2 { gap: var(--sp-2); }
.u-gap-3 { gap: var(--sp-3); }
.u-gap-4 { gap: var(--sp-4); }
.u-gap-5 { gap: var(--sp-5); }
.u-gap-6 { gap: var(--sp-6); }
.u-gap-8 { gap: var(--sp-8); }
.u-col { flex-direction: column; }
.u-wrap { flex-wrap: wrap; }
.u-grow { flex: 1 1 auto; min-width: 0; }
.u-none { flex: none; }
.u-full { width: 100%; }
.u-relative { position: relative; }
.u-hidden { display: none !important; }
.u-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.u-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.u-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.u-mt-0 { margin-top: 0; } .u-mt-2 { margin-top: var(--sp-2); }
.u-mt-3 { margin-top: var(--sp-3); } .u-mt-4 { margin-top: var(--sp-4); }
.u-mt-6 { margin-top: var(--sp-6); } .u-mt-8 { margin-top: var(--sp-8); }
.u-mb-0 { margin-bottom: 0; } .u-mb-2 { margin-bottom: var(--sp-2); }
.u-mb-3 { margin-bottom: var(--sp-3); } .u-mb-4 { margin-bottom: var(--sp-4); }
.u-mb-6 { margin-bottom: var(--sp-6); } .u-mb-8 { margin-bottom: var(--sp-8); }
.u-ml-auto { margin-left: auto; }
.u-text-center { text-align: center; }
.u-text-right { text-align: right; }
.u-text-left { text-align: left; }

.u-text-xs   { font-size: var(--fs-xs); }
.u-text-sm   { font-size: var(--fs-sm); }
.u-text-md   { font-size: var(--fs-md); }
.u-text-lg   { font-size: var(--fs-lg); }
.u-text-xl   { font-size: var(--fs-xl); }
.u-text-2xl  { font-size: var(--fs-2xl); }
.u-text-muted   { color: var(--text-muted); }
.u-text-subtle  { color: var(--text-subtle); }
.u-text-strong  { color: var(--text-strong); }
.u-text-brand   { color: var(--brand-500); }
.u-text-success { color: var(--success-500); }
.u-text-warning { color: var(--warning-500); }
.u-text-danger  { color: var(--danger-500); }
.u-text-gold    { color: var(--gold-500); }
.u-fw-medium { font-weight: var(--fw-medium); }
.u-fw-semibold { font-weight: var(--fw-semibold); }
.u-fw-bold { font-weight: var(--fw-bold); }
.u-mono { font-family: var(--font-mono); }
.u-nowrap { white-space: nowrap; }
.u-num { font-variant-numeric: tabular-nums; }

/* 屏幕阅读器专用 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 跳转链接 */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-toast);
  background: var(--brand-500);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; }

/* 分隔点 */
.u-dot-sep::after {
  content: "·";
  margin: 0 6px;
  color: var(--ink-300);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
/* ==========================================================================
   UIBBS Components —— 通用组件库
   命名：.block / .block--modifier / .block__element
   所有组件仅消费 tokens.css 的变量，改主题即整体换肤。
   ========================================================================== */

/* ==========================================================================
   1. Button 按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-default);
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:disabled,
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 变体 */
.btn--primary {
  background: var(--brand-500);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn--primary:hover { background: var(--brand-600); box-shadow: var(--shadow-sm); }

.btn--secondary {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-default);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn--soft {
  background: var(--brand-50);
  color: var(--brand-600);
}
.btn--soft:hover { background: var(--brand-100); }

.btn--ghost { color: var(--text-muted); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text-strong); }

.btn--outline {
  border-color: var(--brand-500);
  color: var(--brand-500);
  background: transparent;
}
.btn--outline:hover { background: var(--brand-50); }

.btn--danger { background: var(--danger-500); color: #fff; }
.btn--danger:hover { background: var(--danger-600); }
.btn--danger-soft { background: var(--danger-50); color: var(--danger-600); }
.btn--danger-soft:hover { background: var(--danger-100); }

.btn--success { background: var(--success-500); color: #fff; }
.btn--success:hover { background: var(--success-600); }

.btn--gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #4a3306;
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-gold);
}
.btn--gold:hover { filter: brightness(1.05); }

.btn--link {
  height: auto;
  padding: 0;
  color: var(--brand-500);
  border-radius: var(--r-xs);
}
.btn--link:hover { color: var(--brand-600); text-decoration: underline; }

/* 尺寸 */
.btn--xs { height: 26px; padding: 0 9px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn--sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
.btn--lg { height: 44px; padding: 0 22px; font-size: var(--fs-lg); border-radius: var(--r-lg); }
.btn--xl { height: 52px; padding: 0 28px; font-size: var(--fs-lg); border-radius: var(--r-lg); }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--icon.btn--xs { width: 26px; }
.btn--pill { border-radius: var(--r-full); }
.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.7;
  animation: ui-spin 0.6s linear infinite;
  color: inherit;
}

/* 图标按钮 */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  position: relative;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.icon-btn.is-active { color: var(--brand-500); background: var(--brand-50); }
.icon-btn--sm { width: 30px; height: 30px; }
.icon-btn--round { border-radius: var(--r-full); }

@keyframes ui-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   2. Input 输入框 / 表单
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-default);
  display: flex;
  align-items: center;
  gap: 4px;
}
.field__label .req { color: var(--danger-500); }
.field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field__error {
  font-size: var(--fs-xs);
  color: var(--danger-500);
  display: flex;
  align-items: center;
  gap: 4px;
}

.input {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 38px;
  padding: 0 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input:hover { border-color: var(--border-strong); }
.input:focus-within {
  border-color: var(--brand-500);
  box-shadow: var(--focus-ring);
}
.input > input,
.input > textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--fs-md);
  color: var(--text-strong);
}
.input > input::placeholder { color: var(--text-subtle); }
.input__prefix, .input__suffix {
  display: inline-flex;
  align-items: center;
  color: var(--text-subtle);
  flex: none;
}
.input__suffix .icon-btn { width: 26px; height: 26px; }
.input--sm { height: 32px; padding: 0 10px; font-size: var(--fs-sm); }
.input--lg { height: 46px; padding: 0 16px; font-size: var(--fs-lg); }
.input--pill { border-radius: var(--r-full); }
.input--error { border-color: var(--danger-500); }
.input--error:focus-within { box-shadow: var(--focus-ring-danger); }
.input--success { border-color: var(--success-500); }
.input:has(> input:disabled) { background: var(--bg-muted); opacity: 0.7; }

/* 纯 input（不带 wrapper） */
.input-bare {
  height: 38px;
  padding: 0 12px;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  color: var(--text-strong);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input-bare:focus { border-color: var(--brand-500); box-shadow: var(--focus-ring); }

/* 文本域 */
.textarea {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text-strong);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.textarea:focus { border-color: var(--brand-500); box-shadow: var(--focus-ring); }

/* 选择器 */
.select {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.select select {
  appearance: none;
  height: 36px;
  padding: 0 32px 0 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  color: var(--text-strong);
  cursor: pointer;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.select select:focus { border-color: var(--brand-500); box-shadow: var(--focus-ring); }
.select::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 8px; height: 8px;
  border-right: 1.6px solid var(--text-subtle);
  border-bottom: 1.6px solid var(--text-subtle);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.select--sm select { height: 30px; font-size: var(--fs-sm); padding: 0 28px 0 10px; }

/* 复选框 / 单选 */
.check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: var(--fs-md);
  color: var(--text-default);
  line-height: 1.4;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex: none;
  width: 17px; height: 17px;
  margin-top: 1px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-xs);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.check__box::after {
  content: "";
  width: 9px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  margin-top: -2px;
  transition: transform var(--dur-fast) var(--ease-spring);
}
.check input:checked + .check__box {
  background: var(--brand-500);
  border-color: var(--brand-500);
}
.check input:checked + .check__box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .check__box { box-shadow: var(--focus-ring); }
.check input:disabled + .check__box { opacity: 0.5; }
.check--radio .check__box { border-radius: var(--r-full); }
.check--radio .check__box::after {
  width: 7px; height: 7px;
  border: none;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  margin: 0;
}
.check--radio input:checked + .check__box::after { transform: scale(1); }

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  flex: none;
  width: 38px; height: 22px;
  border-radius: var(--r-full);
  background: var(--ink-300);
  position: relative;
  transition: background-color var(--dur-base) var(--ease-out);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-spring);
}
.switch input:checked + .switch__track { background: var(--brand-500); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus-ring); }
.switch input:disabled + .switch__track { opacity: 0.5; }
.switch__label { font-size: var(--fs-md); color: var(--text-default); }

/* 滑块 */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--ink-200);
  outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand-500);
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* ==========================================================================
   3. Card 卡片
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card--flat { box-shadow: none; }
.card--raised { box-shadow: var(--shadow-md); }
.card--hover { transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.card--hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card--borderless { border: none; }
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}
.card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.card__body { padding: var(--sp-5); }
.card__body--tight { padding: var(--sp-4); }
.card__footer {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}
.card__divider { height: 1px; background: var(--border-subtle); }

/* 分区标题 */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.section-head__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.section-head__desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; font-weight: var(--fw-regular); }

/* ==========================================================================
   4. Badge / Chip / Tag
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
}
.badge--brand   { background: var(--brand-50);   color: var(--brand-600); }
.badge--success { background: var(--success-50); color: var(--success-600); }
.badge--warning { background: var(--warning-50); color: var(--warning-600); }
.badge--danger  { background: var(--danger-50);  color: var(--danger-600); }
.badge--neutral { background: var(--bg-muted);   color: var(--text-muted); }
.badge--gold    { background: var(--gold-50);    color: var(--gold-600); }
.badge--vip     { background: linear-gradient(135deg, #7C5CFF, #F0549C); color: #fff; }
.badge--outline { background: transparent; border: 1px solid var(--border-default); color: var(--text-muted); }
.badge--solid   { background: var(--brand-500); color: #fff; }
.badge--dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge--pill { border-radius: var(--r-full); }
.badge--lg { height: 24px; padding: 0 10px; font-size: var(--fs-sm); }

/* 计数徽标（角标） */
.count-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--danger-500);
  color: #fff;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  line-height: 16px;
  text-align: center;
  border: 2px solid var(--bg-surface);
  box-sizing: content-box;
}

/* Tag 标签（可点击） */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-full);
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  transition: all var(--dur-fast) var(--ease-out);
  border: 1px solid transparent;
}
a.tag:hover { background: var(--brand-50); color: var(--brand-600); }
.tag--active, .tag.is-active {
  background: var(--brand-500);
  color: #fff;
}
.tag--outline { background: transparent; border-color: var(--border-default); }
.tag--outline:hover { border-color: var(--brand-500); color: var(--brand-500); }
.tag--removable { padding-right: 4px; }
.tag__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  color: inherit;
  opacity: 0.6;
}
.tag__remove:hover { opacity: 1; background: rgba(0,0,0,0.08); }
.tag--brand { background: var(--brand-50); color: var(--brand-600); }
.tag--gold { background: var(--gold-50); color: var(--gold-600); }

/* 楼层号 / 序号 */
.floor-no {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  background: var(--bg-muted);
  border-radius: var(--r-xs);
  padding: 1px 6px;
}

/* ==========================================================================
   5. Avatar 头像
   ========================================================================== */
.avatar {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: var(--ink-200);
  color: #fff;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: 1;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--xs { width: 24px; height: 24px; font-size: 10px; }
.avatar--sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar--md { width: 40px; height: 40px; }
.avatar--lg { width: 56px; height: 56px; font-size: var(--fs-xl); }
.avatar--xl { width: 76px; height: 76px; font-size: var(--fs-2xl); }
.avatar--2xl { width: 96px; height: 96px; font-size: var(--fs-3xl); }
.avatar--square { border-radius: var(--r-lg); }
.avatar--ring { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--brand-500); }
.avatar--ring-gold { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--gold-400); }

/* 渐变头像（mock 用，无外链图片） */
.av-1 { background: linear-gradient(135deg, #5B8CF5, #3A66F0); }
.av-2 { background: linear-gradient(135deg, #F3A95B, #E0752B); }
.av-3 { background: linear-gradient(135deg, #4FC3A1, #12A87A); }
.av-4 { background: linear-gradient(135deg, #B78CF5, #7C5CFF); }
.av-5 { background: linear-gradient(135deg, #F58CAE, #F0549C); }
.av-6 { background: linear-gradient(135deg, #5BC8E0, #14B8C6); }
.av-7 { background: linear-gradient(135deg, #F0935B, #E0454C); }
.av-8 { background: linear-gradient(135deg, #8FA3B8, #52627A); }

.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--bg-surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink-200);
  color: var(--ink-700);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

/* 在线状态点 */
.presence {
  position: absolute;
  right: 0; bottom: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-400);
  border: 2px solid var(--bg-surface);
}
.presence--online { background: var(--success-500); }
.presence--busy { background: var(--warning-500); }

/* ==========================================================================
   6. Nav / Tab / Breadcrumb
   ========================================================================== */
/* 分段导航（pill tabs） */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--bg-muted);
  border-radius: var(--r-md);
}
.segmented__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: calc(var(--r-md) - 3px);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.segmented__item:hover { color: var(--text-strong); }
.segmented__item.is-active {
  background: var(--bg-surface);
  color: var(--text-strong);
  box-shadow: var(--shadow-xs);
}
.segmented--block { display: flex; width: 100%; }
.segmented--block .segmented__item { flex: 1; justify-content: center; }

/* 下划线 Tabs */
.tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 2px;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}
.tab:hover { color: var(--text-strong); }
.tab.is-active { color: var(--brand-500); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--brand-500);
  border-radius: var(--r-full);
}
.tab__count {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  background: var(--bg-muted);
  border-radius: var(--r-full);
  padding: 1px 6px;
}
.tab.is-active .tab__count { background: var(--brand-50); color: var(--brand-600); }

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand-500); }
.breadcrumb__sep { color: var(--ink-300); display: inline-flex; }
.breadcrumb__current { color: var(--text-default); font-weight: var(--fw-medium); }

/* 垂直侧边导航 */
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav__group {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-4) var(--sp-3) var(--sp-1);
}
.side-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-out);
  position: relative;
}
.side-nav__item:hover { background: var(--bg-hover); color: var(--text-strong); }
.side-nav__item.is-active {
  background: var(--brand-50);
  color: var(--brand-600);
  font-weight: var(--fw-medium);
}
.side-nav__item.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--brand-500);
  border-radius: var(--r-full);
}
.side-nav__item .badge { margin-left: auto; }

/* ==========================================================================
   7. Pagination 分页
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-default);
  font-variant-numeric: tabular-nums;
  transition: all var(--dur-fast) var(--ease-out);
}
.pagination__btn:hover:not(:disabled) {
  border-color: var(--brand-500);
  color: var(--brand-500);
  background: var(--brand-50);
}
.pagination__btn.is-active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}
.pagination__btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px; height: 34px;
  color: var(--text-subtle);
}
.pagination__info { font-size: var(--fs-sm); color: var(--text-muted); }
.pagination--simple { justify-content: space-between; }

/* ==========================================================================
   8. Alert / Toast / Modal / Drawer / Popover
   ========================================================================== */
.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  border: 1px solid transparent;
}
.alert__icon { flex: none; margin-top: 1px; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__title { font-weight: var(--fw-semibold); margin-bottom: 2px; }
.alert__close { flex: none; }
.alert--info    { background: var(--info-50);    color: var(--brand-700);  border-color: var(--brand-100); }
.alert--success { background: var(--success-50); color: var(--success-600); border-color: var(--success-100); }
.alert--warning { background: var(--warning-50); color: var(--warning-600); border-color: var(--warning-100); }
.alert--danger  { background: var(--danger-50);  color: var(--danger-600);  border-color: var(--danger-100); }
.alert--neutral { background: var(--bg-subtle);  color: var(--text-default); border-color: var(--border-subtle); }

/* Toast */
.toast-stack {
  position: fixed;
  z-index: var(--z-toast);
  top: calc(var(--header-h) + 12px);
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-md);
  pointer-events: auto;
  animation: toast-in var(--dur-slow) var(--ease-spring);
}
.toast.is-out { animation: toast-out var(--dur-base) var(--ease-out) forwards; }
.toast__icon { flex: none; margin-top: 1px; }
.toast__icon--success { color: var(--success-500); }
.toast__icon--error { color: var(--danger-500); }
.toast__icon--info { color: var(--brand-500); }
.toast__icon--warning { color: var(--warning-500); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(24px) scale(0.96); }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: rgba(16, 22, 32, 0.45);
  backdrop-filter: blur(3px);
  animation: fade-in var(--dur-base) var(--ease-out);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  animation: modal-in var(--dur-slow) var(--ease-spring);
  overflow: hidden;
}
.modal--sm { max-width: 380px; }
.modal--lg { max-width: 680px; }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}
.modal__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.modal__body { padding: var(--sp-5); overflow-y: auto; }
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Drawer 抽屉 */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: var(--z-drawer);
  width: min(420px, 92vw);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: drawer-in var(--dur-slow) var(--ease-out);
}
.drawer[hidden] { display: none; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
.drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}
.drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-5); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  padding: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  animation: menu-in var(--dur-base) var(--ease-out);
}
.dropdown__menu[hidden] { display: none; }
.dropdown__menu--left { right: auto; left: 0; }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  color: var(--text-default);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.dropdown__item:hover { background: var(--bg-hover); }
.dropdown__item--danger { color: var(--danger-500); }
.dropdown__item--danger:hover { background: var(--danger-50); }
.dropdown__sep { height: 1px; background: var(--border-subtle); margin: 5px 4px; }
.dropdown__label {
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  padding: 6px 10px 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--fw-semibold);
}

/* Tooltip */
.tooltip { position: relative; }
.tooltip__bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 9px;
  background: var(--ink-800);
  color: #fff;
  font-size: var(--fs-xs);
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out);
  z-index: var(--z-dropdown);
}
.tooltip:hover .tooltip__bubble { opacity: 1; }

/* ==========================================================================
   9. Progress / Skeleton / Empty / Loading
   ========================================================================== */
.progress {
  width: 100%;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--ink-100);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand-500);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress__bar--success { background: var(--success-500); }
.progress__bar--gold { background: linear-gradient(90deg, var(--gold-400), var(--gold-600)); }
.progress__bar--danger { background: var(--danger-500); }
.progress--lg { height: 10px; }
.progress--sm { height: 4px; }
.progress__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* 环形进度 */
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: var(--ink-100); }
.ring__value { stroke: var(--brand-500); stroke-linecap: round; transition: stroke-dashoffset var(--dur-slow) var(--ease-out); }
.ring__text {
  position: absolute;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 37%, var(--ink-100) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.skeleton--text { height: 12px; margin-bottom: 8px; }
.skeleton--title { height: 18px; width: 60%; margin-bottom: 12px; }
.skeleton--avatar { width: 40px; height: 40px; border-radius: 50%; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-16) var(--sp-6);
  text-align: center;
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: var(--r-full);
  background: var(--bg-muted);
  color: var(--text-subtle);
}
.empty__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-strong); }
.empty__desc { font-size: var(--fs-md); color: var(--text-muted); max-width: 380px; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--ink-200);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  animation: ui-spin 0.7s linear infinite;
}

/* ==========================================================================
   10. Table 表格
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th, .table td {
  padding: 12px var(--sp-4);
  text-align: left;
  white-space: nowrap;
}
.table thead th {
  background: var(--bg-subtle);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1;
}
.table tbody tr { border-bottom: 1px solid var(--border-subtle); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-subtle); }
.table tbody tr.is-selected { background: var(--brand-50); }
.table .cell-num { font-variant-numeric: tabular-nums; }
.table .cell-actions { text-align: right; }
.table--compact th, .table--compact td { padding: 9px var(--sp-3); }
.table--zebra tbody tr:nth-child(even) { background: var(--bg-subtle); }

/* ==========================================================================
   11. Stat 数据卡 / 时间线 / 步骤条
   ========================================================================== */
.stat-card {
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}
.stat-card__label {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-card__value {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--ls-tight);
}
.stat-card__unit { font-size: var(--fs-md); font-weight: var(--fw-regular); color: var(--text-muted); margin-left: 3px; }
.stat-card__trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: var(--fs-xs); font-weight: var(--fw-medium);
  margin-top: 6px;
}
.stat-card__trend--up { color: var(--danger-500); }    /* 中国习惯：涨=红 */
.stat-card__trend--down { color: var(--success-500); }  /* 跌=绿 */
.stat-card__icon {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--brand-50);
  color: var(--brand-500);
}

/* 时间线 */
.timeline { position: relative; padding-left: var(--sp-6); }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--border-subtle);
}
.timeline__item { position: relative; padding-bottom: var(--sp-5); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: calc(-1 * var(--sp-6) + 2px);
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--ink-300);
}
.timeline__dot--active { border-color: var(--brand-500); background: var(--brand-500); }
.timeline__dot--gold { border-color: var(--gold-500); background: var(--gold-400); }
.timeline__time { font-size: var(--fs-xs); color: var(--text-subtle); margin-bottom: 2px; }
.timeline__title { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-strong); }
.timeline__desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }

/* 步骤条 */
.steps { display: flex; align-items: flex-start; }
.steps__item { flex: 1 1 0; position: relative; text-align: center; }
.steps__item::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--ink-200);
  z-index: 0;
}
.steps__item:first-child::before { display: none; }
.steps__item.is-done::before { background: var(--brand-500); }
.steps__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--ink-200);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
}
.steps__item.is-done .steps__dot { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
.steps__item.is-current .steps__dot { border-color: var(--brand-500); color: var(--brand-500); }
.steps__label { font-size: var(--fs-sm); color: var(--text-muted); }
.steps__item.is-current .steps__label { color: var(--text-strong); font-weight: var(--fw-medium); }
/* ==========================================================================
   UIBBS Layout —— 站点骨架：顶栏 / 三栏栅格 / 侧栏 / 移动底栏
   ========================================================================== */

/* ==========================================================================
   Site Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .site-header { background: var(--bg-surface); }
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
@media (min-width: 768px) { .header-inner { padding-inline: var(--sp-6); } }

/* 品牌区 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  color: var(--text-strong);
}
.brand:hover { color: var(--text-strong); }
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.brand__mark svg { width: 19px; height: 19px; }
.brand__text {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}
.brand__text span { color: var(--brand-500); }
/* 品牌文字：仅超窄屏（<360px）才隐藏 —— 手机端 App 栏左侧只有「菜单键 + Logo」，
   右侧图标也已精简，常见 375/390 宽度足够放下品牌名 */
@media (max-width: 359px) { .brand__text { display: none; } }

/* 主导航 */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: var(--sp-2);
}
.main-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.main-nav__link:hover { background: var(--bg-hover); color: var(--text-strong); }
.main-nav__link.is-active { background: var(--brand-50); color: var(--brand-600); }

/* 头部搜索 */
.header-search {
  flex: 1 1 auto;
  max-width: 380px;
  margin-inline: var(--sp-3);
  position: relative;
}
.header-search .input { height: 36px; border-radius: var(--r-full); background: var(--bg-subtle); }
.header-search .input:focus-within { background: var(--bg-surface); }
.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: var(--z-dropdown);
  max-height: 60vh;
  overflow-y: auto;
}
.search-panel[hidden] { display: none; }
.search-panel__group { padding: 6px 8px 4px; font-size: var(--fs-2xs); color: var(--text-subtle); font-weight: var(--fw-semibold); }
.search-panel__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  color: var(--text-default);
}
.search-panel__item:hover { background: var(--bg-hover); }
.search-panel__item .icon { color: var(--text-subtle); }
.search-hint { display: flex; gap: var(--sp-3); padding: 8px; font-size: var(--fs-xs); color: var(--text-subtle); }

/* 右侧操作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex: none;
}
.header-actions .divider {
  width: 1px; height: 20px;
  background: var(--border-subtle);
  margin: 0 6px;
}

/* 用户菜单触发器 */
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 8px 0 4px;
  border-radius: var(--r-full);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.user-trigger:hover { background: var(--bg-hover); }

/* ==========================================================================
   主体骨架
   ========================================================================== */
.site-main {
  min-height: calc(100vh - var(--header-h) - 200px);
  padding-block: var(--sp-5);
}
@media (min-width: 768px) { .site-main { padding-block: var(--sp-6); } }

/* 三栏栅格 */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  align-items: start;
}
@media (min-width: 1024px) {
  .layout--with-left { grid-template-columns: var(--sidebar-l) minmax(0, 1fr); }
  .layout--with-right { grid-template-columns: minmax(0, 1fr) var(--sidebar-r); }
  .layout--with-both { grid-template-columns: var(--sidebar-l) minmax(0, 1fr) var(--sidebar-r); }
}
.layout__side { display: flex; flex-direction: column; gap: var(--sp-4); }
.layout__side--left { order: 2; }
.layout__side--right { order: 3; }
.layout__main { order: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
@media (min-width: 1024px) {
  .layout__main { order: 2; }
  .layout__side--left { order: 1; }
  .layout__side--right { order: 3; }
  .layout__side.is-sticky {
    position: sticky;
    top: calc(var(--header-h) + var(--sp-5));
    max-height: calc(100vh - var(--header-h) - var(--sp-8));
    overflow-y: auto;
    scrollbar-width: none;
  }
  .layout__side.is-sticky::-webkit-scrollbar { display: none; }
}

/* 侧栏小卡 */
.side-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.side-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}
.side-card__title {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.side-card__body { padding: var(--sp-3) var(--sp-4); }
.side-card__body--flush { padding: var(--sp-2) 0; }
.side-card__foot {
  padding: 10px var(--sp-4);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}

/* 侧栏列表项 */
.mini-list { display: flex; flex-direction: column; }
.mini-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px var(--sp-4);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.mini-list__item:hover { background: var(--bg-hover); }
.mini-list__rank {
  flex: none;
  width: 20px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.mini-list__rank--top { color: var(--gold-500); }
.mini-list__main { flex: 1 1 auto; min-width: 0; }
.mini-list__name {
  font-size: var(--fs-md);
  color: var(--text-default);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-list__meta { font-size: var(--fs-xs); color: var(--text-subtle); }
.mini-list__extra { flex: none; font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   手机端底部标签栏（App 主 Tab）：首页 / 消息 / ＋ / 发现 / 我的
   · 只在 < 1024px 渲染；桌面端由顶部主导航承担，这里整块 display:none
   · 中间「＋」浮出栏上沿，是主内容入口（取代原先右下角的悬浮按钮）
   · 高度含 env(safe-area-inset-bottom)，避开全面屏的手势条
   ========================================================================== */
.mobile-tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}
/* 支持的浏览器上换成「毛玻璃」，滚动内容从下方隐约透出（不支持则退回实色）
   透明度取 96%：太透会让标签文字和身下的正文互相干扰，长期阅读更累 */
@supports (background: color-mix(in srgb, red, blue)) {
  .mobile-tabbar {
    background: color-mix(in srgb, var(--bg-surface) 96%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
  }
}

.mobile-tabbar__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-subtle);
  font-size: var(--fs-xs);
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.mobile-tabbar__item .icon { width: 22px; height: 22px; transition: transform var(--dur-fast) var(--ease-out); }
.mobile-tabbar__item.is-active { color: var(--brand-500); font-weight: var(--fw-medium); }
.mobile-tabbar__item.is-active .icon { transform: translateY(-1px); }
.mobile-tabbar__item:active { color: var(--brand-600); }

/* 未读小红点：贴着图标右上角 */
.mobile-tabbar__dot {
  position: absolute;
  top: 50%; left: 50%;
  margin: -16px 0 0 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--danger-500);
  box-shadow: 0 0 0 2px var(--bg-surface);
}

/* 中间凸起的主入口 */
.mobile-tabbar__compose {
  position: relative;
  align-self: start;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tabbar-btn);
  height: var(--tabbar-btn);
  margin-top: calc(var(--tabbar-lift) * -1);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff;
  /* 第二层阴影是「挖槽」用的描边，颜色跟随栏底色 */
  box-shadow: var(--shadow-brand), 0 0 0 5px var(--bg-surface);
  transition: transform var(--dur-base) var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.mobile-tabbar__compose .icon { width: 26px; height: 26px; }
.mobile-tabbar__compose:active { transform: scale(0.92); }

@media (min-width: 1024px) { .mobile-tabbar { display: none; } }

/* 移动端抽屉菜单 */
.nav-drawer-backdrop {
  position: fixed; inset: 0;
  z-index: var(--z-drawer);
  background: rgba(16, 22, 32, 0.45);
  animation: fade-in var(--dur-base) var(--ease-out);
}
.nav-drawer-backdrop[hidden] { display: none; }
.nav-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(300px, 84vw);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: drawer-left-in var(--dur-slow) var(--ease-out);
  z-index: calc(var(--z-drawer) + 1);
}
.nav-drawer[hidden] { display: none; }
@keyframes drawer-left-in { from { transform: translateX(-100%); } to { transform: none; } }
.nav-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
  padding-inline: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-3); }
.nav-drawer__foot { padding: var(--sp-3); border-top: 1px solid var(--border-subtle); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: var(--sp-10);
  padding-block: var(--sp-10) var(--sp-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.6fr repeat(3, 1fr); } }
.footer-brand__desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-3); max-width: 320px; line-height: var(--lh-normal); }
.footer-col__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  margin-bottom: var(--sp-3);
}
.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-links a { font-size: var(--fs-sm); color: var(--text-muted); }
.footer-links a:hover { color: var(--brand-500); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
.footer-stats { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.footer-stats b { color: var(--text-default); font-weight: var(--fw-semibold); }

/* ==========================================================================
   页面级通用头部（列表页 / 详情页顶部）
   ========================================================================== */
.page-head { margin-bottom: var(--sp-5); }
.page-head__title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
}
@media (max-width: 640px) { .page-head__title { font-size: var(--fs-2xl); } }
.page-head__desc { font-size: var(--fs-md); color: var(--text-muted); margin-top: 6px; }
.page-head__meta { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-3); }

/* 板块头部 */
.forum-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}
.forum-head__icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  background: var(--brand-50);
  color: var(--brand-500);
  font-size: var(--fs-2xl);
  flex: none;
}
.forum-head__main { flex: 1 1 auto; min-width: 0; }
.forum-head__title { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); }
.forum-head__desc { font-size: var(--fs-md); color: var(--text-muted); margin-top: 4px; }
.forum-head__stats { display: flex; gap: var(--sp-5); margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); flex-wrap: wrap; }
.forum-head__stats b { color: var(--text-strong); font-weight: var(--fw-semibold); }

/* 工具条（排序 / 筛选） */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: 10px var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}
.toolbar__group { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* 打印 */
@media print {
  .site-header, .site-footer, .mobile-tabbar, .layout__side { display: none !important; }
}
/* ==========================================================================
   UIBBS Widgets —— 论坛业务组件
   帖子项 / 评论 / 编辑器 / 日历 / 榜单 / 钱包 / 红包 / 抽奖 / 会话 / 富文本
   ========================================================================== */

/* ==========================================================================
   A. 帖子列表项 Thread Item
   ========================================================================== */
.thread-list { display: flex; flex-direction: column; }
.thread-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--dur-fast) var(--ease-out);
  position: relative;
}
.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: var(--bg-subtle); }
.thread-item.is-pinned { background: color-mix(in srgb, var(--brand-50) 45%, transparent); }
.thread-item.is-pinned:hover { background: var(--brand-50); }

.thread-item__avatar { flex: none; }
.thread-item__main { flex: 1 1 auto; min-width: 0; }
.thread-item__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-medium);
  color: var(--text-strong);
  line-height: var(--lh-snug);
  margin-bottom: 5px;
}
.thread-item__title a { color: inherit; }
.thread-item__title a:hover { color: var(--brand-500); }
.thread-item.is-read .thread-item__title a { color: var(--text-muted); }
.thread-item__excerpt {
  font-size: var(--fs-md);
  color: var(--text-muted);
  line-height: var(--lh-normal);
  margin-bottom: var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-item__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}
.thread-item__meta > * { display: inline-flex; align-items: center; gap: 4px; }
.thread-item__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--sp-2); }
.thread-item__side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 56px;
}
.thread-item__count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.thread-item__thumb {
  flex: none;
  width: 96px; height: 66px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--ink-100);
}
.thread-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) {
  .thread-item__thumb { display: none; }
  .thread-item__side { flex-direction: row; align-items: center; min-width: 0; }
}

/* 列表卡容器 */
.list-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* 紧凑模式 */
.thread-list--compact .thread-item { padding: 10px var(--sp-4); align-items: center; }
.thread-list--compact .thread-item__excerpt { display: none; }
.thread-list--compact .thread-item__title { font-size: var(--fs-md); margin-bottom: 0; }

/* 网格卡片模式 */
.thread-grid { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
@media (min-width: 640px) { .thread-grid { grid-template-columns: repeat(2, 1fr); } }
.thread-card { display: flex; flex-direction: column; }
.thread-card__cover {
  height: 140px;
  background: linear-gradient(135deg, var(--brand-100), var(--brand-50));
  position: relative;
}
.thread-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.thread-card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.thread-card__title { font-size: var(--fs-lg); font-weight: var(--fw-medium); line-height: var(--lh-snug); }
.thread-card__foot { margin-top: auto; }

/* 板块卡片 */
.forum-card {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  transition: all var(--dur-base) var(--ease-out);
}
.forum-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.forum-card__icon {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  flex: none;
  font-size: var(--fs-xl);
}
.forum-card__name { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.forum-card__desc { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 3px; }
.forum-card__meta { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 8px; display: flex; gap: var(--sp-3); }

/* ==========================================================================
   B. 帖子详情 & 富文本
   ========================================================================== */
.post {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.post__head { padding: var(--sp-5) var(--sp-6) var(--sp-4); border-bottom: 1px solid var(--border-subtle); }
@media (max-width: 640px) { .post__head { padding: var(--sp-4); } }
.post__title { font-size: var(--fs-4xl); line-height: 1.3; letter-spacing: var(--ls-tight); }
@media (max-width: 640px) { .post__title { font-size: var(--fs-2xl); } }
.post__byline {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}
.post__author { display: flex; align-items: center; gap: 10px; }
.post__author-name { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-strong); }
.post__author-meta { font-size: var(--fs-xs); color: var(--text-subtle); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post__stats { display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-sm); color: var(--text-muted); flex-wrap: wrap; margin-top: var(--sp-3); }
.post__stats > span { display: inline-flex; align-items: center; gap: 4px; }

.post__body { padding: var(--sp-6); }
@media (max-width: 640px) { .post__body { padding: var(--sp-4); } }

.post__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
}
@media (max-width: 640px) { .post__actions { padding: var(--sp-3) var(--sp-4); } }

/* 互动按钮 */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  transition: all var(--dur-fast) var(--ease-out);
}
.action-btn:hover { border-color: var(--brand-300); color: var(--brand-500); background: var(--brand-50); }
.action-btn.is-active { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-500); }
.action-btn.is-active .icon { fill: currentColor; }
.action-btn--gold.is-active { border-color: var(--gold-500); background: var(--gold-50); color: var(--gold-600); }

/* 富文本排版 */
.prose {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-default);
  word-wrap: break-word;
}
@media (max-width: 640px) { .prose { font-size: var(--fs-base); } }
.prose > * + * { margin-top: var(--sp-4); }
.prose h2 { font-size: var(--fs-2xl); margin-top: var(--sp-8); }
.prose h3 { font-size: var(--fs-xl); margin-top: var(--sp-6); }
.prose h4 { font-size: var(--fs-lg); margin-top: var(--sp-5); }
.prose p { margin: 0 0 var(--sp-4); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { padding-left: var(--sp-6); margin-bottom: var(--sp-4); }
.prose ul li, .prose ol li { list-style: disc; margin-bottom: 6px; }
.prose ol li { list-style: decimal; }
.prose blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--brand-300);
  background: var(--bg-subtle);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--text-muted);
  font-size: var(--fs-md);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose pre {
  margin: var(--sp-5) 0;
  padding: var(--sp-4);
  background: var(--ink-900);
  color: #E6EDF6;
  border-radius: var(--r-lg);
  overflow-x: auto;
  font-size: var(--fs-sm);
  line-height: 1.65;
}
.prose pre code { color: inherit; font-size: inherit; }
.prose :not(pre) > code {
  padding: 2px 6px;
  background: var(--bg-muted);
  border-radius: var(--r-xs);
  color: var(--brand-600);
  font-size: 0.9em;
}
.prose img { border-radius: var(--r-lg); margin: var(--sp-5) 0; }
.prose figcaption { font-size: var(--fs-sm); color: var(--text-subtle); text-align: center; margin-top: -8px; }
.prose hr { margin: var(--sp-8) 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); margin: var(--sp-5) 0; }
.prose th, .prose td { border: 1px solid var(--border-default); padding: 8px 12px; }
.prose th { background: var(--bg-subtle); font-weight: var(--fw-semibold); }
.prose .mention {
  color: var(--brand-500);
  background: var(--brand-50);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  font-weight: var(--fw-medium);
}

/* 投票块 */
.poll { padding: var(--sp-4); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); background: var(--bg-subtle); margin: var(--sp-5) 0; }
.poll__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin-bottom: var(--sp-3); }
.poll__option { margin-bottom: var(--sp-3); }
.poll__option:last-child { margin-bottom: 0; }
.poll__row { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-sm); margin-bottom: 5px; }
.poll__bar { height: 8px; background: var(--ink-100); border-radius: var(--r-full); overflow: hidden; }
.poll__fill { height: 100%; background: var(--brand-500); border-radius: var(--r-full); transition: width var(--dur-slow) var(--ease-out); }
.poll__meta { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: var(--sp-3); }

/* 文章内目录 TOC */
.toc { font-size: var(--fs-sm); }
.toc__title { font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-subtle); font-weight: var(--fw-semibold); margin-bottom: var(--sp-2); }
.toc__list { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--border-subtle); }
.toc__link {
  display: block;
  padding: 5px 0 5px var(--sp-3);
  color: var(--text-muted);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all var(--dur-fast) var(--ease-out);
}
.toc__link:hover { color: var(--text-strong); }
.toc__link.is-active { color: var(--brand-500); border-left-color: var(--brand-500); font-weight: var(--fw-medium); }
.toc__link--h3 { padding-left: var(--sp-5); font-size: var(--fs-xs); }

/* ==========================================================================
   C. 评论区
   ========================================================================== */
.comment {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.comment:last-child { border-bottom: none; }
.comment__main { flex: 1 1 auto; min-width: 0; }
.comment__head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: 6px; }
.comment__author { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-strong); }
.comment__author:hover { color: var(--brand-500); }
.comment__time { font-size: var(--fs-xs); color: var(--text-subtle); }
.comment__badge-op { background: var(--brand-50); color: var(--brand-600); }
.comment__text {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text-default);
  word-break: break-word;
}
.comment__text p { margin-bottom: var(--sp-2); }
.comment__quote {
  padding: 8px 12px;
  border-left: 3px solid var(--ink-200);
  background: var(--bg-subtle);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.comment__foot { display: flex; align-items: center; gap: var(--sp-4); margin-top: 8px; }
.comment__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--text-subtle);
  transition: color var(--dur-fast) var(--ease-out);
}
.comment__btn:hover { color: var(--brand-500); }
.comment__btn.is-active { color: var(--brand-500); }
.comment__btn.is-active .icon { fill: currentColor; }
/* 楼中楼 */
.comment__replies {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-subtle);
  border-radius: var(--r-md);
}
.reply-item { display: flex; gap: 8px; padding: 6px 0; font-size: var(--fs-sm); }
.reply-item__main { flex: 1; min-width: 0; }
.reply-item__text { line-height: var(--lh-normal); }
.reply-item__meta { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 2px; display: flex; gap: var(--sp-3); }

/* 回复编辑器 */
.reply-box {
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.reply-box:focus-within { border-color: var(--brand-500); box-shadow: var(--focus-ring); }
.reply-box__toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  flex-wrap: wrap;
}
.reply-box__area {
  width: 100%;
  min-height: 84px;
  border: none;
  outline: none;
  padding: var(--sp-3);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  background: transparent;
  color: var(--text-strong);
  resize: vertical;
}
.reply-box__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.tool-btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.tool-btn.is-active { background: var(--brand-50); color: var(--brand-500); }

/* ==========================================================================
   D. 编辑器页面
   ========================================================================== */
.editor-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); overflow: hidden; }
.editor-title-input {
  width: 100%;
  border: none;
  outline: none;
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  background: transparent;
  border-bottom: 1px solid var(--border-subtle);
}
.editor-title-input::placeholder { color: var(--ink-300); font-weight: var(--fw-regular); }
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  flex-wrap: wrap;
}
.editor-toolbar__divider { width: 1px; height: 18px; background: var(--border-default); margin: 0 4px; }
.editor-area {
  width: 100%;
  min-height: 380px;
  border: none;
  outline: none;
  padding: var(--sp-5);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  background: transparent;
  color: var(--text-strong);
  resize: vertical;
  font-family: var(--font-mono);
}
.editor-preview { padding: var(--sp-5); min-height: 380px; }
.editor-tabs { display: flex; }
.editor-tab {
  padding: 10px var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
}
.editor-tab.is-active { color: var(--brand-500); border-bottom-color: var(--brand-500); }
.editor-meta { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border-subtle); display: grid; gap: var(--sp-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .editor-meta { grid-template-columns: 1fr 1fr; } }
.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  flex-wrap: wrap;
}
.tag-input {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 38px;
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
}
.tag-input:focus-within { border-color: var(--brand-500); box-shadow: var(--focus-ring); }
.tag-input input { flex: 1 1 80px; min-width: 70px; border: none; outline: none; background: transparent; font-size: var(--fs-md); }

/* 上传占位 */
.uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--sp-8);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: var(--fs-md);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.uploader:hover { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-600); }
.uploader__icon { color: var(--text-subtle); }

/* ==========================================================================
   E. 用户等级 / 会员
   ========================================================================== */
.level-bar { display: flex; flex-direction: column; gap: 6px; }
.level-bar__head { display: flex; align-items: center; justify-content: space-between; font-size: var(--fs-sm); }
.level-bar__lv {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #4a3306;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}
.level-bar__lv--vip { background: linear-gradient(135deg, #7C5CFF, #F0549C); color: #fff; }

/* 徽章墙 */
.badge-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--sp-3); }
.achievement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--sp-3) 6px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  text-align: center;
  transition: all var(--dur-base) var(--ease-out);
}
.achievement:hover { border-color: var(--border-default); transform: translateY(-2px); }
.achievement__icon {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  font-size: var(--fs-lg);
}
.achievement__name { font-size: var(--fs-xs); color: var(--text-default); line-height: 1.3; }
.achievement--locked { opacity: 0.45; }
.achievement--locked .achievement__icon { background: var(--ink-100) !important; color: var(--text-subtle); }

/* ==========================================================================
   F. 签到 / 日历
   ========================================================================== */
.checkin-hero {
  position: relative;
  padding: var(--sp-8) var(--sp-6);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #3A66F0 0%, #7C5CFF 55%, #F0549C 100%);
  color: #fff;
  overflow: hidden;
  text-align: center;
}
.checkin-hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.checkin-hero__days { font-size: 52px; font-weight: var(--fw-bold); line-height: 1; letter-spacing: -0.03em; }
.checkin-hero__unit { font-size: var(--fs-md); opacity: 0.85; }
.checkin-hero__desc { font-size: var(--fs-md); opacity: 0.9; margin-top: 8px; }
.checkin-btn {
  position: relative;
  width: 132px; height: 132px;
  margin: var(--sp-5) auto 0;
  border-radius: 50%;
  background: #fff;
  color: var(--brand-600);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.22);
  transition: transform var(--dur-base) var(--ease-spring);
}
.checkin-btn:hover { transform: scale(1.05); }
.checkin-btn::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.45);
  animation: pulse-ring 2s ease-out infinite;
}
.checkin-btn.is-done { background: rgba(255,255,255,0.22); color: #fff; box-shadow: none; }
.checkin-btn.is-done::before { display: none; }
.checkin-btn__sub { display: block; font-size: var(--fs-xs); font-weight: var(--fw-regular); opacity: 0.8; margin-top: 2px; }
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.2); opacity: 0; }
}

/* 签到日历 */
.calendar { width: 100%; }
.calendar__head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.calendar__wd { text-align: center; font-size: var(--fs-xs); color: var(--text-subtle); }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar__cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-default);
  background: var(--bg-subtle);
  position: relative;
}
.calendar__cell--empty { background: transparent; }
.calendar__cell--today { outline: 2px solid var(--brand-500); outline-offset: -2px; font-weight: var(--fw-semibold); }
.calendar__cell--done { background: var(--success-50); color: var(--success-600); font-weight: var(--fw-medium); }
.calendar__cell--missed { background: var(--bg-muted); color: var(--text-subtle); }
.calendar__cell--bonus { background: var(--gold-50); color: var(--gold-600); font-weight: var(--fw-semibold); }
.calendar__cell .icon { width: 12px; height: 12px; }

/* 连续奖励进度 */
.reward-strip { display: flex; gap: var(--sp-2); }
.reward-node {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: var(--sp-3) 6px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  text-align: center;
}
.reward-node__icon { font-size: var(--fs-lg); }
.reward-node--done { background: var(--success-50); border-color: var(--success-100); color: var(--success-600); }
.reward-node--current { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-600); box-shadow: var(--shadow-xs); }
.reward-node--bonus { background: var(--gold-50); border-color: var(--gold-100); color: var(--gold-600); }

/* 热力图 */
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heatmap__cell { width: 11px; height: 11px; border-radius: 2px; background: var(--ink-100); }
.heatmap__cell[data-level="1"] { background: var(--brand-100); }
.heatmap__cell[data-level="2"] { background: var(--brand-300); }
.heatmap__cell[data-level="3"] { background: var(--brand-500); }
.heatmap__cell[data-level="4"] { background: var(--brand-700); }
.heatmap-legend { display: flex; align-items: center; gap: 5px; font-size: var(--fs-2xs); color: var(--text-subtle); }

/* ==========================================================================
   G. 钱包 / 资产
   ========================================================================== */
.wallet-hero {
  position: relative;
  padding: var(--sp-6);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #1F2A44 0%, #2F4270 60%, #3A66F0 100%);
  color: #fff;
  overflow: hidden;
}
.wallet-hero::after {
  content: "";
  position: absolute;
  left: -40px; bottom: -80px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.wallet-hero__label { font-size: var(--fs-sm); opacity: 0.8; display: flex; align-items: center; gap: 6px; }
.wallet-hero__amount { font-size: var(--fs-5xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.wallet-hero__amount small { font-size: var(--fs-xl); font-weight: var(--fw-medium); opacity: 0.85; }
.wallet-hero__sub { display: flex; gap: var(--sp-6); margin-top: var(--sp-4); font-size: var(--fs-sm); flex-wrap: wrap; }
.wallet-hero__sub div { opacity: 0.9; }
.wallet-hero__sub b { display: block; font-size: var(--fs-lg); font-weight: var(--fw-semibold); margin-top: 2px; }
.wallet-hero__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); flex-wrap: wrap; }
.wallet-hero .btn--ghost { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.14); }
.wallet-hero .btn--ghost:hover { background: rgba(255,255,255,0.22); color: #fff; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.asset-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}
.asset-chip__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); flex: none; }
.asset-chip__num { font-size: var(--fs-xl); font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.2; }
.asset-chip__label { font-size: var(--fs-xs); color: var(--text-muted); }

/* 交易记录行 */
.txn-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}
.txn-item:last-child { border-bottom: none; }
.txn-item__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-full); flex: none; }
.txn-item__main { flex: 1 1 auto; min-width: 0; }
.txn-item__title { font-size: var(--fs-md); color: var(--text-strong); }
.txn-item__meta { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 2px; }
.txn-item__amount { flex: none; font-size: var(--fs-md); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.txn-item__amount--in { color: var(--danger-500); }   /* 收入=红 */
.txn-item__amount--out { color: var(--success-500); } /* 支出=绿 */

/* ==========================================================================
   H. 排行榜
   ========================================================================== */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-4) var(--sp-5);
}
.podium__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  max-width: 160px;
}
.podium__avatar { position: relative; }
.podium__crown {
  position: absolute;
  top: -16px; left: 50%;
  transform: translateX(-50%);
  color: var(--gold-500);
}
.podium__name { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-strong); text-align: center; }
.podium__value { font-size: var(--fs-sm); color: var(--gold-600); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.podium__stand {
  width: 100%;
  border-radius: var(--r-md) var(--r-md) 0 0;
  display: grid;
  place-items: center;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: #fff;
}
.podium__item--1 .podium__stand { height: 92px; background: linear-gradient(180deg, var(--gold-400), var(--gold-600)); }
.podium__item--2 .podium__stand { height: 72px; background: linear-gradient(180deg, #C3CDDB, #98A3B4); }
.podium__item--3 .podium__stand { height: 58px; background: linear-gradient(180deg, #E0A97A, #C08552); }
.podium__item--1 { order: 2; }
.podium__item--2 { order: 1; }
.podium__item--3 { order: 3; }

.rank-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--dur-fast) var(--ease-out);
}
.rank-row:hover { background: var(--bg-subtle); }
.rank-row.is-me { background: var(--brand-50); }
.rank-row__no {
  flex: none;
  width: 34px;
  text-align: center;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}
.rank-row__no--top { color: var(--gold-500); font-size: var(--fs-lg); }
.rank-row__main { flex: 1 1 auto; min-width: 0; }
.rank-row__name { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-strong); }
.rank-row__meta { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 2px; }
.rank-row__value { flex: none; text-align: right; }
.rank-row__num { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.rank-row__trend { font-size: var(--fs-xs); display: inline-flex; align-items: center; gap: 2px; }
.trend-up { color: var(--danger-500); }
.trend-down { color: var(--success-500); }
.trend-flat { color: var(--text-subtle); }

/* ==========================================================================
   I. 抽奖 / 红包
   ========================================================================== */
.lottery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: linear-gradient(160deg, #FFF3D6, #FFE4EC);
  border-radius: var(--r-xl);
  max-width: 420px;
  margin-inline: auto;
}
.lottery-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-2xs);
  color: var(--text-muted);
  text-align: center;
  padding: 6px;
  position: relative;
  overflow: hidden;
}
.lottery-cell__icon { font-size: var(--fs-2xl); }
.lottery-cell.is-active { box-shadow: 0 0 0 2px var(--gold-500), var(--shadow-md); }
.lottery-cell--prize { background: linear-gradient(160deg, #FFF9EC, #FFF0D4); }
.lottery-cell--prize .lottery-cell__icon { font-size: var(--fs-xl); }
.lottery-go {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #FF7A45, #E0454C);
  color: #fff;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-base) var(--ease-spring);
}
.lottery-go:hover { transform: scale(1.03); }
.lottery-go small { font-size: 10px; font-weight: var(--fw-regular); opacity: 0.9; }

/* 红包卡 */
.redpacket {
  position: relative;
  padding: var(--sp-5);
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, #F0544C 0%, #D93A3A 100%);
  color: #fff;
  overflow: hidden;
  text-align: center;
}
.redpacket::after {
  content: "";
  position: absolute;
  top: -70px; left: 50%;
  transform: translateX(-50%);
  width: 240px; height: 160px;
  border-radius: 0 0 50% 50%;
  background: rgba(255,255,255,0.1);
}
.redpacket__title { font-size: var(--fs-md); opacity: 0.9; }
.redpacket__amount { font-size: var(--fs-5xl); font-weight: var(--fw-bold); line-height: 1.1; margin-top: 4px; letter-spacing: -0.02em; }
.redpacket__amount small { font-size: var(--fs-lg); font-weight: var(--fw-medium); }
.redpacket__meta { font-size: var(--fs-sm); opacity: 0.85; margin-top: 6px; }
.redpacket__progress { margin-top: var(--sp-4); height: 8px; background: rgba(255,255,255,0.25); border-radius: var(--r-full); overflow: hidden; }
.redpacket__progress-fill { height: 100%; background: linear-gradient(90deg, #FFD98A, #F3C263); border-radius: var(--r-full); }
.redpacket__btn {
  margin-top: var(--sp-4);
  width: 88px; height: 88px;
  border-radius: 50%;
  background: linear-gradient(160deg, #FFE9B0, #F3C263);
  color: #8A2B0B;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  transition: transform var(--dur-base) var(--ease-spring);
}
.redpacket__btn:hover { transform: scale(1.06); }
.redpacket__btn:disabled { background: rgba(255,255,255,0.3); color: rgba(255,255,255,0.7); box-shadow: none; }

/* 领取记录 */
.claim-item { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-4); border-bottom: 1px solid var(--border-subtle); }
.claim-item:last-child { border-bottom: none; }
.claim-item__main { flex: 1; min-width: 0; }
.claim-item__name { font-size: var(--fs-md); color: var(--text-strong); display: flex; align-items: center; gap: 6px; }
.claim-item__time { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 2px; }
.claim-item__amount { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--danger-500); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   J. 消息 / 会话
   ========================================================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}
@media (min-width: 1024px) { .chat-layout { grid-template-columns: 280px minmax(0, 1fr) 260px; } }
.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.chat-list { flex: 1; overflow-y: auto; max-height: 620px; }
.chat-list__item {
  display: flex;
  gap: 10px;
  padding: 12px var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
  position: relative;
}
.chat-list__item:hover { background: var(--bg-subtle); }
.chat-list__item.is-active { background: var(--brand-50); }
.chat-list__item.is-active::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--brand-500);
}
.chat-list__main { flex: 1; min-width: 0; }
.chat-list__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-list__name { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-strong); }
.chat-list__time { font-size: var(--fs-2xs); color: var(--text-subtle); flex: none; }
.chat-list__msg { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list__unread {
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--danger-500);
  color: #fff;
  font-size: 10px;
  font-weight: var(--fw-semibold);
  display: grid;
  place-items: center;
  flex: none;
}

.chat-window { display: flex; flex-direction: column; height: 100%; min-height: 520px; }
.chat-window__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 12px var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
}
.chat-window__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  background: var(--bg-subtle);
}
.chat-msg { display: flex; gap: 10px; max-width: 78%; }
.chat-msg--mine { flex-direction: row-reverse; margin-left: auto; }
.chat-msg__bubble {
  padding: 10px 14px;
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text-default);
  word-break: break-word;
}
.chat-msg--mine .chat-msg__bubble {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}
.chat-msg__meta { font-size: var(--fs-2xs); color: var(--text-subtle); margin-top: 4px; }
.chat-msg--mine .chat-msg__meta { text-align: right; }
.chat-window__foot { padding: var(--sp-3); border-top: 1px solid var(--border-subtle); }
.chat-date-sep { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-subtle); font-size: var(--fs-xs); }
.chat-date-sep::before, .chat-date-sep::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }

/* 会话列表 → 会话详情（下钻） */
.conv-module { display: block; }
.conv-list-view { display: block; }
.conv-detail-view {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 72vh;
}
.conv-detail__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.conv-detail__who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv-detail__meta { min-width: 0; }
.conv-detail__name { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.25; }
.conv-detail__status { font-size: var(--fs-2xs); color: var(--text-subtle); }
.conv-detail-view .chat-window__foot { border-top: 1px solid var(--border-subtle); background: var(--bg-surface); }
.chat-list__item:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }

/* 通知条目 */
.notify-item {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
.notify-item:last-child { border-bottom: none; }
.notify-item:hover { background: var(--bg-subtle); }
.notify-item.is-unread { background: color-mix(in srgb, var(--brand-50) 40%, transparent); }
.notify-item__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-full); }
.notify-item__main { flex: 1; min-width: 0; }
.notify-item__text { font-size: var(--fs-md); color: var(--text-default); line-height: var(--lh-normal); }
.notify-item__text b { color: var(--text-strong); font-weight: var(--fw-semibold); }
.notify-item__quote {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-left: 3px solid var(--ink-200);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.notify-item__time { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 5px; }

/* ==========================================================================
   K. 后台
   ========================================================================== */
.admin-shell { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
@media (min-width: 1024px) { .admin-shell { grid-template-columns: 220px minmax(0, 1fr); } }
.admin-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  align-self: start;
}
@media (min-width: 1024px) {
  .admin-sidebar { position: sticky; top: calc(var(--header-h) + var(--sp-5)); }
}
.admin-brand {
  display: flex; align-items: center; gap: 8px;
  padding: var(--sp-2) var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.admin-brand .badge { margin-left: auto; }

/* 迷你图表（纯 CSS） */
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: var(--sp-3); }
.chart-bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bars__bar {
  width: 100%;
  max-width: 34px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  transition: opacity var(--dur-fast) var(--ease-out);
  min-height: 4px;
}
.chart-bars__col:hover .chart-bars__bar { opacity: 0.8; }
.chart-bars__label { font-size: var(--fs-2xs); color: var(--text-subtle); }
.chart-bars__value { font-size: var(--fs-2xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }

.sparkline { width: 100%; height: 60px; }
.sparkline path { fill: none; stroke: var(--brand-500); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sparkline .area { fill: url(#sparkFill); stroke: none; }

/* 审核队列 */
.review-item { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-subtle); align-items: flex-start; }
.review-item:last-child { border-bottom: none; }
.review-item__main { flex: 1; min-width: 0; }
.review-item__title { font-size: var(--fs-md); color: var(--text-strong); font-weight: var(--fw-medium); }
.review-item__excerpt { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-item__meta { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 5px; display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.review-item__actions { display: flex; gap: 6px; flex: none; }

/* ==========================================================================
   L. 推广中心
   ========================================================================== */
.invite-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  flex-wrap: wrap;
}
.invite-code__value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--brand-600);
  letter-spacing: 0.06em;
}
.qr-box {
  width: 132px; height: 132px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  padding: 10px;
}
.qr-box svg { width: 100%; height: 100%; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: var(--sp-3); }
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--sp-3) 6px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  transition: all var(--dur-base) var(--ease-out);
}
.share-btn:hover { background: var(--brand-50); color: var(--brand-600); transform: translateY(-2px); }
.share-btn__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-full); background: var(--bg-surface); }

/* ==========================================================================
   M. 任务
   ========================================================================== */
.task-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  transition: all var(--dur-base) var(--ease-out);
}
.task-item:hover { border-color: var(--brand-200); box-shadow: var(--shadow-sm); }
.task-item.is-done { opacity: 0.62; }
.task-item__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-md); flex: none; }
.task-item__main { flex: 1; min-width: 0; }
.task-item__title { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-strong); display: flex; align-items: center; gap: 6px; }
.task-item__desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 3px; }
.task-item__reward { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--gold-600); font-weight: var(--fw-medium); margin-top: 6px; }
.task-item__action { flex: none; }

/* ==========================================================================
   N. 认证页
   ========================================================================== */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
  align-items: center;
  min-height: calc(100vh - var(--header-h) - 120px);
  padding-block: var(--sp-6);
}
@media (min-width: 1024px) { .auth-layout { grid-template-columns: 1fr 440px; gap: var(--sp-12); } }
.auth-hero__title { font-size: var(--fs-4xl); line-height: 1.25; letter-spacing: var(--ls-tight); }
.auth-hero__desc { font-size: var(--fs-lg); color: var(--text-muted); margin-top: var(--sp-3); line-height: var(--lh-normal); }
.auth-hero__points { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-6); }
.auth-hero__point { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); color: var(--text-default); }
.auth-hero__point .icon { color: var(--brand-500); }
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-6);
}
@media (max-width: 640px) { .auth-card { padding: var(--sp-5) var(--sp-4); box-shadow: var(--shadow-sm); } }
.auth-card__title { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); }
.auth-card__sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-5); }
.social-login { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text-default);
  background: var(--bg-surface);
  transition: all var(--dur-fast) var(--ease-out);
}
.social-btn:hover { border-color: var(--brand-300); background: var(--brand-50); }
.divider-text {
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-xs); color: var(--text-subtle);
}
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }

/* ==========================================================================
   O. 个人中心 Profile
   ========================================================================== */
.profile-cover {
  position: relative;
  height: 160px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(120deg, #3A66F0 0%, #7C5CFF 50%, #14B8C6 100%);
  overflow: hidden;
}
.profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 120%, rgba(255,255,255,0.25), transparent 60%);
}
.profile-head {
  position: relative;
  padding: 0 var(--sp-5) var(--sp-4);
  background: var(--bg-surface);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  border: 1px solid var(--border-subtle);
  border-top: none;
}
.profile-head__avatar { margin-top: -46px; position: relative; display: inline-block; }
.profile-head__name { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-head__bio { font-size: var(--fs-md); color: var(--text-muted); margin-top: 6px; max-width: 640px; }
.profile-head__meta { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-3); }
.profile-head__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.profile-head__actions { display: flex; gap: var(--sp-2); }
@media (max-width: 640px) { .profile-head__actions { width: 100%; } }

.stat-inline { display: flex; gap: var(--sp-6); }
.stat-inline__item { text-align: left; }
.stat-inline__num { font-size: var(--fs-xl); font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-inline__label { font-size: var(--fs-xs); color: var(--text-muted); }

/* 动态流 */
.feed-item { display: flex; gap: var(--sp-3); padding: var(--sp-4); border-bottom: 1px solid var(--border-subtle); }
.feed-item:last-child { border-bottom: none; }
.feed-item__main { flex: 1; min-width: 0; }
.feed-item__head { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 6px; }
.feed-item__head b { color: var(--text-strong); font-weight: var(--fw-medium); }
.feed-item__title { font-size: var(--fs-md); font-weight: var(--fw-medium); color: var(--text-strong); line-height: var(--lh-snug); }
.feed-item__excerpt { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 5px; }
.feed-item__quote {
  margin-top: 8px;
  padding: var(--sp-3);
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  border-left: 3px solid var(--ink-200);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.feed-item__foot { display: flex; gap: var(--sp-4); margin-top: 8px; font-size: var(--fs-xs); color: var(--text-subtle); }

/* ==========================================================================
   P. 收藏页
   ========================================================================== */
.fav-layout { display: grid; grid-template-columns: 1fr; gap: var(--sp-4); }
@media (min-width: 1024px) { .fav-layout { grid-template-columns: 200px minmax(0, 1fr); } }
.fav-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--sp-3);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.fav-folder:hover { background: var(--bg-hover); color: var(--text-strong); }
.fav-folder.is-active { background: var(--brand-50); color: var(--brand-600); font-weight: var(--fw-medium); }
.fav-folder__count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-subtle); }
/* ==========================================================================
   UIBBS Mobile (H5) —— 移动端优先适配层
   加载顺序：最后。基础样式默认即「手机样式」，桌面用 min-width 断点增强。
   本文件负责：安全区 / 触控尺寸 / 底部 Sheet / 表格卡片化 / 底部操作条 /
               横滑导航 / 弹层适配 / 字体防缩放
   ========================================================================== */

/* ------------------------------------------------------------ 显示控制工具
   注意：这里只在「需要隐藏的那个断点」上加 display:none，
   另一个方向不写 display —— 否则会覆盖组件自身的 display（如 .btn 的
   inline-flex），导致图标与文字无法居中排布。
   ------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 1024px) {
  .mobile-only { display: none !important; }
}

/* ------------------------------------------------------- 安全区 / 页面留白
   手机端底部有一条固定标签栏（.mobile-tabbar），带 tabbar 的页面必须为它
   预留高度，否则页脚与「已经到底了」会被压在栏下面。高度含安全区。
   ------------------------------------------------------------------------- */
body { overscroll-behavior-y: none; }               /* 关掉橡皮筋，接近原生手感 */
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
@media (min-width: 1024px) {
  body.has-tabbar { padding-bottom: 0; }
}
/* 个别页面若另有固定底部区域，再按需要用 `.safe-pad` 或自定义 padding 补偿 */
.safe-pad { padding-bottom: env(safe-area-inset-bottom); }

/* ==========================================================================
   App Shell —— 手机端按原生 App 范式组织导航
   · 底部标签栏：首页 / 消息 / ＋ / 发现 / 我的（全局固定，仅手机端）
   · 一级页 = 品牌 + 抽屉键，二级页 = 返回键 + 页面标题
   · 顶部栏随滚动自动隐藏 / 呼出；中间「＋」承担主内容入口
   · 支持左边缘右滑返回 / 打开菜单；顶部下拉触发刷新
   ========================================================================== */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  background: var(--bg-body);
}
body.app-shell {
  /* 避免双击缩放导致的 300ms 延迟，同时保留内容可选中能力 */
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
}

/* App 导航栏：标题（仅手机显示） */
.appbar__title { display: none; }
.appbar__leading { margin-right: 2px; }
.appbar__back .icon { width: 22px; height: 22px; }

@media (max-width: 1023px) {
  .site-header.has-appbar-title .brand { display: none; }
  .appbar__title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    font-size: 16px;
    font-weight: var(--fw-semibold);
    letter-spacing: -0.01em;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* App 栏右侧精简：头像下拉、私信、主题切换收敛到抽屉，保持 ≤3 个图标 */
  .header-actions .user-trigger,
  .header-actions .dropdown,
  .header-actions .divider,
  .header-actions a[href="messages.html"].icon-btn { display: none; }
  .header-actions .count-badge { top: 4px; right: 4px; }
  /* 登录页自身不需要「登录 / 注册」入口 */
  .auth-page .header-actions .btn { display: none; }
}

/* 抽屉底部：夜间模式开关 */
.nav-drawer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
}
.nav-drawer__row-title { font-size: var(--fs-md); color: var(--text-default); }

/* 导航栏滚动行为：向下滚动隐藏（腾出内容空间），向上即呼出 */
.site-header {
  transition: transform var(--dur-slow) var(--ease-out),
              border-color var(--dur-fast) linear,
              box-shadow var(--dur-fast) linear;
  will-change: transform;
}
.site-header.is-scrolled { box-shadow: var(--shadow-xs); }
.site-header.is-hidden { transform: translateY(-102%); }

/* 页面进入动效（作用在 .container 上，避免与下拉刷新的 transform 冲突） */
@media (max-width: 1023px) {
  .app-shell .site-main > .container {
    animation: page-in 280ms var(--ease-out) both;
  }
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------- 下拉刷新指示器 */
.ptr {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(104px + var(--safe-t));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding-bottom: 14px;
  z-index: calc(var(--z-header) - 1);
  pointer-events: none;
  opacity: 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  transition: opacity var(--dur-fast) linear;
}
.ptr.is-active { opacity: 1; }
.ptr__spin {
  width: 18px; height: 18px;
  border: 2px solid var(--border-default);
  border-top-color: var(--brand-500);
  border-radius: 50%;
}
.ptr.is-loading .ptr__spin { animation: ptr-spin 760ms linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ 手势返回提示 */
.edge-hint {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--brand-500), transparent);
  opacity: 0;
  z-index: calc(var(--z-drawer) - 1);
  transition: opacity var(--dur-base) linear;
  pointer-events: none;
}
.edge-hint.is-active { opacity: .5; }

/* 尊重「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  .site-header, .mobile-tabbar__compose, .app-shell .site-main > .container { transition: none !important; animation: none !important; }
  .ptr.is-loading .ptr__spin { animation-duration: 1600ms; }
}

/* ------------------------------------------------------------ 触控友好尺寸 */
@media (max-width: 1023px) {
  /* 交互元素最小 44px 触控区 */
  .btn { min-height: 44px; padding-inline: 16px; }
  .btn--xs { min-height: 32px; }
  .btn--sm { min-height: 38px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn--sm { width: 36px; height: 36px; }
  .action-btn { height: 38px; }
  .segmented__item { height: 38px; }
  .tab { padding-block: 12px; }
  .side-nav__item, .fav-folder { height: 44px; }
  .mini-list__item { padding-block: 11px; }
  .tool-btn { width: 34px; height: 34px; }
  .pagination__btn { min-width: 40px; height: 40px; }
  .tag { height: 30px; padding-inline: 12px; }
  .u-h5-tap { display: inline-flex; align-items: center; min-height: 44px; }

  /* 输入框字号 >=16px，避免 iOS 聚焦自动缩放 */
  .input, .input-bare, .textarea, .tag-input input,
  .editor-title-input, .editor-area, .reply-box__area,
  .header-search input, .select select {
    font-size: 16px;
  }
  .input { height: 44px; }
  .input-bare { height: 44px; }
  .select select { height: 44px; }

  /* 取消 hover 态，避免移动端「粘住」 */
  .card--hover:hover { transform: none; box-shadow: var(--shadow-xs); }
  .forum-card:hover { transform: none; box-shadow: none; border-color: var(--border-subtle); }
  .forum-card:active { background: var(--bg-subtle); }
  .thread-item:active, .mini-list__item:active, .rank-row:active,
  .chat-list__item:active, .feed-item:active, .task-item:active {
    background: var(--bg-active);
  }
}

/* --------------------------------------------------------- 顶部导航（手机） */
@media (max-width: 1023px) {
  .site-header {
    height: calc(var(--appbar-h) + var(--safe-t));
    padding-top: var(--safe-t);
  }
  .header-inner { gap: 6px; padding-inline: 12px; }
  .brand__mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand__text { font-size: var(--fs-md); }
  .header-search {
    position: fixed;
    left: 12px; right: 12px;
    top: 8px;
    max-width: none;
    margin: 0;
    z-index: calc(var(--z-header) + 2);
    display: none;
  }
  .header-search.is-open { display: block; }
  .header-search .input { height: 40px; background: var(--bg-surface); box-shadow: var(--shadow-md); }
  .header-search__mask {
    position: fixed; inset: 0;
    background: rgba(16,22,32,0.35);
    z-index: calc(var(--z-header) + 1);
  }
  .header-search__mask[hidden] { display: none; }
  .header-actions .icon-btn { width: 40px; height: 40px; }
  .nav-toggle { margin-left: -4px; }
}

/* ------------------------------------------------------------ 横滑滚动容器 */
.scroll-x {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { scroll-snap-align: start; flex: none; }

/* 手机端 Tabs / Segmented 横滑并贴边 */
@media (max-width: 1023px) {
  .tabs {
    gap: var(--sp-4);
    padding-inline: 0;
    margin-inline: 0;
  }
  .tabs--fullbleed {
    margin-inline: -16px;
    padding-inline: 16px;
  }
  .segmented--scroll {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    background: transparent;
    padding: 0;
    gap: 8px;
  }
  .segmented--scroll::-webkit-scrollbar { display: none; }
  .segmented--scroll .segmented__item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-full);
    height: 36px;
    flex: none;
  }
  .segmented--scroll .segmented__item.is-active {
    background: var(--brand-500);
    color: #fff;
    border-color: var(--brand-500);
    box-shadow: none;
  }
}

/* ------------------------------------------------------ 卡片 / 间距收紧 */
@media (max-width: 640px) {
  .site-main { padding-block: 12px; }
  .layout { gap: 12px; }
  .layout__main { gap: 12px; }
  .layout__side { gap: 12px; }
  .card, .side-card, .list-card, .post, .forum-card, .stat-card,
  .editor-card, .chat-panel, .admin-sidebar {
    border-radius: var(--r-lg);
  }
  .card__body, .post__body, .editor-preview { padding: 14px; }
  .card__header, .post__head, .side-card__head { padding: 12px 14px; }
  .side-card__body { padding: 12px 14px; }
  .page-head { margin-bottom: 12px; }
  .page-head__title { font-size: var(--fs-xl); }
  .forum-head { padding: 14px; gap: 12px; }
  .forum-head__icon { width: 42px; height: 42px; font-size: var(--fs-lg); }
  .forum-head__title { font-size: var(--fs-lg); }
  .toolbar { padding: 10px 12px; border-radius: var(--r-lg); }
  .section-head { margin-bottom: 10px; }
  .section-head__title { font-size: var(--fs-md); }

  /* 帖子项：手机上更紧凑 */
  .thread-item { padding: 12px 14px; gap: 10px; }
  .thread-item .avatar { width: 36px; height: 36px; }
  .thread-item__title { font-size: var(--fs-md); line-height: 1.45; }
  .thread-item__excerpt { font-size: var(--fs-sm); -webkit-line-clamp: 2; }
  .thread-item__meta { gap: 10px; font-size: 11px; }
  .thread-item__side { font-size: var(--fs-xs); }
}

/* -------------------------------------------------------- 详情页（手机） */
@media (max-width: 640px) {
  .post__title { font-size: var(--fs-xl); line-height: 1.4; }
  .post__byline { gap: 8px; }
  .post__stats { gap: 12px; font-size: var(--fs-xs); }
  .prose { font-size: 16px; line-height: 1.8; }
  .prose h2 { font-size: var(--fs-lg); margin-top: var(--sp-6); }
  .prose h3 { font-size: var(--fs-md); margin-top: var(--sp-5); }
  .prose pre { padding: 12px; border-radius: var(--r-md); font-size: 12px; -webkit-overflow-scrolling: touch; }
  .prose img { border-radius: var(--r-md); }
  .prose blockquote { padding: 10px 12px; font-size: var(--fs-sm); }
  .post__actions { justify-content: space-between; }
  .post__actions .action-btn { flex: 1 1 auto; justify-content: center; }

  /* 评论区 */
  .comment { padding: 12px 0; gap: 10px; }
  .comment .avatar { width: 32px; height: 32px; }
  .comment__text { font-size: var(--fs-md); }
  .comment__replies { padding: 10px; margin-left: 0; }
  .comment__foot { gap: 14px; }
  .comment__foot .comment__btn { min-height: 32px; }
}

/* ------------------------------------------- 已移除：底部固定操作条（手机）
   原 `.mobile-actionbar` 是一条横跨全屏的贴底工具条，观感与底部标签栏几乎一致，
   属于网页痕迹。v2 一并删除：互动操作回到正文末尾的 .post__actions 与评论区，
   不再长期占用屏幕底部。若确需恢复，结构参考下方，并给 body 加 .has-actionbar。
   ------------------------------------------------------------------------- */

/* --------------------------------------------- 底部 Sheet（手机弹窗形态） */
@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: none;
    width: 100%;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-in var(--dur-slow) var(--ease-out);
  }
  .modal::before {
    content: "";
    display: block;
    width: 38px; height: 4px;
    margin: 8px auto 0;
    border-radius: var(--r-full);
    background: var(--ink-200);
  }
  .modal__header { padding: 12px 16px; }
  .modal__body { padding: 16px; }
  .modal__footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    flex-direction: column-reverse;
  }
  .modal__footer .btn { width: 100%; }
  .drawer {
    width: 100%;
    top: auto;
    height: 86vh;
    border-radius: 20px 20px 0 0;
    animation: sheet-in var(--dur-slow) var(--ease-out);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .toast-stack {
    top: calc(58px + var(--safe-t) + var(--sp-2));
    bottom: auto;
    left: 12px; right: 12px;
    align-items: stretch;
  }
  .toast { min-width: 0; max-width: none; }
}
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }

/* ------------------------------------------------------ 表格 → 卡片（手机） */
@media (max-width: 767px) {
  .table-wrap {
    border: none;
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }
  .table-responsive thead { display: none; }
  .table-responsive,
  .table-responsive tbody,
  .table-responsive tr,
  .table-responsive td { display: block; width: 100%; }
  .table-responsive tr {
    margin-bottom: 10px;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
  }
  .table-responsive tbody tr:hover { background: var(--bg-surface); }
  .table-responsive td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    white-space: normal;
    text-align: right;
    border: none;
  }
  .table-responsive td::before {
    content: attr(data-label);
    flex: none;
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    text-align: left;
  }
  .table-responsive td[data-label=""]::before { content: none; }
  .table-responsive .cell-actions { justify-content: flex-end; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border-subtle); margin-top: 6px; }
  .table-responsive .cell-actions::before { content: none; }
}

/* ------------------------------------------------------------ 资产 / 榜单 */
@media (max-width: 640px) {
  .wallet-hero { padding: 18px 16px; border-radius: var(--r-lg); }
  .wallet-hero__amount { font-size: var(--fs-4xl); }
  .wallet-hero__sub { gap: 18px; }
  .wallet-hero__actions .btn { flex: 1 1 auto; }
  .asset-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .asset-chip { padding: 12px; }

  .checkin-hero { padding: 22px 16px; border-radius: var(--r-lg); }
  .checkin-hero__days { font-size: 40px; }
  .checkin-btn { width: 108px; height: 108px; font-size: var(--fs-lg); }
  .calendar__grid, .calendar__head { gap: 4px; }
  .calendar__cell { font-size: var(--fs-xs); border-radius: var(--r-xs); }
  .reward-strip { gap: 6px; }
  .reward-node { padding: 10px 4px; }

  .podium { padding: 18px 8px 14px; gap: 8px; }
  .podium__item--1 .podium__stand { height: 68px; }
  .podium__item--2 .podium__stand { height: 54px; }
  .podium__item--3 .podium__stand { height: 44px; }
  .podium__name { font-size: var(--fs-sm); }

  .lottery-grid { gap: 8px; padding: 10px; max-width: none; }
  .lottery-cell__icon { font-size: var(--fs-xl); }
  .redpacket { padding: 18px 16px; }
  .redpacket__amount { font-size: var(--fs-4xl); }
  .redpacket__btn { width: 76px; height: 76px; }

  .stat-card { padding: 12px 14px; }
  .stat-card__value { font-size: var(--fs-2xl); }
}

/* -------------------------------------------------------- 会话 / 消息（手机） */
@media (max-width: 1023px) {
  .chat-layout { gap: 12px; }
  .chat-panel { border-radius: var(--r-lg); }
  .chat-list { max-height: none; }
  .chat-window { min-height: 60vh; }
  .chat-window__body { padding: 12px; }
  .chat-msg { max-width: 86%; }
  .chat-window__foot { padding: 10px; }
  .chat-window__foot .reply-box__area { min-height: 44px; }

  /* 进入会话后：详情全屏，盖住顶栏与底部 Tab（原生 App 手感） */
  .conv-detail-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 450;
    border: none;
    border-radius: 0;
    min-height: 0;
  }
  .conv-detail__bar { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .conv-detail-view .chat-window__foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------------------------------------------------------- 编辑器（手机） */
@media (max-width: 640px) {
  .editor-title-input { font-size: var(--fs-lg); padding: 14px; }
  .editor-toolbar { padding: 6px 8px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .editor-toolbar::-webkit-scrollbar { display: none; }
  .editor-toolbar .tool-btn { flex: none; }
  .editor-area { min-height: 240px; padding: 14px; font-size: 15px; }
  .editor-preview { padding: 14px; min-height: 240px; }
  .editor-meta { padding: 14px; gap: 14px; }
  .editor-foot { padding: 12px 14px; }
  .editor-foot .btn { flex: 1 1 auto; }
  .reply-box__toolbar { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .reply-box__toolbar::-webkit-scrollbar { display: none; }
  .reply-box__toolbar .tool-btn { flex: none; }
}

/* ------------------------------------------------------------ 后台（手机） */
@media (max-width: 1023px) {
  .admin-shell { gap: 12px; }
  .admin-sidebar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 8px;
  }
  .admin-sidebar::-webkit-scrollbar { display: none; }
  .admin-brand { display: none; }
  .admin-sidebar .side-nav {
    flex-direction: row;
    gap: 6px;
  }
  .admin-sidebar .side-nav__group { display: none; }
  .admin-sidebar .side-nav__item {
    height: 38px;
    padding: 0 12px;
    border-radius: var(--r-full);
    background: var(--bg-subtle);
    white-space: nowrap;
    flex: none;
  }
  .admin-sidebar .side-nav__item.is-active::before { display: none; }
  .admin-sidebar .side-nav__item.is-active { background: var(--brand-500); color: #fff; }
  .admin-sidebar .side-nav__item .badge { display: none; }
  .chart-bars { height: 120px; }
}

/* ------------------------------------------------------------ 认证页（手机） */
@media (max-width: 1023px) {
  .auth-layout { min-height: auto; padding-block: 24px; gap: 24px; }
  .auth-hero { text-align: center; }
  .auth-hero__title { font-size: var(--fs-2xl); }
  .auth-hero__desc { font-size: var(--fs-md); }
  .auth-hero__points { display: none; }
  .social-login { grid-template-columns: repeat(3, 1fr); }
}

/* ------------------------------------------------------------ 个人中心（手机） */
@media (max-width: 640px) {
  .profile-cover { height: 110px; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .profile-head { padding: 0 14px 14px; }
  .profile-head__avatar { margin-top: -36px; }
  .profile-head__avatar .avatar { width: 66px; height: 66px; font-size: var(--fs-xl); }
  .profile-head__name { font-size: var(--fs-lg); }
  .profile-head__bio { font-size: var(--fs-sm); }
  .profile-head__actions { display: flex; gap: 8px; }
  .profile-head__actions .btn { flex: 1; }
  .stat-inline { gap: 18px; }
  .stat-inline__num { font-size: var(--fs-lg); }
  .badge-wall { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
}

/* --------------------------------------------------------- 抽屉导航（手机） */
.nav-drawer__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
}
.nav-drawer__quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.nav-drawer__quick a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  font-size: 11px;
  color: var(--text-muted);
}
.nav-drawer__quick a .icon { color: var(--brand-500); }

/* ------------------------------------------------------------ 其它 H5 细节 */
@media (max-width: 640px) {
  /* 横向卡片流（首页推荐板块） */
  .hscroll-card { width: 74%; }
  /* 返回顶部：App 里没有悬浮回顶球（双击状态栏才是原生习惯），手机端隐藏，
     避免和底部标签栏的「＋」挤在一起 */
  .backtop { display: none !important; }
  /* App 风格：手机端不保留网页式多列页脚（像一排底部导航），
     只留一条居中的版权信息与「已经到底了」结束线 */
  .site-footer {
    margin-top: var(--sp-6);
    padding-block: var(--sp-5);
    border-top: 1px solid var(--border-subtle);
  }
  .footer-grid { display: none; }
  .footer-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--text-subtle);
  }
  .footer-bottom::before {
    content: "— 已经到底了 —";
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
  }
  .footer-stats { display: none; }
}

/* 返回顶部 */
.backtop {
  position: fixed;
  right: 20px; bottom: 28px;
  z-index: var(--z-sticky);
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  transform: translateY(8px);
}
.backtop.is-show { opacity: 1; pointer-events: auto; transform: none; }
.backtop:hover { color: var(--brand-500); }

/* 顶部阅读进度条 */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--brand-500);
  z-index: calc(var(--z-header) + 5);
  transition: width 80ms linear;
}

/* 骨架屏区块（手机首屏） */
.skeleton-row { display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid var(--border-subtle); }
.skeleton-row__main { flex: 1; }

/* 图片懒加载占位 */
.img-ph {
  background: linear-gradient(120deg, var(--ink-100), var(--ink-50));
  border-radius: var(--r-md);
}
/* ==========================================================================
   UIBBS 兼容桥接层（线上专用，最后加载）
   作用：把 tangshui 线上历史变量映射到本地 UIBBS 设计令牌，
   保证线上独有组件（tabbar-icon / home-thread-card 等）不会因变量缺失而失效，
   同时让共有组件（card / btn / thread-item 等）呈现与本地模板完全一致。
   ========================================================================== */

:root {
  /* 字体 */
  --font: var(--font-sans);
  --mono: var(--font-mono);

  /* 背景与表面 */
  --bg: var(--bg-body);
  --surface: var(--bg-surface);
  --surface-2: var(--bg-subtle);
  --surface-3: var(--bg-muted);
  --nav: rgba(255, 255, 255, 0.9);

  /* 分隔线 */
  --line: var(--border-default);
  --line-2: var(--border-subtle);
  --line-3: var(--border-strong);

  /* 语义色别名（线上沿用的旧名） */
  --green: var(--brand-500);
  --green-active: var(--brand-600);
  --green-soft: var(--brand-50);
  --blue: var(--info-500);
  --red: var(--danger-500);
  --orange: var(--warning-500);
  --ink: var(--text-default);

  /* 尺寸常量 */
  --site-width: var(--container);
  --nav-h: var(--header-h);
  --tab-h: var(--tabbar-h);

  /* 圆角别名 */
  --r-card: var(--r-lg);
  --r-btn: var(--r-md);
  --r-avatar: var(--r-full);

  /* 阴影别名 */
  --shadow-pop: var(--shadow-lg);
}
