:root {
  --bg: #f4efe3;
  --bg-2: #faf7ef;
  --card: #fffdf7;
  --card-2: #fffefa;
  --gold: #9c7c37;
  --gold-2: #7a5c22;
  --gold-dim: rgba(156, 124, 55, .30);
  --gold-soft: rgba(156, 124, 55, .10);
  --red: #a8332b;
  --red-2: #c04437;
  --ink: #2b2318;
  --ink-2: #5d5346;
  --ink-3: #8c8171;
  --line: #e3d9c6;
  --line-2: rgba(156, 124, 55, .16);
  --lu: #2e8b57;
  --quan: #8e44ad;
  --ke: #2f6fb0;
  --ok: #2b7f66;   /* UI「吉／选中」语义，不随四化色变（P3-2026-10-11 拆出） */
  --ji: #c0392b;
  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 50% -12%, #fffaf0 0%, rgba(244, 239, 227, 0) 70%),
    radial-gradient(760px 420px at 100% 6%, rgba(168, 51, 43, .05) 0%, rgba(244, 239, 227, 0) 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--gold-dim);
  padding: 26px 0 20px;
  margin-bottom: 20px;
  background: linear-gradient(180deg, rgba(255, 252, 244, .9), rgba(244, 239, 227, 0));
}
.head-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand h1 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold-2);
}
.brand p { margin: 0; font-size: 12.5px; color: var(--ink-3); letter-spacing: .6px; }

/* 语言切换 */
.lang-switch { display: flex; gap: 4px; background: #fffdf7; border: 1px solid var(--line); border-radius: 7px; padding: 3px; }
.lang-btn {
  border: none; background: none; border-radius: 5px;
  padding: 5px 14px; font-size: 13px; font-family: var(--serif);
  letter-spacing: 1px; color: var(--ink-2); cursor: pointer;
}
.lang-btn.active { background: var(--gold); color: #fffdf7; font-weight: 700; }

/* ---------- card ---------- */
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(90, 70, 40, .06), 0 6px 18px rgba(90, 70, 40, .05);
  padding: 18px 20px;
  margin-bottom: 16px;
  position: relative;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 26px; height: 26px;
  border-top: 1px solid var(--gold-dim);
  border-left: 1px solid var(--gold-dim);
  border-top-left-radius: var(--radius);
  pointer-events: none;
}
.card::after {
  content: '';
  position: absolute; bottom: 0; right: 0;
  width: 26px; height: 26px;
  border-bottom: 1px solid var(--gold-dim);
  border-right: 1px solid var(--gold-dim);
  border-bottom-right-radius: var(--radius);
  pointer-events: none;
}
.card h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold-2);
}

/* ---------- form ---------- */
.form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.link-btn { background: none; border: none; color: var(--gold); font-size: 13px; cursor: pointer; padding: 0; font-family: var(--sans); }
.link-btn:hover { color: var(--gold-2); text-decoration: underline; }

.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
  font-size: 12px; color: var(--ink-2); font-weight: 500;
  display: flex; justify-content: space-between; align-items: baseline; gap: 6px;
}
.field .opt { color: var(--ink-3); font-weight: 400; font-size: 11px; }

input[type="text"], input[type="date"], input[type="time"], select {
  height: 38px; padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffefa;
  color: var(--ink);
  font-size: 14px;
  font-family: var(--sans);
  width: 100%; min-width: 0;
}
select { appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 14px) 17px, calc(100% - 9px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(156, 124, 55, .16); }
input[type="range"] { padding: 0; height: 38px; border: none; background: none; accent-color: var(--gold); }

