/* === 风水平台 - 主样式 === */

/* ─── 浅色主题（body.theme-light 时覆写 :root 变量） ─── */
body.theme-light {
  --bg-primary: #f4f2ee;
  --bg-secondary: #e9e6df;
  --bg-card: #ffffff;
  --bg-hover: #efece5;
  --text-primary: #26221c;
  --text-secondary: #55504a;
  --text-muted: #8a847c;
  --accent-gold: #a8813f;
  --accent-gold-dim: #8b7355;
  --accent-jade: #3f7d5f;
  --accent-red: #b04a3c;
  --border-color: #d9d4ca;

  /* 五行色（浅底用深色系保持对比度） */
  --wu-xing-mu: #3f7d5f;     /* 木 = 綠 */
  --wu-xing-huo: #b04a3c;    /* 火 = 紅 */
  --wu-xing-tu: #a8813f;     /* 土 = 黃/金 */
  --wu-xing-jin: #55504a;    /* 金 = 白/銀 */
  --wu-xing-shui: #3a6a8a;   /* 水 = 藍 */

  --wu-xing-mu-bg: rgba(63,125,95,0.12);
  --wu-xing-huo-bg: rgba(176,74,60,0.12);
  --wu-xing-tu-bg: rgba(168,129,63,0.12);
  --wu-xing-jin-bg: rgba(85,80,74,0.12);
  --wu-xing-shui-bg: rgba(58,106,138,0.12);
  --shadow: 0 2px 12px rgba(0,0,0,0.12);
}

:root {
  --bg-primary: #0f0f14;
  --bg-secondary: #1a1a24;
  --bg-card: #22222f;
  --bg-hover: #2a2a3a;
  --text-primary: #f0ece6;
  --text-secondary: #c8c4bc;
  --text-muted: #9a9690;
  --accent-gold: #c9a96e;
  --accent-gold-dim: #8b7355;
  --accent-jade: #5a9f7c;
  --accent-red: #c45a4a;
  --border-color: #2a2a35;
  
  /* 金色點綴（全平台統一） */
  --gold-light: #f8e3ae;
  --gold: #d4af37;
  --gold-dark: #7a5c22;
  --gold-border: rgba(212,175,55,0.35);
  --gold-glow: rgba(212,175,55,0.14);
  
  /* 五行色 */
  --wu-xing-mu: #5a9f7c;     /* 木 = 綠 */
  --wu-xing-huo: #c45a4a;    /* 火 = 紅 */
  --wu-xing-tu: #c9a96e;     /* 土 = 黃/金 */
  --wu-xing-jin: #c8c4bc;    /* 金 = 白/銀 */
  --wu-xing-shui: #4a7a9f;   /* 水 = 藍 */
  
  /* 五行深色背景 */
  --wu-xing-mu-bg: rgba(90,159,124,0.12);
  --wu-xing-huo-bg: rgba(196,90,74,0.12);
  --wu-xing-tu-bg: rgba(201,169,110,0.12);
  --wu-xing-jin-bg: rgba(200,196,188,0.12);
  --wu-xing-shui-bg: rgba(74,122,159,0.12);
  --border-color: #2a2a3a;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --radius: 12px;
  --radius-sm: 8px;
}

/* ─── 五行元素通用類 ────────────────────────────── */
.wu-mu { color: var(--wu-xing-mu); }
.wu-huo { color: var(--wu-xing-huo); }
.wu-tu { color: var(--wu-xing-tu); }
.wu-jin { color: var(--wu-xing-jin); }
.wu-shui { color: var(--wu-xing-shui); }
.wu-mu-bg { background: var(--wu-xing-mu-bg); }
.wu-huo-bg { background: var(--wu-xing-huo-bg); }
.wu-tu-bg { background: var(--wu-xing-tu-bg); }
.wu-jin-bg { background: var(--wu-xing-jin-bg); }
.wu-shui-bg { background: var(--wu-xing-shui-bg); }

/* ─── 全局重置 ────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── 布局 ──────────────────────────────────────────────── */

