/* ===== 紫微斗数排盘 · 浅色古典高级风 ===== */
:root {
  --bg-0: #f6f1e6;
  --bg-1: #efe6d2;
  --bg-card: #fffdf7;
  --bg-card-solid: #fffdf7;
  --line: #e0d3b4;
  --line-dark: #c4af7d;
  --gold: #b08a2c;
  --gold-soft: #d4af5e;
  --gold-dim: #9a7a2e;
  --ink: #2b2113;
  --ink-soft: #6b5d43;
  --ink-faint: #97886b;
  --accent: #8c1f28;
  --accent-strong: #a5282f;
  --red: #b9332e;
  --red-soft: #c96a5f;
  --shadow: 0 10px 30px rgba(90, 65, 25, 0.12);
  --miao: #b9332e;   /* 庙 - 红 */
  --wang: #b87a12;   /* 旺 - 橙 */
  --li:   #2f6f9f;   /* 利 - 蓝 */
  --ping: #7a8494;   /* 平 - 灰 */
  --bu:   #7d6a2a;   /* 不/陷 - 暗金 */
  --hua-lu: #c0392b;   /* 禄 - 红 */
  --hua-quan: #8e44ad; /* 权 - 紫 */
  --hua-ke: #1e8a6a;   /* 科 - 青 */
  --hua-ji: #3a5a7a;   /* 忌 - 墨蓝 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scrollbar-color: var(--gold-dim) var(--bg-1); }

body {
  font-family: "Songti SC", "STSong", "SimSun", "PingFang SC", "Microsoft YaHei", serif;
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

/* 盘面（星盘 SVG）强制使用微软雅黑，覆盖 body 的古典宋体栈 */
#zw-wheel,
.wheel-container {
  font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif;
}

/* ===== 背景装饰 ===== */
.bg-orbit {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orbit {
  position: absolute;
  border: 1px solid rgba(176, 138, 44, 0.10);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.orbit-1 { width: 80vmax; height: 80vmax; }
.orbit-2 { width: 60vmax; height: 60vmax; border-style: dashed; }
.orbit-3 { width: 40vmax; height: 40vmax; }
.orbit::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(176, 138, 44, 0.5);
  top: -3px;
  left: 50%;
  box-shadow: 0 0 10px rgba(176, 138, 44, 0.5);
}

/* ===== 头部 ===== */
.app-header {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #7d1620 0%, #a5282f 55%, #8c1f28 100%);
  border-bottom: 2px solid var(--gold-soft);
  padding: 18px 28px;
  box-shadow: 0 4px 18px rgba(90, 20, 10, 0.25);
}
.app-title { display: flex; align-items: center; gap: 16px; max-width: 1600px; margin: 0 auto; }
.brand-mark {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #7d1620;
  background: linear-gradient(145deg, #f0d9a0 0%, var(--gold-soft) 55%, var(--gold) 100%);
  box-shadow: 0 0 18px rgba(255, 220, 150, 0.5), inset 0 1px 0 rgba(255,255,255,0.6);
}
.brand-text h1 {
  font-size: 24px;
  letter-spacing: 6px;
  font-weight: 700;
  color: #fff8e8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.app-subtitle { font-size: 12px; color: #f2dcb0; letter-spacing: 2px; }

/* ===== 主布局 ===== */
.app-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 20px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

/* 右侧主区：盘面上、信息面板横排下 */
.main-area { min-width: 0; }
.chart-block {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.block-title {
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 3px;
  font-weight: 700;
}

.info-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.5fr 0.85fr; /* 简要分析列放宽：文案较长，等宽会堆成 30 行并撑高整行 */
  gap: 16px;
}
.info-grid .card { margin-bottom: 0; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-title {
  font-size: 15px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 14px;
  letter-spacing: 2px;
  font-weight: 700;
}
.title-num {
  font-size: 11px;
  color: var(--gold-dim);
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0;
}

/* ===== 表单 ===== */
.form-row { margin-bottom: 12px; }
.form-label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 5px;
  letter-spacing: 1px;
  font-weight: 600;
}
.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(140, 31, 40, 0.12);
}
.form-input option { background: #fff; color: var(--ink); }
.time-inputs { display: flex; align-items: center; gap: 6px; }
.time-select { flex: 1; }
.colon { font-weight: 700; color: var(--ink-soft); }
.field-hint { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }

.seg-control {
  display: flex;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.seg-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  letter-spacing: 2px;
}
.seg-btn.active {
  background: linear-gradient(145deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: #fff;
  font-weight: 700;
}
.seg-btn:not(.active):hover { background: #f6edda; color: var(--accent); }

.checkbox-label {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}
.checkbox-label input { accent-color: var(--accent); width: 15px; height: 15px; }

.form-actions { display: flex; gap: 10px; margin-top: 14px; }
.form-divider { border-top: 1px dashed var(--line-dark); margin: 14px 0 16px; }
.chart-actions { flex-wrap: wrap; }
.chart-actions .btn-primary { flex: 2 1 100%; }

/* ===== 粘贴排盘 ===== */
/* 粘贴卡片主说明：加大加粗，作为整张卡的功能引导句 */
.paste-lead {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.3px;
  line-height: 1.7;
  margin-bottom: 9px;
}
.paste-lead::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: -2px;
}
.paste-input {
  width: 100%;
  min-height: 122px;
  padding: 12px 13px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.paste-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(140, 31, 40, 0.12); }
/* 占位文字：加粗加大，空框时一眼看清能识别什么 */
.paste-input::placeholder { font-size: 15px; font-weight: 700; color: #6b6158; opacity: 1; }
.paste-input::-webkit-input-placeholder { font-size: 15px; font-weight: 700; color: #6b6158; }
.paste-result { margin-top: 10px; font-size: 12px; min-height: 18px; line-height: 1.6; }
.paste-result.ok { color: #2e7d32; font-weight: 600; }
.paste-result.err { color: var(--red); font-weight: 600; }

/* ===== 子时等候需要用户核实的提示（显著提示条，不拦截排盘）===== */
.paste-notice {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fdf1ef;
  border: 1px solid #e8c4bd;
  border-left: 4px solid var(--red);
  border-radius: 0 9px 9px 0;
  font-size: 12px;
  line-height: 1.8;
  color: #8a2f28;
  font-weight: 600;
}
/* 盘面上方的同位提示：同样内容再显示一次，避免用户只看盘面时错过 */
.chart-notice { margin: 0 0 12px; }

/* ===== 三方四正：宫格可点击 + 焦点提示 ===== */
#zw-wheel .zw-palace { cursor: pointer; }
#zw-wheel .zw-palace:hover > rect:first-child { stroke: #e07b39; stroke-width: 2; }
#zw-wheel .zw-center { cursor: pointer; }
.focus-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
  text-align: center;
}
.focus-hint b { color: #c0621f; font-weight: 600; }
.focus-hint .fh-sub { font-size: 11px; color: var(--ink-faint); font-weight: 400; margin-left: 2px; }

/* ===== 历法规则提示（醒目 callout，避免用户把数字写法误当公历）===== */
.paste-hint-law {
  display: block;
  margin: 0 0 10px;
  padding: 9px 12px;
  background: #fdf6e6;
  border: 1px solid var(--line-dark);
  border-left: 4px solid var(--accent);
  border-radius: 0 9px 9px 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.paste-hint-law b { color: var(--accent); font-weight: 700; letter-spacing: 1px; }
.paste-hint-law code {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--ink);
  font-family: Consolas, "Cascadia Code", monospace;
}

/* ===== 识别回显：按历法给左侧色条，呼应回显里的【农历】/【公历】标签 ===== */
.paste-result.ok.law-lunar {
  background: #eef6fb;
  border-left: 3px solid #2f6f9f;
  padding-left: 9px;
  border-radius: 0 6px 6px 0;
}
.paste-result.ok.law-solar {
  background: #fdf6e6;
  border-left: 3px solid var(--accent);
  padding-left: 9px;
  border-radius: 0 6px 6px 0;
}

.btn-primary {
  flex: 1;
  padding: 11px 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: #fff;
  font-size: 15px;
  letter-spacing: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.12s, box-shadow 0.18s;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(140, 31, 40, 0.25);
}
.btn-primary:hover { opacity: 0.92; box-shadow: 0 4px 16px rgba(140, 31, 40, 0.35); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  padding: 11px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  letter-spacing: 1px;
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: #fdf3e0; }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-small { padding: 5px 12px; font-size: 12px; }

/* ===== 方形命盘 ===== */
.chart-area { min-width: 0; }
.wheel-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}
.wt-label { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }
.wt-divider { width: 1px; height: 18px; background: var(--line-dark); margin: 0 2px; }
.wt-copy { font-size: 12px; padding: 0 12px; height: 30px; display: inline-flex; align-items: center; }
.wt-btn {
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}
.wt-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: #fdf3e0; }
.wt-btn.active {
  background: linear-gradient(145deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}
.wt-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.wt-value { font-size: 13px; color: var(--ink); min-width: 40px; text-align: center; font-weight: 600; }
.wt-reset { font-size: 12px; padding: 0 10px; }
.wheel-container {
  background: linear-gradient(180deg, #fffdf7 0%, #f7efdc 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  position: relative;
  overflow-x: auto;
  text-align: center;
}
#zw-wheel {
  display: block;
  margin: 0 auto;
  max-width: none;
  height: auto;
  width: 800px;
  box-shadow: 0 6px 24px rgba(90, 65, 25, 0.18);
  border-radius: 4px;
  transition: width 0.15s ease;
}
.wheel-placeholder {
  height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-faint);
  font-size: 16px;
  letter-spacing: 2px;
}
.wheel-placeholder .small { font-size: 12px; color: var(--ink-faint); }
.wheel-placeholder-mark {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  border: 2px solid var(--line-dark);
  box-shadow: 0 0 24px rgba(176, 138, 44, 0.25), inset 0 0 20px rgba(176, 138, 44, 0.15);
}
.muted { color: var(--ink-faint); }

/* ===== 信息面板 ===== */
.summary-box .summary-item { margin-bottom: 8px; font-size: 13px; }
.summary-item .k { color: var(--ink-faint); display: inline-block; min-width: 52px; letter-spacing: 1px; }
.summary-item .v { font-weight: 600; color: var(--ink); }

.analysis-box .analysis-text {
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink);
  text-align: justify;
}

.sihua-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sihua-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  background: #fdf8ec;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.sihua-card:hover { border-color: var(--line-dark); box-shadow: 0 3px 10px rgba(90, 65, 25, 0.1); }
.sihua-card .type { font-size: 22px; font-weight: 700; }
.sihua-card .type.hua-lu { color: var(--hua-lu); }
.sihua-card .type.hua-quan { color: var(--hua-quan); }
.sihua-card .type.hua-ke { color: var(--hua-ke); }
.sihua-card .type.hua-ji { color: var(--hua-ji); }
.sihua-card .star { font-size: 16px; color: var(--ink-soft); margin-top: 6px; letter-spacing: 3px; }
.sihua-card .palace { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }

/* ===== 限运选择带（紧贴盘面下方：先选大限 → 再选流年）===== */
.limit-picker {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
/* —— 开关（Toggle）：开启才允许点选大限 / 流年 —— */
.picker-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
/* 隐藏原生 checkbox 但保留键盘可达性与焦点态 */
.switch-input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  border-radius: 22px;
  background: #ded2b6;
  border: 1px solid var(--line-dark);
  transition: background 0.18s, border-color 0.18s;
}
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow: 0 1px 3px rgba(90, 65, 25, 0.28);
  transition: transform 0.18s;
}
.switch-input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch-input:checked + .switch-track .switch-knob { transform: translateX(18px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch-input:disabled + .switch-track { opacity: 0.5; }
.switch:hover .switch-track { border-color: var(--accent); }
.switch-text { font-size: 12px; font-weight: 700; color: var(--ink); letter-spacing: 0.5px; }
.switch-state { font-size: 11px; color: var(--accent); }
.limit-picker.is-locked .switch-state { color: var(--ink-faint); }

.picker-row { display: flex; align-items: flex-start; gap: 10px; }
.picker-row + .picker-row { margin-top: 8px; }
.picker-label {
  flex: 0 0 40px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  padding-top: 7px;
}
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.limit-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdf8ec;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.limit-chip:hover { border-color: #3f51b5; }
.limit-chip .lc-name { font-weight: 600; }
.limit-chip .lc-age { font-size: 11px; color: var(--accent); }
.limit-chip .lc-gz { font-size: 11px; color: var(--ink-faint); }
.limit-chip.active { background: #eef1fc; border-color: #3f51b5; box-shadow: inset 0 0 0 1px #3f51b5; }
.limit-chip.active .lc-name { color: #3f51b5; }
.limit-chip.chip-flow:hover { border-color: #2e7d32; }
.limit-chip.chip-flow .lc-gz { color: #2e7d32; }
.limit-chip.chip-flow.active { background: #e8f3e9; border-color: #2e7d32; box-shadow: inset 0 0 0 1px #2e7d32; }
.limit-chip.chip-flow.active .lc-name { color: #2e7d32; }
.limit-chip.chip-reset { border-style: dashed; border-color: #3f51b5; color: #3f51b5; font-size: 11px; }
.limit-chip.chip-reset:hover { background: #3f51b5; color: #fff; }
/* 「起限前」chip：虚岁 1 ~ 起运岁−1（大限未起），虚线边 + 中性褐，与真大限的实线靛蓝区分 */
.limit-chip.chip-pre { border-style: dashed; }
.limit-chip.chip-pre:hover { border-color: #8a6d3b; }
.limit-chip.chip-pre .lc-name { color: #8a6d3b; }
.limit-chip.chip-pre .lc-gz { color: #8a6d3b; }
.limit-chip.chip-pre.active { background: #f6f1e4; border-color: #8a6d3b; box-shadow: inset 0 0 0 1px #8a6d3b; }
.limit-chip.chip-pre.active .lc-name { color: #8a6d3b; }
.picker-meta { align-self: center; font-size: 11px; color: var(--ink-faint); padding-left: 2px; }
.picker-hint { font-size: 12px; color: var(--ink-faint); margin: 0; padding-top: 6px; line-height: 1.6; }
.picker-note { font-size: 12px; color: var(--ink-soft); margin: 8px 0 0; line-height: 1.6; }
.picker-note b { color: var(--ink); }
.picker-note-dim { color: var(--ink-faint); }

/* 锁定态：开关关闭时，选择带整体置灰且不可交互 */
.limit-picker.is-locked .picker-label { color: var(--ink-faint); }
.limit-chip:disabled {
  cursor: not-allowed;
  background: #f4efe3;
  border-color: var(--line);
  color: var(--ink-faint);
}
.limit-chip:disabled:hover { border-color: var(--line); }
.limit-chip:disabled .lc-age,
.limit-chip:disabled .lc-gz { color: var(--ink-faint); }
.limit-chip:disabled.active { box-shadow: none; }

/* 四化分层（本命 / 大限 / 流年各一组，配色与盘面标记一致） */
.sihua-layer { margin-bottom: 12px; }
.sihua-layer:last-child { margin-bottom: 0; }
.sihua-layer-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid;
  border-radius: 20px;
  padding: 1px 9px;
  margin-bottom: 7px;
}
.sihua-layer .sihua-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sihua-layer .sihua-card { padding: 8px 4px; }
.sihua-layer .sihua-card .type { font-size: 17px; }
.sihua-layer .sihua-card .star { font-size: 13px; margin-top: 3px; letter-spacing: 1px; }
.sihua-layer .sihua-card .palace { font-size: 11px; }

/* ===== 历史记录 ===== */
.history-section {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px 20px;
}
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.history-header .card-title { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
  font-size: 12px;
  box-shadow: 0 4px 14px rgba(90, 65, 25, 0.1);
}
.history-item:hover {
  border-color: var(--gold);
  box-shadow: 0 6px 20px rgba(176, 138, 44, 0.2);
  transform: translateY(-2px);
}
.history-item .h-title { font-weight: 700; font-size: 13px; margin-bottom: 5px; color: var(--ink); letter-spacing: 1px; }
.history-item .h-meta { color: var(--ink-soft); margin-bottom: 2px; }
.history-item .h-actions { margin-top: 8px; display: flex; gap: 6px; }
.history-item .h-del { margin-left: auto; }

/* ===== 页脚 ===== */
.app-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 14px 0 26px;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 1px;
  border-top: 1px solid var(--line);
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .app-main { grid-template-columns: 1fr; }
  .side-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .form-panel { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .info-grid { grid-template-columns: 1fr; }
  .wheel-toolbar { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 14px; }

  .side-panel { display: block; }
  .app-header { padding: 12px 14px; }
  .app-title { gap: 10px; }
  .brand-mark { width: 38px; height: 38px; font-size: 22px; border-radius: 10px; }
  .brand-text h1 { font-size: 18px; letter-spacing: 3px; }
  .app-subtitle { font-size: 11px; letter-spacing: 1px; }

  .app-main { padding: 12px 10px 16px; gap: 12px; }
  .card { padding: 14px 12px; }
  .chart-block { padding: 12px 10px; }

  /* 表单：iOS 输入框字号 >=16px 防止聚焦自动放大页面 */
  .form-input,
  .seg-btn,
  .paste-input,
  .btn-primary,
  .btn-secondary { font-size: 16px; }
  .form-label { font-size: 13px; }
  .field-hint { font-size: 12px; }
  .time-select { font-size: 16px; }

  .form-actions .btn-primary { flex: 1 1 100%; padding: 14px 0; }

  /* 盘面：SVG 按屏幕宽度自适应，不再固定 800px（保留比例） */
  #zw-wheel {
    width: 100% !important;
    height: auto !important;
    max-width: 800px;
  }
  .wheel-container { padding: 8px; overflow-x: hidden; }
  .wheel-placeholder { height: 320px; font-size: 14px; }
  .wheel-placeholder-mark { width: 60px; height: 60px; font-size: 32px; }

  /* 工具栏：保留「复制盘面」，隐藏缩放控件（盘面已自适应） */
  .wheel-toolbar { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .wt-label, .wt-value, .wt-divider,
  #btn-zoom-out, #btn-zoom-in, #btn-zoom-reset { display: none; }
  .wt-copy { margin-left: auto; }

  .chart-head { align-items: center; }
  .block-title { font-size: 15px; }

  /* 历史：单列 */
  .history-list { grid-template-columns: 1fr; }
  .history-section { padding: 0 10px 16px; }

  .info-grid { gap: 10px; }
  .summary-box .summary-item { font-size: 14px; }
  .analysis-box .analysis-text { font-size: 14px; }

  /* 手机端精简：隐藏次要功能，只保留核心排盘 */
  .only-desktop { display: none !important; }
}