.seg { display: flex; gap: 6px; }
.seg-btn {
  flex: 1; height: 38px;
  border: 1px solid var(--line); background: #fffefa;
  border-radius: 6px; font-size: 14px; color: var(--ink-2);
  cursor: pointer; font-family: var(--sans);
}
.seg-btn.active { background: linear-gradient(180deg, #b8453a, #96312a); border-color: var(--red-2); color: #fff6f2; font-weight: 600; }

.lunar-row, .place-row { display: flex; gap: 6px; }
.lunar-row select { flex: 1; }

.form-foot { display: flex; align-items: center; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--gold); width: 15px; height: 15px; }

.primary-btn {
  margin-left: auto; height: 40px; padding: 0 28px;
  background: linear-gradient(180deg, #b8453a, #8e2c26);
  color: #fff7f4; border: 1px solid var(--red-2);
  border-radius: 6px; font-size: 14px; font-weight: 600;
  letter-spacing: 2px; cursor: pointer; font-family: var(--serif);
}
.primary-btn:hover { background: linear-gradient(180deg, #cc5142, #a1332a); }

.ghost-btn {
  height: 32px; padding: 0 14px;
  background: #fffefa; border: 1px solid var(--gold-dim);
  border-radius: 6px; font-size: 13px; color: var(--gold);
  cursor: pointer; font-family: var(--sans);
}
.ghost-btn:hover { border-color: var(--gold); background: var(--gold-soft); }

.ghost-select {
  height: 32px; padding: 0 22px 0 10px;
  background: #fffefa; border: 1px solid var(--gold-dim);
  border-radius: 6px; font-size: 13px; color: var(--gold);
  cursor: pointer; font-family: var(--sans);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b09b71' d='M6 7.5L.5 1h11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.ghost-select:hover { border-color: var(--gold); background-color: var(--gold-soft); }

.form-tip { margin: 10px 0 0; font-size: 12.5px; color: var(--red); min-height: 18px; }

/* ---------- info bar ---------- */
.info-card { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.info-main { min-width: 210px; }
.info-title { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--gold-2); display: flex; align-items: center; gap: 8px; letter-spacing: 1px; }
.badge { font-size: 11px; padding: 1px 9px; border-radius: 3px; background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-dim); font-weight: 400; letter-spacing: 1px; }
.info-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; flex: 1; min-width: 280px; }
.info-item { font-size: 13px; }
.info-item b { display: block; color: var(--ink-3); font-weight: 400; font-size: 11.5px; letter-spacing: .5px; }
.info-item span { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- tool bar ---------- */
.tool-card { padding-bottom: 14px; }
.mode-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.mode-tab {
  flex: 1; height: 40px;
  border: 1px solid var(--line); background: #fffefa;
  border-radius: 6px; font-family: var(--serif);
  font-size: 15px; letter-spacing: 3px; color: var(--ink-2);
  cursor: pointer;
}
.mode-tab:hover { border-color: var(--gold-dim); color: var(--gold); }
.mode-tab.active {
  background: linear-gradient(180deg, #f7edd6, #f2e5c9);
  border-color: var(--gold); color: var(--gold-2); font-weight: 700;
}
.select-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.sel { display: flex; flex-direction: column; gap: 5px; }
.sel > label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .5px; }
.sel select { min-width: 132px; }
.year-ctl { display: flex; gap: 5px; align-items: center; }
.year-ctl select { width: 96px; }
.mini-btn {
  width: 30px; height: 38px; border: 1px solid var(--line);
  background: #fffefa; color: var(--gold); border-radius: 6px;
  cursor: pointer; font-size: 16px; line-height: 1;
}
.mini-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.sel.checks { flex-direction: row; gap: 14px; align-items: center; padding-bottom: 9px; }
.tool-note { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.6; }

/* ---------- chart ---------- */
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.chart-actions { display: flex; align-items: center; gap: 12px; }
.legend { display: flex; gap: 4px; }

.chart-scroll { overflow-x: auto; }
.chart-stage { position: relative; min-width: 0; }
.chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  /* P3c-2026-10-11：改回自适应宽度（移除固定 min-width 与 100vh 限制，手机端不再横向溢出） */
  width: 100%;
  max-width: 860px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  gap: 1px;                     /* 连体网格：1px 间隙透出网格线 */
  background: #e6e8ed;
  border: 1.5px solid #cdd2da;
}

.cell {
  position: relative;
  background: #fff;
  padding: 9px 11px;
  display: flex; flex-direction: column;
  cursor: pointer; overflow: hidden;
  transition: background .15s, box-shadow .15s, opacity .15s;
}
.cell:hover { background: #fafbfc; box-shadow: inset 0 0 0 1px #cdd2da; }
.cell.is-life { background: #fdf7f1; }
.cell.is-cause { box-shadow: inset 0 0 0 1.5px #b0362a; }
.cell.is-sanhui { background: #fffcf6; }
.cell.is-flyfrom { box-shadow: inset 0 0 0 2px #c04437; }
.cell.dim { opacity: .42; }
.cell.is-lunar-month { box-shadow: inset 0 0 0 1.5px #2f6fb0; }
/* 焦点宫与其三方四正（P0-2026-10-11）：用 outline 不用 box-shadow，避免与来因宫/飞星起点的 inset 边框互相覆盖 */
.cell.is-focus { outline: 2px solid #9c7c37; outline-offset: -2px; background: #fffdf7; z-index: 2; }
.cell.is-focus-sanhui { background: #fbf3e4; box-shadow: inset 0 0 0 1px rgba(156,124,55,.30); }

/* 宫职名称与干支改置底部（P3c-2026-10-11）：宫名正下居中、干支右下角 */
.cell-bot { position: relative; height: 16px; margin-top: 3px; flex: none; }
.cell-bot .pname { position: absolute; left: 0; right: 0; text-align: center; font-family: var(--serif); font-size: 12px; font-weight: 700; color: #1a1d21; letter-spacing: .3px; }
.cell.is-life .cell-bot .pname { color: #9a2b1c; }
.cell-bot .pbranch { position: absolute; right: 0; bottom: 0; font-variant-numeric: tabular-nums; letter-spacing: .5px; font-size: 11px; color: #9aa0a6; }

.ov-row { display: flex; gap: 6px; flex-wrap: wrap; font-size: 10.5px; line-height: 1.5; margin-top: 2px; }
.ov-row .ov-dec { color: #b0362a; }
.ov-row .ov-year { color: #2f6fb0; }
.ov-row .ov-star { color: #9a2b1c; }

.cell-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 2px 0; overflow: hidden; }
.star-row { display: flex; align-items: baseline; gap: 4px; line-height: 1.5; }
.star-row .sname {
  font-family: var(--serif); font-size: 16px; font-weight: 700;
  color: #c0392b; letter-spacing: .5px; cursor: help;
}
.star-row .bright { font-size: 10px; color: #9aa0a6; }
/* 辅星 / 杂曜：两列网格（与导出 PNG 一致） */
.minor-row { font-size: 11.5px; line-height: 1.55; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 6px; align-content: start; }
.m-item { display: flex; align-items: baseline; gap: 3px; min-width: 0; }
.minor-row .mname { color: #2f6f5e; cursor: help; }
.minor-row .mname.tough { color: #1a1d21; }   /* 六煞用黑 */
.minor-row .mname.lucky { color: #8e44ad; }   /* 七吉用紫 */
.adj-row { font-size: 10.5px; line-height: 1.5; color: #9aa0a6; display: grid; grid-template-columns: 1fr 1fr; gap: 1px 6px; align-content: start; }
.empty-note { font-size: 11.5px; color: #9aa0a6; }

.cell-foot {
  font-size: 10px; color: #9aa0a6;
  border-top: 1px solid #eef0f3;
  padding-top: 3px; margin-top: 2px;
  display: flex; justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

/* 四化徽章（禄绿/权红/科蓝/忌紫，与导出 PNG 统一） */
.mut {
  font-style: normal; font-size: 9.5px; line-height: 1;
  padding: 2px 4px; border-radius: 3px; color: #fff;
  font-weight: 700; font-family: var(--sans);
}
.mut.lu { background: #2e8b57; }
.mut.quan { background: #8e44ad; }
.mut.ke { background: #2f6fb0; }
.mut.ji { background: #c0392b; }
.legend .mut { padding: 3px 8px; font-size: 12px; }

/* 自化标记（P0-2026-10-11）：与生年四化「实心底色」相反——透明底＋虚线描边，一眼可分 */
/* 自化几何箭头（P3b-2026-10-11）：绝对定位贴宫位边缘，位置与旋转由 ZW.orientSelfArrows() 内联指定 */
/* 自化几何箭头覆盖层（P3c-2026-10-11）：div 覆盖于盘面之上、跨宫位边框半内半外；不裁切 */
.self-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 4; }
.self-arrow { position: absolute; display: block; z-index: 4; pointer-events: auto; left: 0; top: 0; }
.self-arrow.mut-lu { color: #2e8b57; }
.self-arrow.mut-quan { color: #8e44ad; }
.self-arrow.mut-ke { color: #2f6fb0; }
.self-arrow.mut-ji { color: #c0392b; }

.cell.center {
  grid-column: 2 / span 2; grid-row: 2 / span 2;
  cursor: default;
  background: #fcfcfe;
  padding: 14px 16px; gap: 8px;
}
.cell.center:hover { background: #fcfcfe; box-shadow: none; }
.center-title { font-family: var(--serif); font-size: 16px; font-weight: 700; color: #1f2329; letter-spacing: 1px; }
.center-sub { font-size: 11.5px; color: #9aa0a6; }
.center-kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; font-size: 12px; }
.center-kv div { display: flex; justify-content: space-between; border-bottom: 1px dotted #e6e8ed; padding: 1px 0; }
.center-kv b { color: #9aa0a6; font-weight: 400; }
.center-kv span { color: #1f2329; }
.center-note { font-size: 10.5px; color: #9aa0a6; line-height: 1.55; }

.sanhui-layer { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
.fly-layer { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
.fly-layer line { stroke-width: 1.6; opacity: .8; }
.fly-layer circle { fill: #c04437; }
.fly-layer text { font-size: 11px; font-family: var(--serif); fill: #5b6068; }

.chart-tip { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }

/* ---------- sections ---------- */
.sec { margin-bottom: 16px; }
.sec-head { margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec-head h3 {
  margin: 0; font-family: var(--serif); font-size: 16px;
  font-weight: 700; color: var(--gold-2); letter-spacing: 1.5px;
}
.sec-head p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

.items { display: grid; gap: 10px; }
.items.cols-2 { grid-template-columns: repeat(2, 1fr); }

.item {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold-dim);
  border-radius: 6px; padding: 12px 14px;
}
.item.highlight { border-left-color: var(--gold); background: #fdf8ea; }
.item.warn { border-left-color: var(--red); background: #fdf3f2; }
.item.good { border-left-color: var(--ok); background: #f3f9f6; }

.item-label { font-size: 12px; color: var(--gold); font-weight: 600; letter-spacing: .5px; flex-wrap: wrap; display: flex; gap: 6px; align-items: center; }
.item.warn .item-label { color: var(--red); }
.item.good .item-label { color: var(--ok); }
.item-title { font-family: var(--serif); font-size: 14.5px; font-weight: 700; color: var(--ink); margin-top: 3px; letter-spacing: .5px; }
.item-text { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; }
.item-meta { margin-top: 7px; display: flex; flex-direction: column; gap: 3px; }
.item-meta span { font-size: 12px; color: var(--ink-3); padding-left: 10px; position: relative; }
.item-meta span::before { content: ''; position: absolute; left: 0; top: 8px; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.item-meta span.star { color: var(--gold); }
.item-meta span.star::before { background: var(--gold); }

/* ---------- 流月卡片 ---------- */
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.month-card {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; background: #fffdf8;
}
.month-card.active { border-color: var(--ok); background: #f2f9f6; }
.month-card h4 { margin: 0 0 4px; font-family: var(--serif); font-size: 14px; color: var(--gold-2); letter-spacing: 1px; }
.month-card .m-palace { font-size: 12.5px; color: var(--ink); }
.month-card .m-sihua { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }

/* ---------- tooltip ---------- */
.tooltip {
  position: fixed; z-index: 80; max-width: 280px;
  background: #fffdf7;
  border: 1px solid var(--gold); border-radius: 6px;
  padding: 10px 12px; pointer-events: none;
  box-shadow: 0 8px 24px rgba(90, 70, 40, .18);
}
.tooltip h5 { margin: 0 0 3px; font-family: var(--serif); font-size: 14px; color: var(--gold-2); letter-spacing: 1px; }
.tooltip .t-sub { font-size: 11.5px; color: var(--ink-3); margin-bottom: 5px; }
.tooltip p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.tooltip .t-meta { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(60, 48, 34, .38); }
.modal-box {
  position: relative; width: min(580px, 92vw); max-height: 84vh;
  background: #fffdf7;
  border: 1px solid var(--gold-dim); border-radius: 8px;
  display: flex; flex-direction: column;
  box-shadow: 0 22px 60px rgba(90, 70, 40, .28);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-family: var(--serif); font-size: 16px; color: var(--gold-2); letter-spacing: 1.5px; }
.modal-close { border: none; background: none; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--gold); }
.modal-body { padding: 14px 18px 20px; overflow-y: auto; }
.modal-body .block { margin-bottom: 13px; }
.modal-body .block h4 { margin: 0 0 5px; font-size: 12px; color: var(--gold); font-weight: 500; letter-spacing: 1px; }
.modal-body .block p { margin: 0; font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; }
.modal-body .starlist { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-body .starchip {
  font-size: 12.5px; padding: 2px 10px;
  border: 1px solid var(--line); border-radius: 3px; color: var(--ink-2); background: #fffefa;
}
.modal-body .starchip b { font-family: var(--serif); font-weight: 700; color: var(--ink); }

/* ---------- footer ---------- */
.site-footer { padding: 20px 0 44px; font-size: 12px; color: var(--ink-3); text-align: center; }
.disclaimer { font-size: 12px; color: var(--ink-3); text-align: center; margin: 4px 0 0; }

.hidden { display: none !important; }

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: #efe9dc; }
::-webkit-scrollbar-thumb { background: #d3c7b0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .items.cols-2 { grid-template-columns: 1fr; }
  .info-card { flex-direction: column; gap: 12px; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .brand h1 { font-size: 21px; letter-spacing: 2px; }
  .chart { grid-template-rows: repeat(4, minmax(120px, auto)); }
  .chart-stage { min-width: 0; }
  .primary-btn { width: 100%; margin-left: 0; }
  .mode-tab { letter-spacing: 1px; font-size: 14px; }
  .sel select { min-width: 110px; }
  .head-inner { align-items: flex-start; }
}

/* ========== 会员体系 ========== */

/* 账户栏 */
.account-bar { display: flex; align-items: center; gap: 10px; }
.account-bar #acctUser { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.acct-email { font-size: 13px; color: var(--ink-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn.primary-link { color: #fff; background: var(--gold); border-radius: 4px; padding: 4px 12px; font-size: 13px; }
.link-btn.primary-link:hover { background: var(--gold-2); text-decoration: none; }
.badge.paid { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: #2a2113; border-color: var(--gold-2); font-weight: 600; }
.badge.free { background: #efe7d6; color: var(--ink-3); border-color: #ddd2bd; }

/* 续费提醒横幅 */
.renew-banner { background: linear-gradient(90deg, #fbf2dc, #f6e6c4); border-bottom: 1px solid var(--gold-dim); color: #6a4f1d; font-size: 13px; padding: 8px 16px; display: flex; align-items: center; gap: 12px; justify-content: center; }
.renew-banner #renewText { flex: 1; text-align: center; }
.renew-banner .banner-close { margin-left: auto; border: none; background: none; font-size: 18px; color: #6a4f1d; cursor: pointer; }
.renew-banner .link-btn { background: var(--gold); color: #fff; border-radius: 4px; padding: 3px 12px; }

/* 锁定态 */
.lock-ico { font-size: 11px; margin-left: 4px; }
.mode-tab.locked { opacity: .55; cursor: not-allowed; position: relative; }
.mode-tab.locked::after { content: ''; }
.select-row.free-locked, #dayWrap.free-locked { position: relative; }
.select-row.free-locked::before, #dayWrap.free-locked::before {
  content: '会员专享'; position: absolute; top: -9px; right: 8px; z-index: 5;
  font-size: 10px; padding: 1px 7px; border-radius: 3px; background: var(--gold); color: #fff; letter-spacing: 1px;
}
.select-row.free-locked select, #dayWrap.free-locked select { opacity: .5; pointer-events: none; }
.ghost-btn.locked { opacity: .7; }

/* 弹窗尺寸变体 */
.modal-box.narrow { max-width: 360px; }
.modal-box.wide { max-width: 560px; }

/* 登录/注册（美化） */
.seg.center { justify-content: center; margin-bottom: 12px; }
.form-err { color: var(--red); font-size: 12.5px; min-height: 16px; margin: 6px 0 0; }
.modal-hint { font-size: 11.5px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.6; }
.primary-btn.block { width: 100%; margin-top: 6px; }

.auth-box { max-width: 388px; overflow: hidden; }
.auth-box .modal-close { position: absolute; top: 9px; right: 12px; z-index: 4; color: #fff; opacity: .9; }
.auth-box .modal-close:hover { color: #fff; opacity: 1; }
.auth-hero {
  text-align: center; padding: 26px 20px 18px;
  background: linear-gradient(180deg, #f7edd6, #f3e6ca);
  border-bottom: 1px solid var(--gold-dim);
}
.auth-seal {
  width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 11px; background: linear-gradient(180deg, #b8453a, #8e2c26);
  border: 1px solid var(--red-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 26px; color: #fff7f4; font-weight: 700;
  box-shadow: 0 6px 16px rgba(168, 51, 43, .28);
}
.auth-hero h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 19px; color: var(--gold-2); letter-spacing: 2px; }
.auth-subtitle { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.auth-box .modal-body { padding: 16px 22px 22px; }
.auth-box .seg.center { margin: 4px 0 16px; }
.auth-box .seg-btn { height: 40px; border-radius: 8px; }
.auth-field { margin-bottom: 13px; }
.auth-field input { height: 42px; border-radius: 8px; font-size: 14.5px; }
.form-err:not(:empty) {
  background: rgba(168, 51, 43, .08); border: 1px solid rgba(168, 51, 43, .22);
  border-radius: 7px; padding: 8px 11px; margin: 8px 0 0; color: #8e2c26;
}
.auth-submit { height: 46px; border-radius: 8px; margin-top: 10px; font-size: 15px; letter-spacing: 3px; }
.auth-submit.loading { cursor: default; opacity: .82; }
.auth-submit.loading::before {
  content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px;
  vertical-align: -2px; border: 2px solid rgba(255, 247, 244, .45); border-top-color: #fff7f4;
  border-radius: 50%; animation: zw-spin .7s linear infinite;
}
@keyframes zw-spin { to { transform: rotate(360deg); } }

/* 会员中心 */
.plan-status { font-size: 13px; color: var(--ink-2); margin: 0 0 14px; line-height: 1.6; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-card { border: 1px solid var(--gold-dim); border-radius: 8px; padding: 14px 12px; text-align: center; background: #fdfaf2; }
.plan-card.current { border-color: var(--gold-2); box-shadow: 0 0 0 2px rgba(156,124,55,.18); }
.pc-name { font-family: var(--serif); font-size: 15px; color: var(--gold-2); letter-spacing: 1px; }
.pc-price { font-size: 24px; font-weight: 700; color: var(--ink); margin: 6px 0 2px; }
.pc-price span { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-left: 2px; }
.pc-sub { font-size: 11.5px; color: var(--ink-3); margin-bottom: 10px; }
.plan-features { margin: 14px 0; }
.plan-features h4 { margin: 0 0 8px; font-size: 13px; color: var(--gold); font-weight: 500; letter-spacing: 1px; }
.plan-features ul { margin: 0; padding-left: 18px; }
.plan-features li { font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.plan-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ghost-btn.danger { color: var(--red); border-color: #e3b3ad; }
.ghost-btn.danger:hover { background: #fbeae8; }

/* 历史列表 */
.hist-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }
.hist-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #e7ddc8; border-radius: 8px; padding: 10px 14px; background: #fdfaf2; }
.hist-main { min-width: 0; }
.hist-name { font-family: var(--serif); font-size: 15px; color: var(--ink); }
.hist-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.hist-btns { display: flex; gap: 8px; flex-shrink: 0; }

/* 免费提示强调 */
.form-tip.vip { color: var(--gold-2); }

/* ---------- AI 解盘按钮 / 面板 ---------- */
.primary-btn.sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.primary-btn.sm.loading { opacity: .7; cursor: progress; }
.primary-btn.sm .btn-label::after { content: ''; }
.primary-btn.sm.loading .btn-label::after { content: ' ⟳'; }

.interp-wrap {
  margin: 18px 0 6px;
  background: linear-gradient(160deg, #fffdf8, #fbf6ec);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 6px 22px rgba(120, 96, 40, .08);
}
.interp-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.interp-head .interp-model { font-weight: 600; color: var(--gold-2); }
.interp-head .interp-quota { margin-left: auto; padding: 2px 10px; border-radius: 20px; background: #f1e8d6; color: var(--ink-2); }
.interp-head .interp-quota.vip { background: var(--gold-2); color: #fff; }
.interp-sec { margin: 12px 0; }
.interp-sec h4 {
  font-family: var(--serif); font-size: 15.5px; color: var(--ink);
  margin: 0 0 6px; padding-left: 10px; border-left: 3px solid var(--gold-2);
}
.interp-item { font-size: 13.5px; line-height: 1.75; color: var(--ink-2); padding: 3px 0; }
.interp-item b { color: var(--ink); }
.interp-pal { color: var(--gold-2); font-size: 12px; }
.interp-text { font-size: 13.5px; line-height: 1.8; color: var(--ink-2); margin: 4px 0; }
.interp-note {
  margin-top: 10px; font-size: 12px; color: var(--ink-3);
  background: #f6efe1; border-radius: 8px; padding: 8px 12px;
}
.interp-loading { text-align: center; color: var(--ink-3); padding: 26px; font-size: 14px; }
.interp-locked { text-align: center; padding: 22px; }
.interp-locked .lock-ico { font-size: 30px; }
.interp-locked p { color: var(--ink-2); margin: 10px 0 14px; }
.interp-error { color: #b3261e; text-align: center; padding: 18px; font-size: 13.5px; }

/* ---------- 训练后台入口（仅管理员可见） ---------- */
#acctAdmin { color: var(--gold-2); font-weight: 600; }
#acctAdmin:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .account-bar { gap: 6px; }
  .acct-email { max-width: 96px; }
  .plan-cards { grid-template-columns: 1fr; }
  .renew-banner { font-size: 12px; padding: 7px 10px; }
  .interp-wrap { padding: 14px; }
}

/* 读盘账本导出（P1-2026-10-11）：Markdown 预览/复制框 */
.ledger-text {
  width: 100%; height: 46vh; min-height: 260px; box-sizing: border-box;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.6;
  padding: 10px 12px; border: 1px solid #d8d3c8; border-radius: 6px;
  background: #fdfcf9; color: #23262b; resize: vertical;
  white-space: pre; overflow: auto;
}
.ledger-acts { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ledger-hint { font-size: 12px; color: #8a8f96; }
@media (max-width: 640px) { .ledger-text { height: 40vh; font-size: 11px; } }

/* 飞星分象筛选条（P2-2026-10-11） */
.fly-filter { margin-top: 8px; flex-wrap: wrap; }
.fly-filter .seg-btn { font-size: 12px; padding: 0 10px; }

/* 导出按钮突出（P3-2026-10-11）：访客常自己截屏，把导出做显眼 */
.ghost-btn.export-btn { background: linear-gradient(180deg, #b8453a, #96312a); color: #fff6f2; border-color: #96312a; font-weight: 600; }
.ghost-btn.export-btn:hover { background: linear-gradient(180deg, #a53e33, #86291f); color: #fff; }
.legend-note { font-size: 11.5px; color: var(--ink-3); margin-left: 2px; }
