:root {
  --ink: #151916;
  --muted: #66706b;
  --paper: #f6f8f1;
  --panel: #ffffff;
  --line: #d9ded4;
  --line-strong: #bfc8bd;
  --cinnabar: #b9342b;
  --jade: #1d7564;
  --blue: #255272;
  --brass: #a87328;
  --metal: #7c8580;
  --shadow: 0 24px 70px rgba(18, 25, 20, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(21, 25, 22, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(rgba(21, 25, 22, 0.035) 1px, transparent 1px) 0 0 / 42px 42px,
    #eef2ea;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1460px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid rgba(191, 200, 189, 0.76);
  border-radius: var(--radius);
  background: rgba(246, 248, 241, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.seal {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(185, 52, 43, 0.65);
  border-radius: 6px;
  color: var(--cinnabar);
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 4px rgba(185, 52, 43, 0.06);
}

.brand-title {
  margin: 0;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
}

.brand-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.tab {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: #4c5651;
  background: transparent;
  font-size: 13px;
  transition: 180ms ease;
}

.tab.active {
  color: white;
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(21, 25, 22, 0.18);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 210px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  transition: 180ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(18, 25, 20, 0.12);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  max-width: 1460px;
  margin: 0 auto;
  align-items: start;
}

.page-view[hidden] {
  display: none;
}

.feature-page {
  max-width: 1460px;
  margin: 0 auto;
}

.feature-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 210px;
  padding: 28px;
  border: 1px solid rgba(191, 200, 189, 0.82);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(185, 52, 43, 0.09), transparent 38%),
    linear-gradient(45deg, rgba(29, 117, 100, 0.1), transparent 42%),
    rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.feature-hero h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
}

.feature-copy {
  max-width: 620px;
  margin: 14px 0 0;
  color: #4f5a55;
  font-size: 15px;
  line-height: 1.75;
}

.feature-orbit {
  display: grid;
  width: 148px;
  height: 148px;
  place-items: center;
  border: 1px solid rgba(168, 115, 40, 0.34);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 10px rgba(168, 115, 40, 0.08);
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 30px;
  font-weight: 900;
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.feature-panel {
  border: 1px solid rgba(191, 200, 189, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 18px;
}

.feature-panel.wide {
  min-width: 0;
}

.feature-panel h3 {
  margin: 0 0 14px;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 22px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  min-height: 98px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  padding: 12px;
  background: rgba(246, 248, 241, 0.68);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 26px;
}

.bone-verdict {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.bone-verdict div,
.bone-verdict blockquote {
  min-height: 104px;
  margin: 0;
  border: 1px solid rgba(168, 115, 40, 0.18);
  border-radius: 7px;
  padding: 14px;
  background: rgba(246, 248, 241, 0.74);
}

.bone-verdict span,
.bone-reading-grid span,
.bone-mini-note b {
  display: block;
  color: var(--brass);
  font-size: 12px;
  font-weight: 900;
}

.bone-verdict strong {
  display: block;
  margin-top: 10px;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 30px;
  line-height: 1.05;
}

.bone-verdict blockquote {
  color: #3f4944;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 23px;
  line-height: 1.55;
}

.bone-reading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.bone-reading-grid section,
.bone-mini-note {
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  padding: 13px;
  background: rgba(246, 248, 241, 0.68);
}

.bone-reading-grid p,
.bone-mini-note p {
  margin: 7px 0 0;
  color: #4f5a55;
  font-size: 13px;
  line-height: 1.72;
}

.bone-mini-note {
  margin-top: 14px;
}

.reading-block {
  margin-top: 16px;
  border-top: 1px solid rgba(21, 25, 22, 0.08);
  padding-top: 16px;
}

.reading-block p {
  margin: 0;
  color: #4f5a55;
  font-size: 14px;
  line-height: 1.8;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.timeline-card {
  position: relative;
  min-height: 138px;
  width: 100%;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  padding: 14px;
  color: var(--ink);
  background: rgba(246, 248, 241, 0.68);
  text-align: left;
  transition: 160ms ease;
}

.timeline-card.active {
  border-color: rgba(185, 52, 43, 0.52);
  background: rgba(185, 52, 43, 0.08);
}

.timeline-card:hover,
.month-card:hover,
.compare-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(18, 25, 20, 0.1);
}

.timeline-card strong {
  display: block;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 30px;
}

.timeline-card span,
.timeline-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.year-picker {
  display: grid;
  gap: 8px;
  width: 170px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.month-card {
  min-height: 118px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  padding: 12px;
  color: var(--ink);
  background: rgba(246, 248, 241, 0.68);
  text-align: left;
  transition: 160ms ease;
}

.month-card strong {
  display: block;
  margin-top: 8px;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 24px;
}

.month-card span,
.month-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compare-layout {
  display: grid;
  grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.compare-form {
  display: grid;
  gap: 14px;
}

.compare-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compare-card {
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  padding: 14px;
  background: rgba(246, 248, 241, 0.68);
}

.compare-card h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.compare-card strong {
  display: block;
  margin-top: 10px;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 34px;
}

.compare-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compare-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.compare-pill {
  border: 1px solid rgba(21, 25, 22, 0.09);
  border-radius: 999px;
  padding: 8px 11px;
  color: #3f4944;
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 900;
  transition: 160ms ease;
}

.compare-matrix {
  display: grid;
  margin-top: 14px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  overflow: hidden;
}

.compare-matrix div {
  display: grid;
  grid-template-columns: 1fr 78px 78px;
  min-height: 38px;
  border-bottom: 1px solid rgba(21, 25, 22, 0.08);
  align-items: center;
  background: rgba(255, 255, 255, 0.58);
}

.compare-matrix div:first-child {
  background: rgba(246, 248, 241, 0.92);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.compare-matrix div:last-child {
  border-bottom: 0;
}

.compare-matrix span,
.compare-matrix b,
.compare-matrix em {
  padding: 8px 10px;
  font-size: 12px;
  font-style: normal;
}

.compare-matrix b,
.compare-matrix em {
  text-align: right;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.detail-section-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.detail-scroll {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.detail-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  table-layout: fixed;
}

.detail-table th,
.detail-table td {
  border-right: 1px solid rgba(21, 25, 22, 0.08);
  border-bottom: 1px solid rgba(21, 25, 22, 0.08);
  padding: 12px 10px;
  vertical-align: top;
  background: rgba(255, 255, 255, 0.58);
}

.detail-table th:first-child,
.detail-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 88px;
  color: var(--muted);
  background: rgba(246, 248, 241, 0.96);
  font-weight: 900;
}

.detail-table thead th {
  color: var(--muted);
  background: rgba(246, 248, 241, 0.9);
  font-size: 13px;
  font-weight: 900;
}

.detail-cell-main {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 54px;
  text-align: center;
}

.big-glyph {
  border: 0;
  color: var(--ink);
  background: transparent;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 42px;
  font-weight: 900;
  line-height: 0.95;
}

.element-wood {
  color: var(--jade);
}

.element-fire {
  color: var(--cinnabar);
}

.element-earth {
  color: var(--brass);
}

.element-metal {
  color: #c68a17;
}

.element-water {
  color: var(--blue);
}

.mini-stack {
  display: grid;
  gap: 5px;
}

.mini-stack.horizontal {
  display: flex;
  flex-wrap: wrap;
}

.mini-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 999px;
  padding: 3px 8px;
  color: #3f4944;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.mini-token.muted {
  color: var(--muted);
  font-weight: 800;
}

.mini-token.danger {
  color: var(--cinnabar);
}

.detail-side-title {
  margin: 0 0 14px;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 22px;
}

.detail-side-list {
  display: grid;
  gap: 8px;
}

.detail-side-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(21, 25, 22, 0.08);
  padding-bottom: 8px;
  color: #4f5a55;
  font-size: 13px;
}

.detail-side-list b {
  color: var(--ink);
  text-align: right;
}

.pro-luck-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(116px, 1fr);
  min-width: 960px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  overflow: hidden;
}

.pro-luck-card {
  display: grid;
  gap: 8px;
  min-height: 154px;
  border: 0;
  border-right: 1px solid rgba(21, 25, 22, 0.08);
  padding: 12px;
  color: var(--ink);
  background: rgba(246, 248, 241, 0.66);
  text-align: left;
}

.pro-luck-card.active {
  background: rgba(185, 52, 43, 0.08);
  box-shadow: inset 0 3px 0 var(--cinnabar);
}

.pro-luck-card strong {
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 28px;
}

.pro-luck-card span,
.pro-luck-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.flow-matrix {
  display: grid;
  min-width: 960px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  overflow: hidden;
}

.flow-row {
  display: grid;
  grid-template-columns: 92px repeat(10, minmax(82px, 1fr));
}

.flow-row + .flow-row {
  border-top: 1px solid rgba(21, 25, 22, 0.08);
}

.flow-head,
.flow-cell {
  min-height: 58px;
  border-right: 1px solid rgba(21, 25, 22, 0.08);
  padding: 9px 8px;
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.flow-head {
  color: var(--muted);
  background: rgba(246, 248, 241, 0.9);
  font-size: 12px;
  font-weight: 900;
}

.flow-cell strong {
  display: block;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 20px;
}

.flow-cell span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.attention-strip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin-top: 14px;
  border-top: 1px solid rgba(21, 25, 22, 0.08);
  padding-top: 12px;
  color: #4f5a55;
  font-size: 13px;
  line-height: 1.6;
}

.attention-strip b {
  color: var(--brass);
}

.relation-panel {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  border-top: 1px solid rgba(21, 25, 22, 0.08);
  padding-top: 12px;
}

.relation-panel > span {
  color: var(--brass);
  font-size: 12px;
  font-weight: 900;
}

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

.shensha-card {
  display: grid;
  gap: 10px;
  min-height: 172px;
  width: 100%;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  padding: 14px;
  color: var(--ink);
  background: rgba(246, 248, 241, 0.68);
  text-align: left;
  transition: 160ms ease;
}

.shensha-card.active {
  border-color: rgba(29, 117, 100, 0.38);
  background:
    linear-gradient(135deg, rgba(29, 117, 100, 0.1), transparent 56%),
    rgba(255, 255, 255, 0.78);
}

.shensha-card.danger.active {
  border-color: rgba(185, 52, 43, 0.42);
  background:
    linear-gradient(135deg, rgba(185, 52, 43, 0.1), transparent 56%),
    rgba(255, 255, 255, 0.78);
}

.shensha-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(18, 25, 20, 0.1);
}

.shensha-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.shensha-top strong {
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 24px;
}

.shensha-status {
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.shensha-card.active .shensha-status {
  color: white;
  background: var(--jade);
}

.shensha-card.danger.active .shensha-status {
  background: var(--cinnabar);
}

.shensha-card p {
  margin: 0;
  color: #4f5a55;
  font-size: 13px;
  line-height: 1.65;
}

.shensha-matches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}

.shensha-chip {
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 999px;
  padding: 4px 8px;
  color: #3f4944;
  background: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 900;
}

.shensha-rule {
  border-top: 1px solid rgba(21, 25, 22, 0.08);
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.panel,
.chart-area,
.right-rail {
  border: 1px solid rgba(191, 200, 189, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.panel,
.right-rail {
  overflow: hidden;
}

.panel-header,
.module-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.panel-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-title,
.module h3,
.dial-card h3,
.history-head h3 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
}

.panel-title {
  font-size: 18px;
}

.small-note,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 8px;
  font-weight: 800;
}

.form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.switch-label {
  color: #3d4742;
  font-size: 12px;
  font-weight: 700;
}

.input,
.select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(246, 248, 241, 0.74);
  padding: 0 12px;
  outline: none;
  transition: 160ms ease;
}

.input:focus,
.select:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(29, 117, 100, 0.14);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(246, 248, 241, 0.74);
}

.segment button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  color: #4c5651;
  background: transparent;
  font-size: 13px;
}

.segment button.active {
  color: white;
  background: var(--jade);
  box-shadow: 0 10px 18px rgba(29, 117, 100, 0.2);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 0 2px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 28px;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #dde4da;
  transition: 180ms ease;
}

.slider::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 4px 10px rgba(18, 25, 20, 0.22);
  content: "";
  transition: 180ms ease;
}

.switch input:checked + .slider {
  border-color: rgba(185, 52, 43, 0.54);
  background: var(--cinnabar);
}

.switch input:checked + .slider::after {
  transform: translateX(22px);
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 2px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--ink);
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(18, 25, 20, 0.22);
  transition: 180ms ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  background: #252d28;
}