.app-container {
  display: flex;
  min-height: 100vh;
}

/* ─── 侧边栏 ────────────────────────────────────────────── */

.sidebar {
  width: 220px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 16px 0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ─── 侧边栏主题切换 ────────────────────────────── */
.sidebar-theme-toggle {
  margin: 8px 12px 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar-theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.theme-btn.active {
  background: var(--accent-gold);
  color: #0f0f14;
  border-color: var(--accent-gold);
  font-weight: 600;
}
.lang-sel-btn.active {
  background: var(--accent-gold);
  color: #0f0f14;
  border-color: var(--accent-gold);
  font-weight: 600;
}

.sidebar-logo {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.sidebar-logo h1 { font-size: 17px; font-weight: 700; color: var(--accent-gold); }
.sidebar-logo .subtitle { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; margin-top: 2px; }

.sidebar-nav { list-style: none; flex: 1; display: flex; flex-direction: column; }

.sidebar-nav li {
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-nav li:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-left-color: var(--wu-xing-shui);
}

.sidebar-nav li.active {
  background: var(--wu-xing-tu-bg);
  color: var(--wu-xing-tu);
  border-left-color: var(--wu-xing-huo);
}

.sidebar-nav li .icon { font-size: 15px; width: 20px; text-align: center; }

/* Sidebar 编辑模式 (自訂排序) */
.nav-move-btns { display: none; margin-left: auto; gap: 4px; flex-shrink: 0; }
.nav-move-btns button {
  background: none; border: 1px solid var(--wu-xing-tu);
  color: var(--wu-xing-tu); font-size: 11px; padding: 2px 6px;
  border-radius: 4px; cursor: pointer; line-height: 1;
  transition: all 0.15s;
}
.nav-move-btns button:hover { background: var(--wu-xing-tu-bg); }
.edit-mode li .nav-move-btns { display: flex; }
.edit-mode li { cursor: grab; }
.edit-mode li:active { cursor: grabbing; }
.sidebar-edit-btn {
  padding: 12px 20px; cursor: pointer; color: var(--wu-xing-mu);
  font-size: 13px; border-top: 1px solid var(--border-color);
  transition: all 0.2s; display: flex; align-items: center; gap: 12px;
}
.sidebar-edit-btn:hover { background: var(--wu-xing-mu-bg); }
.sidebar-edit-btn.editing { background: var(--wu-xing-tu-bg); color: var(--wu-xing-tu); font-weight: 600; }
/* ─── 主内容 ────────────────────────────────────────────── */

.main-content {
  flex: 1;
  padding: 20px;
  max-width: 100%;
  overflow-x: hidden;
}

.page-section { display: none; }
.page-section.active { display: block; }

/* ─── 欢迎页 ────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 48px 20px 32px;
}

.hero h1 {
  font-size: 2.2em;
  color: var(--accent-gold);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.hero p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.quick-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.quick-action-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.quick-action-card .icon { font-size: 30px; margin-bottom: 8px; display: block; }
.quick-action-card h3 { font-size: 14px; margin-bottom: 6px; font-weight: 600; }
.quick-action-card p { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* ─── 表单 ──────────────────────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}

/* iOS Safari date/time input 修復：原生 date input 喺 iPhone 顯示黑底+紅字高亮
   加 color-scheme + 自訂文字色/日曆圖示，令 dark mode 下同其他 input 一致 */
.form-group input[type="date"],
.form-group input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
  min-height: 38px;
}
.form-group input[type="date"]::-webkit-date-and-time-value {
  color: var(--text-primary);
  text-align: left;
  -webkit-text-fill-color: var(--text-primary);
}
.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.72) sepia(0.3) saturate(1.2);
  opacity: 0.9;
  cursor: pointer;
}
.form-group input[type="date"]:not(:valid)::-webkit-date-and-time-value {
  color: var(--text-secondary);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ─── 按钮 ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--wu-xing-tu), #b89450);
  color: #0f0f14;
}
.btn-primary:hover { background: var(--accent-gold-dim); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger {
  background: var(--wu-xing-huo-bg);
  color: var(--wu-xing-huo);
  border: 1px solid rgba(196,90,74,0.3);
}

.btn-sm { padding: 5px 12px; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; }

/* ─── 卡片 ──────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  width: 100%;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}

.card:hover {
  border-color: rgba(212,175,55,.6);
  box-shadow: 0 2px 18px var(--gold-glow);
}

/* 風水小物卡（jn-card inline 樣式強化 hover 光暈） */
.jn-card:hover {
  border-color: rgba(212,175,55,.65) !important;
  box-shadow: 0 3px 20px var(--gold-glow);
  transform: translateY(-2px);
}

.card-title {
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: .4px;
}

/* ─── 八字结果显示 ───────────────────────────────────────── */

.bazi-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.pillar-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}

