/* ============================================================
   全栈 · 设计令牌与基础组件
   视觉基线继承自「来客宝」B01 银白体系：
   银白底 / 白色面 / 石墨文字 / 亮蓝操作色 / Lucide 线性图标
   登录页沿用电影感 + 小玻璃弹窗，不在此文件范围内（见 landing.css）
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --raised: #edf0f4;
  --panel: #ffffff;
  --text: #232730;
  --muted: #626b77;
  --faint: #8b939e;
  --line: #dce1e7;
  --line-soft: #e9edf2;
  --blue: #0961e7;
  --action: #0961e7;
  --blue-soft: #e8effa;
  --blue-line: #c3d6f2;
  --orange: #88500e;
  --red: #b32637;
  --green: #1f7a4d;
  --shadow: 0 6px 24px rgb(26 43 65 / 6%);
  --shadow-lg: 0 12px 40px rgb(40 58 83 / 15%);
  --radius: 16px;
  --radius-lg: 22px;
  --nav-h: 76px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
}
body.landing-mode { background: #04101d; }

button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { touch-action: manipulation; }
button { cursor: pointer; border: 0; color: inherit; background: transparent; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--blue); text-decoration: none; }
button:hover, a:hover { filter: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px;
}
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -.025em; }
p { line-height: 1.65; }
small { font-size: 13px; color: var(--muted); }
ul { margin: 0; padding: 0; list-style: none; }

svg.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; stroke-width: 1.7; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 200; background: var(--blue); color: #fff;
  padding: 12px 18px; border-radius: 10px; transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 排版工具 ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.blue { color: var(--blue); }
.num { font-variant-numeric: tabular-nums; }
.inline { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn {
  min-height: 44px; padding: 10px 18px; display: inline-flex; gap: 9px; align-items: center;
  justify-content: center; border-radius: 11px; background: var(--raised); color: var(--text);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}
.btn:hover { background: #e3e8ef; }
.btn.primary { background: var(--action); color: #fff; }
.btn.primary:hover { background: #0755cc; }
.btn.ghost { background: transparent; color: var(--blue); }
.btn.ghost:hover { background: #eaf0f8; }
.btn.danger { background: #fff0f0; color: #a72031; }
.btn.danger:hover { background: #ffe2e2; }
.btn.small { min-height: 38px; padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn.large { min-height: 52px; padding: 14px 26px; font-size: 16px; border-radius: 13px; }
.btn:active { opacity: .78; }

.iconbtn {
  display: inline-flex; justify-content: center; align-items: center;
  width: 44px; height: 44px; border-radius: 12px; background: var(--raised); color: var(--text);
  transition: background-color 160ms ease-out;
}
.iconbtn:hover { background: #e3e8ef; }
.iconbtn.round { border-radius: 50%; }
.iconbtn.sm { width: 36px; height: 36px; border-radius: 10px; }
.iconbtn.sm svg.icon { width: 17px; height: 17px; }

/* ---------- 标签 / 提示 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px;
  background: #e9f0f9; color: #365a84; font-size: 12px; line-height: 1.5; white-space: nowrap;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.warn { background: #fff1dc; color: #87500c; }
.tag.bad { background: #ffedef; color: #a62d3d; }
.tag.ok { background: #e4f4ec; color: #1c6b46; }
.tag.plain { background: var(--raised); color: var(--muted); }

.hint { padding: 14px 17px; background: #eaf0f7; border-radius: 12px; color: #3b546f; font-size: 14px; line-height: 1.65; }
.hint.warn { background: #fff3df; color: #80511e; }
.hint.bad { background: #ffedee; color: #97232f; }

.divider { height: 1px; background: var(--line); margin: 22px 0; }

/* ---------- 表面 / 卡片 ---------- */
.surface { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.surface.flat { box-shadow: none; border: 1px solid var(--line); }
.surface.tight { padding: 18px; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.card-sub { font-size: 13px; color: var(--muted); }

.stat { background: var(--surface); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.stat strong { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.stat .delta svg.icon { width: 13px; height: 13px; }
.up { color: #c0392b; }     /* 涨 · 红（国内习惯） */
.down { color: #1f7a4d; }   /* 跌 · 绿 */

/* ---------- 表单 ---------- */
.field { display: block; font-size: 13px; color: #535e6b; }
.field > span { display: block; margin-bottom: 8px; font-weight: 500; }
.field input, .field textarea, .field select {
  display: block; width: 100%; margin-top: 0; border: 1px solid #cbd2dc; border-radius: 11px;
  background: #fff; color: var(--text); padding: 12px 14px; min-height: 46px; font-size: 15px; resize: vertical;
}
.field textarea { line-height: 1.65; min-height: 96px; }
.field input::placeholder, .field textarea::placeholder { color: #8b939e; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); outline-offset: 1px; }
.field .unit-hint { font-size: 12px; color: var(--faint); margin-top: 7px; }
.field.wide { grid-column: 1 / -1; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.formgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.formfooter { display: flex; gap: 12px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.6; margin: 14px 0; color: var(--muted); }
.check input { accent-color: var(--blue); width: 17px; height: 17px; margin: 2px 0 0; }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; }
.switch input { accent-color: var(--blue); width: 18px; height: 18px; }

/* 段选择 */
.seg { display: inline-flex; background: var(--raised); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { min-height: 38px; padding: 7px 15px; border-radius: 9px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 2px 5px rgb(37 52 75 / 7%); }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 500; background: #fafbfc; }
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* ---------- 列表行 ---------- */
.row { display: flex; gap: 16px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row .grow strong { display: block; font-size: 15px; font-weight: 550; margin-bottom: 5px; letter-spacing: 0; }
.row .grow span { font-size: 13px; color: var(--muted); }

/* ---------- 头像 / 图片 ---------- */
.avatar { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; display: block; }
.avatar.lg { width: 52px; height: 52px; }
.avatar.sm { width: 30px; height: 30px; }
.avatars { display: flex; }
.avatars img { width: 30px; height: 30px; object-fit: cover; border-radius: 50%; border: 2px solid #fff; margin-right: -7px; }
.photo { width: 100%; object-fit: cover; border-radius: 13px; display: block; }
.crop { background-size: cover; background-position: center; border-radius: 13px; min-height: 130px; }
.crop.c0 { background-image: url('../assets/case-hotpot.webp'); }
.crop.c1 { background-image: url('../assets/case-wellness.webp'); }
.crop.c2 { background-image: url('../assets/case-cafe.webp'); }
.crop.c3 { background-image: url('../assets/case-fitness.webp'); }

/* ---------- 网格 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.twocol { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .85fr); gap: 28px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: 0 8px 40px rgb(40 58 83 / 15%);
  padding: 12px 20px; border-radius: 12px; font-size: 14px; z-index: 120; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out; max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 进度条 ---------- */
.bar { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.bar.warn > i { background: #e0a33a; }
.bar.ok > i { background: #2f9e68; }

@media (max-width: 760px) {
  .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .formgrid, .twocol, .grid2 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .formgrid.three { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
