/* ==========================================================================
   筑造工作流 · 设计系统基础层（v2 改版）
   --------------------------------------------------------------------------
   配色语言对齐 qianwen（设计工作台）：浅色扁平 + 单一蓝色主色
   - 主色 #2563EB，悬停 #1D4ED8，浅底 #EFF6FF
   - 页面底 #F5F7FA，卡片纯白，边框 #E2E8F0，卡片头 #F8FAFC
   - 文本三级：#0F172A / #64748B / #94A3B8
   - 圆角统一 14px（卡片）/ 10px（控件）/ 8px（小件）
   - 阴影只有一档轻投影 0 1px 8px rgba(0,0,0,.06)，去掉玻璃拟态与多层投影

   保留全部语义变量名（--surface / --text / --border …），
   这样 views.css / budget.css / shopping.css 里的既有写法无需逐个改。
   ========================================================================== */

:root {
  /* ---------- 主色 ---------- */
  --brand-1: #2563eb;
  --brand-2: #3b82f6;
  --brand-ink: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-soft-2: #dbeafe;
  --grad-brand: #2563eb;
  --grad-brand-soft: #eff6ff;
  --grad-cool: #3b82f6;
  --grad-violet: #8b5cf6;

  /* ---------- 状态色（与 qianwen 一致：橙=待处理 / 绿=完成 / 红=风险） ---------- */
  --st-todo: #94a3b8;
  --st-doing: #2563eb;
  --st-review: #e8834a;
  --st-done: #22c55e;
  --st-block: #ef4444;
  --st-todo-soft: #f1f5f9;
  --st-doing-soft: #eff6ff;
  --st-review-soft: #fff7ed;
  --st-done-soft: #f0fdf4;
  --st-block-soft: #fef2f2;

  /* ---------- 尺寸 ---------- */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 16px;
  --r-full: 999px;
  --sidebar-w: 220px;     /* 展开宽度 */
  --sidebar-w-mini: 64px;  /* 收起宽度（纯图标） */
  --topbar-h: 48px;

  /* ---------- 动效 ---------- */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur: 0.18s;

  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* ==========================================================================
   主题
   --------------------------------------------------------------------------
   v2 改版只保留浅色一套视觉。深色不再是「另一套配色」，
   而是直接别名到浅色——这样即使某个组件漏改、或浏览器缓存了旧的
   data-theme="dark"，也不会退回到那套深墨底玻璃拟态的旧观感。
   ========================================================================== */
html,
html[data-theme="light"],
html[data-theme="dark"] {
  --bg: #f5f7fa;
  --bg-grad-1: transparent;
  --bg-grad-2: transparent;

  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-hi: #e2e8f0;
  --glass: #ffffff;
  --glass-2: #ffffff;

  --border: #e2e8f0;
  --border-2: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-2: #64748b;
  --text-3: #94a3b8;

  --shadow-sm: 0 1px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.16);
  --shadow-brand: 0 2px 8px rgba(37, 99, 235, 0.24);
  --ring: rgba(37, 99, 235, 0.35);
  --skeleton: linear-gradient(90deg, #eef1f6, #f7f9fc, #eef1f6);
}

* { box-sizing: border-box; }
*::selection { background: #dbeafe; color: #0f172a; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; flex-shrink: 0; }
img { max-width: 100%; display: block; }

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

/* ---------- 滚动条：细、浅、无轨道 ---------- */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---------- 排版小工具 ---------- */
.mono { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tiny { font-size: 11.5px; }
.sm { font-size: 12.5px; }
.lg { font-size: 16px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.bold { font-weight: 600; }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-2 { margin-top: 2px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-28 { margin-top: 28px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 主色文字（保留类名，内部改为纯色） ---------- */
.grad-text { color: var(--brand-1); }

/* ---------- 启动屏 ---------- */
.boot-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: var(--bg);
}
.boot-logo {
  font-size: 26px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--brand-1);
}
.boot-sub { color: var(--text-3); font-size: 13px; letter-spacing: 0.02em; }

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.anim-up { animation: fadeUp 0.36s var(--ease) both; }
.anim-in { animation: fadeIn 0.24s var(--ease) both; }

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