/* ============================================================
   紫微斗数 · PC 前端 主题样式（亮色系）
   设计令牌依据《统一系统功能说明》19 章
   ============================================================ */
:root {
  --c-finance: #3A6EA5;
  --c-ziwei: #6A4FA3;
  --c-accent: #B8860B;
  --c-accent-2: #C9A227;
  --c-gold: #8B6D00;
  --c-bg-dark: #F2F4F8;
  --c-bg-light: #FFFFFF;
  --c-text-1: #1F2937;
  --c-text-2: #5A6472;
  --c-text-light: #1F2937;
  --c-text-dim: rgba(31, 41, 55, 0.55);
  --c-success: #2E7D32;
  --c-danger: #C62828;
  --c-warning: #F9A825;
  --c-info: #1565C0;
  --c-card: #FFFFFF;
  --c-card-strong: #FDF6E3;
  --c-line: rgba(184, 134, 11, 0.3);
  --c-line-soft: rgba(31, 41, 55, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(31, 41, 55, 0.08);
  --font-cn: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --gold-grad: linear-gradient(135deg, #D4AF37, #B8860B);
  --bg-page: radial-gradient(1200px 600px at 15% -5%, rgba(212, 175, 55, 0.10), transparent 60%),
             radial-gradient(1000px 500px at 90% 0%, rgba(58, 110, 165, 0.08), transparent 55%),
             linear-gradient(180deg, #F6F7FB 0%, #EDF0F5 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-cn);
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text-light);
  background: var(--bg-page);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(184, 134, 11, 0.35); border-radius: 6px; }
::-webkit-scrollbar-track { background: rgba(31, 41, 55, 0.04); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line-soft);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(201, 162, 39, 0.3);
}
.brand-name { font-size: 18px; font-weight: 600; letter-spacing: 2px; }
.brand-sub { font-size: 12px; color: var(--c-text-dim); letter-spacing: 1px; }
.domain-switch { display: flex; gap: 4px; background: rgba(31, 41, 55, 0.06); border-radius: 999px; padding: 3px; }
.domain-switch a {
  padding: 5px 18px; border-radius: 999px; font-size: 13px;
  color: var(--c-text-dim); transition: all 0.2s;
}
.domain-switch a.active {
  background: var(--gold-grad); color: #1A1A1A; font-weight: 600;
  box-shadow: 0 2px 10px rgba(201, 162, 39, 0.3);
}
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  padding: 8px 18px; border-radius: 999px; font-size: 14px;
  color: var(--c-text-dim); transition: all 0.2s;
}
.topnav a:hover { color: var(--c-text-light); }
.topnav a.active {
  color: #1A1A1A; background: var(--gold-grad); font-weight: 500;
  box-shadow: 0 2px 10px rgba(201, 162, 39, 0.3);
}
.topbar-user { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-card-strong); border: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #8B6D00;
}
.btn-login, .btn-user {
  border: 1px solid var(--c-line); color: var(--c-text-light);
  background: transparent; padding: 6px 16px; border-radius: 999px; font-size: 13px;
  transition: all 0.2s;
}
.btn-login:hover { border-color: var(--c-accent); color: var(--c-accent); }
.btn-user { border-color: var(--c-line-soft); }

