/* 源库 · 品牌侧栏升级 + 全站深空银星毛玻璃主题（可通过 html[data-theme="dark"] 无损切换） */

/* ---------- 左侧栏品牌标语与主题按钮（深空与宣纸双模共用） ---------- */
body { padding-left: 196px; }
body > header { width: 196px; padding: 36px 20px 28px; gap: 36px; }
.brand { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
header strong { font-size: 36px; line-height: 1.15; letter-spacing: .06em; }
.brand-logo { width: 32px; height: 32px; }
.brand-tag { font-family: var(--serif); font-size: 12px; letter-spacing: .06em; color: #b5a382; white-space: nowrap; margin-left: 1px; }

.header-foot { margin-top: 0; display: flex; justify-content: center; }
body > header nav { margin-top: clamp(20px, 5.5vh, 56px); margin-bottom: auto; }

#cosmos-bg {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1;
  pointer-events: none; display: none;
}

#custom-bg {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1;
  pointer-events: none; display: none; overflow: hidden;
  background: #020306;
}
#custom-bg-img {
  position: absolute; inset: -24px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  filter: blur(var(--bg-blur, 0px));
  transform: scale(1.04);
  transition: filter .2s ease;
}
#custom-bg::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(3, 5, 11, var(--bg-dim, 0.45));
  transition: background .2s ease;
}
html[data-bg="custom"] #cosmos-bg { display: none !important; }
html[data-bg="custom"] #custom-bg { display: block; }

@media (max-width: 650px) {
  body { padding-left: 76px; }
  body > header { width: 76px; padding: 24px 7px; gap: 24px; }
  header strong { font-size: 22px; }
  .theme-toggle { font-size: 11px; padding: 4px 4px; min-height: 30px; letter-spacing: 0; }
}

/* ---------- 全站深空银星宇宙主题 ---------- */
html[data-theme="dark"] {
  --ink: #eef2fa;
  --panel: rgba(9, 12, 22, 0.62);
  --raised: rgba(22, 28, 46, 0.72);
  --paper: #05070e;
  --gold: #c9d4ea;
  --line: rgba(206, 218, 242, 0.16);
  --muted: #9aa5ba;
  color-scheme: dark;
}

html[data-theme="dark"] #cosmos-bg { display: block; }

