:root {
  --bg: #F7F4EE;
  --bg-soft: #FFFFFF;
  --panel: rgba(255, 255, 255, .92);
  --panel-2: rgba(255, 255, 255, .85);
  --card: #FFFFFF;
  --line: #E0E0E0;
  --line-strong: rgba(198, 165, 107, .62);
  --text: #1C1822;
  --muted: #68636F;
  --primary: #6F4CC3;
  --blue: #6F4CC3;
  --cyan: #6F4CC3;
  --purple: #6F4CC3;
  --gold: #8a6d3b;
  --green: #1d7a52;
  --red: #c0392b;
  --orange: #8a6d3b;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --font-content: 16px;
  --font-note: 13px;
  --shadow: 0 2px 8px rgba(14, 11, 20, .06), 0 0 0 1px rgba(14, 11, 20, .04);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--font-content);
  background:
    radial-gradient(circle at 16% 10%, rgba(111, 76, 195, .08), transparent 28%),
    radial-gradient(circle at 88% 6%, rgba(198, 165, 107, .06), transparent 24%),
    radial-gradient(circle at 70% 90%, rgba(111, 76, 195, .06), transparent 30%),
    var(--bg);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { display: grid; grid-template-columns: 260px minmax(0,1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 22px 18px;
  background: linear-gradient(180deg, rgba(14,11,20,.98), rgba(36,20,58,.97));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand-block { display: flex; align-items: center; gap: 12px; padding: 8px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.brand-logo { width: 46px; height: 46px; object-fit: contain; border-radius: 50%; box-shadow: 0 0 28px rgba(57, 221, 255, .26); }
.brand-title { font-size: 22px; font-weight: 900; letter-spacing: .32em; }
.brand-subtitle { color: rgba(200,195,207,.6); font-size: 13px; letter-spacing: .18em; margin-top: 2px; }
.nav-group-title { color: rgba(200,195,207,.5); font-size: 13px; margin: 16px 12px 8px; letter-spacing: .14em; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px; border-radius: 12px; color: #C8C3CF; border: 1px solid transparent; transition: .18s; }
.nav-item:hover, .nav-item.active { background: linear-gradient(90deg, rgba(111,76,195,.25), rgba(111,76,195,.10)); border-color: #5a3da6; color: #fff; box-shadow: inset 0 0 22px rgba(111,76,195,.05); }
.nav-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; background: rgba(111,76,195,.14); color: var(--cyan); font-weight: 900; }
.sidebar-card { margin-top: 18px; display: flex; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.45); }
.sidebar-card span { display: block; color: rgba(200,195,207,.65); font-size: 13px; margin-top: 3px; }
.status-dot { width: 10px; height: 10px; border-radius: 99px; background: var(--green); box-shadow: 0 0 16px var(--green); flex: 0 0 auto; }
.main-panel { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 28px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.topbar b { display: block; font-size: 18px; }
.topbar span { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.top-actions a, .primary-btn, .ghost-btn, .danger-btn, .mini-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px; border-radius: 12px; border: 1px solid rgba(111,76,195,.35); background: linear-gradient(135deg, rgba(111,76,195,.92), rgba(111,76,195,.65)); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 12px 28px rgba(0,0,0,.18); }
.ghost-btn, .mini-btn { background: rgba(255,255,255,.48); color: #1C1822; box-shadow: none; }
.danger-btn { border-color: #c0392b; background: rgba(255,109,134,.15); color: #c0392b; }
.mini-btn { min-height: 32px; padding: 6px 10px; border-radius: 10px; font-size: 14px; }
.content-wrap { padding: 26px 28px 0; }
.footer { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; color: #68636F; font-size: 14px; padding: 28px 20px; }
.page-header, .panel, .hero-card, .form-card, .report-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.03); }
.page-header { display: flex; justify-content: space-between; gap: 22px; align-items: center; padding: 18px 26px; margin-bottom: 14px; }
.page-header h1 { margin: 0; font-size: clamp(28px, 3.2vw, 44px); line-height: 1.1; }
.page-header p { margin: 10px 0 0; color: var(--muted); line-height: 1.7; }
.header-badge { min-width: 120px; text-align: center; border: 1px solid rgba(111,76,195,.35); background: rgba(111,76,195,.12); color: #5a3da6; border-radius: 0; padding: 12px 18px; font-weight: 900; }
.badge-purple { background: rgba(111,76,195,.16); border-color: #5a3da6; }
.hero-card { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 26px; align-items: center; padding: 34px; overflow: hidden; }
.hero-card img { width: 260px; height: 260px; object-fit: contain; border-radius: 50%; filter: drop-shadow(0 22px 44px rgba(111,76,195,.23)); animation: logo-spin 1.2s ease-out; }
@keyframes pulse-btn { 0%, 100% { box-shadow: 0 0 32px rgba(111,76,195,.45); } 50% { box-shadow: 0 0 56px rgba(111,76,195,.75); } }
@keyframes logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.hero-card h1 { margin: 0; font-size: clamp(34px, 4vw, 62px); }
.hero-card h1 .char { display: inline-block; animation: pop-in .35s ease-out both; }
@keyframes pop-in { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
.eyebrow { margin: 0 0 10px; color: var(--cyan); letter-spacing: .08em; word-spacing: .06em; font-size: 16px; text-transform: uppercase; }
.hero-desc { color: #68636F; font-size: 20px; line-height: 1.8; max-width: 980px; }
.hero-tags, .tag-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.tag, .hero-tags span, .wf-tag { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; background: rgba(111,76,195,.10); border: 1px solid rgba(111,76,195,.25); color: #5a3da6; font-size: 13px; }
.module-strip, .quick-grid, .stat-grid, .dashboard-grid, .detail-grid, .two-col, .three-col, .four-col { display: grid; gap: 16px; }
.module-strip { grid-template-columns: repeat(4, minmax(0,1fr)); margin-top: 18px; }
.module-tile { min-height: 128px; padding: 18px 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); display: grid; gap: 10px; align-content: center; justify-items: center; text-align: center; transition: .18s; }
.module-tile:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.module-tile span, .tile-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(111,76,195,.45), rgba(111,76,195,.28)); color: #ffffff; font-weight: 900; font-size: 20px; border: 1px solid rgba(111,76,195,.5); box-shadow: 0 0 18px rgba(111,76,195,.35), 0 4px 16px rgba(0,0,0,.25); transition: .22s; }
.module-tile:hover span, .module-tile:hover .tile-icon { box-shadow: 0 0 28px rgba(111,76,195,.55), 0 6px 24px rgba(0,0,0,.35); border-color: #5a3da6; transform: scale(1.08); }
.module-tile b, .tile-body b { font-size: 15px; }
.module-tile small, .tile-body small { color: var(--muted); line-height: 1.55; }
.dashboard-grid { grid-template-columns: minmax(0, 1fr) 360px; margin-top: 18px; }
.detail-grid { grid-template-columns: 1.15fr .85fr; }
.two-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
.three-col { grid-template-columns: repeat(3, minmax(0,1fr)); }
.four-col { grid-template-columns: repeat(4, minmax(0,1fr)); }
.panel, .form-card { padding: 16px; margin-top: 0; margin-bottom: 16px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.panel-title h2 { margin: 0; font-size: 20px; }
.panel-title small { color: var(--muted); }
.panel-line { flex: 1; max-width: 80px; height: 3px; border-radius: 999px; background: linear-gradient(90deg,var(--blue),var(--cyan)); }
.kpi-card, .info-card, .status-grid div, .timeline-item, .result-section { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 16px; }
.kpi-card, .info-card { text-align: center; }
.kpi-card b, .info-card b { color: var(--muted); display: block; font-size: 13px; margin-bottom: 8px; }
.kpi-card strong { display: block; font-size: 26px; color: var(--gold); }
.info-card strong { color: #fff; }
.muted { color: var(--muted); }
.text-gold { color: var(--gold); }
.text-cyan { color: var(--cyan); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.status-grid span { color: var(--green); font-weight: 800; }
.data-table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 14px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(111,76,195,.12); text-align: left; vertical-align: top; }
.data-table th { color: #1C1822; background: rgba(57,90,150,.28); white-space: nowrap; font-size: 14px; }
.data-table td { color: #68636F; line-height: 1.6; font-size: 14px; }
.form-grid { display: grid; gap: 10px; }
.form-card label { display: grid; gap: 8px; color: #68636F; font-weight: 800; }
.form-card input, .form-card select, .form-card textarea { width: 100%; min-height: 42px; border-radius: 12px; border: 1px solid rgba(111,76,195,.30); background: #FFFFFF; color: #1C1822; padding: 9px 12px; outline: none; }
.form-card input:focus, .form-card select:focus, .form-card textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(111,76,195,.10); }
.form-card textarea { min-height: 92px; resize: vertical; }
.form-note { color: var(--muted); line-height: 1.7; margin: 14px 0 0; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; justify-content: center; }
.check-line { display: flex !important; align-items: center; gap: 10px !important; flex-wrap: nowrap; }
.check-line input { width: 18px; min-height: 18px; }
.check-line-group { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin: 20px 0; padding: 14px 18px; border-radius: 12px; background: rgba(255,255,255,.22); border: 1px solid rgba(111,76,195,.12); }
.check-inline { flex: 0 0 auto; }
.mode-select-line { white-space: nowrap; }
.matching-layout { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.person-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.36); }
.warning-box, .placeholder-note, .disclaimer-card { border-radius: 14px; padding: 16px; line-height: 1.7; }
.warning-box { border: 1px solid rgba(255,182,92,.34); background: rgba(255,182,92,.12); color: #8a6d3b; margin-bottom: 18px; }
.placeholder-note { border-left: 4px solid var(--orange); background: rgba(255,182,92,.10); color: #8a6d3b; }
.disclaimer-card { border: 1px solid rgba(255,182,92,.28); background: rgba(255,182,92,.10); color: #8a6d3b; }
.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.flash { border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: rgba(255,255,255,.72); }
.flash.success { border-color: rgba(84,228,157,.35); color: #1d7a52; }
.flash.error { border-color: #c0392b; color: #c0392b; }
.result-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; }
.result-section { margin-bottom: 12px; }
.result-section h3 { margin: 0 0 8px; color: var(--cyan); }
.result-section p { margin: 0; white-space: pre-wrap; color: #1C1822; line-height: 1.8; }
.side-action { width: 100%; margin-bottom: 10px; }
/* Bazi */
.pillar-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 14px; }
.pillar-card { position: relative; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(34,64,126,.68), rgba(255,255,255,.82)); border-radius: 18px; padding: 18px; text-align: center; }
.pillar-card:before { content:""; position:absolute; inset:auto -20% -50% -20%; height:90px; background: radial-gradient(circle, rgba(111,76,195,.18), transparent 65%); }
.pillar-label { color: var(--muted); font-size: 14px; letter-spacing: .15em; }
.stem-char { font-size: 46px; line-height: 1; font-weight: 900; color: var(--gold); margin-top: 10px; }
.branch-char { font-size: 32px; font-weight: 900; color: var(--cyan); }
.pillar-meta { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; color: #68636F; font-size: 14px; }
.pillar-detail-stack { margin-top: 12px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.pillar-detail-row { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; }
.detail-label { color: var(--muted); white-space: nowrap; min-width: 32px; flex-shrink: 0; }
.detail-label:after { content: "："; }
.tag-inline { display: inline-block; padding: 1px 6px; margin: 1px 2px; border-radius: 6px; background: rgba(111,76,195,.10); color: var(--cyan); font-size: 13px; border: 1px solid rgba(111,76,195,.18); }
.timeline-current { border: 2px solid var(--gold) !important; background: linear-gradient(135deg, rgba(255,182,92,.18), rgba(255,182,92,.06)) !important; box-shadow: 0 0 20px rgba(255,182,92,.15); }
.dayun-quick-timeline::-webkit-scrollbar { height: 4px; }
.dayun-quick-timeline::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.wx-stack { display: grid; gap: 10px; }
.wx-row { display: grid; grid-template-columns: 42px minmax(0,1fr) 58px; align-items: center; gap: 10px; }
.wx-bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.wx-fill { height: 100%; border-radius: 999px; }
.ten-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px,1fr)); gap: 10px; }
.ten-cell { border: 1px solid var(--line); background: rgba(255,255,255,.36); border-radius: 12px; padding: 12px; text-align: center; }
.ten-cell strong { display:block; font-size: 20px; color: var(--gold); }
.timeline { display: grid; gap: 10px; }
.timeline-item { display: grid; grid-template-columns: 80px 90px minmax(0,1fr); gap: 12px; align-items: center; }
.palace-chart { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-auto-rows: minmax(140px, auto); gap: 10px; }
.palace-cell { border: 1px solid rgba(111,76,195,.18); border-radius: 16px; background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(240,237,232,.96)); padding: 14px; min-height: 136px; transition: all .25s ease; position: relative; overflow: hidden; }
.palace-cell::before { content: ''; position: absolute; inset: 0; border-radius: 16px; background: radial-gradient(ellipse at top left, rgba(111,76,195,.06), transparent 70%); pointer-events: none; }
.palace-cell:hover { border-color: #5a3da6; box-shadow: 0 8px 32px rgba(111,76,195,.12); transform: translateY(-2px); }
.palace-cell.center { grid-column: 2 / span 2; grid-row: 2 / span 2; display: grid; place-items: center; text-align: center; background: linear-gradient(145deg, rgba(111,76,195,.10), rgba(255,255,255,.96)); border-color: #8a6d3b; box-shadow: 0 0 48px rgba(111,76,195,.10); }
.palace-cell.center::before { background: radial-gradient(ellipse at center, rgba(198,165,107,.08), transparent 65%); }
.palace-cell.center:hover { border-color: #8a6d3b; box-shadow: 0 0 64px rgba(198,165,107,.18); }
.palace-cell h3 { margin: 0 0 6px; font-size: 14px; color: #8a6d3b; font-weight: 700; letter-spacing: .04em; }
.palace-cell p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.star-list { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0; }
.star { display:inline-flex; padding: 3px 7px; border-radius: 999px; background: rgba(111,76,195,.10); border: 1px solid rgba(111,76,195,.22); font-size: 13px; }
.star.major { color: #6F4CC3; border-color: #5a3da6; background: rgba(111,76,195,.14); }
.star.mal { color: #c0392b; border-color: #c0392b; background: rgba(255,109,134,.10); }
.nine-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.nine-cell { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.42); padding: 14px; min-height: 116px; }
.nine-cell b { color: var(--gold); display: block; margin-bottom: 6px; }
.score-ring { width: 136px; height: 136px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; background: conic-gradient(var(--cyan) calc(var(--score) * 1%), rgba(255,255,255,.08) 0); position: relative; }
.score-ring:after { content:""; position:absolute; inset: 12px; border-radius:50%; background: rgba(111,76,195,.10); }
.score-ring strong { position: relative; z-index: 1; font-size: 30px; color: var(--gold); }
.dimension-list { display:grid; gap:12px; }
.dimension-item { border:1px solid var(--line); border-radius:14px; padding:14px; background:rgba(255,255,255,.36); }
.dimension-top { display:flex; justify-content:space-between; gap:12px; margin-bottom:8px; }
.progress { height: 10px; border-radius:999px; background: rgba(255,255,255,.08); overflow:hidden; }
.progress > span { display:block; height:100%; border-radius:999px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.report-card { display:grid; grid-template-columns: 360px minmax(0,1fr); overflow:hidden; }
.report-cover { min-height: 440px; display:grid; place-items:center; align-content:center; gap:14px; padding:36px; background: radial-gradient(circle, rgba(111,76,195,.10), rgba(255,255,255,.6)); border-right:1px solid var(--line); text-align:center; }
.report-cover img { width: 210px; height: 210px; object-fit:contain; }
.report-info { padding:34px; }
.download-grid { display:flex; gap:12px; flex-wrap:wrap; margin:22px 0; }
.chat-box { display:grid; grid-template-rows: 1fr auto; overflow:hidden; min-height:420px; max-height:calc(100vh - 340px); background:var(--surface); }
.chat-log { overflow:auto; padding:18px; display:grid; align-content:start; gap:8px; }
.chat-log::-webkit-scrollbar { width:5px; }
.chat-log::-webkit-scrollbar-track { background:transparent; }
.chat-log::-webkit-scrollbar-thumb { background:rgba(111,76,195,.2); border-radius:3px; }
.chat-message { max-width: 82%; padding:10px 14px; border-radius:16px; line-height:1.5; background:rgba(255,255,255,.52); position:relative; animation:msgIn .3s ease-out; }
@keyframes msgIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.chat-message.user { justify-self:end; background:linear-gradient(135deg, rgba(111,76,195,.28), rgba(111,76,195,.12)); border:1px solid rgba(111,76,195,.28); border-bottom-right-radius:4px; }
.chat-message.bot { justify-self:start; border:1px solid rgba(111,76,195,.12); border-bottom-left-radius:4px; box-shadow:0 2px 12px rgba(0,0,0,.12); }
.chat-message b { color:var(--cyan); font-size:13px; display:block; margin-bottom:6px; letter-spacing:.5px; }
.chat-message br { display:inline; }
.chat-message p { margin:0 0 1em 0; line-height:1.5; }
.chat-message p:last-child { margin-bottom:0; }
.kb-answer-text p { margin:0 0 1em 0; line-height:1.5; }
.chat-message.rule-mode { }
.chat-input { display:flex; gap:12px; padding:14px 20px; border-top:1px solid var(--line); background:var(--surface); }
.chat-input input { flex:1; border-radius:20px; border:1px solid var(--line); background:var(--card); color:var(--text); padding:0 18px; font-size:14px; transition:all .25s; height:42px; }
.chat-input input:focus { outline:none; border-color:#6F4CC3; box-shadow:0 0 0 3px rgba(111,76,195,.1); }
.chat-input input::placeholder { color:#999; font-size:14px; }
.chat-input button { padding:10px 24px; border-radius:20px; border:none; background:#6F4CC3; color:#fff; font-weight:600; font-size:14px; cursor:pointer; transition:all .2s; }
.chat-input button:hover { background:#5a3da6; box-shadow:0 2px 12px rgba(111,76,195,.25); }
.empty-state { text-align:center; padding:42px 20px; color:var(--muted); }

/* ── QA 交互问答页 ── */
.qa-grid { grid-template-columns: 1fr; gap:16px; }
.qa-grid .panel { margin-bottom: 0; }
.qa-chat-panel { min-width:0; border:1px solid var(--line); border-radius:16px; overflow:hidden; background:var(--card); }
.qa-chat-panel .panel-title { padding:14px 20px; margin:0; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.qa-quick-panel { display: grid; grid-template-columns: 1fr; gap: 10px; align-content: start; padding-right:8px; }
.qa-quick-panel::-webkit-scrollbar { width: 6px; }
.qa-quick-panel::-webkit-scrollbar-track { background: transparent; }
.qa-quick-panel::-webkit-scrollbar-thumb { background: rgba(111,76,195,.25); border-radius: 3px; }
.qa-quick-panel::-webkit-scrollbar-thumb:hover { background: rgba(111,76,195,.4); }
.qa-quick-panel .panel-title { grid-column: 1 / -1; }
.qa-group-body-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-scroll-questions { max-height:280px; overflow-y:auto; padding-right:4px; }
.qa-scroll-questions::-webkit-scrollbar { width:5px; }
.qa-scroll-questions::-webkit-scrollbar-track { background:transparent; }
.qa-scroll-questions::-webkit-scrollbar-thumb { background:rgba(111,76,195,.28); border-radius:3px; }

/* 模式切换栏 */
.qa-mode-bar { display:flex; align-items:center; justify-content:center; gap:16px; padding:12px 24px; margin-top:-10px; background:linear-gradient(135deg, rgba(255,255,255,.32), rgba(255,255,255,.22)); border-radius:16px; border:1px solid rgba(111,76,195,.12); box-shadow:inset 0 1px 0 rgba(255,255,255,.03); }
.mode-label { font-size:14px; font-weight:700; transition:all .35s; letter-spacing:.5px; }
.mode-label-ai { color:var(--cyan); text-shadow:0 0 20px rgba(111,76,195,.25); }
.mode-label-rule { color:var(--gold); text-shadow:0 0 20px rgba(198,165,107,.25); }

/* Toggle Switch */
.mode-toggle { position:relative; display:inline-block; width:52px; height:28px; flex-shrink:0; }
.mode-toggle input { opacity:0; width:0; height:0; }
.mode-slider { position:absolute; cursor:pointer; top:0; left:0; right:0; bottom:0; background:linear-gradient(135deg, rgba(111,76,195,.8), rgba(111,76,195,.55)); border-radius:28px; transition:.35s; border:1px solid rgba(111,76,195,.35); }
.mode-slider::before { content:""; position:absolute; height:22px; width:22px; left:3px; bottom:2px; background:#fff; border-radius:50%; transition:.35s; box-shadow:0 2px 8px rgba(0,0,0,.25); }
.mode-toggle input:checked + .mode-slider { background:linear-gradient(135deg, rgba(198,165,107,.6), rgba(255,182,92,.5)); border-color:#8a6d3b; }
.mode-toggle input:checked + .mode-slider::before { transform:translateX(23px); }

/* 模式徽章 */
.mode-badge { font-size:13px; padding:3px 12px; border-radius:20px; font-weight:700; flex-shrink:0; }
.mode-badge.mode-ai { background:rgba(111,76,195,.18); color:var(--cyan); border:1px solid rgba(111,76,195,.3); }
.mode-badge.mode-rule { background:rgba(198,165,107,.18); color:var(--gold); border:1px solid rgba(198,165,107,.3); }

/* 问答分类 */
.qa-cat { border:1px solid rgba(111,76,195,.1); border-radius:14px; overflow:hidden; background:linear-gradient(180deg, rgba(255,255,255,.42), rgba(111,76,195,.08)); transition:all .25s; }
.qa-cat:hover { border-color:#5a3da6; box-shadow:0 4px 16px rgba(0,0,0,.12); }
.qa-cat-header { display:flex; align-items:center; gap:10px; padding:12px 16px; cursor:pointer; user-select:none; transition:all .2s; }
.qa-cat-header:hover { background:rgba(111,76,195,.08); }
.qa-cat-header.open { border-bottom:1px solid rgba(111,76,195,.1); background:rgba(111,76,195,.06); }
.qa-cat-icon { font-size:20px; transition:transform .25s; }
.qa-cat-header.open .qa-cat-icon { transform:scale(1.15); }
.qa-cat-title { font-weight:700; font-size:15px; color:var(--text); flex:1; }
.qa-cat-count { font-size:13px; color:var(--muted); background:rgba(255,255,255,.48); padding:2px 10px; border-radius:10px; letter-spacing:.5px; }
.qa-cat-arrow { color:var(--muted); font-size:14px; transition:transform .25s; }
.qa-cat-header.open .qa-cat-arrow { color:var(--cyan); }
.qa-total { font-size:13px; color:var(--muted); background:rgba(255,255,255,.3); padding:3px 12px; border-radius:12px; border:1px solid rgba(111,76,195,.1); }

/* 滚动列表 */
.qa-scroll { max-height:340px; overflow-y:auto; padding:10px; display:block; }
.qa-scroll::-webkit-scrollbar { width:5px; }
.qa-scroll::-webkit-scrollbar-track { background:transparent; }
.qa-scroll::-webkit-scrollbar-thumb { background:rgba(111,76,195,.28); border-radius:3px; }

/* 快捷提问按钮 */
.quick-btn { display:flex; align-items:flex-start; gap:8px; width:100%; text-align:left; padding:8px 12px; margin-bottom:3px; border-radius:10px; border:1px solid transparent; background:rgba(255,255,255,.22); color:var(--text); font-size:14px; cursor:pointer; transition:all .2s; line-height:1.5; }
.quick-btn:hover { background:rgba(111,76,195,.18); border-color:#5a3da6; color:#fff; transform:translateX(4px); box-shadow:0 2px 8px rgba(111,76,195,.08); }
.quick-btn:last-child { margin-bottom:0; }
.quick-num { display:inline-flex; align-items:center; justify-content:center; min-width:22px; height:20px; border-radius:10px; background:linear-gradient(135deg, rgba(111,76,195,.28), rgba(111,76,195,.15)); color:var(--cyan); font-size:13px; font-weight:700; flex-shrink:0; margin-top:1px; }
.quick-text { flex:1; min-width:0; }

/* ── 知识库快捷问答卡片 ── */
.kb-qa-item { margin-bottom:6px; }
.kb-question-btn { margin-bottom:0; border-radius:10px; display:flex; align-items:flex-start; gap:8px; width:100%; text-align:left; padding:8px 12px; border:1px solid transparent; background:rgba(255,255,255,.22); color:var(--text); font-size:14px; cursor:pointer; transition:all .2s; line-height:1.5; }
.kb-question-btn:hover { background:rgba(111,76,195,.18); border-color:#5a3da6; color:#fff; transform:translateX(4px); }
.kb-badge { font-size:13px; background:rgba(255,207,138,.15); color:#8a6d3b; padding:2px 6px; border-radius:4px; white-space:nowrap; flex-shrink:0; margin-left:auto; }
.kb-answer { padding:10px 14px; background:linear-gradient(180deg, rgba(255,255,255,.32), rgba(111,76,195,.12)); border:1px solid rgba(111,76,195,.14); border-top:none; border-radius:0 0 10px 10px; font-size:14px; line-height:1.35; color:var(--text); margin-top:-3px; animation:fadeIn .25s; }
.kb-answer-text { margin-bottom:4px; }
.kb-answer-source { font-size:14px; color:var(--muted); font-style:italic; opacity:.7; }
@keyframes fadeIn { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }

/* ── 合盘档案选择器 ── */
.profile-select-bar { display:flex; align-items:flex-end; gap:16px; padding:18px 22px; margin-bottom:22px; background:rgba(255,255,255,.48); border:1px solid var(--line); border-radius:14px; flex-wrap:wrap; }
.profile-select-bar.empty { color:var(--muted); font-size:14px; justify-content:center; padding:14px; }
.profile-select-group { flex:1; min-width:200px; }
.profile-select-label { display:block; font-size:14px; font-weight:700; color:var(--muted); margin-bottom:6px; }
.profile-select { width:100%; padding:10px 14px; border-radius:12px; border:1px solid var(--line); background:#FFFFFF; color:#1C1822; font-size:14px; cursor:pointer; }
.profile-select option { background:#FFFFFF; color:#1C1822; }
.profile-select-arrow { font-size:22px; color:var(--cyan); padding-bottom:8px; flex-shrink:0; }
#swap-btn { flex-shrink:0; margin-bottom:0; }
@media (max-width: 860px) {
  .profile-select-bar { flex-direction:column; }
  .profile-select-arrow { display:none; }
}

/* TTS 朗读按钮 */
.tts-btn { display:inline-flex; align-items:center; gap:5px; margin-top:10px; padding:6px 14px; border-radius:20px; border:1px solid rgba(198,165,107,.35); background:rgba(198,165,107,.12); color:#8a6d3b; font-size:13px; font-weight:700; cursor:pointer; transition:all .25s; }
.tts-btn:hover { background:rgba(198,165,107,.24); border-color:#8a6d3b; }
.tts-btn.speaking { background:rgba(255,109,134,.18); border-color:#c0392b; color:var(--red); animation:pulse-tts 1.2s ease-in-out infinite; }
@keyframes pulse-tts { 0%,100%{opacity:1} 50%{opacity:.6} }

/* 加载倒计时 */
.loading-msg { opacity:.85; border:1px dashed rgba(111,76,195,.4); }
.loading-timer { display:inline-block; padding:4px 14px; margin-top:6px; border-radius:14px; background:rgba(111,76,195,.12); color:var(--cyan); font-size:14px; font-weight:700; animation:pulse-tts 1s ease-in-out infinite; }

/* 提交加载遮罩 */
.submit-overlay { position:fixed; inset:0; z-index:9999; background:rgba(14,11,20,.88); backdrop-filter:blur(12px); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:24px; }
.submit-overlay .submit-spinner { width:56px; height:56px; border:4px solid rgba(111,76,195,.18); border-top-color:var(--cyan); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
/* AI 解读加载旋转动画（bazi_detail / ziwei_detail / matching_detail 等） */
.spinner { width: 40px; height: 40px; border: 3px solid rgba(111,76,195,.18); border-top-color: #6F4CC3; border-radius: 50%; animation: spin .8s linear infinite; margin: 10px auto; }

/* ═══ 合盘详情页 UX 增强（2026-07-18） ═══ */
/* 置顶总结卡片 */
.match-summary { display:flex; flex-wrap:wrap; gap:14px; align-items:center; padding:16px 20px; margin-bottom:12px; border-radius:14px; background:linear-gradient(135deg,rgba(108,92,231,.12),rgba(255,255,255,.85)); border:1.5px solid rgba(108,92,231,.35); }
.match-summary .ms-avatars { display:flex; align-items:center; gap:12px; min-width:200px; }
.match-summary .ms-avatar { padding:6px 14px; border-radius:10px; font-weight:700; font-size:0.95rem; }
.match-summary .ms-avatar.a { background:rgba(111,76,195,.22); color:#5a3da6; border:1px solid rgba(111,76,195,.3); }
.match-summary .ms-avatar.b { background:rgba(111,76,195,.22); color:#5a3da6; border:1px solid rgba(111,76,195,.3); }
.match-summary .ms-vs { font-size:1.2rem; color:var(--muted); }
.match-summary .ms-verdict { flex:1; min-width:200px; }
.match-summary .ms-verdict b { display:block; font-size:1.1rem; margin-bottom:2px; }
.match-summary .ms-score { font-size:2.2rem; font-weight:900; line-height:1; }
.match-summary .ms-tags { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.match-summary .ms-tag { padding:3px 10px; border-radius:20px; font-size:13px; font-weight:700; }
.match-summary .ms-tag.good { background:rgba(255,109,134,.15); color:#c0392b; border:1px solid rgba(255,109,134,.25); }
.match-summary .ms-tag.warn { background:rgba(255,152,0,.15); color:#8a6d3b; border:1px solid rgba(255,152,0,.25); }
.match-summary .ms-actions { display:flex; gap:8px; flex-shrink:0; }

/* 快速导航锚点 */
.anchor-nav { display:flex; flex-wrap:wrap; gap:6px; padding:10px 14px; margin-bottom:16px; border-radius:12px; background:rgba(255,255,255,.38); border:1px solid rgba(111,76,195,.1); position:sticky; top:0; z-index:4; backdrop-filter:blur(8px); }
.anchor-nav a { padding:6px 12px; border-radius:8px; font-size:13px; font-weight:600; color:var(--muted); text-decoration:none; transition:all .2s; white-space:nowrap; }
.anchor-nav a:hover, .anchor-nav a:focus { background:rgba(111,76,195,.12); color:var(--cyan); }

/* 可折叠章节（<details>） */
.collapse-section { margin-top:14px; border:1px solid var(--line); border-radius:14px; background:var(--panel); overflow:hidden; }
.collapse-section > summary { padding:14px 18px; cursor:pointer; font-weight:700; font-size:1rem; color:var(--text); list-style:none; display:flex; align-items:center; gap:10px; user-select:none; }
.collapse-section > summary::-webkit-details-marker { display:none; }
.collapse-section > summary::before { content:'▶'; display:inline-block; font-size:13px; transition:transform .25s; color:var(--cyan); }
.collapse-section[open] > summary::before { transform:rotate(90deg); }
.collapse-section > summary small { color:var(--muted); font-weight:400; margin-left:auto; }
.collapse-section .collapse-inner { padding:6px 16px 16px; }

/* 回到顶部 */
.back-to-top { position:fixed; bottom:24px; right:24px; z-index:9; width:44px; height:44px; border-radius:50%; background:rgba(111,76,195,.15); border:1px solid rgba(111,76,195,.3); color:var(--cyan); font-size:20px; cursor:pointer; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .3s; pointer-events:none; }
.back-to-top.visible { opacity:1; pointer-events:auto; }
.back-to-top:hover { background:rgba(111,76,195,.25); }

/* 评分悬浮提示 */
.has-tooltip { position:relative; cursor:help; border-bottom:1px dotted var(--muted); }
.has-tooltip .tooltip { display:none; position:absolute; bottom:120%; left:50%; transform:translateX(-50%); padding:10px 14px; border-radius:8px; background:rgba(14,11,20,.95); border:1px solid var(--line); color:#C8C3CF; font-size:13px; font-weight:400; white-space:nowrap; z-index:10; box-shadow:0 8px 24px rgba(0,0,0,.4); }
.has-tooltip:hover .tooltip { display:block; }
.submit-overlay .submit-title { font-size:20px; font-weight:700; color:#fff; letter-spacing:2px; }
.submit-overlay .submit-timer { display:inline-flex; align-items:center; gap:8px; padding:8px 24px; border-radius:20px; background:rgba(111,76,195,.1); border:1px solid rgba(111,76,195,.25); color:var(--cyan); font-size:28px; font-weight:800; font-variant-numeric:tabular-nums; }
.submit-overlay .submit-timer .timer-dot { width:8px; height:8px; border-radius:50%; background:var(--cyan); animation:pulse-tts 1s ease-in-out infinite; }
.submit-overlay .submit-hint { font-size:14px; color:rgba(255,255,255,.5); }

/* ═══════════════════════════════════════════
   Profile Page — 视觉增强 V2
   ═══════════════════════════════════════════ */

/* ── 页面头部：渐变边框 + 微光背景 ── */
.page-header {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(111,76,195,.16);
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(111,76,195,.08), transparent 60%),
    radial-gradient(ellipse at 85% 70%, rgba(111,76,195,.05), transparent 50%);
  pointer-events: none;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(111,76,195,.35), rgba(111,76,195,.25), transparent);
}

/* ── 徽章光环动画 ── */
.header-badge {
  position: relative;
}
.header-badge::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(111,76,195,.25), rgba(111,76,195,.12), rgba(111,76,195,.25));
  z-index: -1;
  animation: badge-glow 3s ease-in-out infinite;
}
@keyframes badge-glow {
  0%, 100% { opacity: .35; transform: scale(1); }
  50% { opacity: .7; transform: scale(1.04); }
}

/* ── 表单卡片：玻璃拟态 + 悬停发光边框 ── */
.form-card {
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(111,76,195,.14);
  transition: border-color .45s ease, box-shadow .45s ease;
  animation: card-enter .6s ease-out;
}
@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.form-card:hover {
  border-color: #5a3da6;
  box-shadow:
    0 24px 80px rgba(0,0,0,.35),
    0 0 48px rgba(111,76,195,.07),
    inset 0 1px 0 rgba(255,255,255,.04);
}

/* ── 面板标题：发光下划线 ── */
.form-card .panel-title {
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(111,76,195,.08);
}
.panel-line {
  background: linear-gradient(90deg, rgba(111,76,195,.7), rgba(111,76,195,.5), rgba(111,76,195,.3));
  box-shadow: 0 0 14px rgba(111,76,195,.2);
  height: 2px;
  border-radius: 999px;
}

/* ── 输入框 / 下拉框增强 ── */
.form-card input,
.form-card select {
  transition: all .3s cubic-bezier(.4,0,.2,1);
  border: 1px solid rgba(111,76,195,.26);
}
.form-card input:hover,
.form-card select:hover {
  border-color: #5a3da6;
  background: rgba(111,76,195,.05);
}
.form-card input:focus,
.form-card select:focus {
  border-color: var(--cyan);
  box-shadow:
    0 0 0 3px rgba(111,76,195,.07),
    0 0 22px rgba(111,76,195,.08);
  background: #FFFFFF;
}

/* ── 下拉框自定义箭头 ── */
.form-card select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M5 7L1 3h8z' fill='%2368636F'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── 标签左侧对焦指示条 ── */
.form-card label {
  position: relative;
  padding-left: 10px;
}
.form-card label::before {
  content: '';
  position: absolute;
  left: 0; top: 28px;
  width: 3px; height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  opacity: 0;
  transform: scaleY(0);
  transition: all .35s cubic-bezier(.4,0,.2,1);
}
.form-card label:focus-within::before {
  opacity: 1;
  transform: scaleY(1);
}

/* ── 复选框组卡片：悬停发光 ── */
.check-line-group {
  border: 1px solid rgba(111,76,195,.06);
  transition: border-color .35s ease, box-shadow .35s ease;
  border-radius: 14px;
}
.check-line-group:hover {
  border-color: #5a3da6;
  box-shadow: 0 0 22px rgba(111,76,195,.04);
}

/* ── 自定义复选框样式 ── */
.check-line input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px !important;
  min-height: 20px !important;
  height: 20px !important;
  border: 2px solid rgba(111,76,195,.38);
  border-radius: 5px;
  background: #FFFFFF;
  cursor: pointer;
  position: relative;
  transition: all .28s ease;
  flex-shrink: 0;
}
.check-line input[type="checkbox"]:hover {
  border-color: #5a3da6;
  box-shadow: 0 0 10px rgba(111,76,195,.12);
}
.check-line input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(111,76,195,.3);
}
.check-line input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

/* ── 提交按钮：光扫动画 + 悬停上浮 ── */
.form-actions .primary-btn {
  position: relative;
  overflow: hidden;
  transition: all .4s cubic-bezier(.4,0,.2,1);
}
.form-actions .primary-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 35%, rgba(255,255,255,.07) 48%, rgba(255,255,255,.14) 50%, rgba(255,255,255,.07) 52%, transparent 65%);
  transform: translateX(-110%);
  transition: transform .7s ease;
}
.form-actions .primary-btn:hover::after {
  transform: translateX(110%);
}
.form-actions .primary-btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 52px rgba(111,76,195,.55),
    0 0 80px rgba(111,76,195,.15),
    0 10px 36px rgba(0,0,0,.32) !important;
}
.form-actions .primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 28px rgba(111,76,195,.4) !important;
}

/* ── 模式选择行 ── */
.mode-select-line {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(111,76,195,.08);
  transition: all .3s ease;
}
.mode-select-line:hover {
  border-color: #5a3da6;
  background: rgba(255,255,255,.24);
}
.mode-select-line select {
  background: #FFFFFF !important;
  border: 1px solid rgba(111,76,195,.28) !important;
  transition: all .3s ease;
}
.mode-select-line select:hover {
  border-color: #5a3da6 !important;
  box-shadow: 0 0 14px rgba(111,76,195,.06);
}


/* ═══════════════════════════════════════════
   Bazi Detail Page — 八字详情页视觉增强
   ═══════════════════════════════════════════ */

/* ── 四柱卡片：悬停铭文发光 ── */
.pillar-card {
  transition: all .35s cubic-bezier(.4,0,.2,1);
}
.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 12px 40px rgba(111,76,195,.15),
    0 0 60px rgba(111,76,195,.08),
    inset 0 0 40px rgba(111,76,195,.04);
  border-color: #5a3da6;
}
.pillar-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,182,92,.06), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
.pillar-card:hover::after {
  opacity: 1;
}

/* ── 天干字发光 ── */
.stem-char {
  text-shadow: 0 0 18px rgba(198,165,107,.25);
  transition: text-shadow .4s ease;
}
.pillar-card:hover .stem-char {
  text-shadow: 0 0 32px rgba(198,165,107,.45), 0 0 64px rgba(255,182,92,.2);
}
.branch-char {
  text-shadow: 0 0 14px rgba(111,76,195,.2);
  transition: text-shadow .4s ease;
}
.pillar-card:hover .branch-char {
  text-shadow: 0 0 28px rgba(111,76,195,.4);
}

/* ── 信息卡片悬停微动 ── */
.info-card {
  transition: all .3s ease;
}
.info-card:hover {
  border-color: #5a3da6;
  box-shadow: 0 4px 20px rgba(111,76,195,.06);
  transform: translateY(-1px);
}

/* ── 评分圆环动画 ── */
.score-ring {
  position: relative;
  transition: filter .5s ease;
}
.score-ring:hover {
  filter: drop-shadow(0 0 16px rgba(198,165,107,.35));
}

/* ── 五行能量条悬停 ── */
.wx-row {
  transition: transform .25s ease;
}
.wx-row:hover {
  transform: translateX(4px);
}
.wx-fill {
  transition: width .8s cubic-bezier(.22,1,.36,1);
}

/* ── 当前大运卡片增强 ── */
.dayun-card {
  transition: all .4s ease;
  font-family: 'Courier New', 'Source Code Pro', 'Noto Sans Mono CJK SC', 'Sarasa Mono SC', Consolas, monospace;
}
.dayun-card .dayun-header b,
.dayun-card .dayun-header span,
.dayun-card .tag-inline,
.dayun-card .tag,
.dayun-card .muted,
.dayun-card .dayun-expandable {
  font-family: inherit;
}
.dayun-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

/* ── 大运时间线导航悬停 ── */
.dayun-quick-timeline a > div {
  transition: all .25s ease;
}
.dayun-quick-timeline a:hover > div {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(111,76,195,.15);
}

/* ── 神煞卡片悬停 ── */
.four-col .info-card {
  transition: all .3s ease;
}
.four-col .info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ── 十神单元悬停放大 ── */
.ten-cell {
  transition: all .3s ease;
}
.ten-cell:hover {
  transform: scale(1.06);
  border-color: #5a3da6;
  box-shadow: 0 4px 20px rgba(111,76,195,.1);
}

/* ── 数据表格行悬停 ── */
.data-table tbody tr {
  transition: background .2s ease;
}
.data-table tbody tr:hover {
  background: rgba(111,76,195,.05);
}

/* ── 纳音卡片 ── */
.info-card:has(strong[style*="color:var(--gold)"]) {
  border-left: 3px solid rgba(198,165,107,.25);
}

/* ═══════════════════════════════════════════
   Ziwei Detail Page — 紫微详情页视觉增强
   ═══════════════════════════════════════════ */

/* ── 宫位单元格悬停铭文发光 ── */
.palace-cell {
  transition: all .35s cubic-bezier(.4,0,.2,1);
  cursor: default;
}
.palace-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 30%, rgba(111,76,195,.06), transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
.palace-cell:hover::after {
  opacity: 1;
}

/* ── 中心命盘脉动光晕 ── */
@keyframes center-pulse {
  0%, 100% { box-shadow: 0 0 48px rgba(111,76,195,.08), 0 0 80px rgba(111,76,195,.04); }
  50% { box-shadow: 0 0 64px rgba(111,76,195,.14), 0 0 100px rgba(111,76,195,.08); }
}
.palace-cell.center {
  animation: center-pulse 4s ease-in-out infinite;
}
.palace-cell.center:hover {
  animation: none;
  border-color: #8a6d3b;
  box-shadow: 0 0 72px rgba(198,165,107,.22), 0 0 120px rgba(111,76,195,.12) !important;
}

/* ── 星曜标签悬停发光 ── */
.star {
  transition: all .25s ease;
}
.star:hover {
  transform: scale(1.08);
  box-shadow: 0 0 10px currentColor;
}
.star.major:hover {
  box-shadow: 0 0 14px rgba(111,76,195,.4);
}
.star.mal:hover {
  box-shadow: 0 0 10px rgba(255,109,134,.3);
}

/* ── 四化卡片悬停 ── */
.four-col .info-card {
  transition: all .3s ease;
}
.four-col .info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  border-color: #5a3da6;
}

/* ── 九宫格单元悬停 ── */
.nine-cell {
  transition: all .3s ease;
}
.nine-cell:hover {
  transform: translateY(-2px);
  border-color: #5a3da6;
  box-shadow: 0 6px 24px rgba(111,76,195,.08);
}

/* ── 大限卡片悬停 ── */
[style*="grid-template-columns:1fr 1fr"] > div[style*="border:1px"] {
  transition: all .3s ease;
}
[style*="grid-template-columns:1fr 1fr"] > div[style*="border:1px"]:hover {
  transform: translateY(-2px);
  border-color: #5a3da6 !important;
  box-shadow: 0 6px 24px rgba(111,76,195,.08);
}

/* ── 煞星卡片脉动 ── */
.info-card:has(.tag-inline[style*="#ff6b7a"]) {
  transition: all .35s ease;
}
.info-card:has(.tag-inline[style*="#ff6b7a"]):hover {
  border-left-color: #c0392b !important;
  box-shadow: 0 4px 16px rgba(255,109,134,.08);
}

/* ── 庙旺平陷分布条悬停 ── */
[style*="flex-wrap:wrap"] > span[style*="min-width:48px"] {
  transition: all .25s ease;
}
[style*="flex-wrap:wrap"] > span[style*="min-width:48px"]:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

/* ── 首页兼容：profile-bg 全局生效 ── */
.content-wrap {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════
   Interpretation Page — 综合解析页视觉增强
   ═══════════════════════════════════════════ */

/* ── 维度评分进度条动画 ── */
.dimension-item {
  transition: all .3s ease;
}
.dimension-item:hover {
  border-color: #5a3da6;
  box-shadow: 0 4px 20px rgba(111,76,195,.06);
  transform: translateX(4px);
}
.progress > span {
  transition: width 1s cubic-bezier(.22,1,.36,1);
}

/* ── 建议序号徽章脉动 ── */
.info-card span[style*="border-radius:50%"] {
  transition: all .3s ease;
}
.info-card:hover span[style*="border-radius:50%"] {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(84,228,157,.4);
}

/* ── 交叉分析卡片悬停边框变色 ── */
.four-col .info-card {
  transition: all .35s ease;
}
.four-col .info-card:hover {
  border-left-color: var(--cyan) !important;
  box-shadow: 0 6px 24px rgba(111,76,195,.1);
  transform: translateY(-3px);
}

/* ── 人际关系卡片顶栏变色 ── */
.five-col-grid .info-card {
  transition: all .3s ease;
}
.five-col-grid .info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
}

/* ── 八字紫微快览迷你卡片悬停 ── */
div[style*="min-width:300px"] > div[style*="flex:1"] > div[style*="text-align:center"] {
  transition: all .25s ease;
}
div[style*="min-width:300px"] > div[style*="flex:1"] > div[style*="text-align:center"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(111,76,195,.1);
  border-color: #5a3da6 !important;
}

/* ── 宫位标签悬停 ── */
div[style*="min-width:300px"] span[style*="border-radius:6px"] {
  transition: all .25s ease;
}
div[style*="min-width:300px"] span[style*="border-radius:6px"]:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(111,76,195,.15);
}

/* ── 四化标签悬停 ── */
span[style*="化"][style*="→"] {
  transition: all .25s ease;
}
span[style*="化"][style*="→"]:hover {
  transform: scale(1.06);
  box-shadow: 0 2px 8px currentColor;
}

/* ── 事业适合领域标签悬停 ── */
.tag[style*="background:var(--cyan)"] {
  transition: all .25s ease;
}
.tag[style*="background:var(--cyan)"]:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(111,76,195,.25);
}

/* ── 优势短板卡片增强 ── */
.info-card:has(strong:contains("优势")) {
  transition: all .3s ease;
}

/* ── 深度性格画像日主圈悬停 ── */
.info-card:has(strong[style*="font-size:24px"]):hover {
  border-color: #8a6d3b;
  box-shadow: 0 0 24px rgba(198,165,107,.12);
}

/* ═══════════════════════════════════════════
   Liunian Page — 流年详情页视觉增强
   ═══════════════════════════════════════════ */

/* ── 流年评分趋势柱状图悬停 ── */
div[style*="align-items:flex-end"] > div[style*="flex:1"] > div:first-child {
  transition: all .35s ease;
}
div[style*="align-items:flex-end"] > div[style*="flex:1"]:hover > div:first-child {
  filter: brightness(1.3);
  transform: scaleY(1.1);
  transform-origin: bottom;
  box-shadow: 0 0 16px currentColor;
}

/* ── 年度快速时间线卡片悬停 ── */
.dayun-quick-timeline a > div {
  transition: all .3s ease;
}
.dayun-quick-timeline a:hover > div {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  filter: brightness(1.15);
}

/* ── 每年详情卡片悬停 ── */
section[id^="liunian-"] {
  transition: all .35s ease;
}
section[id^="liunian-"]:hover {
  box-shadow: 0 8px 40px rgba(0,0,0,.25), 0 0 32px rgba(111,76,195,.05);
}

/* ── 月度节奏卡片悬停 ── */
div[style*="min-width:95px"] {
  transition: all .25s ease;
}
div[style*="min-width:95px"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  border-color: #5a3da6 !important;
}

/* ── 五行能量流行悬停 ── */
div[style*="min-width:40px"] {
  transition: all .2s ease;
}

/* ── 重点/谨慎年份卡片悬停增强 ── */
.info-card[style*="border-left:4px"] {
  transition: all .3s ease;
}
.info-card[style*="border-left:4px"]:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

/* ── 四趋势卡片悬停 ── */
section[id^="liunian-"] .four-col .info-card {
  transition: all .3s ease;
}
section[id^="liunian-"] .four-col .info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  border-top-width: 5px !important;
}

/* ── 关键词标签悬停 ── */
.tag[style*="font-weight:600"] {
  transition: all .25s ease;
}
.tag[style*="font-weight:600"]:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(111,76,195,.2);
}

/* ── QA 快捷按钮（模板级样式 → CSS 类，节省 ~400KB）── */
.qa-quick-btn {
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  margin: 3px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
}
.qa-quick-btn:hover {
  background: rgba(111,76,195,.08);
  border-color: var(--accent);
}
.qa-kb-btn {
  padding: 10px 14px;
  border-radius: 10px;
}
.qa-quick-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-note);
  color: var(--muted);
  flex-shrink: 0;
}
.qa-kb-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(111,76,195,.15), rgba(111,76,195,.1));
  font-size: var(--font-note);
  font-weight: 700;
  color: #6F4CC3;
}
.qa-quick-text {
  flex: 1;
  line-height: 1.4;
}
.qa-kb-badge {
  font-size: var(--font-note);
  padding: 2px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(56,216,145,.15), rgba(56,216,145,.08));
  color: #1d7a52;
  font-weight: 600;
  flex-shrink: 0;
}
.form-note {
  padding: 14px 18px;
  border-left: 3px solid rgba(111,76,195,.28);
  background: linear-gradient(90deg, rgba(111,76,195,.04), transparent 60%);
  border-radius: 0 12px 12px 0;
  font-size: 14px;
}

/* ── 页面背景粒子动画 ── */
.profile-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.profile-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .12;
  animation: orb-drift 18s ease-in-out infinite;
}
.orb-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(111,76,195,.6), transparent);
  top: -10%; left: -5%;
  animation-delay: 0s;
}
.orb-2 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(111,76,195,.5), transparent);
  top: 50%; right: -8%;
  animation-delay: -6s;
  animation-duration: 22s;
}
.orb-3 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(111,76,195,.45), transparent);
  bottom: -10%; left: 30%;
  animation-delay: -12s;
  animation-duration: 20s;
}
@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(.95); }
  75% { transform: translate(30px, 15px) scale(1.05); }
}

/* 调整内容层级确保在粒子之上 */
.content-wrap {
  position: relative;
  z-index: 1;
}

@media (max-width: 1200px) {
  .dashboard-grid, .detail-grid, .result-grid, .qa-grid { grid-template-columns: 1fr; }
  .qa-quick-panel { max-height:none; }
  .module-strip { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .four-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .report-card { grid-template-columns:1fr; }
}
@media (max-width: 860px) {
  .app-shell { display:block; }
  .sidebar { position:relative; height:auto; }
  .topbar { position:relative; height:auto; padding:16px; align-items:flex-start; flex-direction:column; }
  .content-wrap { padding:18px; }
  .hero-card, .matching-layout, .two-col, .three-col, .four-col, .pillar-grid, .nine-grid { grid-template-columns: 1fr; }
  .module-strip { grid-template-columns:1fr; }
  .page-header { align-items:flex-start; flex-direction:column; }
  .palace-chart { grid-template-columns:1fr; }
  .palace-cell.center { grid-column:auto; grid-row:auto; }
  .timeline-item { grid-template-columns:1fr; }
}

/* ---- 错误页面 ---- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 20px;
}
.error-code {
  font-size: 96px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
  opacity: .85;
}
.error-page h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}
.error-page p {
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 420px;
}

/* ═══════════════════════════════════════════
   首页优化样式 (2026-07-17)
   ═══════════════════════════════════════════ */
/* 系统状态栏 */
.sys-status-bar { display: flex; align-items: center; gap: 20px; padding: 8px 18px; margin-bottom: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.status-item { display: flex; align-items: center; gap: 6px; }
.status-dot-live { width: 8px; height: 8px; border-radius: 50%; background: #38d891; box-shadow: 0 0 8px rgba(56,216,145,.6); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.status-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(111,76,195,.2); color: #6F4CC3; font-size: 13px; font-weight: 800; }

/* KPI 网格 */
.kpi-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; margin-top: 18px; }
.kpi-item { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); text-decoration: none; transition: transform .15s,border-color .15s; }
a.kpi-item:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.kpi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 16px; flex-shrink: 0; }
.kpi-icon-blue { background: rgba(111,76,195,.18); color: #6F4CC3; }
.kpi-icon-green { background: rgba(56,216,145,.18); color: #1d7a52; }
.kpi-icon-purple { background: rgba(111,76,195,.18); color: #6F4CC3; }
.kpi-icon-gold { background: rgba(255,182,92,.18); color: #8a6d3b; }
.kpi-icon-cyan { background: rgba(111,76,195,.18); color: #6F4CC3; }
.kpi-icon-rose { background: rgba(255,109,134,.18); color: #c0392b; }
.kpi-body strong { display: block; font-size: 22px; color: #fff; font-weight: 800; line-height: 1.2; }
.kpi-body small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 快捷工具入口 */
.quick-tools-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.quick-tool-chip { display: inline-flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 120px; max-width: 180px; padding: 10px 16px; border-radius: 12px; background: rgba(111,76,195,.12); border: 1px solid rgba(111,76,195,.25); color: #3b6ea8; font-size: 14px; font-weight: 600; text-decoration: none; text-align: center; transition: all .18s; }
.quick-tool-chip:hover { background: rgba(111,76,195,.22); border-color: #5a3da6; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(111,76,195,.15); }

/* 快捷工具颜色变体 */
.qtc-plum  { background: rgba(111,76,195,.12);  border-color: #5a3da6;  color: #5a3da6; }
.qtc-plum:hover  { background: rgba(111,76,195,.22);  border-color: #5a3da6;  box-shadow: 0 4px 16px rgba(111,76,195,.15); }
.qtc-gold  { background: rgba(255,182,92,.12);  border-color: rgba(255,182,92,.25);  color: #8a6d3b; }
.qtc-gold:hover  { background: rgba(255,182,92,.22);  border-color: rgba(255,182,92,.5);  box-shadow: 0 4px 16px rgba(255,182,92,.15); }
.qtc-red   { background: rgba(255,109,134,.12); border-color: #c0392b; color: #c0392b; }
.qtc-red:hover   { background: rgba(255,109,134,.22); border-color: #c0392b; box-shadow: 0 4px 16px rgba(255,109,134,.15); }
.qtc-cyan  { background: rgba(111,76,195,.12);  border-color: #5a3da6;  color: #3b6ea8; }
.qtc-cyan:hover  { background: rgba(111,76,195,.22);  border-color: #5a3da6;  box-shadow: 0 4px 16px rgba(111,76,195,.15); }
.qtc-purple { background: rgba(108,92,231,.12);  border-color: rgba(108,92,231,.25);  color: #5a3da6; }
.qtc-purple:hover { background: rgba(108,92,231,.22);  border-color: rgba(108,92,231,.5);  box-shadow: 0 4px 16px rgba(108,92,231,.15); }
.qtc-green  { background: rgba(56,216,145,.12);  border-color: rgba(56,216,145,.25);  color: #1d7a52; }
.qtc-green:hover  { background: rgba(56,216,145,.22);  border-color: rgba(56,216,145,.5);  box-shadow: 0 4px 16px rgba(56,216,145,.15); }
.qtc-amber  { background: rgba(255,159,67,.12);   border-color: rgba(255,159,67,.25);   color: #8a6d3b; }
.qtc-amber:hover  { background: rgba(255,159,67,.22);   border-color: rgba(255,159,67,.5);   box-shadow: 0 4px 16px rgba(255,159,67,.15); }

/* 模块卡片增强 */
.module-tile { text-decoration: none; }
.tile-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(111,76,195,.45), rgba(111,76,195,.28)); color: #ffffff; font-weight: 900; font-size: 20px; border: 1px solid rgba(111,76,195,.5); box-shadow: 0 0 18px rgba(111,76,195,.35), 0 4px 16px rgba(0,0,0,.25); transition: .22s; }
.module-tile:hover .tile-icon { box-shadow: 0 0 28px rgba(111,76,195,.55), 0 6px 24px rgba(0,0,0,.35); border-color: #5a3da6; transform: scale(1.08); }
.tile-body { display: contents; }
.tile-body b { font-size: 15px; }
.tile-body small { color: var(--muted); line-height: 1.55; }

/* 系统亮点 */
.highlights-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.highlight-card { text-align: center; padding: 20px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--accent,#6F4CC3); transition: transform .18s; }
.highlight-card:hover { transform: translateY(-3px); }
.highlight-icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: rgba(111,76,195,.15); color: #6F4CC3; font-weight: 900; font-size: 18px; }
.highlight-card b { display: block; font-size: 15px; margin-bottom: 6px; }
.highlight-card p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }

/* 任务列表 */
.panel-tasks { flex: 2; }
.panel-quick { flex: 0 0 320px; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); transition: border-color .15s; }
.task-row:hover { border-color: var(--line-strong); }
.task-kind { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.task-kind-single { background: rgba(111,76,195,.15); color: #6F4CC3; }
.task-kind-matching { background: rgba(111,76,195,.15); color: #6F4CC3; }
.task-name { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.task-status-ok { background: rgba(56,216,145,.12); color: #1d7a52; }
.task-status-warn { background: rgba(246,199,102,.12); color: #8a6d3b; }
.task-status-err { background: rgba(255,107,122,.12); color: #c0392b; }
.task-status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.task-time { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.task-link { padding: 4px 10px; border-radius: 8px; background: rgba(111,76,195,.15); color: #6F4CC3; font-size: 13px; font-weight: 600; text-decoration: none; transition: all .15s; }
.task-link:hover { background: rgba(111,76,195,.28); color: #fff; }
.view-all-btn { display: block; text-align: center; margin-top: 10px; padding: 8px !important; }

/* 快速操作 */
.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.quick-btn { font-size: 14px; padding: 12px !important; width: 100%; text-decoration: none; }

/* 空状态 */
.empty-icon { font-size: 36px; font-weight: 300; color: var(--muted); margin-bottom: 8px; }

/* ═══════════════════════════════════════════
   使用协议页样式 (2026-07-17)
   ═══════════════════════════════════════════ */
/* 协议文档容器 */
.terms-document { padding: 40px 44px; max-width: 900px; font-size: 14px; line-height: 2; color: var(--muted); }

/* 文档页头 */
.terms-doc-header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; margin-bottom: 28px; border-bottom: 2px solid var(--line); }
.terms-doc-parties { display: flex; flex-direction: column; gap: 6px; }
.terms-doc-parties div { display: flex; align-items: baseline; gap: 12px; }
.terms-doc-parties label { font-size: 14px; font-weight: 800; color: #6F4CC3; min-width: 40px; }
.terms-doc-parties span { font-size: 15px; font-weight: 600; color: #fff; }
.terms-doc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; color: var(--muted); }

/* 序言 */
.terms-preamble { font-size: 14px; color: #1C1822; margin-bottom: 32px; text-indent: 2em; }

/* 条款 */
.terms-article { margin-bottom: 28px; }
.terms-article h2 { font-size: 16px; font-weight: 800; color: #fff; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.06); }
.terms-article p { margin: 0 0 8px; }
.terms-article dt { font-weight: 700; color: #1C1822; margin-top: 8px; }
.terms-article dd { margin: 4px 0 8px 0; padding-left: 16px; border-left: 2px solid rgba(111,76,195,.2); }

/* 签署栏 */
.terms-doc-signature { text-align: center; padding-top: 28px; margin-top: 20px; border-top: 1px solid var(--line); }
.terms-doc-signature p { font-size: 20px; font-weight: 700; color: #fff; margin: 0 0 12px; text-align: center; }
.terms-doc-signature span { display: block; font-size: 13px; color: var(--muted); line-height: 1.8; }

/* 回到顶部 */
.back-to-top { position: fixed; bottom: 28px; right: 28px; width: 44px; height: 44px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; font-size: 20px; text-decoration: none; z-index: 50; transition: all .18s; }
.back-to-top:hover { background: rgba(111,76,195,.15); border-color: #5a3da6; color: #fff; transform: translateY(-2px); }

/* 响应式调整 */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-quick { flex: 0 0 auto; }
}
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .highlights-grid { grid-template-columns: 1fr; }
  .hero-card { grid-template-columns: 1fr; text-align: center; }
  .hero-card img { width: 160px; height: 160px; margin: 0 auto; }
  .module-strip { grid-template-columns: repeat(2,1fr); }
  .task-row { flex-wrap: wrap; }
  .task-time { display: none; }
  /* 表格横向滚动 — 移动端兜底 */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .data-table-wrap table, .yao-table { display: table; white-space: normal; }
}

/* ═══════════════════════════════════════════
   Print Styles — 八字详情页打印优化
   ═══════════════════════════════════════════ */
@media print {
  /* 隐藏导航/侧边栏/页脚 */
  .sidebar,
  .side-nav,
  .footer,
  .brand-block,
  .sidebar-card,
  .profile-bg,
  .profile-bg-orb { display: none !important; }

  /* 隐藏交互按钮 */
  #copy-link-btn,
  .tts-btn,
  .ai-btn,
  .dayun-expand-btn,
  .dayun-quick-timeline,
  .dayun-chevron,
  .dayun-header { cursor: default !important; }
  .dayun-header { display: flex !important; }
  .dayun-chevron { display: none !important; }

  /* 展开所有大运折叠内容 */
  .dayun-expandable { display: block !important; }

  /* 全局打印优化 */
  * {
    background: #fff !important;
    color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
  }
  body {
    font-size: 13px;
    line-height: 1.5;
    color: #000;
  }
  .content-wrap {
    max-width: 100%;
    padding: 10px;
  }
  .panel,
  .info-card,
  .warning-box,
  .disclaimer-card {
    border: 1px solid #ccc !important;
    background: #fff !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .panel-title h2 { font-size: 16px; }
  .page-header { flex-direction: row !important; }
  .header-badge { border: 1px solid #ccc; }
  .wx-fill { background: #666 !important; }
  .tag { border: 1px solid #888; color: #000 !important; background: #f0f0f0 !important; }
  .tag-inline { border: 1px solid #ccc; color: #333 !important; }
  .muted { color: #555 !important; }
  .text-gold { color: #996600 !important; }
  .text-cyan { color: #6F4CC3 !important; }
  .text-green { color: #006600 !important; }
  .form-note { border-left: 3px solid #999; }
  .score-ring { border: 2px solid #999; }
  .score-ring:after { background: #fff !important; }

  /* 图表占位静默 */
  canvas { max-width: 300px; page-break-inside: avoid; }

  /* 缩小间距避免浪费纸张 */
  .panel { margin-top: 8px !important; padding: 12px !important; }
  .detail-grid { margin-top: 8px !important; }
  section.panel { margin-top: 8px !important; }

  /* 大运水平滚动变垂直 */
  .dayun-scroll-wrap { overflow: visible !important; }
  .dayun-scroll-wrap > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    min-width: auto !important;
  }
  .dayun-card {
    min-width: auto !important;
    max-width: 100% !important;
  }

  /* 十神网格适应打印 */
  div[style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  .four-col { grid-template-columns: repeat(2, 1fr) !important; }
  .three-col { grid-template-columns: repeat(3, 1fr) !important; }
  .pillar-grid { grid-template-columns: repeat(4, 1fr) !important; }

  @page {
    margin: 15mm 10mm;
  }

  /* 确保所有元素最小字号12px */
  * { font-size: 13px !important; }
  h1, h2, h3, h4, b, strong {
    font-size: inherit !important;
    font-weight: 700 !important;
  }
  h1 { font-size: 18px !important; }
  h2 { font-size: 15px !important; }
  .pillar-char { font-size: 22px !important; }
}

/* ═══ 右侧浮动导航 ─── */
.floating-nav {
  position: fixed; right: 0; top: 16%;
  z-index: 100;
  display: flex;
  max-width: 36px;
  transition: max-width .3s ease;
  overflow: hidden;
}
.floating-nav:hover { max-width: 140px; }
.floating-nav-tab {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(111,76,195,.2);
  border-radius: 8px 0 0 8px;
  color: var(--cyan);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.floating-nav-menu {
  display: flex; flex-direction: column; gap: 2px;
  padding: 4px 8px 4px 4px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(111,76,195,.2);
  border-left: none;
  border-radius: 0 8px 8px 0;
  white-space: nowrap;
}
.floating-nav-menu a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: all .15s;
}
.floating-nav-menu a:hover {
  background: rgba(111,76,195,.12);
  color: var(--cyan);
}