/* ---------- 布局 ---------- */
.app-main {
  max-width: 1440px; margin: 0 auto; padding: 32px 24px 48px;
  min-height: calc(100vh - 64px - 64px);
}
.app-footer {
  text-align: center; padding: 24px; font-size: 12px;
  color: rgba(31, 41, 55, 0.45); border-top: 1px solid var(--c-line-soft);
  line-height: 1.9;
}
.app-footer a {
  color: inherit; text-decoration: none;
}
.app-footer a:hover { color: var(--c-primary, #4263eb); }
.page { animation: pageIn 0.28s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 28px; font-weight: 600; margin-bottom: 8px; letter-spacing: 1px; }
.page-sub { color: var(--c-text-dim); font-size: 14px; margin-bottom: 32px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-line-soft);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card.hover:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31, 41, 55, 0.1); }
.card-grad {
  background: linear-gradient(135deg, #FDF6E3, #F5EDD6);
  border: 1px solid var(--c-line);
}
.card-title { font-size: 18px; font-weight: 500; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.card-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--gold-grad);
}
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; padding: 10px 26px;
  font-size: 14px; font-weight: 500; transition: all 0.2s; line-height: 1.4;
}
.btn-primary { background: var(--gold-grad); color: #1A1A1A; box-shadow: 0 2px 12px rgba(184, 134, 11, 0.25); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--c-text-light);
  border: 1px solid var(--c-line);
}
.btn-ghost:hover { border-color: var(--c-accent); color: var(--c-accent); }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-danger { background: rgba(198, 40, 40, 0.08); color: #C62828; border: 1px solid rgba(198, 40, 40, 0.3); }
.btn-danger:hover { background: rgba(198, 40, 40, 0.14); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 20px; }
.field-label { display: block; font-size: 13px; color: var(--c-text-dim); margin-bottom: 8px; letter-spacing: 1px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 1px solid rgba(31, 41, 55, 0.14);
  color: var(--c-text-light); font-size: 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.12); }
