/**
 * 模块名称：全局样式表（app.css）
 * 核心功能：定义设计系统（颜色、排版、间距、阴影、圆角）以及全部页面组件样式
 * 适用场景：导游讲解排序应用的所有前端页面
 * 设计原则：
 *   1. 移动优先：默认布局针对窄屏，桌面端通过媒体查询逐级增强；
 *   2. 卡片为主：列表全部使用卡片承载，杜绝表格横向滚动；
 *   3. 文案中性：避免暴露 e、N、sort_delta 等算法术语，保留语义化展示；
 *   4. 一致节奏：以 4px 为最小间距单元，圆角统一 14/18/24，阴影统一三档。
 */

/* ============== 设计令牌 ============== */
:root {
  /* 主色：稳重克制的 Indigo，配合紫色高光形成品牌识别 */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-900: #1e1b4b;

  /* 中性色：Slate 暖灰，比纯灰更友好 */
  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;

  /* 语义色 */
  --success-50:  #ecfdf5;
  --success-100: #d1fae5;
  --success-600: #059669;
  --success-700: #047857;

  --danger-50:  #fef2f2;
  --danger-100: #fee2e2;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  --warning-50: #fffbeb;
  --warning-100:#fef3c7;
  --warning-600:#d97706;
  --warning-700:#b45309;

  /* 排面层级 */
  --bg:        #f5f6fb;
  --bg-deep:   #eef0f7;
  --surface:   #ffffff;
  --surface-2: #f8f9fd;

  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-2: 0 4px 14px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-3: 0 16px 40px rgba(79, 70, 229, 0.18), 0 4px 12px rgba(15, 23, 42, 0.06);

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

  /* 字号 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 28px;

  /* 底部导航高度（含安全区） */
  --bottom-nav-h: 64px;
}

/* ============== 基础 ============== */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--ink-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* 文本工具类 */
.muted   { color: var(--ink-500); }
.subtle  { color: var(--ink-400); }
.strong  { color: var(--ink-900); font-weight: 600; }
.center  { text-align: center; }
.mono    { font-variant-numeric: tabular-nums; }

/* ============== 应用骨架 ============== */
.app-shell {
  min-height: 100%;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

/* 顶部栏：低饱和、极简，移动端不抢视觉 */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--ink-200);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar .back {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-100);
  color: var(--ink-700);
  font-size: 18px;
  flex-shrink: 0;
}

.top-bar .back:active { background: var(--ink-200); }

.top-bar .title {
  flex: 1;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-900);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar .user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--ink-100);
  border-radius: var(--r-full);
  color: var(--ink-700);
  font-size: var(--fs-sm);
  cursor: pointer;
}

.top-bar .user-chip img,
.top-bar .user-chip .ph {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-100);
  color: var(--brand-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.top-bar .user-chip .name {
  max-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-bar .menu {
  position: relative;
}

.top-bar .menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 140px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--ink-200);
  padding: 6px;
  display: none;
}

.top-bar .menu-pop.open { display: block; }

.top-bar .menu-pop button {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  color: var(--ink-800);
  cursor: pointer;
}

.top-bar .menu-pop button:hover { background: var(--ink-100); }

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}

.page-head .title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

.page-head .sub {
  color: var(--ink-500);
  font-size: var(--fs-sm);
  margin-top: 2px;
}

/* ============== 底部主导航（移动端） ============== */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--ink-200);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--bottom-nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav .tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-500);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding: 6px 4px;
}

.bottom-nav .tab .icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav .tab.active {
  color: var(--brand-600);
}

.bottom-nav .tab.active .icon {
  transform: translateY(-1px);
}

/* ============== 卡片 ============== */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  border: 1px solid var(--ink-200);
  padding: 16px;
  margin-bottom: 14px;
}

.card.flush { padding: 0; }
.card.tight { padding: 12px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-head .title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-900);
}

.card-head .sub {
  font-size: var(--fs-xs);
  color: var(--ink-500);
}

.card-body { color: var(--ink-700); }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 4px 10px;
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  color: var(--ink-500);
  text-transform: none;
}

