/* ============================================================
 * 乡礼优品 · 设计系统 v1
 * tokens + components，禁页面再写 inline 颜色/字号/间距
 * ============================================================ */

/* ---------- 1. 设计 token ---------- */
:root {
  /* 品牌色 */
  --brand-50:  #e8f1ec;
  --brand-100: #cfe4d6;
  --brand-200: #a5cfb3;
  --brand-300: #6cb287;
  --brand-400: #3e9762;
  --brand-500: #0b7a4b;   /* 主品牌色（PRD 用的也是这个色系） */
  --brand-600: #0a6940;
  --brand-700: #085534;
  --brand-800: #064229;

  /* 中性色 */
  --bg:        #f6f8f5;
  --bg-2:      #eef2ee;
  --surface:   #ffffff;
  --surface-2: #fafcfa;
  --line:      #e3e8e3;
  --line-strong: #d2dbd2;
  --text:      #1f2a22;
  --text-2:    #455146;
  --muted:     #6b7a70;
  --muted-2:   #9aa8a0;

  /* 语义色 */
  --success:   #2e7d32;
  --success-bg:#e8f5e9;
  --warn:      #e65100;
  --warn-bg:   #fff3e0;
  --danger:    #c62828;
  --danger-bg: #ffebee;
  --info:      #1565c0;
  --info-bg:   #e3f2fd;

  /* 股票/财务约定（涨红跌绿，中国惯例） */
  --up:        #c62828;
  --down:      #2e7d32;

  /* 字号 */
  --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-15: 15px;
  --fs-16: 16px; --fs-18: 18px; --fs-20: 20px; --fs-22: 22px;
  --fs-26: 26px; --fs-32: 32px;

  /* 行高 */
  --lh-tight: 1.25;
  --lh-base:  1.5;
  --lh-loose: 1.75;

  /* 间距（4px 步进） */
  --s-2: 2px;  --s-4: 4px;  --s-6: 6px;  --s-8: 8px;
  --s-10: 10px; --s-12: 12px; --s-14: 14px; --s-16: 16px;
  --s-20: 20px; --s-24: 24px; --s-32: 32px; --s-40: 40px; --s-60: 60px;

  /* 圆角 */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;

  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(20,40,30,.06);
  --shadow-2: 0 2px 8px rgba(20,40,30,.08);
  --shadow-3: 0 6px 20px rgba(20,40,30,.10);
  --shadow-4: 0 12px 32px rgba(20,40,30,.14);

  /* 布局 */
  --container: 1080px;
  --container-wide: 1200px;
  --sidebar-w: 220px;
  --topbar-h: 60px;

  /* 动效 */
  --ease: cubic-bezier(.2,.7,.3,1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
}

/* ---------- 2. 重置与基线 ---------- */
*,*::before,*::after { box-sizing: border-box; }
html,body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
               "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  font-size: var(--fs-14);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-800); }
img { max-width: 100%; display: block; }
hr { border: none; border-top: 1px solid var(--line); margin: var(--s-16) 0; }
::selection { background: var(--brand-100); color: var(--brand-800); }

/* ---------- 3. 布局工具 ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--s-20); }
.container-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 var(--s-20); }
main { max-width: var(--container); margin: 0 auto; padding: var(--s-20); }
.row { display: flex; gap: var(--s-12); flex-wrap: wrap; align-items: center; }
.row-tight { display: flex; gap: var(--s-6); flex-wrap: wrap; align-items: center; }
.col { display: flex; flex-direction: column; gap: var(--s-8); }
.spacer { flex: 1; }
.center-wrap { max-width: 440px; margin: var(--s-40) auto; padding: 0 var(--s-16); }
.muted { color: var(--muted); font-size: var(--fs-13); }
.muted-2 { color: var(--muted-2); font-size: var(--fs-12); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 4. 标题与文字 ---------- */
h1,h2,h3,h4 { color: var(--text); font-weight: 700; line-height: var(--lh-tight); margin: 0 0 var(--s-12); }
h1 { font-size: var(--fs-26); margin-top: 0; }
h2 { font-size: var(--fs-18); margin-top: var(--s-24); }
h3 { font-size: var(--fs-16); margin-top: var(--s-16); }
h4 { font-size: var(--fs-14); color: var(--text-2); }
p  { margin: 0 0 var(--s-8); }
small, .small { font-size: var(--fs-12); color: var(--muted); }

/* ---------- 4.1 首页主视觉 (Hero) ---------- */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  background:
    radial-gradient(900px 300px at 80% 0%, rgba(255,255,255,.55), transparent 60%),
    linear-gradient(135deg, var(--brand-700) 0%, var(--brand-500) 55%, var(--brand-400) 100%);
  color: #fff;
  padding: var(--s-32) var(--s-32);
  overflow: hidden;
  box-shadow: var(--shadow-3);
  margin-bottom: var(--s-24);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 92% 20%, rgba(255,255,255,.18), transparent 18%),
    radial-gradient(circle at 8% 80%, rgba(255,255,255,.10), transparent 24%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: grid; gap: var(--s-16); max-width: 760px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); color: #fff;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: var(--fs-12); letter-spacing: .5px;
  width: max-content;
}
.hero h1 {
  color: #fff; font-size: clamp(28px, 4vw, 40px); line-height: 1.2; margin: 0;
  text-shadow: 0 2px 14px rgba(0,40,20,.25);
}
.hero p { color: rgba(255,255,255,.92); font-size: var(--fs-15); margin: 0; max-width: 560px; }
.hero-cta { display: flex; gap: var(--s-12); flex-wrap: wrap; margin-top: var(--s-8); }
.hero-cta .btn { background: #fff; color: var(--brand-700); border-color: #fff; }
.hero-cta .btn:hover { background: var(--brand-50); }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); background: transparent; }
.hero-cta .btn-ghost:hover { background: rgba(255,255,255,.14); border-color: #fff; }
.hero-stats { display: flex; gap: var(--s-24); flex-wrap: wrap; margin-top: var(--s-12); }
.hero-stats .item .num { font-size: var(--fs-22); font-weight: 800; }
.hero-stats .item .lbl { font-size: var(--fs-12); color: rgba(255,255,255,.85); }

/* ---------- 4.2 三大入口卡片 (Quick Entries) ---------- */
.entries { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-14); margin-bottom: var(--s-24); }
.entry {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: var(--s-20);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.entry:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.entry .icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--brand-50); color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: var(--s-12);
}
.entry h3 { margin: 0 0 4px; font-size: var(--fs-16); }
.entry p { margin: 0; color: var(--muted); font-size: var(--fs-13); }
.entry .arrow {
  position: absolute; right: var(--s-16); top: var(--s-16);
  color: var(--muted-2); font-size: 20px; transition: transform var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.entry:hover .arrow { transform: translateX(4px); color: var(--brand-700); }
.entry.accent-1 { background: linear-gradient(135deg, var(--brand-50), var(--surface)); }
.entry.accent-2 { background: linear-gradient(135deg, #fff7ed, var(--surface)); }
.entry.accent-2 .icon { background: #fff3e0; color: var(--warn); }
.entry.accent-3 { background: linear-gradient(135deg, var(--info-bg), var(--surface)); }
.entry.accent-3 .icon { background: #e3f2fd; color: var(--info); }
@media (max-width: 760px) { .entries { grid-template-columns: 1fr; } }

/* ---------- 4.3 Section 标题 ---------- */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin: var(--s-32) 0 var(--s-16);
}
.section-head .title { display: flex; align-items: center; gap: var(--s-10); margin: 0; font-size: var(--fs-20); }
.section-head .title .marker { width: 4px; height: 18px; background: var(--brand-500); border-radius: 2px; }
.section-head .sub { color: var(--muted); font-size: var(--fs-13); }
.section-head .more { color: var(--muted); font-size: var(--fs-13); }
.section-head .more:hover { color: var(--brand-700); }

/* ---------- 4.4 商品卡升级 ---------- */
.product-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-3); transform: translateY(-2px); }
.product-card .cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.product-card:hover .cover img { transform: scale(1.04); }
.product-card .cover .emoji { font-size: 56px; filter: drop-shadow(0 2px 6px rgba(0,40,20,.18)); }
.product-card .corner-tag {
  position: absolute; top: var(--s-8); left: var(--s-8);
  background: rgba(255,255,255,.92); color: var(--brand-700);
  font-size: var(--fs-12); font-weight: 600;
  padding: 2px 8px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
}
.product-card .corner-tag.warn { background: var(--warn); color: #fff; }
.product-card .corner-tag.danger { background: var(--danger); color: #fff; }
.product-card .corner-tag.gray { background: rgba(0,0,0,.45); color: #fff; }
.product-card .body { padding: var(--s-12) var(--s-14); display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-card .cat { font-size: var(--fs-12); color: var(--muted); }
.product-card .name { font-weight: 600; font-size: var(--fs-15); line-height: 1.4; min-height: 42px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.product-card .price { color: var(--up); font-weight: 800; font-size: var(--fs-20); }
.product-card .unit { color: var(--muted); font-size: var(--fs-12); }
.product-card .stock { font-size: var(--fs-12); color: var(--muted); display: flex; align-items: center; gap: 4px; }
.product-card .stock .ok { color: var(--success); }
.product-card .stock .err { color: var(--danger); }
.product-card .foot { padding: 0 var(--s-14) var(--s-14); display: flex; gap: var(--s-8); }
.product-card .foot .btn { flex: 1; }

/* 通用微动效 */
@keyframes float-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: float-up var(--dur-3) var(--ease) both; }

/* ---------- 5. 顶栏 / 品牌 / 导航 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.topbar-inner {
  display: flex; align-items: center; gap: var(--s-16);
  padding: 0 var(--s-20); height: var(--topbar-h);
  max-width: var(--container-wide); margin: 0 auto;
}
.topbar .brand {
  font-weight: 700; font-size: var(--fs-18); color: var(--brand-700);
  display: inline-flex; align-items: center; gap: var(--s-8);
}
.topbar .brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand-500); display: inline-block;
}
.topbar .nav-links { display: flex; gap: var(--s-4); flex: 1; flex-wrap: wrap; }
.topbar .nav-links a {
  color: var(--muted); font-size: var(--fs-14); padding: 6px 10px; border-radius: var(--r-md);
}
.topbar .nav-links a:hover { background: var(--bg-2); color: var(--brand-700); }
.topbar .nav-links a.active {
  color: var(--brand-700); background: var(--brand-50); font-weight: 600;
}
.topbar .auth { display: flex; align-items: center; gap: var(--s-8); font-size: var(--fs-13); }
.topbar .me { color: var(--muted); }
.topbar .menu-toggle {
  display: none;
  background: transparent; border: 1px solid var(--line);
  width: 36px; height: 36px; border-radius: var(--r-md); padding: 0;
  align-items: center; justify-content: center;
}
.topbar .menu-toggle:hover { background: var(--bg-2); }
.topbar .menu-toggle span { width: 18px; height: 2px; background: var(--text); position: relative; display: block; }
.topbar .menu-toggle span::before, .topbar .menu-toggle span::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: var(--text);
}
.topbar .menu-toggle span::before { top: -6px; }
.topbar .menu-toggle span::after  { top:  6px; }

/* 移动端：导航折叠 */
@media (max-width: 760px) {
  .topbar-inner { padding: 0 var(--s-12); }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar .nav-links {
    display: none; position: absolute; top: var(--topbar-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: var(--s-8) var(--s-12);
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2);
  }
  .topbar .nav-links.open { display: flex; }
  .topbar .nav-links a { padding: 10px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .topbar .nav-links a:last-child { border-bottom: none; }
  /* 表格横向滚动（手机端避免挤压）*/
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 560px; }
  /* 卡片 padding 收窄 */
  .panel { padding: var(--s-14); }
  /* 详情页双栏 → 单栏 */
  .detail-grid { grid-template-columns: 1fr !important; gap: var(--s-14) !important; }
  /* 大数字 hero 缩 */
  .hero h1 { font-size: var(--fs-28) !important; }
  .hero { padding: var(--s-16) var(--s-14) !important; }
  /* 卡片按钮在窄屏叠放 */
  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; }
  /* 主区边距收 */
  main { padding: var(--s-12) !important; }
  /* 面包屑允许换行 */
  .breadcrumb { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  /* 更窄屏：顶栏品牌隐藏文字，只留 dot */
  .topbar .brand-text { display: none; }
  .topbar .brand .dot { margin-right: 0; }
  /* 表格进一步缩 */
  .table { font-size: var(--fs-12); }
  /* 主区 padding 再小 */
  main { padding: var(--s-10) !important; }
  /* 隐藏小屏非关键列 */
  .hide-mobile { display: none !important; }
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand-500); color: #fff;
  border: 1px solid var(--brand-500); border-radius: var(--r-md);
  padding: 9px 16px; font-size: var(--fs-14); font-weight: 600;
  cursor: pointer; transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand-300); outline-offset: 2px; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }

.btn-mini {
  background: var(--bg-2); color: var(--brand-700); border: 1px solid transparent;
  border-radius: var(--r-md); padding: 5px 10px; font-size: var(--fs-13); cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.btn-mini:hover { background: var(--brand-50); }

.btn-ghost {
  background: transparent; color: var(--brand-700);
  border: 1px solid var(--brand-500); border-radius: var(--r-md);
  padding: 8px 16px; font-size: var(--fs-14); font-weight: 600; cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.btn-ghost:hover { background: var(--brand-50); }

.btn-danger {
  background: #fff; color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--r-md);
  padding: 8px 14px; font-size: var(--fs-14); font-weight: 600; cursor: pointer;
}
.btn-danger:hover { background: var(--danger-bg); }

.btn-link {
  background: transparent; border: none; padding: 0; color: var(--brand-700);
  cursor: pointer; font-size: inherit; text-decoration: underline dotted;
}
.btn-link:hover { color: var(--brand-800); }

.btn-sm { padding: 5px 10px; font-size: var(--fs-12); }
.btn-lg { padding: 12px 22px; font-size: var(--fs-15); }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: var(--s-8); flex-wrap: wrap; }
.btn[disabled], .btn:disabled {
  opacity: .55; cursor: not-allowed; transform: none;
  background: var(--brand-300, #88c4a5); border-color: var(--brand-300, #88c4a5);
}

/* ---------- 7. 表单 ---------- */
.field { display: block; margin-bottom: var(--s-12); }
.field-label {
  display: block; font-size: var(--fs-13); color: var(--text-2);
  margin: 0 0 6px; font-weight: 500;
}
.field-hint { font-size: var(--fs-12); color: var(--muted); margin-top: 4px; }
.field-error { font-size: var(--fs-12); color: var(--danger); margin-top: 4px; min-height: 1em; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.field.has-error .field-label { color: var(--danger); }

.input, .select, .textarea {
  display: block; width: 100%;
  padding: 9px 12px; font-size: var(--fs-14);
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-50);
}
.input[disabled], .select[disabled], .textarea[disabled] {
  background: var(--bg-2); color: var(--muted); cursor: not-allowed;
}
.input.err, .select.err, .textarea.err {
  border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg, #fee2e2);
}
.field-error { color: var(--danger); font-size: var(--fs-12); margin-top: 4px; min-height: 16px; }
.textarea { resize: vertical; min-height: 80px; }
.input-sm { padding: 6px 10px; font-size: var(--fs-13); }
.checkbox, .radio { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-14); cursor: pointer; }
.checkbox input, .radio input { width: 16px; height: 16px; accent-color: var(--brand-500); }

.form-grid { display: grid; gap: var(--s-12) var(--s-16); grid-template-columns: 1fr; }
@media (min-width: 600px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 760px) { .form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- 8. 面板 / 卡片 ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-20);
  margin-bottom: var(--s-20);
  box-shadow: var(--shadow-1);
}
.panel-title {
  font-size: var(--fs-16); font-weight: 700; margin: 0 0 var(--s-12);
  display: flex; align-items: center; gap: var(--s-8);
}
.panel-title .small { font-weight: 400; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-14);
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.card .name { font-weight: 600; font-size: var(--fs-15); }
.card .cat { font-size: var(--fs-12); color: var(--muted); }
.card .price { color: var(--up); font-weight: 700; font-size: var(--fs-18); }
.card .meta { font-size: var(--fs-12); color: var(--muted); }
.card .img, .card .img-fallback {
  width: 100%; height: 140px; border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-700); font-size: 28px; font-weight: 700;
  object-fit: cover;
}
.card .img { background: var(--bg-2); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-14); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-16); }

/* ---------- 9. 表格 ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-13); background: var(--surface); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: var(--fs-12); position: sticky; top: 0; }
.table tbody tr:hover { background: var(--bg-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .right { text-align: right; }
.table .nowrap { white-space: nowrap; }

/* ---------- 10. 标签 / 徽章 / 状态点 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-pill); font-size: var(--fs-12);
  background: var(--bg-2); color: var(--brand-700); white-space: nowrap;
}
.badge.warn   { background: var(--warn-bg); color: var(--warn); }
.badge.ok     { background: var(--success-bg); color: var(--success); }
.badge.err    { background: var(--danger-bg); color: var(--danger); }
.badge.info   { background: var(--info-bg); color: var(--info); }
.badge.muted  { background: var(--bg-2); color: var(--muted); }

.dot-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); margin-right: 6px; }
.dot-status.ok { background: var(--success); }
.dot-status.warn { background: var(--warn); }
.dot-status.err { background: var(--danger); }

/* ---------- 11. Toast / 通知 ---------- */
.toast {
  position: fixed; left: 50%; top: var(--s-16); transform: translateX(-50%); z-index: 50;
  padding: 10px 18px; border-radius: var(--r-md); font-size: var(--fs-14);
  display: none; box-shadow: var(--shadow-3);
  max-width: 90vw; word-break: break-all;
}
.toast.ok   { background: var(--success-bg); color: var(--success); border: 1px solid #c8e6c9; }
.toast.err  { background: var(--danger-bg); color: var(--danger); border: 1px solid #ffcdd2; }
.toast.info { background: var(--info-bg); color: var(--info); border: 1px solid #bbdefb; }

/* ---------- 12. Skeleton / Empty / Loading ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--line) 37%, var(--bg-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s var(--ease) infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0   50%; }
}

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s-40) var(--s-20); text-align: center; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
}
.empty .icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: var(--s-12);
}
.empty .title { font-size: var(--fs-15); font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.empty .desc  { font-size: var(--fs-13); margin-bottom: var(--s-12); max-width: 320px; }

.loading {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--line-strong); border-top-color: var(--brand-500);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: var(--s-8); color: var(--muted); }

/* ---------- 13. 后台布局 / 侧栏 ---------- */
.admin-layout {
  display: flex; align-items: flex-start;
  max-width: var(--container-wide); margin: 0 auto;
}
.admin-side {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--line);
  min-height: calc(100vh - var(--topbar-h));
  padding: var(--s-20) var(--s-12);
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: var(--topbar-h);
  align-self: flex-start;
}
.admin-side .brand {
  font-weight: 700; color: var(--brand-700); margin-bottom: var(--s-12);
  padding: 0 6px; font-size: var(--fs-15);
}
.side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: var(--r-md);
  color: var(--muted); font-size: var(--fs-14);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.side-link:hover { background: var(--bg-2); color: var(--brand-700); }
.side-link.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.admin-main { flex: 1; padding: var(--s-20); min-width: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-14); margin: var(--s-10) 0; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-16); text-align: left;
  box-shadow: var(--shadow-1);
}
.stat .num { font-size: var(--fs-26); font-weight: 700; color: var(--brand-700); line-height: 1.1; }
.stat .lbl { font-size: var(--fs-13); color: var(--muted); margin-top: 4px; }
.stat .delta { font-size: var(--fs-12); margin-top: 6px; }
.stat .delta.up { color: var(--up); }
.stat .delta.down { color: var(--down); }

/* ---------- 14. 面包屑 ---------- */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: var(--fs-13); color: var(--muted); margin-bottom: var(--s-12);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-700); }
.breadcrumb .sep { color: var(--muted-2); }
.breadcrumb .current { color: var(--text-2); font-weight: 500; }