.rule-list {
  display: grid;
  gap: 8px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  background: rgba(246, 248, 241, 0.62);
}

.rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #4d5752;
  font-size: 12px;
}

.rule strong {
  color: var(--ink);
  font-weight: 800;
}

.history-section {
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
}

.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.history-head h3 {
  font-size: 16px;
}

.text-button {
  border: 0;
  color: var(--cinnabar);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(21, 25, 22, 0.09);
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
}

.history-item strong {
  font-size: 13px;
}

.history-item span {
  color: var(--muted);
  font-size: 11px;
}

.empty-history {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.chart-area {
  overflow: hidden;
}

.chart-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(185, 52, 43, 0.09), transparent 36%),
    linear-gradient(45deg, rgba(37, 82, 114, 0.1), transparent 46%),
    rgba(255, 255, 255, 0.72);
}

.chart-title {
  margin: 0;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
}

.chart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(21, 25, 22, 0.12);
  border-radius: 999px;
  color: #3e4944;
  background: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.clock-face {
  width: 138px;
  height: 138px;
  align-self: center;
}

.clock-face canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 16px 26px rgba(18, 25, 20, 0.12));
}

.chart-body {
  padding: 22px 24px 24px;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pillar {
  position: relative;
  min-height: 272px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 248, 241, 0.82)),
    var(--panel);
}