/* ============== 英雄卡片（下一位讲解 / 推荐分配） ============== */
/* 设计取向：克制简洁。白底 + 细边 + 浅阴影；主色仅用于左侧细色条与小标签，
   不再使用大面积渐变或装饰圆。在阅读和触控目标上保持充足留白。 */
.hero {
  position: relative;
  background: var(--surface);
  color: var(--ink-900);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 12px 14px 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

/* 左侧 3px 主色细条，作为视觉锚点 */
.hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 var(--r-full) var(--r-full) 0;
  background: var(--brand-600);
}

.hero .eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--brand-700);
  background: var(--brand-50);
  border-radius: var(--r-full);
  padding: 2px 10px;
  font-weight: 500;
}

.hero .headline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-width: 0;
}

.hero .headline .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.hero .headline .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .name {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 空态时单行补充说明；正常态不展示描述文案 */
.hero .note {
  margin-top: 6px;
  font-size: var(--fs-sm);
  color: var(--ink-500);
  line-height: 1.5;
}

.hero:not(.muted) .note { display: none; }

/* 导游视角：在英雄卡内展示顺位说明 */
.hero.guide-view:not(.muted) .note {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-500);
}

/* 导游视角：首页三栏状态摘要 */
.guide-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.guide-stat {
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--shadow-1);
}

.guide-stat .label {
  font-size: var(--fs-xs);
  color: var(--ink-500);
}

.guide-stat .value {
  margin-top: 4px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.35;
  word-break: break-all;
}

.guide-stat .value.emphasis {
  color: var(--brand-700);
}

/* 与姓名同一行，靠右排列 */
.hero .actions {
  flex-shrink: 0;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.2;
  background: var(--brand-50);
  color: var(--brand-700);
  border: 1px solid var(--brand-100);
  cursor: pointer;
  white-space: nowrap;
}

.hero .ghost-btn:hover { background: var(--brand-100); }

.hero .ghost-btn.secondary {
  background: var(--surface);
  color: var(--ink-700);
  border-color: var(--ink-200);
}

.hero .ghost-btn.secondary:hover { background: var(--ink-50); }

/* 空态：去掉主色条，整体中性 */
.hero.muted::before { background: var(--ink-300); }

.hero.muted .eyebrow {
  background: var(--ink-100);
  color: var(--ink-600);
}

.hero.muted .headline .avatar {
  background: var(--ink-100);
  color: var(--ink-500);
}

/* ============== 列表（替代表格） ============== */
.list { display: flex; flex-direction: column; }

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink-100);
  background: var(--surface);
}

.list-item:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.list-item:last-child  { border-bottom: 0; border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }

.card.flush .list-item:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.card.flush .list-item:last-child  { border-bottom: 0; border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }

.list-item .lead {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink-100);
  color: var(--ink-700);
  font-weight: 600;
  overflow: hidden;
}

