/* ============================================================
   tokens.css —— 卡密商城三端（前台 / 后台 / 供货端）共用设计令牌
   风格统一的唯一来源：改这一处，三个端一起变。
   取值来自项目既有的两套皮肤，收敛成一套：
     前台 --primary:#3d5af1 / --navy:#1f2a5a（_legacy/shop/shop.css）
     后台 --side-bg:#1f2d3d / --primary:#2f80ed（_legacy/admin/assets/style.css）
   ============================================================ */

:root {
  /* 品牌 */
  --brand: #3d5af1;
  --brand-hover: #2b45d8;
  --brand-active: #2239c4;
  --brand-tint: #eef1fe;
  --brand-tint-2: #dfe4fd;
  --brand-ink: #1f2a5a;   /* 深蓝：导航条、标题 */
  --brand-ink-2: #1b2440;  /* 更深：后台侧栏、顶栏细条 */

  /* 中性 */
  --text: #1f2437;
  --text-2: #5a6480;
  --text-3: #8b93a8;
  --text-4: #b3b9c9;
  --surface: #ffffff;
  --surface-2: #fafbff;
  --bg: #f4f5f9;
  --bg-2: #eef0f7;
  --line: #e6e9f2;
  --line-2: #d8dcea;

  /* 语义 */
  --ok: #12b76a;
  --ok-bg: #e7f8f0;
  --warn: #f79009;
  --warn-bg: #fff4e5;
  --danger: #f04438;
  --danger-bg: #feecea;
  --info: #3d5af1;
  --info-bg: #eef1fe;
  --gold: #f0b429;
  --gold-bg: #fff6e5;

  /* 形状 / 阴影 / 动效 */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(31, 42, 90, .06);
  --shadow-sm: 0 2px 10px rgba(31, 42, 90, .06);
  --shadow-md: 0 8px 24px rgba(31, 42, 90, .12);
  --shadow-lg: 0 18px 48px rgba(21, 29, 60, .18);
  --dur: .16s;
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* 尺寸 */
  --ctl-h: 36px;
  --ctl-h-sm: 30px;
  --ctl-h-lg: 44px;
  --page-max: 1680px;
  --wrap: 1200px;
  /* 侧栏随视口收窄：宽屏 224，窄窗口最低 168，避免固定 224 在 1024~1440 区间白占一条 */
  --side-w: clamp(168px, 15vw, 224px);

  /* 字体：不再引入任何 webfont，直接用系统栈（离线可用、零请求） */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 14px/1.6 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
table { border-collapse: separate; border-spacing: 0; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #ccd2e1; border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #a9b2c8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: var(--brand-tint-2); }

/* ---- 图标：统一用 lucide 雪碧图，颜色跟随文字 ---- */
.ic { width: 18px; height: 18px; flex: 0 0 auto; display: inline-block; vertical-align: -3px; }
.ic--sm { width: 15px; height: 15px; }
.ic--lg { width: 22px; height: 22px; }
.ic--xl { width: 28px; height: 28px; }

/* ---- 原子工具类（够用即可，不做完整 utility 体系） ---- */
.u-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.u-mono { font-family: var(--font-num); font-size: 12.5px; letter-spacing: .2px; }
.u-strong { font-weight: 600; color: var(--text); }
.u-muted { color: var(--text-3); }
.u-sm { font-size: 12.5px; }
.u-price { color: var(--danger); font-weight: 700; font-variant-numeric: tabular-nums; }
.u-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.u-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.u-wrap { flex-wrap: wrap; }
.u-grow { flex: 1 1 auto; min-width: 0; }
.u-nowrap { white-space: nowrap; }
.u-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-hide { display: none !important; }
.u-sr {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
