/* ============================================================
 * CCE 性格分析系统 - 暖黄/米白主题
 * ============================================================ */
:root {
  --gold: #E8B931;
  --gold-deep: #D9A520;
  --gold-light: #F6D879;
  --cream: #FDF8EA;
  --cream-2: #FBF3D9;
  --paper: #FFFDF4;
  --ink: #4A3B10;
  --ink-2: #7A6420;
  --red: #C43C2E;
  --green: #2E8B57;
  --wood: #8FC98F; --fire: #E85C4A; --earth: #E8A366; --metal: #E8C34A; --water: #5BB8C9;
  --border: #E3C76A;
  --shadow: 0 4px 18px rgba(160, 120, 20, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}
[hidden] { display: none !important; }

button { font-family: inherit; }
input { font-family: inherit; }

/* ---------------- 按钮 ---------------- */
.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  padding: 9px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
  letter-spacing: 1px;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #fff;
  border: none;
  font-weight: bold;
}
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; margin-top: 14px; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(232,185,49,.18), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(217,165,32,.15), transparent 50%),
    var(--cream);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 40px 36px 30px;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff; font-size: 30px; line-height: 64px;
  border-radius: 50%;
}
.login-title { font-size: 26px; letter-spacing: 4px; color: var(--ink); }
.login-sub { color: var(--ink-2); font-size: 13px; margin: 6px 0 26px; }
.login-form { text-align: left; }
.login-error { color: var(--red); font-size: 13px; min-height: 20px; margin: 8px 0 0; text-align: center; }
.login-hint { color: var(--ink-2); font-size: 12px; text-align: center; margin-top: 14px; }
.login-copyright { margin-top: 26px; color: var(--ink-2); font-size: 12px; letter-spacing: 2px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 14px; font-weight: bold; margin-bottom: 6px; color: var(--ink); }
.field input[type="text"], .field input[type="password"], .field input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 15px;
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--gold-light); }
.radio-row { display: flex; gap: 24px; padding: 4px 0; }
.radio-item { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-item input { accent-color: var(--gold-deep); width: 16px; height: 16px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(160,120,20,.25);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px;
}
.brand {
  font-size: 15px; font-weight: bold; letter-spacing: 2px;
  font-family: inherit; line-height: 1;
  color: #fff; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.38); border-radius: 999px;
  padding: 8px 18px 8px 14px; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.brand:hover { background: rgba(255,255,255,.3); border-color: rgba(255,255,255,.6); }
.topbar-user, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.15); box-shadow: none; }
.topbar .btn-primary { background: #fff; color: var(--gold-deep); }

/* ---------------- 分享只读提示 ---------------- */
.share-banner {
  background: #fff7e0; border-bottom: 1px solid var(--gold);
  color: var(--gold-deep); text-align: center;
  padding: 8px 16px; font-size: 13px;
}
.share-banner a { color: var(--red); font-weight: bold; margin-left: 8px; }

/* ---------------- 信息条 ---------------- */
.info-strip { background: var(--cream-2); border-bottom: 1px solid var(--border); }
.info-strip-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-wrap: wrap;
  padding: 8px 20px; gap: 6px;
}
.info-item {
  display: flex; align-items: center;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  font-size: 13px;
}
.info-item .k { color: var(--ink-2); margin-right: 8px; font-weight: bold; }
.info-item .v { color: var(--red); font-weight: bold; letter-spacing: 1px; }
.info-item .v.accent { font-size: 15px; }

/* ---------------- 录入页 ---------------- */
.input-main { min-height: calc(100vh - 54px); display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.input-card {
  width: 100%; max-width: 460px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 34px 34px 26px;
}
.page-title { text-align: center; font-size: 22px; letter-spacing: 6px; margin-bottom: 16px; }
.input-notice {
  background: #FFF3F0; border: 1px solid #F2C4BC; color: var(--red);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 20px;
  text-align: center;
}

/* ---------------- 报告布局 ---------------- */
.report-layout {
  max-width: 1200px; margin: 0 auto;
  display: flex; gap: 22px;
  padding: 22px 20px;
  align-items: flex-start;
}
.side-nav {
  width: 190px; flex-shrink: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: sticky; top: 74px;
}
.nav-title {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #fff; text-align: center;
  padding: 9px; font-weight: bold; letter-spacing: 3px;
}
.nav-item {
  display: block;
  padding: 10px 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px dashed var(--border);
  transition: all .15s;
}
.nav-item:last-child { border-bottom: none; }
.nav-item:hover { background: var(--cream-2); }
.nav-item.active { background: var(--gold-light); font-weight: bold; }

.report-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }

/* ---------------- 报告卡片 ---------------- */
.section-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 130px;
}
.section-head {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  text-align: center;
  padding: 12px;
  font-size: 19px;
  font-weight: bold;
  letter-spacing: 6px;
  color: #6b4e00;
}
.section-body { padding: 20px 24px 24px; }
.section-body + .section-body { border-top: 1px dashed var(--border); }
.sub-head {
  background: var(--cream-2);
  border-left: 4px solid var(--gold);
  padding: 7px 14px;
  font-weight: bold;
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: 2px;
}
.section-body .sub-head:first-child { margin-top: 0; }

/* 关键值行（如：流年 4 运势 314） */
.kv-line {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: var(--cream-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px; margin-bottom: 16px;
  font-size: 15px;
}
.kv-line .num { color: var(--red); font-weight: bold; font-size: 20px; }
.kv-line .desc { color: var(--ink); }

/* ---------------- 综合总览 ---------------- */
.overview-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
@media (max-width: 900px) { .overview-grid { grid-template-columns: 1fr; } }
.panel {
  border: 1px solid var(--border); border-radius: 10px;
  background: #fff; padding: 14px;
}
.panel-title {
  text-align: center; background: var(--cream-2);
  font-weight: bold; padding: 6px; border-radius: 6px; margin-bottom: 10px;
  letter-spacing: 3px;
}
.triangle-box { display: flex; justify-content: center; }
.triangle-box svg { max-width: 100%; height: auto; }

/* 指标表 */
.metric-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.metric-table th, .metric-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: center; }
.metric-table th { background: var(--gold-light); font-weight: bold; width: 34%; letter-spacing: 1px; }
.metric-table td { background: #fff; color: var(--red); font-weight: bold; font-size: 15px; }
.metric-table td.plain { color: var(--ink); font-weight: normal; }

/* 复合性格格网 */
.combo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.combo-cell.combo-chair { background: #ffe2b0; border-color: var(--gold); }
.combo-cell {
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--cream-2); text-align: center;
  padding: 7px 4px; font-weight: bold; color: var(--red);
  font-size: 16px; letter-spacing: 2px;
}

/* ---------------- 五行表 ---------------- */
.wuxing-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: center; }
.wuxing-table th, .wuxing-table td { border: 1px solid var(--border); padding: 8px 6px; }
.wuxing-table .row-head { background: var(--gold-light); font-weight: bold; width: 90px; letter-spacing: 2px; }
.wuxing-table .el-head { font-size: 17px; font-weight: bold; color: #fff; letter-spacing: 3px; }
.el-木 { background: var(--wood); } .el-火 { background: var(--fire); }
.el-土 { background: var(--earth); } .el-金 { background: var(--gold); } .el-水 { background: var(--water); }
.el-木.el-text, .el-火.el-text, .el-土.el-text, .el-金.el-text, .el-水.el-text { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.wuxing-table td { background: #fff; }
.wuxing-table .strong-red { color: var(--red); font-weight: bold; }
.parts-cell span { margin: 0 6px; white-space: nowrap; }

/* ---------------- 主性格总评 / 通用解读行 ---------------- */
.desc-table { width: 100%; border-collapse: collapse; }
.desc-table th, .desc-table td { border: 1px solid var(--border); padding: 12px 14px; vertical-align: middle; }
.desc-table th {
  background: var(--gold-light); width: 120px; min-width: 112px;
  text-align: center; white-space: nowrap;
  font-weight: bold; letter-spacing: 2px; font-size: 15px;
}
.desc-table td { background: #fff; font-size: 14px; }
.desc-table td ul { padding-left: 18px; }
.desc-table td li { margin: 3px 0; }
.desc-table .field-cell { font-weight: bold; color: var(--red); }

/* ---------------- 主线 ---------------- */
.line-row { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 14px; display: flex; }
.line-owned { border-color: var(--green); }
.line-name {
  width: 150px; flex-shrink: 0; background: var(--gold-light);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: bold; text-align: center; padding: 10px; gap: 2px;
}
.line-owned .line-name { background: #C9E8CE; }
.line-name .nums { font-size: 17px; color: var(--red); letter-spacing: 1px; }
.line-name .nm { font-size: 14px; }
.line-name .alias { font-size: 12px; color: var(--ink-2); }
.line-status {
  width: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 18px; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.line-status.yes { color: var(--green); }
.line-status.no { color: var(--red); }
.line-body { flex: 1; padding: 10px 16px; font-size: 13.5px; background: #fff; }
.line-body p { margin: 2px 0; }
.line-body .lack-tag { color: var(--red); font-weight: bold; margin-right: 6px; }
/* 辅线（最后四条 2 位数字组合）使用更浅背景 */
.line-row.line-aux { background: #fdfaf2; }
.line-row.line-aux .line-name { background: #f6efdd; }
.line-row.line-aux .line-body { background: #fdfaf2; }

/* ---------------- 数字分布 ---------------- */
.dist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 18px; }
@media (max-width: 900px) { .dist-grid { grid-template-columns: 1fr; } }
.digit-row-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.digit-row-table th, .digit-row-table td { border: 1px solid var(--border); padding: 9px 12px; text-align: center; }
.digit-row-table th { background: var(--gold-light); font-weight: bold; }
.digit-row-table th.fit { width: 72px; }   /* 与「数字」两字等宽（加宽版） */
.digit-row-table th.fit2 { width: 88px; }  /* 与「分布情况」四字等宽 */
.digit-row-table th:last-child { width: auto; }
.digit-row-table td { background: #fff; text-align: left; word-break: break-all; }
.digit-row-table td { background: #fff; text-align: left; }
.in-tag { color: var(--green); font-weight: bold; }
.out-tag { color: var(--red); font-weight: bold; }
/* 分布情况徽章（数字分布表） */
.dist-badge {
  display: inline-block; font-size: 11px; font-weight: bold;
  padding: 2px 4px; border-radius: 8px; letter-spacing: 0;
  white-space: nowrap;
}
.dist-badge.ii { color: var(--green); background: #e7f3e7; }
.dist-badge.io { color: #2c7a2c; background: #f3f8e7; }
.dist-badge.oi { color: var(--gold-deep); background: #faf3dc; }
.dist-badge.oo { color: var(--red); background: #fbeae4; }
/* △内数字解读：缺失（红）/一个（绿）/多个（黄） */
.dist-cnt {
  display: inline-block; font-size: 12px; font-weight: bold;
  padding: 2px 8px; border-radius: 8px; white-space: nowrap;
}
.dist-cnt.miss { color: var(--red); background: #fbeae4; }
.dist-cnt.one { color: var(--green); background: #e7f3e7; }
.dist-cnt.multi { color: var(--gold-deep); background: #faf3dc; }
/* 模块头图：情感模式 4:1 / 理论来源 16:9 */
.module-banner { display: block; width: 100%; object-fit: cover; border-radius: 8px; }
.banner-3 { aspect-ratio: 3 / 1; }
.banner-4 { aspect-ratio: 4 / 1; }
.banner-5 { aspect-ratio: 5 / 1; }
.banner-7 { aspect-ratio: 7 / 1; }
.banner-16 { aspect-ratio: 16 / 9; }
/* 登录页管理员入口（不起眼） */
.admin-entry-link {
  display: inline-block; margin-top: 18px;
  color: var(--ink-2); font-size: 11px; letter-spacing: 1px;
  text-decoration: none; border-bottom: 1px dashed transparent;
}
.admin-entry-link:hover, .admin-entry-link.active { color: var(--gold-deep); border-bottom-color: var(--gold-deep); }

/* ---------------- 联合码 ---------------- */
.combo-map-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.combo-map-table th, .combo-map-table td { border: 1px solid var(--border); padding: 9px 12px; text-align: center; }
.combo-map-table .code { font-weight: bold; color: var(--red); font-size: 16px; letter-spacing: 2px; }
.combo-map-table th { background: var(--gold-light); }
.combo-map-table td { background: #fff; }
.age-band { margin-bottom: 6px; }
.age-band-dark th { background: #f2e3b8; }
.age-band-dark td { background: #fdf6e4; }

/* ---------------- 星座 ---------------- */
.zodiac-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin-bottom: 10px; display: block; }
.zodiac-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; }
@media (max-width: 900px) { .zodiac-grid { grid-template-columns: 1fr; } }
.zodiac-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.zodiac-table th, .zodiac-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: center; }
.zodiac-table th { background: var(--gold-light); width: 90px; font-weight: bold; }
.zodiac-table td { background: #fff; }
.gt-title {
  text-align: center; font-size: 20px; font-weight: bold; letter-spacing: 3px;
  margin: 20px 0 6px; color: var(--ink);
}
.gt-title .red { color: var(--red); }

/* ---------------- 流年 ---------------- */
.dual-triangle { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dual-triangle { grid-template-columns: 1fr; } }
.year-tag {
  display: inline-block; background: var(--red); color: #fff;
  border-radius: 6px; padding: 2px 10px; font-weight: bold; font-size: 13px;
}
.ben-tag { background: var(--green); }

/* ---------------- 页脚 / toast ---------------- */
.report-footer { text-align: center; padding: 26px 20px 40px; color: var(--ink-2); font-size: 13px; }
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(60,45,5,.92); color: #fff;
  padding: 10px 22px; border-radius: 8px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .3s; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 打印 / 导出 PDF ---------------- */
@media print {
  @page { margin: 10mm; }
  body { background: #fff; }
  .topbar, .side-nav, .info-strip, .report-footer, .toast, #view-login, #view-input { display: none !important; }
  #view-report { display: block !important; }
  .report-layout { display: block; max-width: none; padding: 0; }
  .report-content { gap: 0; }
  /* 每个大模块单独占一页：从新页开始，超一页的内容自然续排（性格报告） */
  .section-card { box-shadow: none; page-break-inside: auto; break-inside: auto; border-color: #999; margin-bottom: 10px; page-break-before: always; break-before: page; }
  .report-content .section-card:first-child { page-break-before: auto; break-before: auto; }
  /* 情感合盘 / 家庭合盘：模块连贯排版，不单独分页 */
  #couple-report-content .section-card,
  #family-report-content .section-card { page-break-before: auto; break-before: auto; }
  /* 指定模块仍另起一页 */
  #couple-report-content .section-card.pb-page,
  #family-report-content .section-card.pb-page { page-break-before: always; break-before: page; }
  /* 星座组合解析与上一模块（联合码·解读）同页，不强制分页 */
  #sec-zodiac { page-break-before: auto; break-before: auto; }
  /* 流年趋势 · 运势指南 导出 PDF 时另起一页 */
  #yearly-guide { page-break-before: always; break-before: page; }
  .module-banner { page-break-inside: avoid; break-inside: avoid; }
  .section-head { page-break-after: avoid; break-after: avoid; }
  /* 细粒度防截断：仅单行/小元素不被拦腰切断 */
  tr, .metric-table, .wuxing-table, .line-row, .age-band, .sec-node, .dist-grid > div, .combo-cell { page-break-inside: avoid; break-inside: avoid; }
  .sub-head { page-break-after: avoid; break-after: avoid; }
  /* 大块内容（整表/面板/栅格）允许跨页续排，避免整块推页留大片空白 */
  .desc-table, .panel, .overview-grid, .zodiac-grid, .section-body, .line-body { page-break-inside: auto; break-inside: auto; }
  /* 小图形保持完整 */
  .dual-triangle, .triangle-wrap, .zodiac-img { page-break-inside: avoid; break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* 手机/平板专用导出版式（JS 在导出时给 body 加 print-mobile，PC 不加、不受影响）：
     栅格一律单列、面板与表格铺满页宽，不留右侧空白 */
  body.print-mobile .overview-grid, body.print-mobile .dist-grid, body.print-mobile .zodiac-grid,
  body.print-mobile .cp-two, body.print-mobile .dual-triangle { grid-template-columns: 1fr !important; }
  body.print-mobile .overview-grid > .panel, body.print-mobile .dist-grid > .panel,
  body.print-mobile .cp-two > .panel { width: 100%; box-sizing: border-box; }
  body.print-mobile .report-content table,
  body.print-mobile #couple-report-content table,
  body.print-mobile #family-report-content table { width: 100% !important; }
}

/* ---------------- 顶栏切换菜单 ---------------- */
.menu-wrap { position: relative; }
.menu-btn { cursor: pointer; }
.menu-drop {
  position: absolute; top: 100%; left: 0; margin-top: 8px; z-index: 90;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(60,45,5,.15); min-width: 170px; overflow: hidden;
}
.menu-drop a {
  display: block; padding: 10px 16px; font-size: 14px; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--cream-2);
}
.menu-drop a:last-child { border-bottom: none; }
.menu-drop a:hover { background: var(--cream-2); color: var(--gold-deep); }
.menu-drop a.menu-disabled { color: var(--ink-2); opacity: .6; cursor: default; }

/* ---------------- 情感合盘 ---------------- */
.cp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .cp-two { grid-template-columns: 1fr; } }
.cp-info { width: 100%; border-collapse: collapse; margin: 4px 0; }
.cp-info th, .cp-info td { border: 1px solid var(--border); padding: 8px 10px; font-size: 14px; }
.cp-info th { background: var(--gold-light); width: 64px; font-weight: bold; }
.cp-info td { background: #fff; }
.cp-info .cp-year-th { width: 64px; background: var(--gold); }
.cp-info .cp-year { font-size: 18px; font-weight: bold; text-align: center; background: #fff; }
.cp-person-head {
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center;
  padding: 8px 10px; text-align: center;
  background: var(--gold-light); border-radius: 6px; margin-bottom: 8px; font-weight: bold;
}
.cp-person-head .cp-name { color: var(--red); font-size: 16px; }
.cp-person-head .cp-g { font-size: 16px; color: var(--red); }
.cp-sum {
  margin-top: 18px; text-align: center; font-size: 18px; font-weight: bold;
  background: var(--gold-light); border: 1px solid var(--gold); border-radius: 8px; padding: 12px;
}
.cp-num { font-size: 26px; color: var(--ink); }
.cp-label {
  margin: 12px 0 6px; text-align: center; font-weight: bold; font-size: 15px;
  background: var(--gold-light); border-radius: 6px; padding: 7px;
}
.cp-behavior-item {
  text-align: center; padding: 7px; margin-bottom: 6px;
  background: var(--cream-2); border: 1px solid var(--border); border-radius: 6px; font-size: 13.5px;
}
.cp-mode-title { text-align: center; font-weight: bold; color: var(--red); margin: 10px 0 4px; }
.cp-know-title {
  text-align: center; font-weight: bold; font-size: 16px; letter-spacing: 2px;
  background: var(--gold); color: var(--ink); border-radius: 6px; padding: 8px; margin: 8px 0;
}
.cp-know-body {
  text-align: center; font-size: 13.5px; line-height: 1.9;
  background: var(--cream-2); border-radius: 6px; padding: 10px; margin-bottom: 8px;
}

/* ---------------- 家庭合盘 ---------------- */
.fm-info th { white-space: nowrap; }
/* 模块首行信息条：列宽均分，避免因内容长短导致框宽不均 */
.fm-head-table { table-layout: fixed; }
.fm-head-table th, .fm-head-table td { width: auto; }
.fm-info .fm-must { background: #f3c9c9; color: var(--red); font-weight: bold; }
.fm-info .fm-must-val { background: #fdf3f3; color: var(--red); }
.fm-matrix-title {
  text-align: center; font-weight: bold; font-size: 15px; letter-spacing: 2px;
  background: var(--gold); border-radius: 6px; padding: 8px; margin-bottom: 8px;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .side-nav { display: none; }
  .report-layout { padding: 14px 10px; }
  .section-body { padding: 14px 12px 18px; }
  .combo-grid { grid-template-columns: repeat(2, 1fr); }
  .line-row { flex-direction: column; }
  .line-name, .line-status { width: 100%; flex-direction: row; gap: 10px; }
  .line-status { border: none; border-top: 1px solid var(--border); }
  /* 报告内所有表格：标题/内容上下堆叠，统一铺满屏幕
     （!important 覆盖模板中 th 的内联 style="width:110px" 等） */
  #report-content table, #couple-report-content table, #family-report-content table {
    display: block; width: 100% !important;
  }
  #report-content table tr, #couple-report-content table tr, #family-report-content table tr {
    display: block; width: 100%;
  }
  #report-content table th, #report-content table td,
  #couple-report-content table th, #couple-report-content table td,
  #family-report-content table th, #family-report-content table td {
    display: block; width: 100% !important; box-sizing: border-box;
  }
  .desc-table th, .zodiac-table th, .metric-table td.row-head { border-bottom: none; }
  /* 面板与栅格铺满（单列） */
  .panel, .overview-grid, .zodiac-grid, .cp-two, .dual-triangle { width: 100%; box-sizing: border-box; }
  .overview-grid, .zodiac-grid, .cp-two, .dual-triangle { grid-template-columns: 1fr !important; }
  .zodiac-table th, .zodiac-table td, .combo-map-table th, .combo-map-table td { padding: 8px 6px; }
  .age-band { margin-bottom: 10px; }
  /* 所有栏目标题条（一/二/三级名称、面板标题、合盘小标题）强制满宽 */
  .section-head, .sub-head, .gt-title, .panel-title, .cp-label,
  .cp-mode-title, .cp-know-title, .cp-sum, .fm-matrix-title {
    display: block; width: 100%; box-sizing: border-box; margin-left: 0; margin-right: 0;
  }
  /* 手机端屏蔽板块：五行表 / 联合码·复合性格表 / 人物信息条 / 标记为 m-hide 的表格 */
  .wuxing-table, .combo-map-table, .cp-info, .m-hide { display: none !important; }
}