.pillar-card .label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pillar-card .chars {
  font-size: 24px;
  font-weight: 700;
  color: var(--wu-xing-tu);
  letter-spacing: 2px;
}

.pillar-card .sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.3;
}

/* ─── 五行柱状图 ──────────────────────────────────────────── */

.element-bars {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 100px;
  padding: 0 4px;
}

.element-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.element-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}

.element-bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.element-bar-value {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

/* ─── 九宫飞星 ──────────────────────────────────────────── */

.flying-stars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 100%;
  margin: 12px auto;
}

.flying-stars-grid .cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
  min-height: 90px;
}

.flying-star-cell {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  text-align: center;
  transition: all 0.2s;
  min-height: 100px;
  font-size: var(--fs-caption-size, 11px); /* 盤內文字跟字幕大小（em 基準） */
}

.flying-star-cell .direction {
  font-size: 1.18em;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
  font-weight: 500;
}

.flying-star-cell .star-number {
  font-size: 2.55em;
  font-weight: 800;
  line-height: 1.1;
}

.flying-star-cell .star-name {
  font-size: 1.18em;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: 1px;
  font-weight: 500;
}

.flying-star-cell .fortune-label {
  font-size: 1em;
  padding: 2px 10px;
  border-radius: 8px;
  margin-top: 3px;
  line-height: 1.4;
  font-weight: 600;
}

.flying-star-cell.fortune-good {
  border-color: rgba(90, 159, 124, 0.3);
  background: rgba(90, 159, 124, 0.08);
}
.flying-star-cell.fortune-good .star-number { color: var(--accent-jade); }

.flying-star-cell.fortune-bad {
  border-color: rgba(196, 90, 74, 0.3);
  background: rgba(196, 90, 74, 0.08);
}
.flying-star-cell.fortune-bad .star-number { color: var(--accent-red); }

.flying-star-cell.fortune-great {
  border-color: rgba(201, 169, 110, 0.4);
  background: rgba(201, 169, 110, 0.12);
}
.flying-star-cell.fortune-great .star-number { color: var(--accent-gold); }

.flying-star-cell.center-cell {
  border-width: 2px;
  border-color: var(--accent-gold);
}

/* ─── 仪表盘 ──────────────────────────────────────────── */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.dash-header-left h3 {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.dash-meta { font-size: 13px; color: var(--text-muted); }

.dash-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.dash-badge.completed { background: var(--wu-xing-mu-bg); color: var(--wu-xing-mu); }
.dash-badge.ongoing { background: var(--wu-xing-tu-bg); color: var(--wu-xing-tu); }
.dash-badge.planning { background: var(--wu-xing-shui-bg); color: var(--wu-xing-shui); }

.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dash-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}

.dash-stat-icon {
  font-size: 28px;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  flex-shrink: 0;
}

.dash-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-stat-lbl {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dash-stat-sub {
  font-size: 11px;
  margin-top: 2px;
}
.dash-stat-sub.over { color: var(--wu-xing-huo); }
.dash-stat-sub.ok { color: var(--wu-xing-mu); }

.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.dash-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--wu-xing-tu);
  margin-bottom: 14px;
}

