/* ============================================================
   玄机阁 v2 · 解盘结果页 / 术语 / 存档
   ============================================================ */

/* 可点术语 */
.term {
  cursor: pointer;
  border-bottom: 1px dashed rgba(20, 24, 27, .35);
  transition: color .15s, background .15s;
  border-radius: 2px;
}
.term:hover { color: var(--red); background: var(--red-soft); border-bottom-color: var(--red); }
.term:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.ganzhi-big .term,
.master-char .term { border-bottom: none; color: inherit; }
.ganzhi-big .term:hover,
.master-char .term:hover { background: transparent; color: inherit; }
.ganzhi-big { cursor: pointer; transition: transform .15s; }
.ganzhi-big:hover { transform: translateY(-2px); }

.term-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 16px;
  font-size: 12px;
  color: var(--ink-3);
}
.term-tip svg { color: var(--gold); flex: none; }

/* 标签页 */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-bar button {
  position: relative;
  flex: 1 0 auto;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s;
}
.tab-bar button:hover { color: var(--ink); background: var(--surface-soft); }
.tab-bar button.is-on { background: var(--ink); color: #fff; font-weight: 500; }
.tab-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}
.tab-panel { animation: pageIn .35s var(--ease) both; }
.btn.is-saved { --btn-bg: var(--jade); --btn-fg: #fff; }

/* 基本信息 */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.info-grid > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}
.info-grid dt { font-size: 12px; color: var(--ink-3); letter-spacing: .04em; }
.info-grid dd { font-size: 13.5px; color: var(--ink); line-height: 1.7; }
.info-grid dd small { display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.info-grid > div:nth-child(8),
.info-grid > div:nth-child(14) { grid-column: 1 / -1; }
.wx-row--wide { grid-template-columns: 40px 1fr 36px 96px; }
.wx-group { font-size: 11px; color: var(--ink-3); text-align: right; }
.wx-state {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--ink-3);
}