.pillar::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
}

.pillar.wood::before {
  background: var(--jade);
}

.pillar.fire::before {
  background: var(--cinnabar);
}

.pillar.earth::before {
  background: var(--brass);
}

.pillar.metal::before {
  background: var(--metal);
}

.pillar.water::before {
  background: var(--blue);
}

.pillar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 0 18px;
}

.pillar-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ten-god {
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(21, 25, 22, 0.06);
  font-size: 12px;
  font-weight: 800;
}

.ten-god:hover,
.chip-button:hover,
.glyph-button:hover,
.knowledge-link:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 117, 100, 0.32);
  box-shadow: 0 8px 20px rgba(18, 25, 20, 0.1);
}

.glyphs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 18px 16px 14px 18px;
  align-items: center;
}

.glyph {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px solid rgba(21, 25, 22, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.62);
}

.glyph-button {
  width: 100%;
  border: 1px solid rgba(21, 25, 22, 0.1);
  transition: 160ms ease;
}

.glyph span {
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 0.92;
}

.glyph small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.pillar-info {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px 18px;
}

.line-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(21, 25, 22, 0.08);
  padding-top: 9px;
  color: #4c5651;
  font-size: 12px;
}

.line-item b {
  color: var(--ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.chip {
  border: 1px solid rgba(21, 25, 22, 0.09);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.58);
  color: #3d4742;
  font-size: 11px;
  font-weight: 800;
}

.chip-button {
  transition: 160ms ease;
}

.knowledge-link {
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  font-weight: inherit;
  transition: 160ms ease;
}

.badge.knowledge-link {
  border: 1px solid rgba(21, 25, 22, 0.12);
  color: #3e4944;
  background: rgba(255, 255, 255, 0.66);
  font-weight: 700;
}

.below-grid {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 14px;
  margin-top: 16px;
}

.module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.module-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(21, 25, 22, 0.08);
}