.budget-track {
  width: 100%;
}

.budget-track-bar {
  height: 16px;
  background: var(--bg-primary);
  border-radius: 10px;
  overflow: hidden;
}

.budget-track-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wu-xing-mu), var(--wu-xing-tu));
  border-radius: 10px;
  transition: width 0.5s ease;
}

.budget-track-fill.over {
  background: linear-gradient(90deg, var(--wu-xing-tu), var(--wu-xing-huo));
}

.budget-track-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── 颜色推荐色块 ────────────────────────────────────────── */

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s;
}

.color-swatch:hover { transform: scale(1.15); }

.color-swatch.avoid {
  opacity: 0.4;
  border-color: var(--accent-red);
}
.color-swatch.avoid::after {
  content: '✕';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--accent-red);
  font-size: 18px;
  font-weight: bold;
}

/* ─── 装修建议列表 ────────────────────────────────────────── */

.advice-list { list-style: none; }

.advice-item {
  padding: 10px 14px;
  border-left: 3px solid var(--border-color);
  margin-bottom: 6px;
  background: var(--bg-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  line-height: 1.5;
}

.advice-item.priority-high { border-left-color: var(--accent-red); }
.advice-item.priority-critical { border-left-color: #ff4444; background: rgba(255,68,68,0.05); }
.advice-item.priority-medium { border-left-color: var(--accent-gold); }
.advice-item.priority-low { border-left-color: var(--accent-jade); }

.advice-item .advice-icon { margin-right: 8px; }

/* ─── 市集卡片 ────────────────────────────────────────────── */

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.2s;
}

.task-card:hover { border-color: var(--accent-gold-dim); }

.task-card .task-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.task-card .task-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.task-card .task-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(201,169,110,0.15);
  color: var(--accent-gold);
}

.task-card .task-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card .task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── 记录页增强卡片（查看分析/删除记录） ─────────────── */
.record-card {
  display: flex;
  gap: 14px;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all 0.2s;
  cursor: pointer;
}
.record-card:hover { border-color: var(--accent-gold-dim); box-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.record-main { flex: 1; min-width: 0; }
.record-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.record-name .record-type-icon {
  font-size: 15px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(201,169,110,0.15);
  border: 1px solid var(--accent-gold-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.record-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.record-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  flex-shrink: 0;
}
.record-actions .btn { white-space: nowrap; min-width: 96px; justify-content: center; }
.btn-edit {
  background: rgba(201,169,110,0.15);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-dim);
}
.btn-edit:hover { background: rgba(201,169,110,0.28); }

/* ─── 仪表盘 ────────────────────────────────────────────── */

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-gold);
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.stat-card .stat-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── 进度条 ────────────────────────────────────────────── */

.progress-bar {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-jade), var(--accent-gold));
  transition: width 0.5s ease;
}

.progress-bar-fill.over-budget {
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-red));
}

.budget-category {
  margin-bottom: 12px;
}

.budget-category-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.budget-category .cat-name { color: var(--text-primary); }
.budget-category .cat-amount { color: var(--text-secondary); }
.budget-category .cat-over { color: var(--accent-red); }

/* ─── 里程碑 ────────────────────────────────────────────── */

.milestone-list { list-style: none; }

.milestone-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.milestone-item:last-child { border-bottom: none; }

.milestone-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.milestone-checkbox.done {
  border-color: var(--accent-jade);
  background: var(--accent-jade);
  color: white;
}

.milestone-checkbox.done::after {
  content: '✓';
  font-size: 12px;
  font-weight: bold;
}

.milestone-name {
  flex: 1;
  font-size: 13px;
}

.milestone-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── 模式切换 ──────────────────────────────────────────── */

.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.tab-btn {
  padding: 7px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-gold);
}

/* ─── 空状态 ────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
}

.empty-state .icon { font-size: 40px; margin-bottom: 8px; display: block; }
.empty-state h3 { font-size: 15px; margin-bottom: 6px; color: var(--text-secondary); font-weight: 600; }
.empty-state p { font-size: 12px; color: var(--text-muted); }

/* ─── 工具提示 ────────────────────────────────────────────── */