/* 排盘表 v2 */
.chart-table > .cell--head small { display: block; font-size: 10px; letter-spacing: .04em; color: var(--ink-3); margin-top: 2px; }
.chart-table > .cell.is-hl { background: rgba(184, 137, 47, .07); }
.chart-table > .cell--head.is-hl { color: var(--gold); font-weight: 500; }
.hidden-list { display: grid; gap: 3px; justify-items: center; }
.hidden-list span { display: inline-flex; gap: 5px; align-items: baseline; font-size: 11.5px; color: var(--ink-2); }
.hidden-list b { font-weight: 500; color: var(--el); font-size: 11.5px; }
.ss-list { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.ss-list .term { font-size: 11px; color: var(--ink-2); border-bottom-style: dotted; white-space: nowrap; }
.row-label .term { color: var(--ink-3); }

/* 干支关系 */
.rel-box {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.rel-row { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: start; }
.rel-label { font-size: 12px; color: var(--ink-3); padding-top: 4px; letter-spacing: .04em; }
.rel-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
.rel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink);
}
.rel-chip small { font-size: 10.5px; opacity: .7; }
.rel-chip .term { border-bottom: none; }
.rel-六冲, .rel-天干相冲, .rel-相刑, .rel-自刑, .rel-三刑 { border-color: rgba(185, 58, 43, .25); background: var(--red-soft); color: var(--red); }
.rel-六合, .rel-三合, .rel-半合, .rel-三会, .rel-天干五合, .rel-暗合 { border-color: rgba(31, 107, 88, .2); background: var(--jade-soft); color: var(--jade); }
.rel-相害, .rel-相破, .rel-天干相克 { border-color: rgba(184, 137, 47, .28); background: var(--gold-soft); color: #8a6526; }

/* 运年条 */
.strip-head { display: flex; align-items: baseline; gap: 10px; margin: 20px 0 10px; font-size: 13px; }
.strip-head b { font-weight: 600; }
.strip-head span { font-size: 11.5px; color: var(--ink-3); }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 8px; scrollbar-width: thin; }
.strip-item {
  position: relative;
  flex: 0 0 auto;
  min-width: 74px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 9px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  cursor: pointer;
  transition: all .16s var(--ease);
  font-family: inherit;
}
.strip-item:hover { background: #fff; border-color: var(--line-2); }
.strip-item b { font-family: var(--f-display); font-size: 18px; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.strip-item b span { color: var(--el); }
.strip-item small { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.strip-item.is-now { border-color: rgba(185, 58, 43, .35); }
.strip-item.is-now::after {
  content: "今";
  position: absolute;
  top: -7px;
  right: -4px;
  font-size: 9px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  line-height: 1.6;
}
.strip-item.is-on { background: var(--ink); border-color: var(--ink); }
.strip-item.is-on b,
.strip-item.is-on b span { color: #fff; }
.strip-item.is-on small { color: rgba(255, 255, 255, .7); }
.strip-item--muted { cursor: default; opacity: .7; }
.strip-item--static { cursor: default; min-width: 82px; background: #fff; }
.strip-dot { position: absolute; left: 6px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--jade); }

/* 解盘报告 */
.report {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: clamp(18px, 2.4vw, 28px);
}
.report-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.report-head h3 { font-family: var(--f-display); font-size: 21px; font-weight: 600; letter-spacing: .04em; }
.report-sec { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.report-sec:last-of-type { border-bottom: none; }
.report-sec header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.report-sec h4 { font-family: var(--f-display); font-size: 17px; font-weight: 600; letter-spacing: .03em; flex: 1; }
.report-no { font-family: var(--f-num); font-size: 11px; color: var(--red); background: var(--red-soft); border-radius: 6px; padding: 2px 7px; }
.report-sec p { font-size: 14px; line-height: 2; color: var(--ink-2); }
.report-sec p + p { margin-top: 4px; }

/* 断事笔记 */
.textarea { height: auto; padding: 12px 13px; line-height: 1.8; resize: vertical; min-height: 96px; font-family: var(--f-sans); }
.pick-list { display: grid; gap: 10px; }
.pick-list li {
  position: relative;
  padding: 12px 44px 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.pick-list li > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.pick-list b { font-size: 14px; font-weight: 600; }
.pick-list small { font-size: 11px; color: var(--ink-3); }
.pick-list p {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pick-list .btn { position: absolute; right: 8px; top: 8px; padding: 6px 8px; }

/* 术语弹窗 */
.gb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.gb { padding: 12px; border-radius: 12px; font-size: 13px; line-height: 1.8; }
.gb b { display: block; font-size: 12px; margin-bottom: 4px; }
.gb--good { background: var(--jade-soft); color: #1d5a4a; }
.gb--bad { background: var(--red-soft); color: #8d3226; }
.ctx-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(184, 137, 47, .3);
  background: var(--gold-soft);
  color: #6b5124;
  font-size: 13px;
}
.ctx-box b { display: block; font-size: 12px; margin-bottom: 4px; }
.ctx-box ul { display: grid; gap: 2px; padding-left: 18px; list-style: disc; }

/* 记录中心 */
.rec-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.rec-toolbar .cat-tabs button small { font-family: var(--f-num); font-size: 11px; opacity: .65; margin-left: 2px; }
.rec-search { max-width: 280px; }
.record-title { display: flex; align-items: center; gap: 8px; }
.record-main small { display: block; }
.rec-meta { margin-top: 2px; opacity: .85; }
.rec-star { color: var(--gold); display: inline-flex; }
.rec-star svg { fill: currentColor; }
.record-score { display: flex; align-items: baseline; gap: 6px; }
.record-score b { font-family: var(--f-num); font-size: 24px; font-weight: 600; }
.record-score span { font-size: 12px; color: var(--ink-3); }
.score-mini { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.score-mini b { font-family: var(--f-num); font-size: 34px; font-weight: 600; color: var(--jade); }

/* 打印 */
#printSheet { display: none; }
@media print {
  body.is-printing > *:not(#printSheet) { display: none !important; }
  body.is-printing #printSheet { display: block; padding: 0 8mm; }
  #printSheet pre { white-space: pre-wrap; font-family: "Songti SC", "SimSun", serif; font-size: 11.5pt; line-height: 1.85; color: #000; }
}

@media (max-width: 720px) {
  .info-grid { grid-template-columns: 1fr; }
  .info-grid > div { grid-template-columns: 78px 1fr; }
  .wx-row--wide { grid-template-columns: 34px 1fr 34px; }
  .wx-group { display: none; }
  .tab-bar button { padding: 9px 14px; font-size: 13px; }
  .rel-row { grid-template-columns: 1fr; gap: 6px; }
  .gb-grid { grid-template-columns: 1fr; }
  .rec-search { max-width: none; width: 100%; }
  .report-sec header { flex-wrap: wrap; }
  .hidden-list span { flex-direction: column; gap: 0; align-items: center; }
}
