/* ============================================================
 * base.css —— 设计令牌 / 重置 / 排版 / 基础控件
 * ============================================================ */

:root {
  /* 纸感色板 */
  --paper: #f7f5f0;          /* 页面底色（暖纸） */
  --paper-2: #efede6;        /* 次级底色 */
  --card: #fffdf9;           /* 卡片面 */
  --ink: #211d17;            /* 主墨色 */
  --ink-2: #57503f;          /* 次级文字 */
  --ink-3: #948b76;          /* 弱化文字 */
  --line: #e4dfd2;           /* 分隔线 */
  --line-strong: #cfc7b4;

  /* 印章红（品牌主色） */
  --seal: #b3372a;
  --seal-deep: #8e2b21;
  --seal-soft: #f7e9e6;
  --seal-glow: rgba(179, 55, 42, .14);

  /* 状态色（与 META.STATUS 一致） */
  --st-open: #2e7d46;   --st-open-bg: #e6f3ea;
  --st-cond: #d9820e;   --st-cond-bg: #fbf0dd;
  --st-limited: #7a5af5; --st-limited-bg: #efebfd;
  --st-closed: #c93d31; --st-closed-bg: #fae8e6;
  --st-unknown: #98917f; --st-unknown-bg: #f0ede4;

  /* 字体 */
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;

  /* 阴影与圆角 */
  --shadow-1: 0 1px 2px rgba(48, 38, 20, .05), 0 2px 8px rgba(48, 38, 20, .05);
  --shadow-2: 0 2px 6px rgba(48, 38, 20, .07), 0 10px 28px rgba(48, 38, 20, .09);
  --shadow-pop: 0 6px 16px rgba(48, 38, 20, .12), 0 20px 48px rgba(48, 38, 20, .16);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;

  /* 动效 */
  --ease-out: cubic-bezier(.22, .8, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .44, 1);
  --t-fast: .16s; --t-med: .28s; --t-slow: .5s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* 应用式布局，面板内部滚动 */
}

::selection { background: var(--seal-soft); }

/* 滚动条（细、纸感） */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d5cdbc; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bfb5a0; background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
a { color: var(--seal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 排版 ---------- */
.h-display { font-family: var(--serif); font-weight: 700; letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  transition: all var(--t-fast) var(--ease-out);
}
.btn:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--seal); border-color: var(--seal); color: #fff; }
.btn.primary:hover { background: var(--seal-deep); border-color: var(--seal-deep); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--paper-2); }

/* 图标按钮 */
.ibtn {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px;
  color: var(--ink-2); border: 1px solid var(--line); background: var(--card);
  transition: all var(--t-fast) var(--ease-out);
}
.ibtn:hover { color: var(--seal); border-color: var(--seal); background: var(--seal-soft); }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; white-space: nowrap; line-height: 1.7;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-open { background: var(--st-open-bg); color: var(--st-open); }
.st-cond { background: var(--st-cond-bg); color: var(--st-cond); }
.st-limited { background: var(--st-limited-bg); color: var(--st-limited); }
.st-closed { background: var(--st-closed-bg); color: var(--st-closed); }
.st-unknown { background: var(--st-unknown-bg); color: var(--st-unknown); }

/* 核验徽标 */
.vbadge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; color: var(--vc, var(--ink-3));
  padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--vc, var(--ink-3)) 10%, transparent);
}

/* ★ 推荐标记 */
.star { color: #d9a514; }

/* ---------- 动效工具 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: scale(1); } }
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 var(--seal-glow); }
  70% { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.anim-fade-up { animation: fadeUp var(--t-med) var(--ease-out) both; }
.anim-pop { animation: popIn var(--t-med) var(--ease-spring) both; }

/* 减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