.module h3,
.dial-card h3 {
  font-size: 17px;
}

.bars {
  display: grid;
  gap: 11px;
  padding: 15px 16px 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 42px 1fr 34px;
  align-items: center;
  gap: 10px;
  color: #3f4944;
  font-size: 12px;
  font-weight: 800;
}

.bar-row button {
  width: 34px;
  height: 28px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 999px;
  color: #3f4944;
  background: rgba(255, 255, 255, 0.52);
  font-size: 12px;
  font-weight: 900;
}

.track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(21, 25, 22, 0.08);
}

.fill {
  height: 100%;
  border-radius: inherit;
}

.wood-fill {
  background: var(--jade);
}

.fire-fill {
  background: var(--cinnabar);
}

.earth-fill {
  background: var(--brass);
}

.metal-fill {
  background: var(--metal);
}

.water-fill {
  background: var(--blue);
}

.luck-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px 16px;
}

.luck {
  min-height: 86px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  background: rgba(246, 248, 241, 0.72);
  color: var(--ink);
  text-align: left;
  transition: 160ms ease;
}

.luck:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(18, 25, 20, 0.1);
}

.luck.active {
  border-color: rgba(185, 52, 43, 0.5);
  background: rgba(185, 52, 43, 0.08);
}

.luck strong {
  display: block;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 20px;
}

.luck span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.right-rail {
  display: grid;
}

.dial-card {
  padding: 18px 18px 20px;
  border-bottom: 1px solid var(--line);
}

.bone-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(168, 115, 40, 0.12), transparent 48%),
    rgba(246, 248, 241, 0.42);
}

.bone-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px;
}

.bone-title {
  margin: 0;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 17px;
}

