:root { --bg-primary: #0a0a0f; --bg-secondary: #12121a; --bg-card: #1a1a24; --bg-hover: #252532; --text-primary: #e8e6e3; --text-secondary: #9ca3af; --text-muted: #6b7280; --accent-gold: #c9a962; --accent-gold-light: #e8d5a3; --accent-gold-dark: #9a7b3a; --accent-teal: #2dd4bf; --accent-teal-dark: #0d9488; --accent-teal-light: #5eead4; --border-color: #2a2a3a; --shadow-gold: 0 0 20px rgba(201, 169, 98, 0.15); --font-serif: 'Noto Serif SC', serif; --font-sans: 'Noto Sans SC', sans-serif; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; line-height: 1.6; padding-bottom: 60px; }
footer { text-align: center; padding: 16px 0; color: var(--text-muted); font-size: 0.78rem; border-top: 1px solid var(--border-color); margin-top: 40px; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
header { padding: 20px 0; text-align: center; border-bottom: 1px solid var(--border-color); background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%); }
.logo { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 700; color: var(--accent-gold); text-shadow: var(--shadow-gold); letter-spacing: 0.2em; }
.header-logo { height: 7.2rem; width: 7.2rem; object-fit: contain; flex-shrink: 0; }
.tagline { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; letter-spacing: 0.15em; line-height: 1.4; }
.main-content { display: flex; gap: 30px; padding: 30px 0; flex-wrap: wrap; overflow: visible; }
.input-panel { flex: 0 0 340px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; height: fit-content; }
.bazi-panel { flex: 1; min-width: 400px; overflow: visible; }
.panel-title { font-family: var(--font-serif); font-size: 1.1rem; color: var(--accent-gold); margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }
input, select { width: 100%; padding: 8px 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); font-size: 0.9rem; font-family: var(--font-sans); transition: all 0.3s ease; }
input:focus, select:focus { outline: none; border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.1); }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 32px; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.form-row.two { grid-template-columns: repeat(2, 1fr); }
.true-solar-section { background: var(--bg-secondary); border-radius: 8px; padding: 12px; margin-top: 8px; }
.true-solar-section .form-row { gap: 6px; }
.true-solar-section .form-group { margin-bottom: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; font-size: 0.95rem; font-weight: 500; border: none; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; font-family: var(--font-sans); width: 100%; margin-top: 8px; }
.btn-primary { background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-gold) 100%); color: var(--bg-primary); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-gold); }
.btn-accent { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); color: #fff; }
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }
/* 大运综合分析 -- 星级展示 */
.dayun-comprehensive-result { line-height: 1.8; font-size: 0.88rem; }
.dayun-comprehensive-result .star-rating { color: #f59e0b; font-size: 1.1rem; letter-spacing: 2px; }
.stars-inline { color: #f59e0b; letter-spacing: 1px; font-size: 0.85rem; }
.dayun-comprehensive-result .layer-section { margin: 12px 0; padding: 10px; border-radius: 8px; background: var(--bg-secondary); border-left: 3px solid; }
.dayun-comprehensive-result .layer-0 { border-left-color: #f87171; }  /* 九运-红 */
.dayun-comprehensive-result .layer-1 { border-left-color: var(--accent-gold); } /* 命盘-金 */
.dayun-comprehensive-result .layer-2 { border-left-color: #2dd4bf; } /* 大限-青 */
.dayun-comprehensive-result .layer-3 { border-left-color: #a78bfa; } /* 流年-紫 */
.dayun-comprehensive-result .layer-4 { border-left-color: #f97316; } /* 小限-橙 */
.info-display { background: var(--bg-secondary); border-radius: 8px; padding: 12px; margin-top: 16px; font-size: 0.85rem; }
.info-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--border-color); }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); }
.info-value { color: var(--accent-gold-light); font-weight: 500; }
/* ========== 盘切换器 ========== */
.plate-switcher {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.plate-tabs {
  display: flex;
  gap: 4px;
}
.plate-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}
.plate-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.plate-tab.active {
  color: var(--accent-gold);
  background: rgba(201, 169, 98, 0.1);
}
.plate-tab.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent-gold);
  border-radius: 1px;
}
.plate-tab[data-plate="tianpan"].active { color: #c9a962; }
.plate-tab[data-plate="dayun"].active { color: #2dd4bf; }
.plate-tab[data-plate="liunian"].active { color: #a855f7; }
.plate-tab[data-plate="liuyue"].active { color: #f97316; }
.plate-tab[data-plate="integrated"].active { color: #f59e0b; }
/* ========== 综合大运盘样式 ========== */
.jiuyun-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 12px;
  background: linear-gradient(135deg, #7c2d12, #991b1b);
  color: #fca5a5; font-size: 0.78rem; margin: 4px 0;
  border: 1px solid rgba(252,165,165,0.3);
}
.jiuyun-icon {
  background: #dc2626; color: #fff; border-radius: 50%;
  width: 20px; height: 20px; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: bold;
}
.layer-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px;
}
.dayun-dot { background: #2dd4bf; }
.liunian-dot { background: #a78bfa; }
.xiaoxian-dot { background: #f97316; }
.layer-legend {
  display: flex; gap: 10px; justify-content: center;
  font-size: 0.65rem; color: var(--text-secondary); margin-top: 6px;
}
.layer-marks {
  display: flex; gap: 3px; flex-wrap: wrap; margin: 2px 0;
}
.layer-mark {
  font-size: 0.55rem; padding: 1px 5px; border-radius: 3px; font-weight: 600;
  white-space: nowrap;
}
.dayun-mark { background: rgba(45,212,191,0.15); color: #2dd4bf; border: 1px solid rgba(45,212,191,0.3); }
.liunian-mark { background: rgba(167,139,250,0.15); color: #a78bfa; border: 1px solid rgba(167,139,250,0.3); }
.xiaoxian-mark { background: rgba(249,115,22,0.15); color: #f97316; border: 1px solid rgba(249,115,22,0.3); }
.liunian-star {
  font-size: 0.65rem; padding: 1px 5px; border-radius: 3px;
  background: rgba(167,139,250,0.1); color: #c4b5fd;
  border: 1px solid rgba(167,139,250,0.25); display: inline-block; margin: 1px;
}
.liunian-label {
  color: #a78bfa !important; font-size: 0.68rem; font-weight: 600;
}
.xiaoxian-label {
  color: #f97316 !important; font-size: 0.68rem; font-weight: 600;
}
.xiaoxian-ages {
  margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(249,115,22,0.15);
  font-size: 0.7rem; color: rgba(249,115,22,0.85); display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center; align-items: center;
}
.xiaoxian-age {
  display: inline-block; padding: 2px 6px;
  border: 1px solid rgba(249,115,22,0.2); border-radius: 4px;
  background: rgba(249,115,22,0.06);
}
.liunian-ages {
  margin-top: 4px; padding-top: 4px; border-top: 1px dashed rgba(167,139,250,0.15);
  font-size: 0.7rem; color: rgba(167,139,250,0.85); display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center; align-items: center;
}
.liunian-age {
  display: inline-block; padding: 2px 6px;
  border: 1px solid rgba(167,139,250,0.2); border-radius: 4px;
  background: rgba(167,139,250,0.06);
}
/* 大运/流年/小限三宫同时命中时的边框光晕 */
.palace.dayun-overlay { box-shadow: inset 0 0 0 1px rgba(45,212,191,0.5); }
.palace.liunian-overlay { box-shadow: inset 0 0 0 1px rgba(167,139,250,0.5); }
.palace.xiaoxian-overlay { box-shadow: inset 0 0 0 1px rgba(249,115,22,0.5); }
/* 同时命中两层的边框 */
.palace.dayun-overlay.liunian-overlay { box-shadow: inset 0 0 0 1px rgba(45,212,191,0.5), inset 0 0 0 2px rgba(167,139,250,0.5); }
.palace.dayun-overlay.xiaoxian-overlay { box-shadow: inset 0 0 0 1px rgba(45,212,191,0.5), inset 0 0 0 2px rgba(249,115,22,0.5); }
.palace.liunian-overlay.xiaoxian-overlay { box-shadow: inset 0 0 0 1px rgba(167,139,250,0.5), inset 0 0 0 2px rgba(249,115,22,0.5); }
.palace.dayun-overlay.liunian-overlay.xiaoxian-overlay {
  box-shadow: inset 0 0 0 1px rgba(45,212,191,0.5), inset 0 0 0 2px rgba(167,139,250,0.5), inset 0 0 0 3px rgba(249,115,22,0.5);
}
.overlay-toggle {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.overlay-toggle:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}
.overlay-toggle.active {
  background: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
}

/* ========== 上下文选择器 ========== */
.context-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.context-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.context-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.context-select {
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
}
.context-value {
  font-size: 0.8rem;
  color: var(--accent-gold);
  font-weight: 500;
}

/* ========== 叠加图例 ========== */
.overlay-legend {
  display: none;
  justify-content: center;
  gap: 20px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-top: 12px;
}
.overlay-legend.visible {
  display: flex;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-tianpan .legend-dot { background: #c9a962; }
.legend-dayun .legend-dot { background: #2dd4bf; }
.legend-liunian .legend-dot { background: #a855f7; }
.legend-liuyue .legend-dot { background: #f97316; }

/* ========== 神煞标签 ========== */
.shensha-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 500;
  margin: 1px;
}
.shensha-tag.ji {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.shensha-tag.xiong {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.shensha-tag.ping {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}
.shensha-tag.suipo {
  border: 1px dashed #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ========== 犯太岁标记 ========== */
.fantaisui-badge {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.55rem;
  font-weight: 600;
  margin-left: 4px;
}
.fantaisui-badge.fan { background: #ef4444; color: white; }
.fantaisui-badge.chong { background: #f97316; color: white; }
.fantaisui-badge.hai { background: #eab308; color: black; }
.fantaisui-badge.po { background: #8b5cf6; color: white; }

/* ========== 四化标记 ========== */
.star-hua {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 3px;
}
.hua-lu { background: #22c55e; color: white; }
.hua-quan { background: #3b82f6; color: white; }
.hua-ke { background: #a855f7; color: white; }
.hua-ji { background: #ef4444; color: white; }

/* ========== 盘边框（叠加模式用） ========== */
.palace.tianpan-overlay { border-color: #c9a962; }
.palace.dayun-overlay { border-color: #2dd4bf; }
.palace.liunian-overlay { border-color: #a855f7; }
.palace.liuyue-overlay { border-color: #f97316; }

/* ========== 中心信息区增强 ========== */
.plate-indicator {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.plate-indicator.tianpan { background: rgba(201, 169, 98, 0.2); color: #c9a962; }
.plate-indicator.dayun { background: rgba(45, 212, 191, 0.2); color: #2dd4bf; }
.plate-indicator.liunian { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.plate-indicator.liuyue { background: rgba(249, 115, 22, 0.2); color: #f97316; }

/* ========== 叠加模式样式 ========== */
.overlay-palace-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
}
.overlay-column {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
}
.overlay-column.tianpan-col { background: rgba(201, 169, 98, 0.1); border-left: 2px solid #c9a962; }
.overlay-column.dayun-col { background: rgba(45, 212, 191, 0.1); border-left: 2px solid #2dd4bf; }
.overlay-column.liunian-col { background: rgba(168, 85, 247, 0.1); border-left: 2px solid #a855f7; }
.overlay-label {
  font-weight: 600;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.tianpan-col .overlay-label { color: #c9a962; }
.dayun-col .overlay-label { color: #2dd4bf; }
.liunian-col .overlay-label { color: #a855f7; }
.overlay-stars {
  color: var(--text-secondary);
  word-break: break-all;
}
.overlay-shensha {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}

/* ========== 叠加详情面板 ========== */
.overlay-detail-panel-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.overlay-detail-panel-container.visible {
  opacity: 1;
}
.overlay-detail-panel {
  background: var(--bg-card);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.overlay-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.overlay-detail-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--accent-gold);
}
.overlay-detail-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.overlay-detail-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.overlay-detail-content {
  display: flex;
  flex: 1;
  overflow-x: auto;
  padding: 16px;
  gap: 12px;
}
.overlay-detail-column {
  flex: 1;
  min-width: 150px;
}
.overlay-detail-column-header {
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.overlay-detail-column-header.tianpan { background: rgba(201, 169, 98, 0.2); color: #c9a962; }
.overlay-detail-column-header.dayun { background: rgba(45, 212, 191, 0.2); color: #2dd4bf; }
.overlay-detail-column-header.liunian { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.detail-section {
  margin-bottom: 10px;
}
.detail-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.detail-value {
  font-size: 0.8rem;
  color: var(--text-primary);
}
.detail-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.detail-shensha {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.detail-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 20px 0;
}

.chart-grid-shell {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto 16px;
}
.chart-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, auto));
  gap: 8px;
  width: 100%;
  height: auto;
}
.palace {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: visible;
}
.palace:hover { border-color: var(--accent-gold); box-shadow: var(--shadow-gold); z-index: 2; }
.palace.ming-gong { border-color: var(--accent-gold); box-shadow: var(--shadow-gold); }
.palace-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.palace-header-left { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; min-width: 0; flex: 1; }
.palace-name { font-family: var(--font-serif); font-size: 0.85rem; color: var(--accent-gold); font-weight: 600; }
.palace-name-sub { font-size: 0.62rem; color: var(--text-muted); font-weight: 500; line-height: 1.25; }
.palace-name-en { font-size: 0.65rem; color: var(--text-muted); }
.dayun-center-note { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }
.palace-branch { font-size: 0.7rem; color: var(--text-secondary); font-family: var(--font-serif); }
.shen-mark { font-size: 0.65rem; color: #3b82f6; font-weight: 600; margin-left: 2px; }
.palace.shen-gong { border-color: #3b82f6; box-shadow: 0 0 12px rgba(59,130,246,0.3); }
.stars-container { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.palace-stars-block { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-bottom: 2px; }
/* 四角星曜布局 */
.stars-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 3px; flex: 1; min-height: 0; }
.stars-corner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1px 3px; padding: 2px 3px; font-size: 0.68rem; align-content: flex-start; }
.stars-corner .star { font-size: 0.65rem; padding: 1px 4px; }
.stars-top-left { justify-content: flex-start; }
.stars-top-right { justify-content: flex-end; text-align: right; }
.stars-bottom-left { justify-content: flex-start; }
.stars-bottom-right { justify-content: flex-end; text-align: right; }
.corner-label { font-size: 0.55rem; color: var(--text-muted); margin-right: 2px; flex-shrink: 0; }
/* 底部年龄区 */
.palace-ages { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--border-color); font-size: 0.68rem; display: flex; flex-direction: column; align-items: center; text-align: center; }
.dayun-age-label { color: var(--accent-teal-light); font-size: 0.65rem; font-weight: 600; margin-right: 4px; }
.dayun-age-range { color: var(--accent-teal-light); font-size: 0.65rem; font-weight: 500; }
.dayun-age-row { display: flex; align-items: center; justify-content: center; gap: 3px; margin-bottom: 4px; background: rgba(45,212,191,0.06); border: 1px solid rgba(45,212,191,0.12); border-radius: 4px; padding: 3px 10px; }
.palace-stars-block .block-label { font-size: 0.68rem; color: var(--text-muted); margin-right: 4px; flex-shrink: 0; }
.palace-stars-block.za-block .star { font-size: 0.7rem; padding: 1px 5px; }
.star { font-size: 0.7rem; padding: 2px 5px; border-radius: 3px; background: var(--bg-hover); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star.zhu-star { background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-gold) 100%); color: var(--bg-primary); font-weight: 600; font-size: 0.78rem; text-align: center; }
.star.fu-star { background: var(--bg-secondary); border: 1px solid var(--accent-teal-dark); color: var(--accent-teal-light); font-weight: 500; }
/* 六煞星单独配色：与辅星功效相当，独立于杂曜，明显紫色 */
.star.sha-star { background: linear-gradient(135deg, #5c3d6e 0%, #7b5c8e 100%); border: 1px solid #b39eb5; color: #f0e6f5; font-weight: 500; font-size: 0.72rem; }
.star.za-star { background: #1e3a5f; border: 1px solid #2563eb; color: #93c5fd; font-size: 0.65rem; }
/* 吉星样式：金色边框，浅蓝文字，与辅星接近但可区分 */
.star.ji-star { background: var(--bg-secondary); border: 1px solid var(--accent-gold); color: var(--accent-gold-light); font-weight: 500; font-size: 0.72rem; }
/* 吉星/煞星同层容器 */
.palace-stars-block.ji-sha-block { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.palace-stars-block.ji-sha-block .block-label { margin-right: 2px; }
.block-label.ji-label { background: linear-gradient(135deg, #8b7355 0%, #c9a862 100%); color: var(--bg-primary); padding: 1px 5px; border-radius: 3px; font-size: 0.68rem; font-weight: 600; }
.block-label.sha-label { background: linear-gradient(135deg, #5c3d6e 0%, #7b5c8e 100%); color: #f0e6f5; padding: 1px 5px; border-radius: 3px; font-size: 0.68rem; font-weight: 600; }
.star.star-link { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.star.star-link:hover { opacity: 0.9; }
.my-chart-item { padding: 10px 12px; margin-bottom: 6px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.my-chart-item:hover { border-color: var(--accent-gold); background: var(--bg-hover); }
.my-chart-item .chart-item-name { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; }
.my-chart-item .chart-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }
.my-chart-item .chart-item-relation { display: inline-block; font-size: 0.65rem; padding: 1px 6px; border-radius: 3px; background: rgba(201,169,98,0.15); color: var(--accent-gold); margin-left: 6px; }
.confirm-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 9999; align-items: center; justify-content: center; }
.confirm-overlay.show { display: flex; }
.confirm-modal { background: var(--bg-card); border: 1px solid var(--accent-gold-dark); border-radius: 12px; padding: 28px; max-width: 420px; width: 90%; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
.confirm-modal h3 { font-family: var(--font-serif); color: var(--accent-gold); font-size: 1.1rem; margin-bottom: 18px; text-align: center; }
.confirm-modal .confirm-info { background: var(--bg-secondary); border-radius: 8px; padding: 14px; margin-bottom: 18px; }
.confirm-modal .confirm-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.88rem; border-bottom: 1px solid var(--border-color); }
.confirm-modal .confirm-row:last-child { border-bottom: none; }
.confirm-modal .confirm-row .cl { color: var(--text-secondary); }
.confirm-modal .confirm-row .cv { color: var(--accent-gold-light); font-weight: 500; }
.confirm-modal .confirm-hint { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin-bottom: 16px; line-height: 1.5; }
.confirm-modal .confirm-btns { display: flex; gap: 10px; }
.confirm-modal .confirm-btns button { flex: 1; padding: 10px; border: none; border-radius: 6px; font-size: 0.9rem; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s; }
.confirm-modal .btn-cancel { background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border-color) !important; }
.confirm-modal .btn-cancel:hover { background: var(--bg-secondary); }
.confirm-modal .btn-confirm { background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold)); color: var(--bg-primary); font-weight: 600; }
.confirm-modal .btn-confirm:hover { transform: translateY(-1px); box-shadow: var(--shadow-gold); }
.auth-prompt-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 10000; align-items: center; justify-content: center; }
.auth-prompt-overlay.show { display: flex; }
.auth-prompt-modal { background: var(--bg-card); border: 1px solid var(--accent-gold-dark); border-radius: 12px; padding: 28px; max-width: 380px; width: 90%; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
.auth-prompt-modal h3 { font-family: var(--font-serif); color: var(--accent-gold); font-size: 1.1rem; margin-bottom: 14px; text-align: center; }
.auth-prompt-modal p { font-size: 0.9rem; color: var(--text-secondary); text-align: center; margin-bottom: 20px; line-height: 1.6; }
.auth-prompt-modal .auth-prompt-btns { display: flex; gap: 12px; }
.auth-prompt-modal .auth-prompt-btns button { flex: 1; padding: 12px; border: none; border-radius: 6px; font-size: 0.9rem; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s; }
.auth-prompt-modal .auth-prompt-btns .btn-login { background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold)); color: var(--bg-primary); font-weight: 600; }
.auth-prompt-modal .auth-prompt-btns .btn-register { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--accent-gold-dark); }
.auth-prompt-modal .auth-prompt-btns .btn-login:hover, .auth-prompt-modal .auth-prompt-btns .btn-register:hover { transform: translateY(-1px); }
.member-panel-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 10001; align-items: flex-end; justify-content: center; }
.member-panel-overlay.show { display: flex; }
.member-panel { background: var(--bg-card); border: 1px solid var(--accent-gold-dark); border-radius: 16px 16px 0 0; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; box-shadow: 0 -4px 40px rgba(0,0,0,0.5); }
.member-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid var(--border-color); }
.member-panel-header h3 { font-family: var(--font-serif); color: var(--accent-gold); font-size: 1.1rem; margin: 0; }
.member-panel-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; padding: 4px 8px; line-height: 1; }
.member-panel-close:hover { color: var(--text-primary); }
.member-panel-section { padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.member-panel-section:last-child { border-bottom: none; }
.member-panel-section-title { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.member-panel-tier { display: flex; align-items: center; gap: 10px; }
.member-panel-tier-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.member-panel-tier-name { font-size: 1rem; color: var(--text-primary); font-weight: 500; }
.member-panel-expiry { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.member-panel-quota-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.member-panel-quota-row:last-child { border-bottom: none; }
.member-panel-quota-label { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.9rem; }
.member-panel-quota-icon { font-size: 1rem; }
.member-panel-quota-value { text-align: right; }
.member-panel-quota-count { font-size: 0.95rem; color: var(--accent-gold-light); font-weight: 600; }
.member-panel-quota-reset { font-size: 0.75rem; color: var(--text-muted); }
.member-panel-pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.member-panel-pricing-card { background: var(--bg-secondary); border-radius: 10px; padding: 14px; text-align: center; }
.member-panel-pricing-card .price { font-size: 1.2rem; color: var(--accent-gold); font-weight: 700; }
.member-panel-pricing-card .unit { font-size: 0.8rem; color: var(--text-muted); }
.member-panel-pricing-card .desc { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.member-panel-footer { padding: 16px 20px; }
.member-panel-upgrade-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold)); color: var(--bg-primary); border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s; }
.member-panel-upgrade-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-gold); }
#savedSubjectSelect { margin-bottom: 12px; }
#starOverlay.show { display: flex !important; }
.star-modal .concept-modal-body .star-section { margin-bottom: 16px; }
.star-modal .concept-modal-body .star-section-title { font-weight: 600; color: var(--accent-gold); margin-bottom: 6px; font-size: 0.85rem; }
/* 四化：独立小牌形式，字大易认（参考第二图） */
.star .star-hua { display: inline-block; min-width: 1.1em; padding: 1px 4px; margin-left: 3px; font-size: 0.8rem; font-weight: 600; border-radius: 4px; vertical-align: middle; line-height: 1.2; }
.star .star-hua.hua-lu { background: #1a4d1a; border: 1px solid #2e7d2e; color: #a5d6a7; }
.star .star-hua.hua-quan { background: #5d4037; border: 1px solid #8d6e63; color: #ffcc80; }
.star .star-hua.hua-ke { background: #0d47a1; border: 1px solid #1565c0; color: #90caf9; }
.star .star-hua.hua-ji { background: #b71c1c; border: 1px solid #d32f2f; color: #ffcdd2; }
/* 庙旺平陷：单独小标签，每种状态独立高对比色 */
.star .star-state { display: inline-block; font-size: 0.6rem; margin-left: 2px; vertical-align: super; font-weight: 600; line-height: 1.2; }
.star .star-state[data-state="庙"] { color: #ffd54f; }
.star .star-state[data-state="旺"] { color: #81c784; }
.star .star-state[data-state="得"] { color: #4dd0e1; }
.star .star-state[data-state="利"] { color: #90caf9; }
.star .star-state[data-state="平"] { color: #bdbdbd; }
.star .star-state[data-state="不"] { color: #ffab91; }
.star .star-state[data-state="陷"] { color: #ef9a9a; }
.chart-center-info {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  overflow-y: auto;
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: stretch;
}
.chart-center-info .center-title { font-family: var(--font-serif); font-size: 0.88rem; color: var(--accent-gold); font-weight: 600; margin-bottom: 2px; text-align: center; }
.chart-center-info .center-row { font-size: 0.7rem; color: var(--text-secondary); line-height: 1.4; }
.chart-center-info .center-subtitle { font-size: 0.64rem; color: var(--text-muted); line-height: 1.3; text-align: center; }
.chart-center-info .sizhu-line { font-family: var(--font-serif); letter-spacing: 0.06em; color: var(--text-primary); }
.chart-center-info .center-row strong { color: var(--text-primary); font-weight: 500; }
.chart-center-info .center-row .nayin { color: var(--accent-gold-light); }
/* 标准紫微斗数 4×4 网格（地支顺时针固定）：
   巳  午  未  申
   辰        酉
   卯        戌
   寅  丑  子  亥
   palace-N 的 N = 后端 palaces[index] 的 index，寅起序（0=寅,1=卯,2=辰...）
   CSS 将寅起 index 映射到地支的固定网格位置 */
.palace-0  { grid-column: 1; grid-row: 4; }  /* 寅 */
.palace-1  { grid-column: 1; grid-row: 3; }  /* 卯 */
.palace-2  { grid-column: 1; grid-row: 2; }  /* 辰 */
.palace-3  { grid-column: 1; grid-row: 1; }  /* 巳 */
.palace-4  { grid-column: 2; grid-row: 1; }  /* 午 */
.palace-5  { grid-column: 3; grid-row: 1; }  /* 未 */
.palace-6  { grid-column: 4; grid-row: 1; }  /* 申 */
.palace-7  { grid-column: 4; grid-row: 2; }  /* 酉 */
.palace-8  { grid-column: 4; grid-row: 3; }  /* 戌 */
.palace-9  { grid-column: 4; grid-row: 4; }  /* 亥 */
.palace-10 { grid-column: 3; grid-row: 4; }  /* 子 */
.palace-11 { grid-column: 2; grid-row: 4; }  /* 丑 */
.analysis-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 18px; }
.analysis-card h3 { font-family: var(--font-serif); font-size: 1rem; color: var(--accent-gold); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.analysis-card h3::before { content: ''; width: 3px; height: 16px; background: var(--accent-gold); border-radius: 2px; }
.pattern-summary-card { margin-top: 12px; padding: 10px 12px; background: rgba(201,169,98,0.06); border: 1px solid rgba(201,169,98,0.18); border-radius: 10px; position: relative; z-index: 0; clear: both; }
.pattern-summary-title { font-size: 0.88rem; color: var(--accent-gold-light); margin-bottom: 6px; }
.pattern-summary-empty { font-size: 0.84rem; color: var(--text-muted); line-height: 1.6; }
.pattern-summary-list { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; }
.pattern-summary-item { padding: 5px 10px; background: rgba(0,0,0,0.14); border: 1px solid var(--border-color); border-radius: 6px; flex: 1 1 auto; min-width: 200px; max-width: 100%; }
.pattern-summary-head { display: inline; }
.pattern-summary-name { color: var(--text-primary); font-size: 0.85rem; font-weight: 600; display: inline; }
.pattern-summary-name .concept-link { cursor: pointer; }
.pattern-summary-name .concept-link:hover { color: var(--accent-gold-light); }
.pattern-summary-score { color: var(--accent-gold-light); font-size: 0.78rem; white-space: nowrap; display: inline; margin-left: 6px; }
.pattern-summary-subtitle { margin-top: 6px; margin-bottom: 3px; color: var(--accent-gold-light); font-size: 0.8rem; }
.pattern-summary-reason { color: var(--text-secondary); font-size: 0.8rem; display: inline; }
.pattern-summary-reason::before { content: " · "; }
.pattern-summary-evidence { color: var(--text-muted); font-size: 0.78rem; display: inline; }
.pattern-summary-evidence::before { content: " — "; }
.pattern-summary-missing { color: var(--text-muted); font-size: 0.78rem; }
.pattern-summary-missing-group { margin-top: 4px; }
.pattern-summary-missing-label { color: var(--accent-gold-light); margin-right: 4px; }
.pattern-summary-more { margin-top: 4px; border: 1px dashed rgba(201,169,98,0.2); border-radius: 6px; padding: 4px 8px; }
.period-analysis-panel { margin-top: 12px; padding: 12px 14px; background: rgba(201,169,98,0.06); border: 1px solid rgba(201,169,98,0.18); border-radius: 10px; }
.pattern-summary-more summary { cursor: pointer; color: var(--accent-gold-light); font-size: 0.8rem; }
.pattern-summary-more[open] summary { margin-bottom: 4px; }
.bazi-display { background: var(--bg-secondary); border-radius: 8px; padding: 12px; margin-top: 16px; }
.bazi-title { font-family: var(--font-serif); font-size: 0.95rem; color: var(--accent-gold); margin-bottom: 12px; }
.bazi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.bazi-col { text-align: center; padding: 8px; background: var(--bg-card); border-radius: 6px; }
.bazi-label { font-size: 0.7rem; color: var(--text-muted); }
.bazi-value { font-size: 1rem; color: var(--accent-gold-light); font-weight: 600; margin-top: 4px; }
.bazi-value.bazi-nayin { font-size: 0.88rem; font-weight: 500; }
.bazi-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.bazi-item { padding: 6px 10px; background: var(--bg-card); border-radius: 4px; font-size: 0.85rem; }
.bazi-key { color: var(--text-secondary); }
.bazi-val { color: var(--accent-gold-light); font-weight: 500; }
.wuxing-bar { margin-bottom: 12px; }
.wuxing-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 6px; }
.wuxing-inline { display: flex; gap: 12px; flex-wrap: wrap; }
.wuxing-inline .wx-item { display: flex; align-items: baseline; gap: 2px; font-size: 0.85rem; }
.wuxing-inline .wx-item .wx-name { color: var(--accent-gold-light); font-weight: 500; }
.wuxing-inline .wx-item .wx-count { color: var(--text-primary); font-weight: 600; }
.dayun-list { display: flex; gap: 6px; flex-wrap: wrap; }
.dayun-item { padding: 6px 10px; background: var(--bg-card); border-radius: 4px; font-size: 0.75rem; text-align: center; }
.dayun-label { color: var(--text-muted); font-size: 0.75rem; }
.dayun-value { color: var(--accent-gold-light); font-weight: 500; margin-top: 2px; }
.bazi-table-wrap { overflow-x: auto; margin: 12px 0; }
.bazi-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.bazi-table th, .bazi-table td { padding: 6px 8px; text-align: center; border: 1px solid var(--border-color); }
.bazi-table th { color: var(--text-secondary); font-weight: 500; }
.bazi-table td { color: var(--text-primary); }
.bazi-table .col-gan { color: var(--accent-gold-light); font-weight: 600; }
.bazi-table .col-zhi { color: var(--accent-gold); }
.bazi-table .col-kong { color: var(--text-muted); font-size: 0.75rem; }
.bazi-shensha { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.bazi-shensha span { padding: 4px 10px; background: var(--bg-card); border-radius: 4px; font-size: 0.8rem; }
.bazi-liunian-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.bazi-liunian-row select { width: 100px; }
.bazi-minggong { font-size: 0.85rem; color: var(--text-secondary); }
.bazi-minggong strong { color: var(--accent-gold-light); }
/* ========================================
   RESPONSIVE LAYOUT SYSTEM
   ======================================== */

.drawer-toggle-btn { display: none; }
.mobile-tabs { display: none; }
.mobile-bottom-input { display: none; }

/* Desktop (≥1200px): Input panel as collapsible right drawer */
@media (min-width: 1200px) {
  .main-content { display: flex; gap: 20px; padding: 20px 0; align-items: flex-start; }
  .input-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 340px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
    overflow-y: auto;
    padding: 20px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.3);
    border-radius: 0;
  }
  .input-panel:hover,
  .input-panel.open { transform: translateX(0); }
  .input-panel.docked { transform: translateX(0); }
  .drawer-toggle-btn {
    display: flex;
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--accent-gold-dark);
    border-radius: 50%;
    color: var(--accent-gold);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 101;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
  }
  .drawer-toggle-btn.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .drawer-toggle-btn:hover { background: var(--bg-hover); box-shadow: var(--shadow-gold); }
  .bazi-panel { flex: 1; min-width: 0; margin-right: 60px; }
  .mobile-add-btn { display: none !important; }
}

/* Tablet (768px - 1199px): Input panel inline */
@media (min-width: 768px) and (max-width: 1199px) {
  .main-content { flex-direction: column; gap: 20px; padding: 20px 0; }
  .input-panel { flex: none; width: 100%; position: static; transform: none; box-shadow: none; height: auto; }
  .drawer-toggle-btn { display: none !important; }
  .bazi-panel { min-width: auto; width: 100%; }
  .chart-section { margin-bottom: 20px; }
  .mobile-add-btn { display: none !important; }
}

/* Mobile (<768px): Input panel as slide-up drawer */
@media (max-width: 767px) {
  .main-content { flex-direction: column; padding: 16px 0; gap: 16px; }
  .bazi-panel { min-width: auto; width: 100%; }

  /* Input panel as slide-up drawer */
  .input-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: var(--bg-card);
    border-top: 2px solid var(--accent-gold-dark);
    border-radius: 16px 16px 0 0;
    z-index: 200;
    overflow-y: auto;
    padding: 16px;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    width: 100%;
  }
  .input-panel.open { transform: translateY(0); }

  /* Mobile floating add button */
  .mobile-add-btn {
    display: flex;
    position: fixed;
    right: 16px;
    bottom: 70px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-gold) 100%);
    border: none;
    border-radius: 50%;
    color: var(--bg-primary);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 99;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(201,169,98,0.4);
  }
  .mobile-add-btn:active { transform: scale(0.95); }
  .drawer-toggle-btn { display: none !important; }
  .mobile-panel-close { display: flex !important; }

  /* Mobile tabs for chart/chat switching */
  .mobile-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
  }
  .mobile-tab {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
  }
  .mobile-tab.active {
    background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-gold) 100%);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
  }

  /* Chart section toggle */
  .chart-section { display: none; }
  .chart-section.show { display: block; }
  .chat-section { display: block; position: relative; }
  .chat-section.hide { display: none; }

  /* Chart grid - 2 columns on mobile */
  .chart-grid-shell {
    display: block;
    position: static;
    max-width: none;
    margin: 0 auto 16px;
    min-height: 0 !important;
    overflow: visible;
  }
  .chart-grid {
    position: relative;
    width: 100%;
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto repeat(6, minmax(0, auto));
  }
  .palace {
    height: auto;
    overflow: visible;
  }
  .chart-center-info { grid-column: 1 / -1; grid-row: 1; }
  .palace-0, .palace-1, .palace-2, .palace-3, .palace-4, .palace-5, .palace-6, .palace-7, .palace-8, .palace-9, .palace-10, .palace-11 {
    grid-column: auto;
    grid-row: auto;
  }

  /* Fixed bottom input bar */
  .mobile-bottom-input {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    gap: 8px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  }
  .mobile-bottom-input input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 0.95rem;
  }
  .mobile-bottom-input input:focus {
    border-color: var(--accent-gold);
    outline: none;
  }
  .mobile-bottom-input button {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-gold) 100%);
    border: none;
    border-radius: 24px;
    color: var(--bg-primary);
    font-weight: 600;
    cursor: pointer;
  }
  .voice-btn-mobile {
    width: 44px !important;
    height: 44px;
    padding: 0 !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 50% !important;
    color: var(--text-secondary) !important;
    font-size: 1.2rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .voice-btn-mobile.recording,
  .voice-btn-mobile.wechat-recording {
    background: rgba(239,68,68,0.2) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
  }

  /* Adjust chat section for mobile - hide desktop input */
  .chat-section .chat-input-row { display: none; }
  .chat-section { padding-bottom: 80px; }

  /* Mobile header adjustments */
  header { padding: 12px 0; }
  header .container { flex-direction: column; align-items: center; gap: 6px; }
  header .container > div > a { display: flex; align-items: center; gap: 10px; }
  .logo { font-size: 1.4rem; }
  .header-logo { height: 6rem; width: 6rem; }
  .tagline { font-size: 0.65rem; text-align: center; }
  nav { gap: 10px; }
  nav a, nav span { font-size: 0.8rem !important; }

  /* Mobile plate switcher */
  .plate-switcher {
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
  }
  .plate-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .plate-tab {
    padding: 6px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .plate-tab.active::after {
    bottom: -8px;
  }
  .overlay-toggle {
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  /* Mobile context bar */
  .context-bar {
    padding: 6px 8px;
    gap: 8px;
  }
  .context-item {
    gap: 4px;
  }
  .context-label {
    font-size: 0.7rem;
  }
  .context-select {
    padding: 3px 6px;
    font-size: 0.75rem;
  }

  /* Mobile overlay legend */
  .overlay-legend {
    gap: 12px;
    padding: 8px;
  }
  .legend-item {
    font-size: 0.7rem;
  }

  /* Mobile overlay detail panel */
  .overlay-detail-panel {
    width: 95%;
    max-height: 90vh;
  }
  .overlay-detail-content {
    flex-direction: column;
    gap: 16px;
    padding: 12px;
  }
  .overlay-detail-column {
    min-width: auto;
  }

  /* Mobile palace overlay content */
  .overlay-palace-content {
    max-height: none;
  }
  .overlay-column {
    padding: 2px 4px;
    font-size: 0.6rem;
  }
}

/* Large desktop (≥1400px): More breathing room */
@media (min-width: 1400px) {
  .container { max-width: 1360px; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.4s ease forwards; }

/* ========== 盘切换动画 ========== */
@keyframes plateSwitchFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.chart-grid.switching {
  animation: plateSwitchFade 0.25s ease forwards;
}
@keyframes plateTabUnderline {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.plate-tab.active::after {
  animation: plateTabUnderline 0.2s ease forwards;
}
.plate-tab {
  transition: color 0.2s ease, background-color 0.2s ease;
}
.context-bar {
  transition: opacity 0.3s ease;
}
.overlay-legend {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.overlay-legend.hidden {
  opacity: 0;
  transform: translateY(-10px);
}
.concept-link { cursor: pointer; border-bottom: 1px dotted var(--accent-gold); color: var(--accent-gold-light); }
.concept-link:hover { text-decoration: none; border-bottom-color: var(--accent-gold-light); }
.concept-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.concept-overlay.show { display: flex; }
.concept-modal { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; max-width: 520px; max-height: 85vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.concept-modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.concept-modal-title { font-family: var(--font-serif); font-size: 1.1rem; color: var(--accent-gold); }
.concept-modal-close { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1.4rem; line-height: 1; padding: 4px; }
.concept-modal-close:hover { color: var(--text-primary); }
.concept-modal-body { padding: 20px; overflow-y: auto; font-size: 0.9rem; line-height: 1.75; color: var(--text-secondary); }
.concept-context-card { margin-bottom: 14px; padding: 12px 14px; background: rgba(201,169,98,0.08); border: 1px solid rgba(201,169,98,0.2); border-radius: 10px; }
.concept-context-title { color: var(--accent-gold-light); font-size: 0.88rem; margin-bottom: 6px; }
.concept-context-line { color: var(--text-secondary); font-size: 0.84rem; line-height: 1.6; }
.concept-modal-body p { margin-bottom: 12px; }
.concept-modal-body p:last-child { margin-bottom: 0; }
.concept-modal-body strong { color: var(--text-primary); }
.chat-section { margin-top: 24px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; overflow: visible; position: relative; }
.chat-section h3 { font-family: var(--font-serif); font-size: 1rem; color: var(--accent-gold); padding: 14px 20px; border-bottom: 1px solid var(--border-color); }
.chat-messages-wrap { min-height: 200px; max-height: 60vh; overflow-y: auto; overflow-x: hidden; border: 1px solid transparent; }
.chat-messages { min-height: 0; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 100%; align-self: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 0.9rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.chat-msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-gold) 100%); color: var(--bg-primary); }
.chat-msg.assistant { align-self: flex-start; background: var(--bg-hover); border: 1px solid var(--border-color); color: var(--accent-gold-light); }
.chat-msg.loading { color: var(--accent-gold-light); opacity: 0.7; }
.chat-msg.scope-note { align-self: center; max-width: 100%; background: rgba(201,169,98,0.08); border: 1px dashed rgba(201,169,98,0.35); color: var(--text-secondary); font-size: 0.82rem; }
.chat-input-row { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border-color); align-items: center; flex-shrink: 0; }
.chat-input-row textarea { flex: 1; min-height: 44px; max-height: 120px; padding: 10px 14px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-primary); font-size: 0.9rem; font-family: inherit; resize: none; }
.chat-input-row textarea:focus { outline: none; border-color: var(--accent-gold); }
.chat-input-row .btn { flex: 0 0 auto; width: 80px; margin-top: 0; }
.voice-btn { flex: 0 0 auto; width: 40px; height: 40px; padding: 0; margin-top: 0; border-radius: 8px; background: var(--bg-secondary); border: 1px solid var(--border-color); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; transition: all 0.2s; }
.voice-btn:hover { color: var(--accent-gold); border-color: var(--accent-gold); }
.voice-btn.recording { background: rgba(239,68,68,0.2); border-color: #ef4444; color: #ef4444; animation: pulse-rec 1.5s ease infinite; }
@keyframes pulse-rec { 50% { opacity: 0.7; } }
/* WeChat-style Voice Recording */
.voice-recording-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.voice-recording-overlay.active { display: flex; }
.voice-recording-content { }
/* 首版分析按钮样式 */
.first-impression-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(135deg, #D4AF37 0%, #FFD700 50%, #D4AF37 100%);
  background-size: 200% 200%;
  color: #1a1a1a;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
  transition: all 0.3s ease;
  animation: shimmer 2s infinite;
  text-shadow: 0 1px 1px rgba(255,255,255,0.3);
}
.first-impression-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.first-impression-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
}
/* 推荐问题按钮样式 */
.reco-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 10px;
}
.reco-questions-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.reco-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.reco-btn:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.1);
}
.reco-btn .reco-icon {
  font-size: 1rem;
}
/* 首版分析加载动画 */
.first-impression-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
}
.first-impression-loading .pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: pulse-anim 1.4s ease-in-out infinite;
}
.first-impression-loading .pulse-dot:nth-child(2) { animation-delay: 0.2s; }
.first-impression-loading .pulse-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse-anim {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}
.first-impression-loading-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
  background: #2a2a2a;
  border-radius: 16px;
  padding: 40px 60px;
  text-align: center;
  min-width: 280px;
}
.voice-recording-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(239,68,68,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
}
.voice-recording-icon::before {
  content: '';
  width: 30px;
  height: 30px;
  background: #ef4444;
  border-radius: 50%;
  animation: voice-pulse 1s ease infinite;
}
@keyframes voice-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}
.voice-recording-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
  margin: 16px 0;
}
.voice-recording-wave span {
  width: 4px;
  background: #ef4444;
  border-radius: 2px;
  animation: voice-wave 0.6s ease infinite;
}
.voice-recording-wave span:nth-child(1) { animation-delay: 0s; height: 20px; }
.voice-recording-wave span:nth-child(2) { animation-delay: 0.1s; height: 30px; }
.voice-recording-wave span:nth-child(3) { animation-delay: 0.2s; height: 25px; }
.voice-recording-wave span:nth-child(4) { animation-delay: 0.3s; height: 35px; }
.voice-recording-wave span:nth-child(5) { animation-delay: 0.4s; height: 28px; }
.voice-recording-wave span:nth-child(6) { animation-delay: 0.5s; height: 32px; }
.voice-recording-wave span:nth-child(7) { animation-delay: 0.1s; height: 22px; }
@keyframes voice-wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}
.voice-recording-text {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.voice-recording-hint {
  color: #888;
  font-size: 0.85rem;
}
.voice-recording-cancel {
  color: #ef4444;
  font-size: 0.9rem;
  margin-top: 16px;
}
.voice-transcript {
  color: #fff;
  font-size: 1rem;
  min-height: 24px;
  margin-top: 12px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  max-width: 300px;
  word-break: break-all;
}
.voice-btn.wechat-recording {
  background: rgba(239,68,68,0.2) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  animation: none !important;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes loading-dots { 0%, 20% { content: '●'; } 40% { content: '●●'; } 60%, 100% { content: '●●●'; } }
.analysis-loading { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 12px; padding: 14px 20px; background: linear-gradient(135deg, rgba(201,169,98,0.08) 0%, rgba(201,169,98,0.03) 100%); border: 1px solid rgba(201,169,98,0.25); border-radius: 10px; }
.analysis-loading .spinner { width: 20px; height: 20px; border: 2px solid rgba(201,169,98,0.2); border-top-color: var(--accent-gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
.analysis-loading .text { color: var(--accent-gold-light); font-size: 0.95rem; font-weight: 500; letter-spacing: 0.05em; }
.analysis-loading .dots::after { content: '●●●'; animation: loading-dots 1.5s steps(1) infinite; color: var(--accent-gold); }
.tts-toggle:hover { color: var(--accent-gold); }
.tts-toggle input { margin: 0; width: 14px; height: 14px; accent-color: var(--accent-gold); }
.chat-empty { color: var(--text-muted); font-size: 0.88rem; text-align: center; padding: 24px; }
.chat-section h3 { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.chat-config-btn { font-size: 0.75rem; padding: 4px 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-secondary); cursor: pointer; }
.chat-config-btn:hover { color: var(--accent-gold); border-color: var(--accent-gold); }
.chat-config-status { font-size: 0.75rem; color: var(--text-muted); font-weight: normal; }
.chat-config-status.ok { color: var(--accent-gold); }
.chat-process { margin-top: 12px; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; background: var(--bg-secondary); }
.chat-process-header { font-size: 0.75rem; color: var(--text-muted); padding: 8px 12px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.chat-process-header:hover { color: var(--accent-gold); }
.chat-process-body { padding: 10px 12px; font-size: 0.78rem; max-height: 200px; overflow-y: auto; }
.chat-process-step { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; color: var(--text-secondary); }
.chat-process-step:last-child { margin-bottom: 0; }
.chat-process-step .step-num { flex-shrink: 0; color: var(--accent-gold); font-weight: 500; }
.chat-process-step .step-detail { color: var(--text-muted); white-space: pre-wrap; word-break: break-word; }
.chat-process-step .step-stream { max-height: 160px; overflow-y: auto; margin-top: 4px; padding: 6px; background: var(--bg-primary); border-radius: 4px; white-space: pre-wrap; }
.llm-config-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.llm-config-overlay.show { display: flex; }
.llm-config-modal { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; max-width: 440px; width: 100%; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); max-height: 90vh; overflow-y: auto; }
.llm-config-modal .llm-config-drag-header { cursor: move; user-select: none; margin: -20px -20px 16px -20px; padding: 16px 20px; background: var(--bg-secondary); border-radius: 12px 12px 0 0; border-bottom: 1px solid var(--border-color); position: relative; }
.llm-config-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 1.4rem; color: var(--text-secondary); cursor: pointer; line-height: 1; padding: 4px; }
.llm-config-close:hover { color: var(--text-primary); }
.llm-config-modal h4 { font-family: var(--font-serif); color: var(--accent-gold); margin-bottom: 16px; font-size: 1rem; }
.llm-config-modal .form-group { margin-bottom: 14px; }
.llm-config-modal label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.llm-config-modal input, .llm-config-modal select { width: 100%; padding: 10px 14px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); font-size: 0.9rem; }
.llm-config-modal .btn-row { display: flex; gap: 10px; margin-top: 20px; }
.llm-config-modal .btn-row .btn { flex: 1; margin-top: 0; }
.llm-config-modal .btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border-color); }
/* Voice Settings Panel */
.voice-settings-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1001; display: none; align-items: center; justify-content: center; padding: 20px; }
.voice-settings-overlay.show { display: flex; }
.voice-settings-modal { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; max-width: 380px; width: 100%; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.voice-settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.voice-settings-header h4 { margin: 0; font-size: 1rem; color: var(--accent-gold); }
.voice-settings-close { background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; padding: 0; line-height: 1; }
.voice-settings-close:hover { color: var(--text-primary); }
.voice-settings-content .setting-group { margin-bottom: 16px; }
.voice-settings-content .setting-group > label { display: block; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 8px; }
.voice-settings-content .radio-group { display: flex; flex-direction: column; gap: 6px; }
.voice-settings-content .radio-group label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.voice-settings-content .setting-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.voice-settings-content .setting-row { display: flex; align-items: center; gap: 8px; }
.voice-settings-content input[type="number"] { padding: 6px 10px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-primary); }
/* 命主选择器样式 */
.mingzhu-selector {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}
.mingzhu-selector-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}
.mingzhu-selector-header:hover {
  background: var(--bg-hover);
}
.mingzhu-selector-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mingzhu-selector-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-gold) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-primary);
  font-size: 0.9rem;
}
.mingzhu-selector-info {
  display: flex;
  flex-direction: column;
}
.mingzhu-selector-name {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}
.mingzhu-selector-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.mingzhu-selector-relation {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(201,169,98,0.15);
  color: var(--accent-gold);
  margin-left: 6px;
}
.mingzhu-selector-toggle {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: transform 0.3s;
}
.mingzhu-selector.expanded .mingzhu-selector-toggle {
  transform: rotate(180deg);
}
.mingzhu-selector-body {
  display: none;
  border-top: 1px solid var(--border-color);
  padding: 16px;
  background: var(--bg-secondary);
}
.mingzhu-selector.expanded .mingzhu-selector-body {
  display: block;
}
.mingzhu-search-header {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.mingzhu-search {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.mingzhu-close-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mingzhu-close-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mingzhu-search:focus {
  outline: none;
  border-color: var(--accent-gold);
}
.mingzhu-list {
  max-height: 300px;
  overflow-y: auto;
}
.mingzhu-item {
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.mingzhu-item:hover {
  border-color: var(--accent-gold);
  background: var(--bg-hover);
}
.mingzhu-item.active {
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(201,169,98,0.2);
}
.mingzhu-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.mingzhu-item-name {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}
.mingzhu-item-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.mingzhu-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.mingzhu-item-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.mingzhu-ts-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  background: rgba(201,169,98,0.15);
  color: var(--accent-gold);
  border-radius: 3px;
  margin-left: 8px;
}
.mingzhu-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}
.mingzhu-empty-text {
  margin-bottom: 12px;
}
.mingzhu-add-btn {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent-gold-dark) 0%, var(--accent-gold) 100%);
  color: var(--bg-primary);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}
/* 命主选择确认弹窗 */
#mingzhuConfirmOverlay {
  z-index: 10001;
}
#mingzhuConfirmOverlay .confirm-modal {
  max-width: 360px;
}

/* ========== 派系选择 Banner ========== */
.faction-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.faction-selector-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--accent-gold);
  margin-bottom: 16px;
  text-align: center;
}
.faction-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 768px) {
  .faction-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
.faction-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}
.faction-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}
.faction-card.active {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(201,169,98,0.1) 0%, rgba(201,169,98,0.05) 100%);
}
.faction-card.active .faction-marker {
  display: block;
}
.faction-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.faction-alias {
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
}
.faction-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.faction-marker {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: var(--accent-gold);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}
.faction-marker::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  color: var(--bg-primary);
  font-weight: bold;
}