html[data-theme="dark"] { background: #020306; }
html[data-theme="dark"] body {
  background: transparent;
  background-image: none;
  animation: none;
  color: var(--ink);
}

/* 左侧导航栏：深空半透黑玻，透出背后行星微光 */
html[data-theme="dark"] body > header {
  background: linear-gradient(180deg, rgba(6, 8, 16, 0.78) 0%, rgba(4, 6, 12, 0.86) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #e6ecf8;
  box-shadow: inset -1px 0 0 rgba(210, 222, 246, 0.14), 8px 0 36px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] body > header::after { display: none; }
html[data-theme="dark"] header strong {
  color: #f4f7fc;
  text-shadow: 0 0 18px rgba(210, 226, 255, 0.32);
}
html[data-theme="dark"] .brand-logo {
  filter: drop-shadow(0 0 8px rgba(200, 218, 255, 0.45));
}
html[data-theme="dark"] .brand-tag { color: #9aa7c0; }
html[data-theme="dark"] body > header nav button { color: #9ea9be; }
html[data-theme="dark"] body > header nav button:hover {
  color: #f2f6ff;
  background: rgba(215, 226, 248, 0.08);
  border-color: rgba(215, 226, 248, 0.24);
}
html[data-theme="dark"] body > header nav button.on {
  color: #ffffff;
  background: linear-gradient(180deg, rgba(220, 232, 255, 0.16), rgba(220, 232, 255, 0.04));
  border-color: rgba(224, 234, 255, 0.55);
  box-shadow: 0 0 18px rgba(190, 212, 255, 0.22), inset 0 0 12px rgba(220, 232, 255, 0.10);
  text-shadow: 0 0 10px rgba(215, 230, 255, 0.45);
}
html[data-theme="dark"] body > header nav::before {
  background: linear-gradient(180deg, #f0f5ff, #8fa6cc);
  box-shadow: 0 0 12px rgba(195, 216, 255, 0.7);
}
html[data-theme="dark"] #account {
  border-color: rgba(210, 222, 245, 0.28);
  box-shadow: 0 0 0 1px rgba(210, 222, 245, 0.28);
}

/* 基础控件与链接 */
html[data-theme="dark"] a { color: #c7d5f0; }
html[data-theme="dark"] a:hover { color: #ffffff; }
html[data-theme="dark"] button {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(14, 16, 30, 0.48);
  transition: background .22s cubic-bezier(.22, 1, .36, 1),
              border-color .22s cubic-bezier(.22, 1, .36, 1),
              color .22s ease,
              transform .22s cubic-bezier(.22, 1, .36, 1),
              box-shadow .24s cubic-bezier(.22, 1, .36, 1);
}
html[data-theme="dark"] button:hover {
  background: rgba(206, 196, 252, 0.13);
  border-color: rgba(212, 200, 255, 0.44);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 22px rgba(8, 6, 20, 0.44), 0 0 18px rgba(178, 152, 255, 0.16);
}
html[data-theme="dark"] button:active:not(:disabled) {
  transform: translateY(0) scale(.97);
  box-shadow: 0 2px 10px rgba(8, 6, 20, 0.35);
}
html[data-theme="dark"] .primary {
  background: linear-gradient(135deg, #f5f3ff, #d5d0f2);
  border-color: rgba(240, 234, 255, 0.78);
  color: #090814;
  font-weight: 600;
}
html[data-theme="dark"] .primary:hover {
  background: #ffffff;
  color: #05070e;
  box-shadow: 0 0 24px rgba(198, 178, 255, 0.42);
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: rgba(8, 11, 20, 0.56);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239aa5ba' stroke-width='1.4'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
html[data-theme="dark"] select option {
  background: #0b0e18;
  color: #eef2fa;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #6f7c94; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] select:focus {
  border-color: rgba(220, 232, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(185, 206, 245, 0.16);
}

/* 五行色在深黑夜空下提亮为清透宝石色 */
html[data-theme="dark"] [data-element="木"] { color: #52e5a2; }
html[data-theme="dark"] [data-element="火"] { color: #ff7466; }
html[data-theme="dark"] [data-element="土"] { color: #e8b578; }
html[data-theme="dark"] [data-element="金"] { color: #f8d878; }
html[data-theme="dark"] [data-element="水"] { color: #6ec4ff; }

/* 四柱八字主字（含原局、专业细盘与名人库）：琉璃玉石光泽 + 立体浮雕 + 双层星辉发光 */
html[data-theme="dark"] .chart-sheet .chart-row:not(.tall) > span > b > [data-element],
html[data-theme="dark"] .now-pillar b > [data-element] {
  display: inline-block;
  font-weight: 600;
  text-shadow: none;
  filter:
    drop-shadow(0 3px 2px rgba(0, 0, 0, 0.88))
    drop-shadow(0 0 8px color-mix(in srgb, currentColor 58%, transparent))
    drop-shadow(0 0 18px color-mix(in srgb, currentColor 34%, transparent));
  transition: transform .22s cubic-bezier(.22, 1, .36, 1), filter .22s ease;
}
@supports (background-clip: text) and (color: color-mix(in srgb, red, white)) {
  html[data-theme="dark"] .chart-sheet .chart-row:not(.tall) > span > b > [data-element],
  html[data-theme="dark"] .now-pillar b > [data-element] {
    background: linear-gradient(168deg,
      color-mix(in srgb, currentColor 34%, #ffffff) 0%,
      color-mix(in srgb, currentColor 82%, #ffffff) 32%,
      currentColor 58%,
      color-mix(in srgb, currentColor 66%, #05070e) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
html[data-theme="dark"] .chart-sheet .chart-row:not(.tall) > span.cell-clickable:hover > b > [data-element] {
  transform: scale(1.07);
  filter:
    drop-shadow(0 4px 3px rgba(0, 0, 0, 0.92))
    drop-shadow(0 0 12px color-mix(in srgb, currentColor 76%, transparent))
    drop-shadow(0 0 24px color-mix(in srgb, currentColor 48%, transparent));
}

/* 首页 */
html[data-theme="dark"] #homeView {
  padding-top: clamp(22px, 4vh, 52px);
}
html[data-theme="dark"] .home-title {
  color: #f5f7fc;
  text-shadow: 0 2px 30px rgba(180, 205, 255, 0.25);
}
html[data-theme="dark"] .home-now,
html[data-theme="dark"] .home-actions {
  border-color: rgba(215, 226, 248, 0.22);
  background: rgba(7, 10, 19, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .home-now:hover {
  border-color: rgba(228, 236, 255, 0.48);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.55), 0 0 24px rgba(190, 210, 255, 0.16);
}
html[data-theme="dark"] .home-actions button {
  border-color: rgba(215, 226, 248, 0.26);
  color: #e6ecf8;
  background: rgba(14, 19, 34, 0.5);
}
html[data-theme="dark"] .home-actions button.primary {
  background: linear-gradient(135deg, #f4f7fc, #ced9ed);
  border-color: rgba(255, 255, 255, 0.72);
  color: #070a12;
  box-shadow: 0 0 20px rgba(200, 218, 255, 0.28);
}
html[data-theme="dark"] .home-links {
  border-top-color: rgba(215, 226, 248, 0.22);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
  margin-top: clamp(76px, 12vh, 148px);
  padding-top: 34px;
}
html[data-theme="dark"] .home-links > div {
  background: rgba(6, 9, 17, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(215, 226, 248, 0.16);
  border-radius: 16px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
  transition: border-color .2s, transform .2s, box-shadow .2s, background .2s;
}
html[data-theme="dark"] .home-links > div:hover {
  border-color: rgba(228, 236, 255, 0.44);
  background: rgba(10, 14, 26, 0.68);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 20px rgba(190, 210, 255, 0.12);
}
html[data-theme="dark"] .home-links p { color: #cbd4e6; margin-bottom: 0; max-width: none; }
@media (max-width: 820px) {
  html[data-theme="dark"] #homeView { padding-top: 12px; }
  html[data-theme="dark"] .home-links { margin-top: 40px; padding-top: 24px; }
}
@media (max-width: 650px) {
  html[data-theme="dark"] .home-links { grid-template-columns: 1fr; }
  html[data-theme="dark"] .home-links > div { padding: 20px 20px; }
}
html[data-theme="dark"] .now-hint,
html[data-theme="dark"] .now-pillar small { color: #b8c6df; }
html[data-theme="dark"] .now-time strong {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: .06em;
  color: #dbe3f2;
}

/* 排盘工作台 */
html[data-theme="dark"] #birth {
  border-left-color: var(--line);
  background: rgba(7, 10, 19, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 26px;
}
html[data-theme="dark"] #birth .line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 6px 0;
}
html[data-theme="dark"] #birth .line > span:first-child,
html[data-theme="dark"] #birth .group-line > label {
  width: auto;
  color: #cfd7e8;
}
html[data-theme="dark"] #birth .line input,
html[data-theme="dark"] #birth .group-field input {
  background: rgba(215, 224, 248, 0.05);
  border: 1px solid rgba(215, 224, 248, 0.14);
  border-radius: 10px;
  padding: 8px 12px;
  min-height: 40px;
  text-align: left;
  width: 100%;
  min-width: 0;
  color: #eef2fa;
}
html[data-theme="dark"] #birth .line input:focus,
html[data-theme="dark"] #birth .group-field input:focus {
  border-color: rgba(215, 226, 250, 0.44);
  background: rgba(215, 224, 248, 0.08);
}
html[data-theme="dark"] #birth .group-field {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  gap: 6px;
}
html[data-theme="dark"] #birth #chooseTime {
  padding: 6px 0;
  background: transparent;
  box-shadow: none;
}
html[data-theme="dark"] #birth #chooseTime:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}
html[data-theme="dark"] #birthText {
  width: 100%;
  text-align: left;
  color: #e4ebf8;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(215, 224, 248, 0.14);
  background: rgba(215, 224, 248, 0.05);
}
html[data-theme="dark"] #birth #chooseTime:hover #birthText {
  border-color: rgba(215, 226, 250, 0.36);
  background: rgba(215, 224, 248, 0.09);
}
html[data-theme="dark"] #birth .line:has(.save-toggle) {
  display: flex;
  justify-content: space-between;
}
html[data-theme="dark"] #birth .save-toggle input {
  flex: none;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #dce4f5;
  cursor: pointer;
}
html[data-theme="dark"] .group-menu {
  background: #0d111e;
  border-color: var(--line);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
}
html[data-theme="dark"] #instant,
html[data-theme="dark"] #save {
  border-color: rgba(215, 226, 248, 0.28);
  color: #dfe7f5;
  background: rgba(14, 18, 32, 0.56);
}
html[data-theme="dark"] #instant:hover,
html[data-theme="dark"] #save:hover {
  border-color: rgba(228, 236, 255, 0.52);
  background: rgba(215, 228, 255, 0.12);
}
html[data-theme="dark"] .chart-sheet {
  background: rgba(7, 10, 19, 0.62);
  backdrop-filter: blur(12px);
  border-color: var(--line);
  border-radius: 14px;
}
html[data-theme="dark"] .chart-row:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }
html[data-theme="dark"] .chart-head { background: rgba(215, 228, 252, 0.08); color: #c7d2e6; }
html[data-theme="dark"] .chart-row.tall > span.cell-shensha { color: #c9d4ea; }
html[data-theme="dark"] .cell-shensha .sha { background: rgba(210, 222, 246, 0.1); }
html[data-theme="dark"] .segment label:has(input:checked),
html[data-theme="dark"] #modes button.on {
  background: #edf2fb;
  color: #080b14;
  border-color: #edf2fb;
}

/* 弹窗与时间滚轮 */
html[data-theme="dark"] dialog {
  background: rgba(10, 13, 24, 0.94);
  backdrop-filter: blur(16px);
  border-color: rgba(215, 226, 248, 0.24);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72);
}
html[data-theme="dark"] dialog::backdrop { background: rgba(2, 3, 8, 0.74); }
html[data-theme="dark"] .picker-sheet {
  background: #0a0d17;
  border-color: rgba(215, 226, 248, 0.28);
}
html[data-theme="dark"] .picker-tabs { background: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .picker-tab.on { background: #e8eef9; color: #070a12; }
html[data-theme="dark"] .picker-ok { background: #e8eef9; color: #070a12; border-color: #e8eef9; }
html[data-theme="dark"] .picker-wheel::after { background: rgba(255, 255, 255, 0.05); border-color: rgba(215, 226, 248, 0.35); }
html[data-theme="dark"] .picker-wheel-row:hover { color: #ffffff; }
html[data-theme="dark"] .picker-preview { color: #eef2fa; }
html[data-theme="dark"] .error,
html[data-theme="dark"] #status,
html[data-theme="dark"] #authMsg,
html[data-theme="dark"] .picker-error,
html[data-theme="dark"] .composer-msg { color: #ff8478; }

/* 名人库：一行四卡、紧凑对称、等高顶格 */
html[data-theme="dark"] .archive-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
html[data-theme="dark"] .archive-entry {
  border-top-color: rgba(215, 226, 248, 0.26);
  background: rgba(7, 10, 19, 0.48);
  backdrop-filter: blur(8px);
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
html[data-theme="dark"] .archive-entry small {
  font-size: 12px;
}
html[data-theme="dark"] .archive-entry h3 {
  font-size: 20px;
  margin: 6px 0 4px;
  line-height: 1.3;
}
html[data-theme="dark"] .archive-entry p {
  font-size: 13px;
  min-height: 20px;
  margin: 0 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-theme="dark"] .archive-entry footer {
  margin-top: auto;
  padding-top: 10px;
  font-size: 12px;
  gap: 6px;
}
@media (max-width: 960px) {
  html[data-theme="dark"] .archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  html[data-theme="dark"] .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  html[data-theme="dark"] .archive-grid { grid-template-columns: 1fr; }
}
html[data-theme="dark"] .archive-entry .entry-talk {
  color: #d5dff2;
  border-color: rgba(215, 226, 248, 0.28);
}
html[data-theme="dark"] .archive-entry .entry-talk:hover {
  color: #ffffff;
  border-color: rgba(235, 242, 255, 0.6);
}
html[data-theme="dark"] .tray:not(:empty) {
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(12px);
  border-color: rgba(215, 226, 248, 0.28);
  border-radius: 14px;
}

/* 广场、十日主圈、个人主页与命牌 */
html[data-theme="dark"] .world-main {
  background: rgba(6, 9, 17, 0.54);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 26px;
}
html[data-theme="dark"] .rail-card,
html[data-theme="dark"] .profile-hero,
html[data-theme="dark"] .topic-wrap,
html[data-theme="dark"] .friends-wrap {
  background: rgba(7, 10, 19, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--line);
}
html[data-theme="dark"] .topic-wrap,
html[data-theme="dark"] .friends-wrap {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 28px;
}
html[data-theme="dark"] .world-tabs button.active::after { background: #e2eaf8; }
html[data-theme="dark"] .post-text,
html[data-theme="dark"] .profile-info p,
html[data-theme="dark"] .circle-card-body > span { color: #cfd7e6; }
html[data-theme="dark"] .post-name:hover,
html[data-theme="dark"] .post-title:hover,
html[data-theme="dark"] .rail-name:hover,
html[data-theme="dark"] .rail-hot:hover span,
html[data-theme="dark"] .people-name:hover { color: #ffffff; }
html[data-theme="dark"] .rail-hot b,
html[data-theme="dark"] .rail-link,
html[data-theme="dark"] .act.on,
html[data-theme="dark"] .friends-body h3 { color: #c7d6f2; }
html[data-theme="dark"] .rail-link:hover { color: #ffffff; }
html[data-theme="dark"] .act:hover { background: rgba(215, 228, 250, 0.12); color: #ffffff; }
html[data-theme="dark"] .follow { border-color: rgba(215, 226, 248, 0.45); color: #e2eaf8; }
html[data-theme="dark"] .follow:hover { background: rgba(215, 226, 248, 0.14); }
html[data-theme="dark"] .ghost { border-color: var(--line); color: #e2eaf8; }
html[data-theme="dark"] .ghost:hover,
html[data-theme="dark"] .tool:hover { border-color: rgba(226, 236, 255, 0.52); background: rgba(215, 228, 252, 0.1); }
html[data-theme="dark"] .ghost.on { border-color: rgba(226, 236, 255, 0.62); color: #ffffff; }
html[data-theme="dark"] .tool { border-color: var(--line); color: #e2eaf8; background: rgba(10, 14, 26, 0.42); }
html[data-theme="dark"] .tool-badge,
html[data-theme="dark"] .dm-dot { background: #e8eef9; color: #070a12; }

/* 命牌与十日主圈卡片 */
html[data-theme="dark"] .mp-badge {
  background: color-mix(in srgb, currentColor 14%, rgba(8, 11, 20, 0.85));
  border-color: color-mix(in srgb, currentColor 42%, transparent);
}
html[data-theme="dark"] a.mp-badge:hover {
  background: color-mix(in srgb, currentColor 24%, rgba(8, 11, 20, 0.9));
}
html[data-theme="dark"] .mp-card,
html[data-theme="dark"] .mp-preview,
html[data-theme="dark"] .circle-card,
html[data-theme="dark"] .famous-card {
  background: rgba(11, 15, 28, 0.68);
  border-color: var(--line);
}
html[data-theme="dark"] .mp-card[data-element],
html[data-theme="dark"] .circle-hero {
  background: linear-gradient(145deg, color-mix(in srgb, currentColor 11%, rgba(9, 13, 24, 0.82)), rgba(7, 10, 19, 0.72) 72%);
  border-color: color-mix(in srgb, currentColor 32%, var(--line));
}
html[data-theme="dark"] .mp-seal,
html[data-theme="dark"] .circle-seal,
html[data-theme="dark"] .circle-hero-seal,
html[data-theme="dark"] .famous-pillar,
html[data-theme="dark"] .rail-circle {
  background: rgba(6, 9, 18, 0.82);
  border-color: color-mix(in srgb, currentColor 35%, var(--line));
}
html[data-theme="dark"] .rail-circle:hover,
html[data-theme="dark"] .rail-circle.on {
  background: color-mix(in srgb, currentColor 18%, rgba(8, 12, 24, 0.9));
}
html[data-theme="dark"] .rail-circle.mine { box-shadow: inset 0 0 0 1px rgba(232, 240, 255, 0.65); }
html[data-theme="dark"] .mp-chip {
  border-color: rgba(215, 226, 248, 0.34);
  color: #dce5f6;
  background: rgba(215, 226, 248, 0.08);
}
html[data-theme="dark"] .mp-inline-btn,
html[data-theme="dark"] .rail-mp-btn {
  border-color: rgba(215, 226, 248, 0.36);
  color: #d6e1f5;
}
html[data-theme="dark"] .mp-warn {
  color: #e5c68a;
  background: rgba(229, 198, 138, 0.12);
}
html[data-theme="dark"] .circles-lead {
  border-color: rgba(215, 226, 248, 0.26);
  background: linear-gradient(145deg, rgba(215, 226, 248, 0.09), rgba(8, 11, 22, 0.64));
}
html[data-theme="dark"] .circle-card.mine,
html[data-theme="dark"] .circle-card:hover { border-color: rgba(228, 236, 255, 0.55); }
html[data-theme="dark"] .gan-filter.on { background: #edf2fb; color: #070a12 !important; border-color: #edf2fb; }
html[data-theme="dark"] .rail-famous { border-bottom-color: rgba(215, 226, 248, 0.1); }
html[data-theme="dark"] .topic-head,
html[data-theme="dark"] .reply-heading { border-color: rgba(215, 226, 248, 0.26); }

/* 私信 */
html[data-theme="dark"] .dm-layout {
  background: rgba(7, 10, 19, 0.72);
  backdrop-filter: blur(14px);
  border-color: var(--line);
}
html[data-theme="dark"] .dm-item { border-bottom-color: rgba(215, 226, 248, 0.08); }
html[data-theme="dark"] .dm-item:hover { background: rgba(215, 226, 248, 0.06); }
html[data-theme="dark"] .dm-item.on { background: rgba(215, 226, 248, 0.12); }
html[data-theme="dark"] .dm-thread { background: rgba(4, 6, 12, 0.45); }
html[data-theme="dark"] .bubble {
  background: rgba(16, 22, 38, 0.85);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] .bubble-row.mine .bubble {
  background: rgba(210, 224, 248, 0.18);
  border-color: rgba(210, 224, 248, 0.34);
  color: #f4f7fc;
}

/* 咨询页 */
html[data-theme="dark"] .consult-card {
  background: rgba(7, 10, 19, 0.62);
  backdrop-filter: blur(12px);
  border-color: var(--line);
}
html[data-theme="dark"] .consult-card:hover {
  border-color: rgba(226, 236, 255, 0.46);
  box-shadow: 0 0 24px rgba(185, 206, 248, 0.14);
}
html[data-theme="dark"] .consult-price,
html[data-theme="dark"] .consult-name:hover { color: #e2ebf8; }
html[data-theme="dark"] .consult-tags span {
  border-color: rgba(215, 226, 248, 0.3);
  color: #d6e1f5;
  background: rgba(215, 226, 248, 0.08);
}
html[data-theme="dark"] .consult-steps { border-top-color: rgba(215, 226, 248, 0.24); }
html[data-theme="dark"] .consult-steps li::before {
  border-color: rgba(215, 226, 248, 0.48);
  color: #e6eefc;
}
html[data-theme="dark"] .consult-mine {
  border-color: rgba(215, 226, 248, 0.24);
  background: rgba(7, 10, 19, 0.58);
  backdrop-filter: blur(12px);
}
html[data-theme="dark"] .user-avatar { background: #1a2134; }

@media (max-width: 650px) {
  html[data-theme="dark"] .world-main,
  html[data-theme="dark"] .topic-wrap,
  html[data-theme="dark"] .friends-wrap { padding: 14px 14px; border-radius: 14px; }
}

/* 排盘页：五行比例 + 格局概括毛玻璃卡片（单列舒展排布，保证进度条全宽清晰） */
.chart-insight {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.insight-block {
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(9, 11, 22, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(220, 210, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.insight-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.insight-head h3 {
  font: 500 20px/1.25 var(--serif);
  margin: 0;
  color: #f3f1ff;
}
.insight-head small {
  font-size: 12px;
  color: var(--muted);
}
.wx-bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.wx-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 86px 46px;
  align-items: center;
  gap: 10px;
}
.wx-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.wx-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(215, 222, 248, 0.08);
  overflow: hidden;
  border: 1px solid rgba(215, 222, 248, 0.08);
}
.wx-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, currentColor 65%, transparent), currentColor);
  box-shadow: 0 0 12px color-mix(in srgb, currentColor 45%, transparent);
  transition: width .48s cubic-bezier(.22, 1, .36, 1);
}
.wx-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.wx-meta b {
  font-family: var(--serif);
  font-size: 14px;
  color: #eef2fa;
}
.wx-meta small {
  font-size: 11px;
  color: var(--muted);
}
.wx-state {
  text-align: center;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.wx-state.st-high { color: #f6d57a; background: rgba(246, 213, 122, 0.14); border-color: rgba(246, 213, 122, 0.34); }
.wx-state.st-mid { color: #c7d5f0; background: rgba(199, 213, 240, 0.1); border-color: rgba(199, 213, 240, 0.24); }
.wx-state.st-low { color: #b8a8e6; background: rgba(184, 168, 230, 0.12); border-color: rgba(184, 168, 230, 0.28); }
.wx-state.st-zero { color: #ff8c82; background: rgba(255, 140, 130, 0.12); border-color: rgba(255, 140, 130, 0.3); }

.geju-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.geju-pill {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(210, 200, 250, 0.28);
  background: rgba(190, 174, 245, 0.1);
  color: #eae6ff;
}
.geju-pill[data-element] {
  border-color: color-mix(in srgb, currentColor 42%, transparent);
  background: color-mix(in srgb, currentColor 14%, rgba(10, 12, 24, 0.72));
}
.geju-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.72;
  color: #d6ddf0;
}
.geju-note {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(215, 222, 248, 0.1);
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .chart-insight { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .insight-block { padding: 16px 15px; border-radius: 14px; }
  .wx-row { grid-template-columns: 22px minmax(0, 1fr) 76px 42px; gap: 7px; }
}

/* 白话术语释义触发按钮与毛玻璃气泡 */
.term-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: 0;
  background: transparent !important;
  padding: 2px 4px;
  min-height: 0;
  color: inherit;
  font: inherit;
  border-radius: 6px;
  box-shadow: none !important;
}
.term-trigger:hover {
  color: #f3f0ff;
  transform: none !important;
}
.term-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 10px;
  line-height: 1;
  color: #c8bef2;
  border: 1px solid rgba(200, 190, 242, 0.36);
  background: rgba(190, 174, 245, 0.12);
  flex: none;
}
.term-trigger:hover .term-dot {
  color: #ffffff;
  border-color: rgba(226, 218, 255, 0.72);
  background: rgba(190, 174, 245, 0.28);
}
.term-dict-btn {
  min-height: 30px;
  padding: 3px 12px;
  font-size: 12px;
  border-radius: 999px;
  color: #ded6ff;
  border-color: rgba(204, 192, 250, 0.34);
  background: rgba(190, 174, 245, 0.1);
}
.term-popover {
  position: fixed;
  z-index: 90;
  width: min(310px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(212, 202, 255, 0.36);
  background: rgba(12, 14, 28, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.68), 0 0 22px rgba(176, 152, 255, 0.18);
  color: #eef2fa;
}
.term-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.term-popover-head strong {
  font-family: var(--serif);
  font-size: 16px;
  color: #f5f2ff;
}
.term-popover-sub {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 202, 255, 0.3);
  background: rgba(190, 174, 245, 0.14);
  color: #e4dcff;
}
.term-popover-sub[data-element] {
  border-color: color-mix(in srgb, currentColor 45%, transparent);
  background: color-mix(in srgb, currentColor 16%, rgba(12, 14, 28, 0.8));
}
.cell-clickable {
  cursor: pointer;
  border-radius: 8px;
  transition: background .18s ease, transform .18s ease, filter .18s ease;
}
.cell-clickable:hover {
  background: rgba(206, 196, 252, 0.12);
  filter: brightness(1.12);
}
.cell-shensha .sha.cell-clickable {
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  border: 1px solid transparent;
}
.cell-shensha .sha.cell-clickable:hover {
  background: rgba(198, 182, 255, 0.2);
  border-color: rgba(212, 200, 255, 0.42);
  color: #ffffff;
}
.chart-tap-hint {
  margin: 8px 2px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  letter-spacing: .02em;
}
.term-popover-close {
  min-height: 24px;
  width: 24px;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  box-shadow: none !important;
}
.term-popover p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.68;
  color: #d6ddf0;
}
.term-dict-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 4px;
}
.term-dict-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(215, 226, 248, 0.14);
  background: rgba(8, 11, 22, 0.6);
}
.term-dict-item strong {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  color: #f2efff;
  margin-bottom: 4px;
}
.term-dict-item p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: #cfd7e8;
}

/* ==================== 大字模式（偏大 / 长辈友好大字） ==================== */
html[data-font-size="large"] body { font-size: 18px; }
html[data-font-size="large"] small { font-size: 15px; }
html[data-font-size="large"] body > header nav button { font-size: 17px; }
html[data-font-size="large"] .chart-sheet { font-size: 16.5px; }
html[data-font-size="large"] .chart-row > .row-label,
html[data-font-size="large"] .chart-head { font-size: 15.5px; }
html[data-font-size="large"] .geju-text,
html[data-font-size="large"] .term-popover p,
html[data-font-size="large"] .term-dict-item p,
html[data-font-size="large"] .set-hero p,
html[data-font-size="large"] .set-card-head p,
html[data-font-size="large"] .set-fb-body,
html[data-font-size="large"] .home-links p { font-size: 16px; }
html[data-font-size="large"] .wx-meta b { font-size: 16px; }
html[data-font-size="large"] .wx-meta small,
html[data-font-size="large"] .geju-pill,
html[data-font-size="large"] .geju-note,
html[data-font-size="large"] .cell-shensha { font-size: 13.5px; }
html[data-font-size="large"] .now-time strong { font-size: 16px; }
html[data-font-size="large"] .line input,
html[data-font-size="large"] #birthText,
html[data-font-size="large"] .group-field input { font-size: 16px; }

html[data-font-size="xlarge"] body { font-size: 20px; line-height: 1.8; }
html[data-font-size="xlarge"] small { font-size: 16.5px; }
html[data-font-size="xlarge"] button { font-size: 18px; }
html[data-font-size="xlarge"] body > header nav button { font-size: 18px; padding: 11px 16px; }
html[data-font-size="xlarge"] .chart-sheet { font-size: 18px; }
html[data-font-size="xlarge"] .chart-row { grid-template-columns: 104px repeat(4, minmax(0, 1fr)); }
html[data-font-size="xlarge"] .chart-row > .row-label,
html[data-font-size="xlarge"] .chart-head { font-size: 17px; }
html[data-font-size="xlarge"] .geju-text,
html[data-font-size="xlarge"] .term-popover p,
html[data-font-size="xlarge"] .term-dict-item p,
html[data-font-size="xlarge"] .set-hero p,
html[data-font-size="xlarge"] .set-card-head p,
html[data-font-size="xlarge"] .set-fb-body,
html[data-font-size="xlarge"] .home-links p,
html[data-font-size="xlarge"] .post-text,
html[data-font-size="xlarge"] .archive-title p { font-size: 18px; line-height: 1.8; }
html[data-font-size="xlarge"] .insight-head h3 { font-size: 23px; }
html[data-font-size="xlarge"] .wx-row { grid-template-columns: 30px minmax(0, 1fr) 104px 54px; }
html[data-font-size="xlarge"] .wx-name { font-size: 19px; }
html[data-font-size="xlarge"] .wx-meta b { font-size: 17.5px; }
html[data-font-size="xlarge"] .wx-meta small,
html[data-font-size="xlarge"] .wx-state,
html[data-font-size="xlarge"] .geju-pill,
html[data-font-size="xlarge"] .geju-note,
html[data-font-size="xlarge"] .cell-shensha { font-size: 15px; }
html[data-font-size="xlarge"] .now-time strong { font-size: 17.5px; }
html[data-font-size="xlarge"] .line input,
html[data-font-size="xlarge"] #birthText,
html[data-font-size="xlarge"] .group-field input { font-size: 17.5px; }
html[data-font-size="xlarge"] .term-dot { width: 18px; height: 18px; font-size: 12px; }

/* ==================== 名人库卡片直达 + 左排盘右档案详情页 ==================== */
html[data-theme="dark"] .archive-entry.archive-clickable {
  cursor: pointer;
  transition: border-color .22s cubic-bezier(.22, 1, .36, 1),
              transform .22s cubic-bezier(.22, 1, .36, 1),
              background .22s ease,
              box-shadow .24s ease;
}
html[data-theme="dark"] .archive-entry.archive-clickable:hover {
  border-color: rgba(212, 200, 255, 0.48);
  background: rgba(12, 15, 29, 0.66);
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.46), 0 0 22px rgba(178, 156, 255, 0.14);
}
.entry-enter-hint {
  color: #c8bef2;
  font-size: 12px;
  white-space: nowrap;
  transition: transform .2s ease, color .2s ease;
}
.archive-entry.archive-clickable:hover .entry-enter-hint {
  color: #ffffff;
  transform: translateX(3px);
}

.celeb-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.celeb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.celeb-back {
  min-height: 40px;
  padding: 6px 18px;
  font-size: 14px;
}
.celeb-top-acts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.celeb-top-acts button {
  min-height: 38px;
  padding: 6px 16px;
  font-size: 13px;
}

.celeb-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: 28px;
  align-items: start;
}
.celeb-chart-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.celeb-chart-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 4px;
}
.celeb-chart-meta strong {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: #f3f0ff;
}
.celeb-chart-meta small {
  font-size: 13px;
  color: var(--muted);
}
.celeb-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.celeb-versions button {
  min-height: 34px;
  padding: 4px 14px;
  font-size: 13px;
}
.celeb-versions button.on {
  background: #edf2fb;
  color: #080b14;
  border-color: #edf2fb;
  font-weight: 600;
}

/* 右侧名人档案卡 */
.celeb-dossier {
  padding: 26px 28px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 21, 0.66);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(224, 214, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.celeb-head {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.celeb-photo-wrap {
  width: 142px;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(215, 206, 252, 0.32);
  background: rgba(14, 17, 32, 0.85);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  flex: none;
}
.celeb-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.04) saturate(0.92);
}
.celeb-photo-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 25%, rgba(168, 146, 235, 0.24), rgba(8, 10, 20, 0.92));
  font-family: var(--serif);
  font-size: 38px;
  color: #e6e0ff;
  letter-spacing: .08em;
}
.celeb-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.celeb-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 3.2vw, 46px);
  line-height: 1.15;
  letter-spacing: .04em;
  color: #f7f5ff;
  text-shadow: 0 2px 22px rgba(190, 172, 255, 0.26);
}
.celeb-alias {
  font-family: Georgia, serif;
  font-size: 15px;
  color: #a9b4cc;
  letter-spacing: .02em;
}
.celeb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.celeb-tag {
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(210, 198, 252, 0.36);
  background: rgba(186, 168, 245, 0.14);
  color: #ece6ff;
}
.celeb-tag.subtle {
  border-color: var(--line);
  background: rgba(215, 226, 248, 0.06);
  color: var(--muted);
}
.celeb-facts {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.celeb-fact {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13.5px;
  color: #dce3f4;
}
.celeb-fact small {
  flex: none;
  width: 46px;
  font-size: 12px;
  color: var(--muted);
}

.celeb-section {
  padding-top: 18px;
  border-top: 1px solid rgba(215, 222, 248, 0.12);
}
.celeb-section h2 {
  font: 500 19px/1.3 var(--serif);
  margin: 0 0 10px;
  color: #f2efff;
}
.celeb-section > p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: #d4dcee;
}

/* 关键年份与事件星轨时间轴 */
.celeb-timeline {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.celeb-timeline::before {
  content: "";
  position: absolute;
  left: 58px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(206, 192, 255, 0.45), rgba(206, 192, 255, 0.12));
}
.celeb-timeline li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  position: relative;
}
.celeb-timeline li::before {
  content: "";
  position: absolute;
  left: 54.5px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dfd6ff;
  box-shadow: 0 0 10px rgba(196, 178, 255, 0.72);
}
.celeb-year {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: #e2d8ff;
  text-align: right;
  letter-spacing: .04em;
}
.celeb-ev-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.68;
  color: #d6def0;
}

.celeb-source {
  padding-top: 14px;
  border-top: 1px solid rgba(215, 222, 248, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.celeb-source p { margin: 0; font-size: 12.5px; color: var(--muted); }

html[data-font-size="large"] .celeb-section > p,
html[data-font-size="large"] .celeb-ev-text { font-size: 16px; }
html[data-font-size="xlarge"] .celeb-section > p,
html[data-font-size="xlarge"] .celeb-ev-text { font-size: 18px; line-height: 1.82; }
html[data-font-size="xlarge"] .celeb-year { font-size: 17px; }

@media (max-width: 1020px) {
  .celeb-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .celeb-dossier { padding: 18px 16px; border-radius: 16px; }
  .celeb-head { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; }
  .celeb-photo-wrap { width: 104px; }
  .celeb-name { font-size: 28px; }
}

/* ==================== 排盘页单态切换（录入居中 / 排盘后隐藏档案全宽展示） ==================== */
#work.mode-form {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 16px;
}
#work.mode-form #birth {
  width: min(480px, 100%);
  max-width: 100%;
}
#work.mode-result {
  display: block;
  max-width: 1180px;
  margin: 0 auto;
}
#work.mode-result > article {
  width: 100%;
}
.work-chart-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 0 4px;
}
.work-chart-summary strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: #f5f2ff;
}
.work-chart-summary small {
  font-size: 13.5px;
  color: var(--muted);
}

/* ==================== 原局排盘 ｜ 专业细盘 双模滑动切换 ==================== */
.chart-deck {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chart-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.chart-seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 13, 24, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-width: 248px;
}
.chart-seg-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  pointer-events: none;
  background: linear-gradient(135deg, #f4f2ff, #cfc9f0);
  box-shadow: 0 0 18px rgba(196, 182, 255, 0.34);
  transition: transform .34s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
.chart-seg.is-pro .chart-seg-thumb {
  transform: translateX(100%);
}
html[data-theme="dark"] .chart-seg-btn,
.chart-seg-btn {
  position: relative;
  z-index: 1;
  min-height: 36px;
  padding: 5px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .24s ease;
  box-shadow: none;
}
html[data-theme="dark"] .chart-seg-btn:hover,
.chart-seg-btn:hover {
  color: var(--ink);
  background: transparent;
  transform: none;
  box-shadow: none;
}
html[data-theme="dark"] .chart-seg-btn.active,
.chart-seg-btn.active {
  background: transparent;
  color: #080914;
  font-weight: 600;
  box-shadow: none;
}
.chart-deck-acts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chart-deck-acts button {
  min-height: 38px;
  padding: 6px 16px;
  font-size: 13px;
}

.chart-viewport {
  width: 100%;
  overflow: hidden;
}
.chart-track {
  display: flex;
  width: 200%;
  align-items: flex-start;
  transition: transform .38s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
.chart-track.is-pro {
  transform: translateX(-50%);
}
.chart-slide-pane {
  width: 50%;
  flex: none;
  min-width: 0;
}

/* ==================== 专业细盘（六柱表 + 起运条 + 大运流年交互条） ==================== */
.xipan-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.xipan-row {
  grid-template-columns: 74px repeat(6, minmax(0, 1fr));
}
.xipan-row b {
  font-size: 36px;
}
.xipan-row.tall b {
  font-size: 17px;
}
.xipan-hide-line {
  gap: 3px;
}
.xipan-hide-line small {
  font-size: 11px;
}
.xipan-dyn-head {
  color: #dcd3ff;
  font-weight: 600;
}
.xipan-dyn-cell {
  background: rgba(186, 168, 250, 0.055);
}

.xipan-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.62);
  backdrop-filter: blur(12px);
}
.xipan-meta-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #d6def0;
}
.xipan-meta-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.xipan-age-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.xipan-age-box strong {
  font-family: var(--serif);
  font-size: 16px;
  color: #f3f0ff;
}
.xipan-age-box small {
  font-size: 12px;
  color: var(--muted);
}
.xipan-now-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  border-color: rgba(210, 198, 252, 0.42);
  color: #f2edff;
  background: rgba(188, 170, 250, 0.14);
}

/* 大运 / 流年横向选择条 */
.xipan-strip-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(7, 10, 20, 0.62);
  backdrop-filter: blur(12px);
}
.xipan-strip-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border-right: 1px solid var(--line);
  background: rgba(215, 222, 248, 0.05);
  font-family: var(--serif);
  font-size: 14px;
  color: #d7d0f6;
}
.xipan-strip-label small {
  font-size: 11px;
  color: var(--muted);
}
.xipan-strip-list {
  display: grid;
  grid-template-columns: repeat(10, minmax(56px, 1fr));
  overflow-x: auto;
  scrollbar-width: thin;
}
html[data-theme="dark"] .xipan-cell,
.xipan-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 10px 4px;
  min-height: 0;
  border: 0;
  border-right: 1px solid rgba(215, 222, 248, 0.08);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  position: relative;
  box-shadow: none;
}
.xipan-cell:last-child {
  border-right: 0;
}
html[data-theme="dark"] .xipan-cell:hover {
  background: rgba(206, 196, 252, 0.1);
  transform: none;
  box-shadow: none;
}
html[data-theme="dark"] .xipan-cell.on {
  background: linear-gradient(180deg, rgba(202, 188, 255, 0.24), rgba(162, 148, 230, 0.12));
  box-shadow: inset 0 2px 0 #dfd6ff;
}
.xipan-cell > small {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
}
.xipan-cell.on > small:first-child {
  color: #ffffff;
  font-weight: 600;
}
.xipan-gz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 3px 0;
}
.xipan-gz-row {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1.2;
}
.xipan-gz-row b {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}
.xipan-gz-row i {
  font-style: normal;
  font-size: 10px;
  color: #b7c2d8;
}
.xipan-xy {
  font-family: var(--serif);
  font-size: 11.5px !important;
  color: #b9c3d8 !important;
  margin-top: 2px;
}
.xipan-cell.is-now::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff6b5e;
  box-shadow: 0 0 8px rgba(255, 107, 94, 0.8);
  margin-top: 3px;
}

.xipan-hint-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 22, 0.58);
}
.xipan-hint-bar small {
  font-size: 13px;
  color: var(--muted);
}
.xipan-hint-tag {
  font-size: 12.5px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid rgba(206, 198, 248, 0.28);
  background: rgba(190, 178, 245, 0.12);
  color: #e6e1ff;
}
.xipan-hint-tag.warn {
  border-color: rgba(255, 130, 118, 0.42);
  background: rgba(255, 107, 94, 0.14);
  color: #ff9c92;
}

@media (max-width: 780px) {
  .xipan-row { grid-template-columns: 56px repeat(6, minmax(0, 1fr)); font-size: 13px; }
  .xipan-row b { font-size: 24px; }
  .xipan-row.tall b { font-size: 14px; }
  .xipan-strip-row { grid-template-columns: 42px minmax(0, 1fr); }
}

/* 咨询、名人库、记录页统一居中；原局排盘改为左四柱右五行格局双栏 */
body[data-page="1"] .hero,
body[data-page="1"] #library,
body[data-page="3"] .hero {
  max-width: 1080px;
  margin-inline: auto;
}
body[data-page="3"] .hero,
body[data-page="1"] .hero {
  margin-bottom: 32px;
}
body[data-page="2"] .hero,
body[data-page="2"] #library {
  max-width: 1180px;
  margin-inline: auto;
}
body[data-page="2"] .hero {
  margin-bottom: 32px;
}

/* 主星与副星字体、字号、加粗完全统一 */
.chart-sheet .cell-mainstar,
.chart-sheet .chart-row.tall .cell-line > b:not(:has([data-element])) {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .02em;
}
.xipan-sheet .cell-mainstar {
  font-size: 15px;
}

/* 直接点击导航栏「排盘」：左侧新建排盘 + 右侧排盘记录双栏视图 */
#work.mode-split {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
  gap: 26px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}
#work.mode-split #birth {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
}
.work-cases-panel {
  grid-column: 2;
  grid-row: 1;
  padding: 24px 26px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(7, 10, 19, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 420px;
}
.work-cases-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.work-cases-head h2 {
  font: 500 22px/1.3 var(--serif);
  margin: 0;
}
.work-cases-head small {
  font-size: 12px;
  color: var(--muted);
}
.work-cases-empty {
  margin: auto 0;
  padding: 36px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.work-cases-empty p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 320px;
}
.work-cases-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}
.work-case-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(215, 224, 248, 0.14);
  background: rgba(12, 16, 28, 0.56);
  transition: border-color .2s, background .2s;
}
.work-case-item:hover {
  border-color: rgba(215, 226, 250, 0.36);
  background: rgba(215, 226, 250, 0.08);
}
.work-case-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.work-case-info strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: #eef2fa;
}
.work-case-info small {
  font-size: 12.5px;
  color: var(--muted);
}
.work-case-item button {
  min-height: 34px;
  padding: 4px 16px;
  font-size: 13px;
  flex: none;
}
@media (max-width: 920px) {
  #work.mode-split {
    grid-template-columns: 1fr;
  }
  #work.mode-split #birth,
  .work-cases-panel {
    grid-column: auto;
    grid-row: auto;
  }
}
#library {
  width: 100%;
}
.orig-split {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: 22px;
  align-items: start;
}
.orig-left,
.orig-right {
  min-width: 0;
}
.orig-right .chart-insight {
  margin-top: 0;
}
.celeb-view .orig-split {
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (max-width: 960px) {
  .orig-split {
    grid-template-columns: 1fr;
  }
}

/* ==================== 导航栏「排盘」延伸分支菜单（新建排盘 / 排盘记录） ==================== */
.nav-branch-group {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.nav-branch-group > button[data-page="0"] {
  width: 100%;
}
.nav-branch-menu {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translate(-10px, -50%) scale(.96);
  opacity: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  min-width: 124px;
  border-radius: 16px;
  border: 1px solid rgba(212, 202, 255, 0.34);
  background: rgba(9, 11, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.62), 0 0 22px rgba(182, 162, 255, 0.16);
  transition: opacity .22s cubic-bezier(.22, 1, .36, 1), transform .24s cubic-bezier(.22, 1, .36, 1);
  z-index: 60;
}
/* 隐形桥接热区 + 极细银紫延伸连线 */
.nav-branch-menu::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 0;
  bottom: 0;
  width: 18px;
}
.nav-branch-menu::after {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(210, 198, 255, 0.18), rgba(218, 208, 255, 0.68));
  pointer-events: none;
}
.nav-branch-group.open .nav-branch-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
}
html[data-theme="dark"] .nav-branch-item,
.nav-branch-item {
  width: 100%;
  min-height: 38px;
  padding: 6px 14px;
  font-size: 14px;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  color: #dce4f5;
  border: 1px solid rgba(215, 222, 248, 0.18);
  background: rgba(18, 22, 38, 0.62);
}
html[data-theme="dark"] .nav-branch-item:hover {
  color: #ffffff;
  border-color: rgba(218, 206, 255, 0.58);
  background: linear-gradient(135deg, rgba(210, 196, 255, 0.24), rgba(168, 152, 236, 0.12));
  box-shadow: 0 0 16px rgba(190, 172, 255, 0.24);
}