/* ---------- 15. 分页 ---------- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: var(--s-20) 0;
}
.pagination button {
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2);
  font-size: var(--fs-13); cursor: pointer;
}
.pagination button:hover:not([disabled]) { border-color: var(--brand-500); color: var(--brand-700); }
.pagination button[disabled] { opacity: .5; cursor: not-allowed; }
.pagination button.current { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.pagination .info { color: var(--muted); font-size: var(--fs-12); padding: 0 var(--s-8); }

/* ---------- 16. 步骤条 (Stepper) ---------- */
.stepper {
  display: flex; align-items: center; gap: 0; margin: var(--s-16) 0;
}
.stepper .step { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-13); }
.stepper .step .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-12);
}
.stepper .step.done .dot { background: var(--brand-500); color: #fff; }
.stepper .step.current .dot { background: var(--surface); color: var(--brand-700); border: 2px solid var(--brand-500); }
.stepper .step.current, .stepper .step.done { color: var(--brand-700); font-weight: 600; }
.stepper .bar { flex: 1; height: 2px; background: var(--line); margin: 0 8px; }
.stepper .bar.done { background: var(--brand-500); }

/* ---------- 17. 弹窗 / Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,30,22,.45);
  display: none; align-items: center; justify-content: center; z-index: 100;
  animation: fadeIn var(--dur-2) var(--ease);
}
.modal-mask.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--r-lg);
  width: min(560px, 92vw); max-height: 86vh; overflow: auto;
  box-shadow: var(--shadow-4); animation: rise var(--dur-2) var(--ease);
}
.modal-header { padding: var(--s-16) var(--s-20); border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-header h3 { margin: 0; font-size: var(--fs-16); flex: 1; }
.modal-header .close {
  width: 30px; height: 30px; border-radius: var(--r-md);
  background: transparent; border: none; cursor: pointer; color: var(--muted); font-size: 18px;
}
.modal-header .close:hover { background: var(--bg-2); color: var(--text); }
.modal-body { padding: var(--s-20); }
.modal-footer { padding: var(--s-12) var(--s-20); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: var(--s-8); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 18. Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--s-16); flex-wrap: wrap; }
.tabs button {
  background: transparent; border: none; padding: 10px 14px;
  font-size: var(--fs-14); color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tabs button:hover { color: var(--brand-700); }
.tabs button.active { color: var(--brand-700); font-weight: 600; border-bottom-color: var(--brand-500); }

/* ---------- 19. 图片 / 头像 / 头像占位 ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-100); color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-14);
}
.avatar-lg { width: 56px; height: 56px; font-size: var(--fs-18); }

/* ---------- 20. 工具类 ---------- */
.text-success { color: var(--success); }
.text-warn    { color: var(--warn); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }
.text-muted   { color: var(--muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-700       { font-weight: 700; }
.fw-600       { font-weight: 600; }
.fs-12 { font-size: var(--fs-12); } .fs-13 { font-size: var(--fs-13); }
.fs-14 { font-size: var(--fs-14); } .fs-16 { font-size: var(--fs-16); }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: var(--s-8); } .mt-12 { margin-top: var(--s-12); } .mt-16 { margin-top: var(--s-16); } .mt-24 { margin-top: var(--s-24); }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: var(--s-8); } .mb-12 { margin-bottom: var(--s-12); } .mb-16 { margin-bottom: var(--s-16); } .mb-24 { margin-bottom: var(--s-24); }
.gap-4 { gap: var(--s-4); } .gap-8 { gap: var(--s-8); } .gap-12 { gap: var(--s-12); } .gap-16 { gap: var(--s-16); }
.hidden { display: none !important; }
.relative { position: relative; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
::-webkit-scrollbar-track { background: transparent; }

/* 选区高亮 */
input::placeholder, textarea::placeholder { color: var(--muted-2); }