.bone-weight {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(168, 115, 40, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 7px rgba(168, 115, 40, 0.08);
}

.bone-weight strong {
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 26px;
  line-height: 1;
}

.bone-weight span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bone-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.bone-part {
  display: grid;
  gap: 4px;
  min-height: 62px;
  border: 1px solid rgba(21, 25, 22, 0.09);
  border-radius: 7px;
  padding: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
}

.bone-part span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bone-part strong {
  font-size: 13px;
}

.bone-summary {
  margin: 0;
  color: #4f5a55;
  font-size: 13px;
  line-height: 1.65;
}

.bone-lunar {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dial-wrap {
  position: relative;
  width: min(100%, 286px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.dial-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dial-center {
  position: absolute;
  inset: 31%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(21, 25, 22, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.dial-center strong {
  display: block;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 32px;
  line-height: 1;
}

.dial-center span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.insights {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.insight {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid rgba(21, 25, 22, 0.08);
  padding-bottom: 12px;
}

.insight:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.insight-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 900;
}

.mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--jade);
}

.mark.red {
  background: var(--cinnabar);
}

.mark.blue {
  background: var(--blue);
}

.insight p {
  margin: 0;
  color: #4f5a55;
  font-size: 13px;
  line-height: 1.68;
}

.floating-date {
  position: fixed;
  right: 26px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 48px);
  padding: 10px 12px;
  border: 1px solid rgba(21, 25, 22, 0.12);
  border-radius: 999px;
  background: rgba(21, 25, 22, 0.9);
  color: white;
  font-size: 12px;
  box-shadow: 0 18px 40px rgba(21, 25, 22, 0.24);
}

.floating-date b {
  color: #f4c267;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: calc(100vw - 32px);
  transform: translate(-50%, 16px);
  border-radius: 999px;
  padding: 10px 14px;
  color: white;
  background: rgba(21, 25, 22, 0.92);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.knowledge-backdrop {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(21, 25, 22, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.knowledge-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.knowledge-sheet {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 29;
  display: grid;
  gap: 0;
  width: min(430px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(191, 200, 189, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 88px rgba(18, 25, 20, 0.28);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.knowledge-sheet.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.knowledge-handle {
  display: none;
  justify-self: center;
  width: 42px;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(21, 25, 22, 0.18);
}

.knowledge-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.knowledge-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "Iowan Old Style", Georgia, serif;
  font-size: 28px;
}

.knowledge-body {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 16px 18px 18px;
}

.knowledge-body p {
  margin: 0;
  color: #46514c;
  font-size: 14px;
  line-height: 1.75;
}

.knowledge-facts {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(21, 25, 22, 0.08);
  border-radius: 7px;
  background: rgba(246, 248, 241, 0.76);
}

.knowledge-facts div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #4f5a55;
  font-size: 12px;
}

.knowledge-facts b {
  color: var(--ink);
}

.knowledge-section {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.knowledge-section + .knowledge-section {
  border-top: 1px solid rgba(21, 25, 22, 0.08);
  padding-top: 12px;
}

.knowledge-section h3 {
  margin: 0;
  color: #9a7b3c;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

@media (max-width: 1320px) {
  .workspace {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }

  .right-rail {
    grid-column: 1 / -1;
    grid-template-columns: 340px 1fr;
  }

  .dial-card {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .bone-card {
    border-bottom: 0;
  }
}

@media (max-width: 1080px) {
  .feature-grid,
  .compare-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .tabs {
    grid-column: 1 / -1;
    justify-content: start;
    overflow-x: auto;
  }

  .top-actions {
    min-width: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .chart-head {
    grid-template-columns: 1fr;
  }

  .clock-face {
    display: none;
  }

  .pillar-grid,
  .below-grid,
  .right-rail,
  .timeline,
  .month-grid,
  .stat-strip,
  .shensha-grid,
  .bone-verdict,
  .bone-reading-grid {
    grid-template-columns: 1fr;
  }

  .feature-hero {
    grid-template-columns: 1fr;
  }

  .feature-orbit {
    width: 118px;
    height: 118px;
    font-size: 24px;
  }

  .dial-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .bone-card {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .brand {
    min-width: 0;
  }

  .brand-title {
    font-size: 19px;
  }

  .top-actions {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .split,
  .luck-list,
  .compare-pair {
    grid-template-columns: 1fr;
  }

  .feature-hero {
    padding: 20px;
  }

  .feature-panel {
    padding: 14px;
  }

  .chart-body,
  .chart-head {
    padding: 18px;
  }

  .glyphs {
    grid-template-columns: 1fr 1fr;
  }

  .floating-date {
    position: static;
    justify-content: center;
    margin: 16px auto 0;
    border-radius: 7px;
  }

  .toast {
    bottom: 18px;
  }

  .knowledge-sheet {
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 16px);
    border-radius: 12px 12px 8px 8px;
  }

  .knowledge-handle {
    display: block;
  }

  .bone-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