textarea.input { resize: vertical; min-height: 90px; }
select.input option { background: #FFFFFF; color: var(--c-text-light); }
.input::placeholder { color: rgba(31, 41, 55, 0.3); }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.seg {
  display: inline-flex; background: rgba(31, 41, 55, 0.06);
  border-radius: 999px; padding: 3px; border: 1px solid var(--c-line-soft);
}
.seg button {
  border: none; background: transparent; color: var(--c-text-dim);
  padding: 7px 20px; border-radius: 999px; font-size: 14px; transition: all 0.2s;
}
.seg button.active { background: var(--gold-grad); color: #1A1A1A; font-weight: 500; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; line-height: 1.6;
}
.tag-gold { background: rgba(201, 162, 39, 0.12); color: #8B6D00; border: 1px solid rgba(201, 162, 39, 0.35); }
.tag-red { background: rgba(198, 40, 40, 0.08); color: #C62828; border: 1px solid rgba(198, 40, 40, 0.3); }
.tag-green { background: rgba(46, 125, 50, 0.1); color: #2E7D32; border: 1px solid rgba(46, 125, 50, 0.3); }
.tag-blue { background: rgba(21, 101, 192, 0.1); color: #1565C0; border: 1px solid rgba(21, 101, 192, 0.3); }
.tag-gray { background: rgba(31, 41, 55, 0.05); color: var(--c-text-dim); border: 1px solid var(--c-line-soft); }

/* ---------- 十二宫盘面 ---------- */
.board-wrap { display: flex; gap: 32px; align-items: flex-start; }
.board {
  flex: none; width: 780px;
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 134, 11, 0.12) 1px, transparent 1.4px),
    radial-gradient(circle at 70% 60%, rgba(184, 134, 11, 0.1) 1px, transparent 1.4px),
    radial-gradient(circle at 50% 85%, rgba(184, 134, 11, 0.08) 1px, transparent 1.4px),
    linear-gradient(160deg, #FDF8EC 0%, #F8F1DE 55%, #F4ECD6 100%);
  border: 1px solid #C9A227;
  border-radius: 18px;
  padding: 10px;
  background-size: 90px 90px, 130px 130px, 180px 180px, auto;
  box-shadow: 0 10px 36px rgba(31, 41, 55, 0.12), inset 0 0 60px rgba(201, 162, 39, 0.08);
}
.board-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 128px); gap: 8px; }
/* 中宫 2×2 合并：覆盖中央 4 格 */
.palace-mid {
  grid-column: 2 / span 2; grid-row: 2 / span 2;
  background: linear-gradient(160deg, #FFFDF6, #FBF3DC);
  border-color: rgba(201, 162, 39, 0.55);
  cursor: default;
  z-index: 2;
}
.palace-mid:hover { background: linear-gradient(160deg, #FFFDF6, #FBF3DC); border-color: rgba(201, 162, 39, 0.55); }
.palace {
  position: relative;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 6px 6px;
  display: flex; flex-direction: column;
  cursor: pointer; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
  animation: palaceIn 0.6s ease both;
}
@keyframes palaceIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
.palace:hover { border-color: rgba(184, 134, 11, 0.8); background: rgba(201, 162, 39, 0.08); }
.palace.selected {
  border-color: var(--c-accent); background: rgba(201, 162, 39, 0.12);
  transform: scale(1.02); box-shadow: 0 0 14px rgba(201, 162, 39, 0.25);
}
.palace-header { display: flex; justify-content: space-between; align-items: center; }
.palace-name {
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  color: var(--c-gold); letter-spacing: 3px; text-shadow: 0 0 8px rgba(201, 162, 39, 0.25);
}
.palace-zhi { font-size: 11px; color: var(--c-text-dim); }
.palace-stars { flex: 1; display: flex; flex-wrap: wrap; gap: 2px 6px; align-content: flex-start; margin-top: 6px; }
.star {
  font-size: 13px; line-height: 1.35; position: relative; display: inline-block;
  animation: starIn 0.5s ease both;
}
@keyframes starIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.star.major { font-weight: 600; }
.star.auspicious { color: var(--c-gold); }
.star.neutral { color: #4B5563; }
.star.sinister { color: #C62828; }
.star.minor { font-size: 11px; color: #6B7280; }
.star .mutagen {
  font-size: 10px; display: inline-block; transform: scale(0.85);
  border-radius: 4px; padding: 0 2px; line-height: 1.4; margin-left: 1px;
  vertical-align: 1px;
}
.mutagen-lu { color: #1A1A1A; background: #D4AF37; }
.mutagen-quan { color: #fff; background: var(--c-info); }
.mutagen-ke { color: #fff; background: var(--c-success); }
.mutagen-ji { color: #fff; background: var(--c-danger); }
.palace-bright { font-size: 10px; color: rgba(75, 85, 99, 0.75); }
.palace-dec { margin-top: 4px; font-size: 10px; color: var(--c-text-dim); border-top: 1px dashed rgba(31, 41, 55, 0.12); padding-top: 3px; }
.palace-body-flag {
  position: absolute; right: 6px; bottom: 6px;
  font-size: 10px; color: var(--c-gold); opacity: 0.85;
}

/* 盘面侧栏 */
.board-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.info-item { text-align: center; padding: 14px 8px; border-radius: var(--radius-sm); background: #FFFFFF; border: 1px solid var(--c-line-soft); box-shadow: var(--shadow); }
.info-item .k { font-size: 12px; color: var(--c-text-dim); margin-bottom: 4px; }
.info-item .v { font-size: 16px; font-weight: 600; }
.info-item .v.gold { color: var(--c-gold); font-family: var(--font-serif); letter-spacing: 2px; }
.info-item .v.mono { font-family: Consolas, monospace; letter-spacing: 1px; }

/* ---------- 数据表（库匹配 / 命盘数据） ---------- */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 8px 10px; text-align: left; vertical-align: middle;
  border-bottom: 1px dashed rgba(31, 41, 55, 0.1);
  color: var(--c-text-1); line-height: 1.5;
}
.data-table thead th {
  background: rgba(201, 162, 39, 0.1); color: #6B5600;
  font-size: 12px; font-weight: 600; letter-spacing: 1px; white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(201, 162, 39, 0.04); }
.data-table .mono { font-family: Consolas, monospace; font-variant-numeric: tabular-nums; }
.data-table .star { animation: none; }
.data-table td .tag { vertical-align: middle; }
.kv-table th {
  width: 110px; min-width: 110px; max-width: 110px;
  color: var(--c-text-dim); font-weight: 400; white-space: nowrap;
  background: rgba(255, 255, 255, 0.55);
}
.cmp-label { align-self: center; font-size: 12px; color: var(--c-text-dim); }
.match-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 12px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--c-line-soft); background: #FFF; color: var(--c-text-2);
}
.match-chip.ok { border-color: rgba(46, 125, 50, 0.3); background: rgba(46, 125, 50, 0.08); color: #2E7D32; }
.match-chip.diff { border-color: rgba(198, 40, 40, 0.28); background: rgba(198, 40, 40, 0.06); color: #B24A4A; }

/* 库内 AI 详细解读（数据库命中附带的详细解释） */
.topic-title { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.topic-table th.topic-name { width: 110px; min-width: 110px; max-width: 110px; font-weight: 600; color: var(--c-gold); background: rgba(255, 255, 255, 0.55); }
.topic-table td.topic-text { font-size: 13.5px; line-height: 1.95; color: rgba(31, 41, 55, 0.88); }
.topic-table td.topic-text b { color: var(--c-text-1); }

/* ---------------- 命盘完整精批（去重精简版） ---------------- */
.digest-sec { margin-bottom: 16px; }
.digest-h { font-size: 16px; font-weight: 800; color: var(--c-text-1); padding: 2px 0 2px 10px; margin: 12px 0 9px; border-left: 3px solid var(--c-gold, #C9A227); line-height: 1.5; }
.digest-sec:first-child .digest-h { margin-top: 2px; }
.digest-no { width: 22px; height: 22px; border-radius: 50%; flex: none; background: linear-gradient(135deg, #D9B23E, #B8860B); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(184, 134, 11, 0.35); }

/* 文案式要点行（仿大模型分节精批） */
.dg-sub { color: var(--c-gold, #B8860B); font-weight: 700; font-size: 13.5px; padding: 2px 0 6px; }
.dg-sub b { color: inherit; }
.dg-item { padding: 7px 12px 7px 14px; border-left: 2px solid rgba(201, 162, 39, 0.3); margin: 0 0 7px; font-size: 13.5px; line-height: 1.88; color: rgba(31, 41, 55, 0.9); background: rgba(201, 162, 39, 0.045); border-radius: 0 8px 8px 0; }
.dg-item b { color: var(--c-text-1); }
.dg-item .mut-tag { margin-right: 5px; vertical-align: 1px; }
.dg-decade { background: rgba(21, 101, 192, 0.06); border-left-color: rgba(21, 101, 192, 0.4); }
.dg-closing { background: rgba(46, 125, 50, 0.07); border-left-color: rgba(46, 125, 50, 0.45); font-weight: 600; color: rgba(21, 60, 30, 0.95); }
.pattern-item { margin: 0 0 8px; padding: 9px 12px; background: rgba(201, 162, 39, 0.07); border: 1px dashed rgba(201, 162, 39, 0.35); border-radius: 8px; font-size: 13.5px; line-height: 1.85; color: rgba(31, 41, 55, 0.9); }
.pattern-item b { color: var(--c-gold); margin-right: 6px; font-size: 12.5px; }
.pattern-star b { display: block; margin: 0 0 4px; font-size: 14px; }
.pattern-star { border-style: solid; border-color: rgba(201, 162, 39, 0.45); background: rgba(201, 162, 39, 0.09); }
.four-table td { font-size: 13px; line-height: 1.75; }
.mut-tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 600; color: #fff; }
.mut-lu { background: #2E7D32; }
.mut-quan { background: #1565C0; }
.mut-ke { background: #9C27B0; }
.mut-ji { background: #C62828; }
.palace-table th.palace-cell { width: 74px; min-width: 74px; color: var(--c-text-1); }
.palace-table td { font-size: 13px; line-height: 1.8; }
.palace-table td b { font-size: 13.5px; }
.palace-table .aux-note { font-size: 12px; color: var(--c-text-dim); margin-top: 2px; }
.trait-item { margin-bottom: 10px; }
.trait-k { display: inline-block; padding: 2px 10px; border-radius: 12px; background: rgba(201, 162, 39, 0.12); border: 1px solid rgba(201, 162, 39, 0.35); color: var(--c-gold); font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.trait-b { font-size: 13.5px; line-height: 1.9; color: rgba(31, 41, 55, 0.9); }
.trait-b b { color: var(--c-text-1); }
.aux-line { padding: 5px 10px; border-left: 3px solid rgba(201, 162, 39, 0.55); background: rgba(201, 162, 39, 0.05); border-radius: 0 6px 6px 0; font-size: 13px; line-height: 1.8; margin-bottom: 6px; }
.aux-line b { color: var(--c-text-1); }
.decade-box { padding: 10px 12px; border-radius: 8px; background: rgba(21, 101, 192, 0.06); border: 1px solid rgba(21, 101, 192, 0.2); font-size: 13.5px; line-height: 1.9; }
.raw-box { margin-top: 12px; }
.raw-box summary { cursor: pointer; font-size: 13px; color: var(--c-text-dim); user-select: none; padding: 4px 0; }
.raw-box summary:hover { color: var(--c-gold); }
.raw-box .topic-table { margin-top: 8px; }

/* ---------- 解读区块 ---------- */
.interp-section { margin-bottom: 20px; }
.interp-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.interp-title .no {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold-grad); color: #1A1A1A; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.interp-text { color: rgba(31, 41, 55, 0.85); font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.interp-card .interp-row { display: flex; gap: 20px; align-items: stretch; margin-top: 8px; }
.interp-card .interp-row .interp-text { flex: 1; min-width: 0; }
.interp-card .interp-row #btn-save { flex-shrink: 0; align-self: center; padding: 12px 28px; white-space: nowrap; }
.pattern-item { border-left: 3px solid var(--c-accent); padding: 12px 16px; margin-bottom: 12px; background: rgba(201, 162, 39, 0.07); border-radius: 0 10px 10px 0; }
.pattern-item .name { color: var(--c-gold); font-weight: 600; margin-bottom: 4px; }
.pattern-item .desc { color: rgba(31, 41, 55, 0.75); font-size: 13px; }

/* ---------- AI 深度报告（Markdown 渲染） ---------- */
.md-report { color: rgba(31, 41, 55, 0.85); font-size: 14px; line-height: 1.85; }
.md-report h1 { font-size: 19px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--c-line-soft); }
.md-report h2 { font-size: 16px; margin: 20px 0 8px; color: var(--c-gold); display: flex; align-items: center; gap: 8px; }
.md-report h2::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: var(--gold-grad); display: inline-block; flex-shrink: 0;
}
.md-report h3 { font-size: 15px; margin: 16px 0 6px; color: rgba(31, 41, 55, 0.95); }
.md-report h4 { font-size: 14px; margin: 12px 0 4px; }
.md-report p { margin: 6px 0; }
.md-report ul, .md-report ol { margin: 6px 0; padding-left: 22px; }
.md-report li { margin: 3px 0; }
.md-report strong { color: var(--c-gold); font-weight: 600; }
.md-report code { background: rgba(31, 41, 55, 0.06); border-radius: 4px; padding: 1px 5px; font-size: 13px; font-family: inherit; }
.md-report hr { border: none; border-top: 1px dashed var(--c-line-soft); margin: 14px 0; }

/* ---------- 列表 ---------- */
.list-item {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--c-card); border: 1px solid var(--c-line-soft);
  box-shadow: var(--shadow);
  margin-bottom: 14px; transition: all 0.2s; cursor: pointer;
}
.list-item:hover { transform: translateY(-2px); border-color: var(--c-line); box-shadow: 0 8px 24px rgba(31, 41, 55, 0.1); }
.list-item .main { flex: 1; min-width: 0; }
.list-item .name { font-size: 16px; font-weight: 600; }
.list-item .meta { font-size: 12px; color: var(--c-text-dim); margin-top: 4px; }
.list-item .pillars { font-family: var(--font-serif); font-size: 16px; color: var(--c-gold); letter-spacing: 2px; }
.list-item .actions { display: flex; gap: 8px; }

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--c-text-dim); }
.empty .icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.loading { text-align: center; padding: 60px 20px; color: var(--c-text-dim); }
.spinner {
  width: 30px; height: 30px; margin: 0 auto 12px;
  border: 3px solid rgba(184, 134, 11, 0.2); border-top-color: var(--c-accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 22px; border-radius: 999px; font-size: 13px;
  background: rgba(255, 255, 255, 0.97); border: 1px solid rgba(184, 134, 11, 0.35);
  color: var(--c-text-light); box-shadow: 0 6px 24px rgba(31, 41, 55, 0.12);
  animation: toastIn 0.25s ease both;
}
.toast.error { border-color: rgba(198, 40, 40, 0.6); }
.toast.success { border-color: rgba(46, 125, 50, 0.6); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 登录页 ---------- */
.auth-wrap { max-width: 420px; margin: 48px auto 0; }
.auth-tabs { display: flex; justify-content: center; gap: 32px; margin-bottom: 28px; }
.auth-tabs button { background: none; border: none; color: var(--c-text-dim); font-size: 16px; padding: 6px 4px; border-bottom: 2px solid transparent; }
.auth-tabs button.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.auth-tip { text-align: center; font-size: 12px; color: var(--c-text-dim); margin-top: 16px; }

/* ---------- 分享页 ---------- */
.share-head { text-align: center; margin-bottom: 28px; }
.share-head .name { font-size: 26px; font-weight: 600; font-family: var(--font-serif); letter-spacing: 4px; color: var(--c-gold); }
.share-head .meta { color: var(--c-text-dim); margin-top: 8px; }
.share-img-box { margin-top: 24px; text-align: center; }
.share-img-box img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--c-line); box-shadow: 0 10px 40px rgba(31, 41, 55, 0.15); }

/* ---------- AI 输出 ---------- */
.ai-chat { display: flex; flex-direction: column; gap: 16px; }
.ai-msg { max-width: 85%; padding: 14px 18px; border-radius: 14px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.ai-msg.user { align-self: flex-end; background: var(--gold-grad); color: #1A1A1A; border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: var(--c-card); border: 1px solid var(--c-line-soft); box-shadow: var(--shadow); border-bottom-left-radius: 4px; }
.ai-msg .src { display: block; font-size: 11px; color: var(--c-text-dim); margin-bottom: 4px; }
.ai-cursor::after { content: "▍"; color: var(--c-accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 运势 ---------- */
.decade-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); background: #FFFFFF; border: 1px solid var(--c-line-soft); box-shadow: var(--shadow); margin-bottom: 10px; }
.decade-row.current { border-color: var(--c-accent); background: rgba(201, 162, 39, 0.08); }
.decade-range { font-size: 12px; color: var(--c-text-dim); white-space: nowrap; }
.decade-palace { font-family: var(--font-serif); font-size: 15px; color: var(--c-gold); white-space: nowrap; }
.decade-ganzhi { font-size: 13px; white-space: nowrap; }
.decade-stars { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.decade-points { width: 100%; font-size: 12px; color: var(--c-text-dim); margin-top: 4px; }
.flow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.flow-card { padding: 16px; border-radius: var(--radius-sm); background: #FFFFFF; border: 1px solid var(--c-line-soft); box-shadow: var(--shadow); }
.flow-card .role { color: var(--c-gold); font-weight: 600; font-size: 13px; margin-bottom: 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .board { width: 640px; }
  .board-grid { grid-template-rows: repeat(4, 108px); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .board { width: 100%; }
  .board-wrap { flex-direction: column; }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar-inner { gap: 12px; padding: 0 16px; }
  .brand-sub { display: none; }
  .topnav a { padding: 6px 10px; font-size: 13px; }
  .input-row { grid-template-columns: 1fr; }
}