.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border: 1px solid var(--border-color);
}

.tooltip:hover::after { opacity: 1; }

/* ─── 响应式 ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 14px; }
  .bazi-pillars { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.6em; }
  .flying-stars-grid { max-width: 280px; }
  .quick-actions { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
  
  /* Mobile bottom nav */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 5px 1px;
    z-index: 100;
  }
  
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    padding: 3px 1px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 8.5px;
    border-radius: 6px;
    transition: all 0.2s;
    min-width: 0;
    white-space: nowrap;
  }
  
  .mobile-nav-item .icon { font-size: 16px; line-height: 1.2; }
  .mobile-nav-item.active { color: var(--accent-gold); background: rgba(201,169,110,0.1); }
  .main-content { padding-bottom: 72px; }

  /* Mobile 排序 bottom sheet */
  .mobile-sheet { display: none; }
  .mobile-sheet.open {
    display: flex; flex-direction: column;
    position: fixed; bottom: 60px; left: 8px; right: 8px;
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: 14px; z-index: 200; max-height: 60vh; overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0,0,0,.5);
  }
  .mobile-sheet-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--border-color);
    color: var(--accent-gold); font-weight: 600; font-size: 14px;
    position: sticky; top: 0; background: var(--bg-secondary);
  }
  .mobile-sheet-header button {
    background: var(--wu-xing-tu-bg); color: var(--wu-xing-tu);
    border: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px;
  }
  .mobile-sheet-list { list-style: none; padding: 4px 0; }
  .mobile-sheet-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 16px; color: var(--text-primary); font-size: 14px;
    border-bottom: 1px solid var(--border-color); opacity: 0.95;
  }
  .sheet-name { flex: 1; }
  .sheet-btns { display: flex; gap: 6px; }
  .sheet-btns button {
    background: none; border: 1px solid var(--wu-xing-tu); color: var(--wu-xing-tu);
    font-size: 11px; padding: 3px 9px; border-radius: 5px; cursor: pointer; line-height: 1;
  }
  .sheet-btns button:hover { background: var(--wu-xing-tu-bg); }
}

/* 預算金額編輯 */
.dash-amt-edit { cursor: pointer; }
.dash-amt-edit:hover .dash-edit-btn { opacity: 1; }
.dash-edit-btn { cursor: pointer; opacity: 0.5; font-size: 11px; margin-left: 5px; vertical-align: 1px; transition: opacity .15s; user-select: none; display: inline-block; }
.dash-edit-btn:hover { opacity: 1; }
.dash-hero-label .dash-edit-btn { font-size: 13px; margin-left: 8px; }

@media (min-width: 769px) {
  .mobile-nav { display: none; }
}

/* ─── 信息提示横幅 ──────────────────────────────────────── */

.info-banner {
  background: rgba(201,169,110,0.08);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.6;
}

.info-banner .info-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--accent-gold);
  font-size: 13px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

/* ─── 滚动条 ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Layout grid for advice ─────────────────────────── */

.advice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.advice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
}

.advice-card h4 {
  font-size: 13px;
  color: var(--accent-gold);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

/* ─── 产品设计卡片 ─────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.product-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: all 0.2s;
}

.product-card:hover {
  border-color: var(--accent-gold-dim);
}

.product-card h5 {
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.product-card p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── 风格推荐展示 ──────────────────────────────────────── */

.style-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: rgba(201,169,110,0.15);
  color: var(--accent-gold);
  margin-bottom: 12px;
}

/* Section heading */
.section-title {
  font-size: 18px;
  color: var(--gold);
  text-shadow: 0 0 14px var(--gold-glow);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gold-border);
  letter-spacing: 0.5px;
}