.list-item .lead img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item .main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-item .main .row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-item .main .primary {
  font-weight: 600;
  color: var(--ink-900);
  font-size: var(--fs-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.list-item .main .secondary {
  color: var(--ink-500);
  font-size: var(--fs-sm);
  line-height: 1.5;
  word-break: break-word;
}

.list-item .trail {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-size: var(--fs-sm);
}

/* 排名行：右侧固定积分与操作按钮 */
.list-item.ranking-row .main {
  flex: 1;
  min-width: 0;
}

.list-item-side {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  margin-left: 8px;
}

.list-item-side .score-fixed {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-800);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.list-item-side .score-label {
  font-size: var(--fs-xs);
  color: var(--ink-400);
  margin-right: 2px;
}

.list-item.is-me {
  background: linear-gradient(180deg, var(--brand-50), #fff 80%);
}

.list-item.is-dimmed { opacity: 0.6; }

/* 当 list-item 拥有底部操作条时，将其改为纵向 flex 容器 */
.list-item.has-actions {
  flex-direction: column;
  align-items: stretch;
  padding: 14px 16px;
  gap: 10px;
}

.list-item.has-actions .list-item-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.list-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px dashed var(--ink-200);
}

/* 排名徽章 */
.rank {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  background: var(--ink-100);
  color: var(--ink-600);
  font-variant-numeric: tabular-nums;
}

.rank.gold   { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.rank.silver { background: linear-gradient(135deg, #e5e7eb, #94a3b8); color: #0f172a; }
.rank.bronze { background: linear-gradient(135deg, #fde2cf, #f97316); color: #7c2d12; }

/* 分数徽章：正绿、负红、中性灰 */
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.score-pill.up   { background: var(--success-50); color: var(--success-700); }
.score-pill.down { background: var(--danger-50);  color: var(--danger-700); }
.score-pill.flat { background: var(--ink-100);    color: var(--ink-700); }

/* 标签 */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--ink-100);
  color: var(--ink-600);
}

.chip.success { background: var(--success-50); color: var(--success-700); }
.chip.danger  { background: var(--danger-50);  color: var(--danger-700); }
.chip.warning { background: var(--warning-50); color: var(--warning-700); }
.chip.brand   { background: var(--brand-50);   color: var(--brand-700); }

/* ============== 按钮 ============== */
.btn {
  --bg: var(--surface);
  --fg: var(--ink-800);
  --bd: var(--ink-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: var(--fs-md);
  font-weight: 500;
  border-radius: var(--r-md);
  border: 1px solid var(--bd);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  min-height: 40px;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  --bg: var(--brand-600);
  --fg: #fff;
  --bd: transparent;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.24);
}

.btn-primary:hover { background: var(--brand-700); }

.btn-ghost {
  --bg: transparent;
  --fg: var(--brand-700);
  --bd: transparent;
}

.btn-ghost:hover { background: var(--brand-50); }

.btn-soft {
  --bg: var(--ink-100);
  --fg: var(--ink-800);
  --bd: transparent;
}

.btn-soft:hover { background: var(--ink-200); }

.btn-danger {
  --bg: var(--danger-600);
  --fg: #fff;
  --bd: transparent;
}

.btn-danger:hover { background: var(--danger-700); }

.btn-danger-ghost {
  --bg: transparent;
  --fg: var(--danger-700);
  --bd: var(--danger-100);
}

.btn-danger-ghost:hover { background: var(--danger-50); }

.btn-danger-soft {
  --bg: var(--danger-50);
  --fg: var(--danger-700);
  --bd: transparent;
}

.btn-danger-soft:hover { background: var(--danger-100); }

.btn-sm {
  padding: 6px 12px;
  font-size: var(--fs-sm);
  min-height: 32px;
  border-radius: var(--r-sm);
}

.btn-block { width: 100%; }

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============== 表单 ============== */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  color: var(--ink-700);
  font-weight: 500;
}

.field .hint {
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--ink-500);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  font-size: var(--fs-md);
  background: var(--surface);
  color: var(--ink-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}

.select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2364748b' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.textarea { min-height: 88px; resize: vertical; }

/* 搜索框 */
.search {
  position: relative;
}

.search input {
  padding-left: 36px;
}

.search::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.55;
}

/* 候选列表（替代多选 select） */
.picker {
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  background: var(--surface);
  max-height: 260px;
  overflow-y: auto;
}

.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-100);
  cursor: pointer;
}

.picker-item:last-child { border-bottom: 0; }
.picker-item:hover { background: var(--ink-50); }

.picker-item.active {
  background: var(--brand-50);
  color: var(--brand-700);
}

.picker-item .ph {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink-100);
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.picker-item .meta {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-left: auto;
}

/* ============== 通知条 ============== */
.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 12px 16px;
  border-radius: var(--r-full);
  background: var(--ink-900);
  color: #fff;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-3);
  max-width: 86%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.toast.success { background: var(--success-700); }
.toast.danger  { background: var(--danger-700); }
.toast.warn    { background: var(--warning-700); }

/* 内联通知（页面顶部） */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  margin-bottom: 14px;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
}

.alert .icn { line-height: 1.55; }