/* 适配导航栏在右侧 / 顶部 / 底部时的延伸方向 */
html[data-nav-pos="right"] .nav-branch-menu {
  left: auto;
  right: calc(100% + 14px);
  transform: translate(10px, -50%) scale(.96);
}
html[data-nav-pos="right"] .nav-branch-menu::before {
  right: auto;
  left: 100%;
}
html[data-nav-pos="right"] .nav-branch-menu::after {
  right: auto;
  left: 100%;
  background: linear-gradient(270deg, rgba(210, 198, 255, 0.18), rgba(218, 208, 255, 0.68));
}
html[data-nav-pos="right"] .nav-branch-group.open .nav-branch-menu {
  transform: translate(0, -50%) scale(1);
}

html[data-nav-pos="top"] .nav-branch-group,
html[data-nav-pos="bottom"] .nav-branch-group {
  width: auto;
  flex: none;
}
html[data-nav-pos="top"] body > header nav,
html[data-nav-pos="bottom"] body > header nav {
  overflow: visible;
}
html[data-nav-pos="top"] .nav-branch-menu {
  left: 50%;
  top: calc(100% + 12px);
  flex-direction: row;
  transform: translate(-50%, -8px) scale(.96);
}
html[data-nav-pos="top"] .nav-branch-menu::before {
  right: 0; left: 0; bottom: 100%; top: auto; width: auto; height: 14px;
}
html[data-nav-pos="top"] .nav-branch-menu::after {
  display: none;
}
html[data-nav-pos="top"] .nav-branch-group.open .nav-branch-menu {
  transform: translate(-50%, 0) scale(1);
}

html[data-nav-pos="bottom"] .nav-branch-menu {
  left: 50%;
  top: auto;
  bottom: calc(100% + 12px);
  flex-direction: row;
  transform: translate(-50%, 8px) scale(.96);
}
html[data-nav-pos="bottom"] .nav-branch-menu::before {
  right: 0; left: 0; top: 100%; bottom: auto; width: auto; height: 14px;
}
html[data-nav-pos="bottom"] .nav-branch-menu::after {
  display: none;
}
html[data-nav-pos="bottom"] .nav-branch-group.open .nav-branch-menu {
  transform: translate(-50%, 0) scale(1);
}