.section-desc {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

/* 品牌標題金色（全平台） */
h1 {
  color: var(--gold);
  text-shadow: 0 0 16px var(--gold-glow);
}

/* ═══════════════════════════════════════════════════════════
   項目儀錶盤 — 網頁版 (2026-08-03 editorial redesign)
   一頁式敘事：題頭 → 聚寶盆 → 五行支出榜 → 工程進度長卷
   ═══════════════════════════════════════════════════════════ */

#page-dashboard.active {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 48px;
}

/* ── 題頭 ────────────────────────────────────────────── */
.dash-masthead {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash-seal {
  width: 42px; height: 42px;
  background: linear-gradient(145deg, #c45a4a, #9c3d30);
  color: #fff;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; letter-spacing: 1px;
  transform: rotate(-2deg);
  box-shadow: 0 3px 12px rgba(196, 90, 74, 0.35);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}
.dash-masthead-titles { flex: 1; min-width: 200px; }
.dash-masthead-titles h2 {
  font-size: 22px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--text-primary); margin: 0; line-height: 1.3;
}
.dash-masthead-titles p {
  font-size: 11px; color: var(--text-muted); letter-spacing: 1.5px;
  margin: 2px 0 0;
}
.dash-tabs {
  margin-bottom: 0;
  margin-left: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 3px;
}
.dash-tabs .tab-btn {
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 9px;
}
.dash-tabs .tab-btn.active {
  background: linear-gradient(145deg, rgba(201,169,110,0.22), rgba(201,169,110,0.10));
  color: var(--accent-gold);
  box-shadow: 0 1px 6px rgba(0,0,0,0.25);
}

/* ── 通用卡片 ─────────────────────────────────────────── */
.dash-card {
  background: var(--bg-card);
  border: 1px solid rgba(201,169,110,0.18);
  border-radius: 20px;
  padding: 24px 26px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.dash-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(201,169,110,0.10);
}
.dash-seal-small {
  width: 26px; height: 26px;
  background: linear-gradient(145deg, #c45a4a, #a84537);
  color: #fff; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.dash-card-title {
  font-size: 13px; font-weight: 600; color: var(--accent-gold);
  letter-spacing: 2.5px;
}
.dash-card-note {
  margin-left: auto; font-size: 10px; color: var(--text-muted);
  letter-spacing: 1px;
}
.dash-ornament {
  font-size: 10px; color: var(--accent-gold); letter-spacing: 2px; opacity: 0.7;
}

/* ── 壹·聚寶盆 HERO ───────────────────────────────────── */
.dash-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #1a1625 0%, #2a1f3a 45%, #1f1a2e 100%);
  border: 1px solid rgba(201,169,110,0.22);
  border-radius: 28px;
  padding: 34px 34px 26px;
  margin-bottom: 18px;
}
.dash-hero-topline {
  position: absolute; top: 0; left: 24px; right: 24px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, #c9a96e, #c45a4a, #c9a96e, transparent);
}
.dash-hero-bagua {
  position: absolute; top: 12px; right: 18px;
  font-size: 26px; opacity: 0.28;
}
.dash-hero-clouds {
  position: absolute; bottom: 8px; left: 14px;
  font-size: 18px; opacity: 0.12; letter-spacing: 5px;
}
.dash-hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 28px;
  align-items: center;
  position: relative;
}
.dash-proj-line { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.dash-proj-icon {
  width: 46px; height: 46px; flex-shrink: 0;
  background: linear-gradient(145deg, rgba(201,169,110,0.18), rgba(196,90,74,0.14));
  border: 1px solid rgba(201,169,110,0.3);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.dash-proj-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.dash-proj-meta { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; letter-spacing: 0.5px; }
.dash-hero-label {
  font-size: 10.5px; color: var(--text-muted); letter-spacing: 3px; margin-bottom: 6px;
}
.dash-hero-num {
  font-size: 46px; font-weight: 900; letter-spacing: 1.5px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 40px rgba(201,169,110,0.22);
}
.dash-hero-status { font-size: 11px; margin-top: 8px; letter-spacing: 1px; }
.dash-hero-right { text-align: center; }
.dash-ring-wrap { display: inline-block; position: relative; }
.dash-ring-label {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text-muted); letter-spacing: 2px; white-space: nowrap;
}
.dash-stats {
  display: flex; margin-top: 22px;
  border-top: 1px solid rgba(201,169,110,0.12);
  padding-top: 14px;
}
.dash-stats-item { flex: 1; text-align: center; }
.dash-stats-item + .dash-stats-item {
  border-left: 1px solid rgba(201,169,110,0.10);
}
.dash-stats-val {
  font-size: 17px; font-weight: 700; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.dash-stats-lbl { font-size: 9.5px; color: var(--text-muted); letter-spacing: 1.5px; margin-top: 2px; }

/* ── 行動提示 ─────────────────────────────────────────── */
.dash-action {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(150deg, rgba(196,90,74,0.10), rgba(196,90,74,0.03));
  border: 1px solid rgba(196,90,74,0.22);
}
.dash-action-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.dash-action-title b { color: var(--accent-gold); }
.dash-action-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; letter-spacing: 0.5px; }
.dash-action-sub b { color: var(--accent-red); }

/* ── 貳·五行支出榜 ────────────────────────────────────── */
.dash-cat-list { display: flex; flex-direction: column; }
.dash-cat-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
  transition: background 0.2s ease;
}
.dash-cat-row + .dash-cat-row { border-top: 1px solid rgba(201,169,110,0.06); }
.dash-cat-row:hover { background: rgba(201,169,110,0.05); }
.dash-cat-rank {
  width: 22px; flex-shrink: 0; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.dash-cat-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 6px rgba(255,255,255,0.1);
}
.dash-cat-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  border: 1px solid rgba(201,169,110,0.12);
}
.dash-cat-info { flex: 1; min-width: 0; }
.dash-cat-name-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dash-cat-name { font-size: 12.5px; font-weight: 500; color: var(--text-primary); }
.dash-cat-amt { font-size: 12px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dash-cat-bar {
  height: 4px; background: rgba(255,255,255,0.05);
  border-radius: 3px; margin-top: 5px; overflow: hidden;
}
.dash-cat-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.dash-cat-meta {
  display: flex; justify-content: space-between;
  font-size: 9.5px; color: var(--text-muted); margin-top: 3px; letter-spacing: 0.5px;
}

/* ── 叁·工程進度長卷 ──────────────────────────────────── */
.dash-progress-band { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.dash-progress-track {
  flex: 1; height: 12px; background: rgba(255,255,255,0.04);
  border-radius: 8px; overflow: hidden; position: relative;
}
.dash-progress-fill {
  height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, #c9a96e, #c45a4a);
  box-shadow: 0 0 12px rgba(201,169,110,0.2);
  transition: width 0.6s ease;
}
.dash-progress-pct {
  min-width: 56px; text-align: center;
  font-size: 24px; font-weight: 800; color: var(--accent-gold);
  font-variant-numeric: tabular-nums;
}
.dash-progress-sub { font-size: 9.5px; color: var(--text-muted); letter-spacing: 1px; margin-top: 1px; }
.dash-timeline { position: relative; padding-left: 4px; }
.dash-timeline::before {
  content: '';
  position: absolute; left: 20px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(to bottom, rgba(201,169,110,0.35), rgba(201,169,110,0.08));
  border-radius: 2px;
}
.dash-milestone {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 9px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.dash-milestone:hover { background: rgba(201,169,110,0.05); }
.dash-mdot {
  position: relative; z-index: 1;
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.dash-mdot.done {
  background: linear-gradient(135deg, #c9a96e, #c45a4a);
  color: #fff;
  box-shadow: 0 0 12px rgba(201,169,110,0.25);
}
.dash-mdot.pending {
  border: 2px solid rgba(201,169,110,0.22);
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.18);
}
.dash-milestone-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.dash-milestone-name.done {
  color: rgba(255,255,255,0.45);
  text-decoration: line-through;
  font-weight: 400;
}
.dash-pill {
  padding: 3px 12px; border-radius: 14px;
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.5px; white-space: nowrap;
}
.dash-pill.done {
  background: rgba(201,169,110,0.14); color: var(--accent-gold);
  border: 1px solid rgba(201,169,110,0.16);
}
.dash-pill.pending {
  background: rgba(255,255,255,0.03); color: var(--text-muted);
  border: 1px solid transparent;
}

/* ── 預算明細 Tab ─────────────────────────────────────── */
.dash-budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.dash-cat-card {
  background: var(--bg-card);
  border: 1px solid rgba(201,169,110,0.18);
  border-radius: 18px;
  padding: 18px 20px;
  position: relative; overflow: hidden;
}
.dash-cat-card .dash-cat-name { font-size: 13.5px; font-weight: 600; }
.dash-cat-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.dash-cat-card-icon {
  width: 36px; height: 36px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.dash-cat-card-amt { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dash-total {
  grid-column: 1 / -1;
  background: linear-gradient(160deg, #1a1625, #2a1f3a);
  border: 1px solid rgba(201,169,110,0.22);
  border-radius: 18px;
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── 里程碑 Tab ───────────────────────────────────────── */
.dash-mile-head {
  background: var(--bg-card);
  border: 1px solid rgba(201,169,110,0.18);
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 14px;
  position: relative; overflow: hidden;
}

/* ── 響應式：桌面雙欄 → 手機單欄 ─────────────────────── */
@media (max-width: 860px) {
  .dash-hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .dash-hero-right { text-align: left; }
  .dash-ring-wrap { display: block; text-align: center; }
  .dash-hero { padding: 26px 22px 22px; }
  .dash-masthead-titles h2 { font-size: 19px; }
  .dash-card { padding: 20px 18px; }
  .dash-tabs { margin-left: 0; width: 100%; justify-content: stretch; }
  .dash-tabs .tab-btn { flex: 1; padding: 7px 4px; }
}

/* ── 屋苑 Estate 输入 ──────────────────────────────────── */
.estate-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--wu-xing-tu-bg);
  color: var(--wu-xing-tu);
  vertical-align: middle;
  margin-left: 4px;
}
.estate-info {
  margin-top: 7px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  background: var(--wu-xing-mu-bg);
  border: 1px solid rgba(63,125,95,0.25);
}
.estate-info b { color: var(--wu-xing-mu); }

/* ── 字幕設定（Captions）──────────────────────────── */
:root {
  --fs-caption-size: 11px;   /* 字幕大小（設定頁可調） */
  --fs-caption-offset: 0px;  /* 字幕Y軸位移（設定頁可調，±8px） */
}
/* 飛星盤 / 玄空盤 上方字幕通用樣式 */
.fs-caption {
  font-size: var(--fs-caption-size, 11px);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
  transform: translateY(var(--fs-caption-offset, 0px));
  line-height: 1.5;
}
/* 盤內圖例（box 內底部文字，如「大門在『東北』方」）— 跟字幕大小 + Y軸設定 */
.fs-legend {
  font-size: var(--fs-caption-size, 11px);
  color: var(--text-muted);
  transform: translateY(var(--fs-caption-offset, 0px));
  line-height: 1.5;
}
/* 設定頁：字幕設定卡 */
.caption-setting { margin-bottom: 14px; }
.caption-setting-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.caption-setting-label { font-size: 13px; color: var(--text-primary); }
.caption-setting-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  font-variant-numeric: tabular-nums;
}
.caption-range { width: 100%; accent-color: var(--accent-gold); }
/* 即時預覽：字幕 + 迷你飛星盤 */
.fs-caption-preview {
  border: 1px dashed rgba(201, 169, 110, 0.35);
  border-radius: 12px;
  padding: 10px 10px 12px;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, 0.15);
}
.fs-caption-demo { margin-bottom: 8px; }
.fs-caption-demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.fs-cd-cell {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px;
  text-align: center;
  font-size: var(--fs-caption-size, 12px);
  color: var(--text-secondary);
  padding: 4px 0;
}