.alert-info     { background: var(--brand-50);   color: var(--brand-700);    border-color: var(--brand-100); }
.alert-success  { background: var(--success-50); color: var(--success-700);  border-color: var(--success-100); }
.alert-danger,
.alert-error    { background: var(--danger-50);  color: var(--danger-700);   border-color: var(--danger-100); }
.alert-warning  { background: var(--warning-50); color: var(--warning-700);  border-color: var(--warning-100); }

/* ============== 工具行 ============== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar .spacer { flex: 1; }

/* ============== 分页 ============== */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px 4px;
  font-size: var(--fs-sm);
  color: var(--ink-500);
  gap: 8px;
}

/* ============== 空状态 / 骨架 ============== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px;
  color: var(--ink-500);
}

.empty .icn {
  font-size: 36px;
  margin-bottom: 8px;
  opacity: 0.7;
}

.empty .ttl {
  color: var(--ink-700);
  font-weight: 600;
  font-size: var(--fs-md);
  margin-bottom: 4px;
}

.skeleton {
  background: linear-gradient(90deg, var(--ink-100), var(--ink-50), var(--ink-100));
  background-size: 200% 100%;
  border-radius: var(--r-sm);
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: -200% 50%; }
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.skeleton-row .avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-row .lines  { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-row .lines .l1 { height: 12px; width: 50%; }
.skeleton-row .lines .l2 { height: 10px; width: 30%; }

/* ============== 对话框 ============== */
dialog.dialog {
  border: 0;
  padding: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  width: 92%;
  max-width: 440px;
  background: var(--surface);
  color: var(--ink-800);
}

dialog.dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.dialog-head {
  padding: 18px 20px 4px;
}

.dialog-head .title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--ink-900);
}

.dialog-head .sub {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  margin-top: 4px;
}

.dialog-body {
  padding: 14px 20px 0;
}

.dialog-foot {
  padding: 12px 20px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============== 登录页 ============== */
.auth-page {
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 100%, rgba(99, 102, 241, 0.18), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  padding: 32px 24px 28px;
  text-align: center;
  border: 1px solid var(--ink-100);
}

.auth-card .logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-500), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  box-shadow: var(--shadow-3);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: var(--fs-2xl);
  color: var(--ink-900);
}

.auth-card .lede {
  margin: 0 0 22px;
  color: var(--ink-500);
  font-size: var(--fs-sm);
}

.auth-card #qr-container {
  min-height: 380px;
  margin: 0 auto;
}

/* ============== 工具 ============== */
.hidden { display: none !important; }

.grid {
  display: grid;
  gap: 12px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.divider {
  height: 1px;
  background: var(--ink-100);
  margin: 12px 0;
}

.stat {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  border: 1px solid var(--ink-200);
  box-shadow: var(--shadow-1);
}

.stat .label {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  letter-spacing: 0.04em;
}

.stat .value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--ink-900);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ============== 快捷入口（首页） ============== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

.action-card .icn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--brand-50);
  color: var(--brand-700);
}

.action-card.tone-emerald .icn { background: #d1fae5; color: #047857; }
.action-card.tone-amber   .icn { background: #fef3c7; color: #b45309; }
.action-card.tone-rose    .icn { background: #ffe4e6; color: #be123c; }
.action-card.tone-sky     .icn { background: #e0f2fe; color: #0369a1; }
.action-card.tone-violet  .icn { background: #ede9fe; color: #6d28d9; }

.action-card .label {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-900);
}

.action-card .desc {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-top: 2px;
}

/* ============== 响应式：桌面增强 ============== */
@media (min-width: 720px) {
  .page { padding: 24px; }
  .action-grid { grid-template-columns: repeat(3, 1fr); }
  .list-item-side {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
}

@media (min-width: 960px) {
  .action-grid { grid-template-columns: repeat(4, 1fr); }
  .top-bar { padding: 14px 24px; }
  .page-head .title { font-size: var(--fs-3xl); }
}

/* 屏幕较宽时，仍然以卡片为主，列表保持单列 */
@media (min-width: 1024px) {
  .list-item { padding: 14px 18px; }
}
