:root {
  --bg: #f6f1e7;
  --paper: #fffdf7;
  --ink: #252119;
  --muted: #70675a;
  --line: #d9cbb5;
  --red: #9c3030;
  --green: #2f705d;
  --blue: #315f8c;
  --gold: #a36d22;
  --shadow: 0 18px 42px rgba(49, 38, 22, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fffaf0, var(--bg));
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.compact-hero {
  min-height: 42vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  align-items: end;
  gap: 28px;
  padding: 24px min(6vw, 84px) 70px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 78% 38%, rgba(156,48,48,.14), transparent 28%),
    repeating-linear-gradient(90deg, rgba(37,33,25,.06) 0 70px, transparent 70px 104px),
    #f8f1e4;
}
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: rgba(255,253,247,.88);
  color: var(--ink);
  cursor: pointer;
}
button:hover { border-color: var(--red); }
.eyebrow {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.compact-hero h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.06;
}
.compact-hero p { max-width: 820px; color: #50483c; font-size: 18px; }
.search-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.search-mini input,
.full-input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--paper);
}

main { padding: 0 min(6vw, 84px) 62px; }
.section { margin-top: 72px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 20px;
}
.section h2 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 46px); line-height: 1.2; }
.section-head p { max-width: 560px; margin: 0; color: var(--muted); }

.path-grid, .system-grid, .classic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.path-grid article, .panel, .system-card, .classic-card, .article-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.path-grid article { padding: 20px; min-height: 180px; }
.path-grid span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-weight: 800;
}
.path-grid p, .panel p, .classic-card p, .article-card p, .system-card p { color: var(--muted); }

select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--paper);
}
.result-list { display: grid; gap: 10px; margin-top: 14px; }

.system-card, .classic-card, .article-card { padding: 18px; text-align: left; }
.system-card.active { border-color: var(--red); }
.detail { display: none; margin-top: 16px; }
.detail.visible { display: block; }
.panel { padding: 22px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #f2eadc;
  color: #4d4538;
  font-size: 13px;
}

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tool-grid .wide { grid-column: 1 / -1; }
.select-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.select-row label { display: grid; gap: 6px; color: var(--muted); }
.tool-result {
  min-height: 120px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbf5ea;
}
.wuxing-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bazi-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0; }
.pillar { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbf5ea; }
.pillar label { display: grid; gap: 6px; margin-bottom: 8px; color: var(--muted); }
.yao-wrap { display: grid; gap: 7px; width: 132px; margin: 8px 0 14px; }
.yao { height: 11px; border-radius: 999px; background: var(--ink); }
.yao.yin { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; background: transparent; }
.yao.yin:before, .yao.yin:after { content: ""; border-radius: 999px; background: var(--ink); }

.article-list { display: grid; gap: 12px; margin-top: 18px; }
.notice { border-left: 5px solid var(--red); padding: 18px 22px; background: #fff8ee; }
.hidden { display: none !important; }
.system-hero {
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: #fff8ec;
  box-shadow: var(--shadow);
}
.system-hero h2 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.12;
}
.back-btn { margin-bottom: 18px; }
.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.quick-nav a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--paper);
}
.concept-layout,
.line-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}
.concept-list,
.line-stack {
  display: grid;
  gap: 8px;
  align-content: start;
}
.concept-btn,
.line-position {
  text-align: left;
}
.concept-btn.active,
.line-position.active {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}
.line-position strong,
.line-position span {
  display: block;
}
.line-position span {
  font-size: 13px;
  opacity: .78;
}
.trigram-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.trigram-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.demo-grid,
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.reader-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.reader-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
}
.toc-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.toc-pager span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.toc-pager button {
  min-width: 0;
  padding: 8px 10px;
}
.toc-pager button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.chapter-toc {
  display: grid;
  gap: 8px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}
.chapter-toc button {
  width: 100%;
  text-align: left;
}
.chapter-toc button.active {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}
.chapter-card {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: rgba(255,253,247,.98);
  box-shadow: var(--shadow);
}
.chapter-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.chapter-card h3 {
  margin: 10px 0 6px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2;
}
.chapter-original {
  margin: 18px 0;
  border-left: 5px solid var(--red);
  padding: 16px 18px;
  background: #fff8ee;
  color: #342e25;
  font-size: 18px;
  line-height: 1.9;
}
.chapter-sections {
  display: grid;
  gap: 12px;
}
.chapter-sections section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbf5ea;
}
.chapter-sections h4 {
  margin: 0 0 6px;
}
.chapter-sections p {
  margin: 0;
  color: var(--muted);
}
.reader-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.reader-controls button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.concept-node-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.yinfu-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.yinfu-entry h3 {
  margin: 0 0 8px;
}
.yinfu-entry p {
  margin: 0;
  color: var(--muted);
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.story-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.story-card h3 {
  margin-top: 0;
}
.story-card p {
  color: var(--muted);
}
.story-nodes {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.story-nodes section {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf5ea;
}
.story-nodes span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}
.story-nodes h4,
.story-nodes p {
  margin: 0;
}
.yinfu-page {
  padding-top: 34px;
}
.yinfu-page .system-hero h1 {
  margin: 10px 0;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1.12;
}
.yinfu-content {
  display: grid;
  gap: 18px;
}
.yinfu-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.yinfu-section h3 {
  margin: 0 0 14px;
  font-size: 28px;
}
.yinfu-columns {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 16px;
}
.yinfu-columns section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbf5ea;
}
.yinfu-columns h4 {
  margin: 0 0 10px;
}
.yinfu-columns p {
  margin: 0 0 10px;
  color: var(--muted);
}
.yinfu-columns p:last-child {
  margin-bottom: 0;
}
.dao-center {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fffdf7;
  box-shadow: var(--shadow);
  font-size: 36px;
  font-weight: 800;
}
.hex-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
  max-height: 520px;
  overflow: auto;
  padding-right: 6px;
}
.hex-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf5ea;
}
.hex-item strong,
.hex-item span {
  display: block;
}
.hex-item span {
  color: var(--muted);
  font-size: 13px;
}
.change-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.method-note {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf5ea;
}
.method-note p {
  margin: 0 0 8px;
}
.method-note p:last-child {
  margin-bottom: 0;
}
.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .65fr);
  gap: 18px;
  align-items: start;
}
.floorplan-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.planner-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.floorplan-canvas {
  position: relative;
  height: min(62vw, 620px);
  min-height: 420px;
  overflow: hidden;
  border: 2px solid #8a7150;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent calc(33.333% - 1px), rgba(138,113,80,.42) calc(33.333% - 1px), rgba(138,113,80,.42) calc(33.333% + 1px), transparent calc(33.333% + 1px)),
    linear-gradient(90deg, transparent calc(66.666% - 1px), rgba(138,113,80,.42) calc(66.666% - 1px), rgba(138,113,80,.42) calc(66.666% + 1px), transparent calc(66.666% + 1px)),
    linear-gradient(0deg, transparent calc(33.333% - 1px), rgba(138,113,80,.42) calc(33.333% - 1px), rgba(138,113,80,.42) calc(33.333% + 1px), transparent calc(33.333% + 1px)),
    linear-gradient(0deg, transparent calc(66.666% - 1px), rgba(138,113,80,.42) calc(66.666% - 1px), rgba(138,113,80,.42) calc(66.666% + 1px), transparent calc(66.666% + 1px)),
    #f9f2e6;
  touch-action: none;
}
.nine-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  z-index: 1;
  pointer-events: none;
}
.nine-grid span {
  padding: 8px;
  color: rgba(80,72,60,.42);
  font-size: 13px;
  font-weight: 800;
}
.palace-cell {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  border: 1px solid rgba(138,113,80,.1);
  pointer-events: auto;
}
.palace-cell b {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: rgba(37,33,25,.72);
  font-size: 15px;
}
.palace-cell em {
  color: rgba(80,72,60,.68);
  font-style: normal;
}
.palace-tooltip {
  position: absolute;
  left: 10px;
  top: 54px;
  z-index: 10;
  display: none;
  width: min(260px, 72vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdf7;
  box-shadow: 0 14px 34px rgba(49,38,22,.2);
  color: var(--ink);
  font-style: normal;
  font-weight: 500;
  line-height: 1.55;
}
.palace-cell:hover {
  background: rgba(255,253,247,.58);
}
.palace-cell:hover .palace-tooltip {
  display: block;
}
.floor-room {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 48px;
  min-height: 42px;
  padding: 8px;
  overflow: hidden;
  border: 2px solid rgba(37,33,25,.48);
  border-radius: 6px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 24px rgba(49,38,22,.16);
  text-align: center;
  touch-action: none;
}
.floor-room strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
}
.floor-room span {
  max-width: 100%;
  overflow: hidden;
  color: #3d362c;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.floor-room.active {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(156,48,48,.16), 0 10px 24px rgba(49,38,22,.16);
}
.floor-room.entrance { background: #f8e7d7; }
.floor-room.master { background: #e8efe3; }
.floor-room.kitchen { background: #fae5df; }
.floor-room.living { background: #e9eff6; }
.floor-room.bathroom { background: #e2f0f0; }
.floor-room.study { background: #eee8f4; }
.floor-room.balcony { background: #edf3df; }
.resize-handle {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 14px;
  height: 14px;
  border-right: 3px solid rgba(37,33,25,.55);
  border-bottom: 3px solid rgba(37,33,25,.55);
  cursor: nwse-resize;
}
.planner-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
}
.planner-field input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--paper);
}
.range-field span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.range-field b {
  color: var(--ink);
}
.judgment-panel {
  grid-column: 2;
}
.judgment-list {
  display: grid;
  gap: 10px;
}
.judgment-list.compact {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}
.judgment-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbf5ea;
}
.judgment-card.good {
  border-color: rgba(47,112,93,.5);
  background: #edf5ef;
}
.judgment-card.warn {
  border-color: rgba(156,48,48,.45);
  background: #fff0eb;
}
.judgment-card strong,
.judgment-card span {
  display: block;
}
.judgment-card span,
.example-reasons span {
  color: var(--muted);
  font-size: 13px;
}
.analysis-block {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}
.analysis-block h4,
.judgment-panel h4 {
  margin: 8px 0 2px;
}
.number-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.number-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #f2eadc;
  color: #4d4538;
  font-size: 13px;
}
.good-example-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: 18px;
  align-items: stretch;
}
.bagua-example-stage {
  position: relative;
  min-height: 680px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #d8e7db 0 19%, #eef2e4 19% 78%, #dbe8f1 78% 100%);
  box-shadow: var(--shadow);
}
.outside-label {
  position: absolute;
  z-index: 1;
  display: grid;
  gap: 2px;
  max-width: 180px;
  border: 1px solid rgba(37,33,25,.2);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255,253,247,.9);
  box-shadow: 0 10px 24px rgba(49,38,22,.1);
  color: #3d362c;
  font-size: 13px;
}
.outside-label strong {
  color: var(--ink);
}
.outside-label span {
  color: var(--muted);
}
.outside-label.south { left: 50%; bottom: 4%; transform: translateX(-50%); }
.outside-label.north { left: 50%; top: 4%; transform: translateX(-50%); }
.outside-label.east { left: 4%; top: 46%; transform: translateY(-50%); }
.outside-label.west { right: 4%; top: 46%; transform: translateY(-50%); }
.outside-label.southeast { left: 7%; bottom: 20%; }
.outside-label.southwest { right: 7%; bottom: 20%; }
.outside-label.northeast { left: 7%; top: 20%; }
.outside-label.northwest { right: 7%; top: 20%; }
.good-palace-map {
  position: absolute;
  left: 19%;
  right: 19%;
  top: 21%;
  bottom: 21%;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
  border: 4px solid #5d4c36;
  border-radius: 8px;
  padding: 6px;
  background: #fffdf7;
}
.good-palace-cell {
  display: grid;
  align-content: space-between;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: #fbf5ea;
}
.good-palace-cell div {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.good-palace-cell b {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
}
.good-palace-cell span,
.good-palace-cell em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.good-palace-cell strong {
  color: var(--ink);
  line-height: 1.35;
}
.good-palace-cell em {
  justify-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: #f2eadc;
}
.site-map {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #d8e7db 0 24%, #eef2e4 24% 62%, #dbe8f1 62% 100%);
  box-shadow: var(--shadow);
}
.site-ridge,
.site-guard,
.front-yard,
.water-curve,
.example-house {
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid rgba(37,33,25,.22);
  color: #342e25;
  font-weight: 800;
}
.site-ridge {
  left: 14%;
  top: 7%;
  width: 72%;
  height: 18%;
  border-radius: 8px;
  background: #7c9a74;
}
.site-guard {
  top: 27%;
  width: 18%;
  height: 44%;
  border-radius: 8px;
  background: #a8b88b;
}
.site-guard.left { left: 7%; }
.site-guard.right { right: 7%; }
.example-house {
  left: 31%;
  top: 31%;
  width: 38%;
  height: 30%;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: .7fr 1fr 1fr;
  gap: 5px;
  padding: 8px;
  border: 3px solid #5d4c36;
  border-radius: 8px;
  background: #fffdf7;
}
.house-room {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  background: #f0e2cd;
  font-size: 13px;
}
.house-room.entry { grid-column: 1 / -1; background: #f6d7c2; }
.house-room.hall { grid-row: span 2; background: #dce8f1; }
.house-room.master { background: #dfeadb; }
.house-room.kitchen { background: #f4d8d2; }
.front-yard {
  left: 28%;
  top: 64%;
  width: 44%;
  height: 16%;
  border-style: dashed;
  border-radius: 8px;
  background: rgba(255,253,247,.65);
}
.water-curve {
  left: 8%;
  right: 8%;
  bottom: 7%;
  height: 12%;
  border: 0;
  border-top: 14px solid #6aa3bd;
  border-radius: 50% 50% 0 0;
  color: #245064;
}
.example-reasons {
  display: grid;
  gap: 14px;
}
.page-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}
.page-link:hover {
  border-color: var(--red);
}
.seasonal-page {
  padding-top: 36px;
}
.seasonal-page .system-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.12;
}
.seasonal-current h3 {
  margin-top: 0;
}
.seasonal-reco-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}
.seasonal-reco-grid p {
  margin: 0;
}
.solar-term-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.solar-term-card {
  position: relative;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.solar-term-card.active {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(47,112,93,.14), var(--shadow);
}
.term-hover-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% - 8px);
  z-index: 8;
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffdf7;
  box-shadow: 0 18px 42px rgba(49,38,22,.22);
}
.solar-term-card:hover .term-hover-panel {
  display: block;
}
.acupoint-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 18px;
}
.acupoint-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.small-note {
  color: var(--muted);
  font-size: 13px;
}
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px min(6vw, 84px);
  border-top: 1px solid var(--line);
  background: #eadfcd;
  color: var(--muted);
}

.history-map-layout,
.history-relation-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.history-period-strip,
.history-topic-list {
  display: grid;
  gap: 10px;
}
.history-period-btn,
.history-relation-btn,
.history-option-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.history-period-btn {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}
.history-period-btn span {
  color: var(--muted);
  font-size: 13px;
}
.history-relation-btn,
.history-option-btn,
.history-role-btn,
.history-choice-btn,
.scenario-next-btn,
.scenario-review-btn,
.scenario-reset-btn {
  padding: 11px 13px;
}
.history-period-btn.active,
.history-relation-btn.active,
.history-option-btn.active,
.history-role-btn.active,
.history-choice-btn.active {
  border-color: var(--red);
  background: #fff8eb;
  box-shadow: 0 10px 24px rgba(133, 44, 30, .12);
}
.history-map-stage {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, .95fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.history-map-visual {
  min-height: 330px;
  border: 1px solid #d8cab4;
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(41, 96, 88, .08), transparent 42%),
    linear-gradient(180deg, #f6efe3, #eadcc8);
  position: relative;
  overflow: hidden;
}
.history-map-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #3d3328;
}
.history-map-title span {
  border: 1px solid #b65b3d;
  border-radius: 999px;
  padding: 4px 10px;
  color: #8a3327;
  background: rgba(255,253,247,.78);
}
.history-zone-grid {
  position: absolute;
  inset: 70px 22px 22px;
}
.history-zone {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 92px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(68, 58, 44, .18);
  border-radius: 8px;
  background: rgba(255,253,247,.78);
  color: #2f392f;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(50, 42, 30, .08);
}
.history-zone.zone-1 { left: 8%; top: 34%; background: rgba(168, 64, 42, .14); }
.history-zone.zone-2 { left: 36%; top: 24%; background: rgba(43, 111, 100, .14); }
.history-zone.zone-3 { right: 9%; top: 42%; background: rgba(178, 132, 54, .16); }
.history-zone.zone-4 { left: 48%; bottom: 6%; background: rgba(75, 82, 134, .13); }
.history-map-copy h3,
.history-relation-head h3,
.history-chain-card h3,
.history-scenario-card h3 {
  margin-top: 0;
}
.history-map-copy p,
.history-relation-head p,
.history-node p,
.history-chain-card p,
.history-scenario-card p {
  color: var(--muted);
}
.history-relation-detail,
.history-chain-card,
.history-scenario-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.history-relation-detail {
  padding: 18px;
}
.history-relation-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .48fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}
.history-node-grid,
.history-chain-grid,
.history-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.history-node {
  min-height: 132px;
  border: 1px solid #ded2c0;
  border-radius: 8px;
  padding: 14px;
  background: #fffaf0;
}
.history-node strong,
.history-node span {
  display: block;
}
.history-node span {
  margin-top: 4px;
  color: #8a3327;
  font-size: 13px;
}
.history-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.history-link-list span {
  border: 1px solid #d9c8ac;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f4ead8;
  color: #4a4033;
  font-size: 13px;
}
.history-chain-card,
.history-scenario-card {
  padding: 18px;
}
.history-chain-card ol {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}
.history-chain-card li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  border-left: 3px solid #b65b3d;
  padding: 8px 0 8px 12px;
}
.history-chain-card li span {
  color: var(--muted);
}
.history-option-row {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}
.history-scenario-rich-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.history-scenario-play {
  display: grid;
  gap: 14px;
}
.scenario-open-btn {
  display: grid;
  gap: 12px;
  min-height: 220px;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.scenario-open-btn:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}
.scenario-topline,
.scenario-round-head,
.scenario-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.scenario-topline span,
.scenario-round-head span {
  border: 1px solid #d9c8ac;
  border-radius: 999px;
  padding: 5px 10px;
  color: #8a3327;
  background: #fff8eb;
  font-size: 13px;
  white-space: nowrap;
}
.scenario-role-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.history-role-btn,
.scenario-next-btn,
.scenario-review-btn,
.scenario-reset-btn {
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  cursor: pointer;
}
.scenario-role-note {
  border-left: 3px solid #b65b3d;
  padding: 10px 12px;
  background: #fff8eb;
  color: #4a4033;
}
.scenario-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.scenario-meter {
  border: 1px solid #e1d3bf;
  border-radius: 8px;
  padding: 10px;
  background: #fffaf0;
}
.scenario-meter div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #4a4033;
  font-size: 13px;
}
.scenario-meter strong {
  color: #8a3327;
}
.scenario-meter i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #e6d8c1;
  overflow: hidden;
}
.scenario-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2b6f64, #b28436);
}
.scenario-round-panel,
.scenario-review,
.scenario-path {
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  padding: 14px;
  background: #f8f0e2;
}
.scenario-round-panel p,
.scenario-review p {
  margin-bottom: 10px;
}
.scenario-voice-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.scenario-voice-list span {
  border-left: 3px solid #2b6f64;
  padding: 8px 10px;
  background: rgba(43, 111, 100, .08);
  color: #425047;
}
.scenario-choice-row {
  margin-bottom: 12px;
}
.history-choice-btn {
  display: grid;
  gap: 5px;
  text-align: left;
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  cursor: pointer;
}
.history-choice-btn span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.history-scenario-result {
  min-height: 150px;
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  padding: 14px;
  background: #f7eddb;
}
.history-scenario-result h4 {
  margin: 0 0 8px;
}
.scenario-empty-result {
  min-height: auto;
}
.scenario-effect-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}
.scenario-effect-row span {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 700;
}
.scenario-effect-row .up {
  background: rgba(43, 111, 100, .12);
  color: #1f6258;
}
.scenario-effect-row .down {
  background: rgba(182, 91, 61, .13);
  color: #8a3327;
}
.scenario-action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}
.scenario-next-btn,
.scenario-review-btn {
  background: #8a3327;
  color: #fffdf7;
  border-color: #8a3327;
}
.scenario-reset-btn {
  background: #fffdf7;
}
.scenario-path {
  display: grid;
  gap: 8px;
  background: #fffaf0;
}
.scenario-path p {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  color: #4a4033;
}
.scenario-path span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #2b6f64;
  color: #fffdf7;
  font-size: 12px;
  font-weight: 700;
}
.scenario-source {
  margin-bottom: 0;
}
.scenario-modal-shell {
  width: min(1360px, 96vw);
}
.scenario-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.scenario-side-panel {
  display: grid;
  gap: 14px;
}
.scenario-link-panel {
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  padding: 14px;
  background: #fffaf0;
}
.scenario-link-panel h3 {
  margin: 0 0 10px;
}
.scenario-link-panel p {
  color: var(--muted);
}
.scenario-link-panel button,
.scenario-map-sync,
.scenario-relation-open {
  width: 100%;
  border: 1px solid #8a3327;
  border-radius: 8px;
  padding: 10px 12px;
  background: #8a3327;
  color: #fffdf7;
  cursor: pointer;
}
.scenario-link-map {
  position: relative;
  min-height: 180px;
  margin-bottom: 12px;
  border: 1px solid #d8cab4;
  border-radius: 8px;
  background:
    radial-gradient(circle at 28% 36%, rgba(43, 111, 100, .18), transparent 0 20%, transparent 21%),
    radial-gradient(circle at 62% 42%, rgba(178, 132, 54, .2), transparent 0 18%, transparent 19%),
    linear-gradient(135deg, #dce6d5, #f6efe3 52%, #d7e6ea);
  overflow: hidden;
}
.scenario-link-map::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(68, 58, 44, .12);
  border-radius: 50%;
}
.scenario-map-dot {
  position: absolute;
  display: inline-grid;
  place-items: center;
  max-width: 120px;
  border: 1px solid rgba(80, 45, 14, .2);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255,253,247,.88);
  color: #4a4033;
  font-size: 12px;
  font-weight: 800;
}
.scenario-map-dot.dot-1 { left: 13%; top: 54%; }
.scenario-map-dot.dot-2 { left: 43%; top: 28%; }
.scenario-map-dot.dot-3 { right: 9%; top: 49%; }
.scenario-map-dot.dot-4 { left: 42%; bottom: 11%; }
.scenario-mini-events {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.scenario-mini-events p {
  margin: 0;
  border-left: 3px solid #2b6f64;
  padding-left: 9px;
}
.scenario-mini-events strong {
  display: block;
  color: #30443d;
}
.scenario-mini-roles {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}
.scenario-mini-roles p {
  margin: 0;
  border-left: 3px solid #b65b3d;
  padding-left: 10px;
}
.scenario-mini-roles strong,
.scenario-mini-roles span {
  display: block;
}
.scenario-mini-roles span {
  color: var(--muted);
  font-size: 13px;
}
.history-globe-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr);
  gap: 18px;
  align-items: start;
}
.history-globe-panel,
.history-time-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
}
.history-globe-panel {
  padding: 18px;
}
.history-globe-shell {
  display: grid;
  place-items: center;
  min-height: 560px;
  border: 1px solid #d8cab4;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 239, .92), rgba(234, 220, 200, .88)),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(58, 82, 72, .06) 35px 36px);
  overflow: hidden;
}
.history-globe {
  width: min(520px, 78vw);
  aspect-ratio: 1;
  position: relative;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.42), transparent 24%),
    radial-gradient(circle at 58% 48%, rgba(216, 179, 94, .42), transparent 18%),
    radial-gradient(circle at 46% 58%, rgba(41, 111, 100, .34), transparent 20%),
    linear-gradient(135deg, #4f93a1, #234e65 56%, #183447);
  box-shadow:
    inset -34px -28px 56px rgba(0,0,0,.26),
    inset 22px 18px 36px rgba(255,255,255,.22),
    0 24px 60px rgba(31, 45, 54, .26);
}
.history-globe::before,
.history-globe::after,
.history-globe-shade {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  pointer-events: none;
}
.history-globe::before {
  border: 1px solid rgba(255,255,255,.22);
  background:
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(255,255,255,.16) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255,255,255,.12) 47px 48px);
  mix-blend-mode: screen;
}
.history-globe::after {
  inset: 0;
  background: radial-gradient(circle at 68% 50%, transparent 0 48%, rgba(11, 27, 38, .18) 66%, rgba(5, 13, 20, .36) 100%);
}
.history-globe-shade {
  inset: 14%;
  border: 1px solid rgba(255,255,255,.12);
}
.history-globe-markers {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.history-region-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 78px;
  border: 0;
  background: transparent;
  color: #fff8eb;
  cursor: pointer;
  text-shadow: 0 1px 8px rgba(0,0,0,.54);
}
.history-region-marker span {
  width: 13px;
  height: 13px;
  border: 2px solid #fff8eb;
  border-radius: 50%;
  background: #b65b3d;
  box-shadow: 0 0 0 5px rgba(255,248,235,.18);
}
.history-region-marker strong {
  display: block;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(27, 38, 38, .48);
  font-size: 13px;
  white-space: nowrap;
}
.history-region-marker em {
  display: none;
  max-width: 150px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255,253,247,.94);
  color: #3d3328;
  font-style: normal;
  line-height: 1.35;
  text-shadow: none;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.history-region-marker.active span,
.history-region-marker:hover span {
  background: #f0c65f;
  box-shadow: 0 0 0 7px rgba(240,198,95,.24);
}
.history-region-marker.active em,
.history-region-marker:hover em {
  display: block;
}
.history-slider-panel {
  margin-top: 16px;
}
.history-slider-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.history-slider-head strong:last-child {
  text-align: right;
}
#lishiSliderYear {
  min-width: 82px;
  border: 1px solid #b65b3d;
  border-radius: 999px;
  padding: 5px 12px;
  text-align: center;
  color: #8a3327;
  background: #fff8eb;
  font-weight: 800;
}
.history-year-range {
  width: 100%;
  margin: 14px 0 8px;
  accent-color: #b65b3d;
}
.history-era-strip {
  position: relative;
  height: 34px;
  border-top: 1px solid #d7c6aa;
}
.history-era-strip span {
  position: absolute;
  top: 8px;
  transform: translateX(-8%);
  max-width: 110px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.history-time-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  position: sticky;
  top: 18px;
}
.history-time-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.history-era-panel,
.history-region-panel {
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  padding: 14px;
  background: #fffaf0;
}
.history-era-panel h3,
.history-region-panel h3 {
  margin: 0 0 8px;
}
.history-era-panel p,
.history-region-panel p {
  color: var(--muted);
}
.history-region-events {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.history-region-events article {
  border-left: 3px solid #2b6f64;
  padding: 7px 0 7px 12px;
  background: rgba(43, 111, 100, .06);
}
.history-region-events strong {
  color: #30443d;
}
.history-region-events p {
  margin: 6px 0 0;
}
.relation-topic-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.relation-topic-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255,253,247,.96);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.relation-topic-card span,
.relation-topic-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}
.relation-topic-card strong {
  display: block;
  margin: 10px 0;
  font-size: 19px;
  line-height: 1.25;
}
.relation-topic-card:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}
.relation-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 27, 22, .58);
}
.relation-modal-shell {
  width: min(1280px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  box-shadow: 0 28px 80px rgba(20, 16, 10, .32);
  padding: 20px;
}
.relation-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}
.relation-modal-head h2 {
  margin: 0 0 8px;
}
.relation-modal-head p {
  max-width: 760px;
  color: var(--muted);
}
.relation-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  background: #f4ead8;
  cursor: pointer;
}
.relation-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.relation-filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--paper);
  cursor: pointer;
}
.relation-filter.active {
  border-color: var(--red);
  background: #fff8eb;
  color: #8a3327;
}
.relation-universe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 16px;
}
.relation-map {
  position: relative;
  min-height: 620px;
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(255, 248, 235, .98) 0 22%, rgba(234, 220, 200, .92) 23% 58%, rgba(43, 111, 100, .08) 59%),
    linear-gradient(180deg, #fffaf0, #eadbc4);
}
.relation-center-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 190px;
  min-height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid #b65b3d;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,253,247,.94);
  color: #8a3327;
  text-align: center;
  font-weight: 800;
  z-index: 2;
}
.relation-node {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(68, 58, 44, .2);
  border-radius: 50%;
  background: #fff8eb;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(50, 42, 30, .14);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 6px;
  text-align: center;
  z-index: 3;
}
.relation-node strong {
  font-size: 13px;
  line-height: 1.1;
}
.relation-node span {
  display: none;
}
.relation-node.active {
  border-color: #b65b3d;
  background: #f0c65f;
}
.relation-node:hover span,
.relation-node.active span {
  display: block;
  position: absolute;
  top: calc(100% + 6px);
  min-width: 88px;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(61, 51, 40, .9);
  color: white;
  font-size: 11px;
}
.relation-edge-list {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  z-index: 4;
}
.relation-edge {
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  padding: 8px;
  background: rgba(255,253,247,.92);
  text-align: left;
  cursor: pointer;
}
.relation-edge strong,
.relation-edge span {
  display: block;
}
.relation-edge span {
  color: #8a3327;
  font-size: 12px;
  margin-top: 2px;
}
.relation-detail-panel,
.relation-bottom-grid article {
  border: 1px solid #d9c8ac;
  border-radius: 8px;
  padding: 16px;
  background: #fffaf0;
}
.relation-detail-panel h3 {
  margin-top: 0;
}
.relation-detail-panel h4 {
  margin: 16px 0 8px;
}
.relation-detail-panel p,
.relation-bottom-grid p {
  color: var(--muted);
}
.relation-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.cshape-panel {
  display: grid;
  gap: 12px;
}
.cshape-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.cshape-toolbar button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff8eb;
  color: var(--ink);
  cursor: pointer;
}
.cshape-toolbar span {
  color: var(--muted);
  font-size: 13px;
}
.cshape-canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 620px;
  border: 1px solid #d8cab4;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 46%, rgba(255,255,255,.78), transparent 0 38%, rgba(43, 111, 100, .08) 39%, transparent 40%),
    linear-gradient(180deg, #f8f0e2, #eadbc4);
  overflow: hidden;
}
.cshape-canvas-wrap::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(74, 64, 51, .08);
  border-radius: 8px;
  pointer-events: none;
}
#lishiWorldCanvas {
  width: min(100%, 960px);
  height: auto;
  max-height: 70vh;
  touch-action: none;
  cursor: grab;
}
#lishiWorldCanvas:active {
  cursor: grabbing;
}

@media (max-width: 1080px) {
  .compact-hero,
  .path-grid,
  .system-grid,
  .classic-grid,
  .tool-grid,
  .bazi-form,
  .trigram-grid,
  .demo-grid,
  .source-grid,
  .hex-list,
  .reader-shell,
  .concept-node-grid,
  .story-grid,
  .yinfu-columns,
  .planner-layout,
  .good-example-layout,
  .solar-term-grid,
  .acupoint-layout {
    grid-template-columns: 1fr 1fr;
  }
  .concept-layout,
  .line-layout {
    grid-template-columns: 1fr;
  }
  .history-map-layout,
  .history-relation-layout,
  .history-map-stage,
  .history-relation-head,
  .history-node-grid,
  .history-chain-grid,
  .history-scenario-grid {
    grid-template-columns: 1fr 1fr;
  }
  .history-period-strip,
  .history-topic-list {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, 1fr);
  }
  .history-map-layout,
  .history-relation-layout {
    grid-template-columns: 1fr;
  }
  .history-globe-workbench {
    grid-template-columns: 1fr;
  }
  .relation-topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .relation-universe-layout,
  .relation-bottom-grid,
  .scenario-modal-layout {
    grid-template-columns: 1fr;
  }
  .relation-edge-list {
    grid-template-columns: 1fr 1fr;
  }
  .history-time-panel {
    position: static;
  }
}
@media (max-width: 720px) {
  .compact-hero { padding: 18px 18px 52px; }
  main { padding: 0 18px 48px; }
  .section-head, .footer { display: block; }
  .path-grid,
  .system-grid,
  .classic-grid,
  .tool-grid,
  .bazi-form,
  .search-mini,
  .wuxing-grid,
  .trigram-grid,
  .demo-grid,
  .source-grid,
  .hex-list,
  .reader-shell,
  .concept-node-grid,
  .story-grid,
  .yinfu-columns,
  .change-compare {
    grid-template-columns: 1fr;
  }
  .yinfu-entry {
    display: grid;
  }
  .tool-grid .wide { grid-column: auto; }
  .planner-layout,
  .good-example-layout {
    grid-template-columns: 1fr;
  }
  .solar-term-grid,
  .acupoint-layout,
  .acupoint-grid,
  .seasonal-reco-grid {
    grid-template-columns: 1fr;
  }
  .history-map-layout,
  .history-relation-layout,
  .history-map-stage,
  .history-relation-head,
  .history-node-grid,
  .history-chain-grid,
  .history-scenario-grid,
  .history-period-strip,
  .history-topic-list {
    grid-template-columns: 1fr;
  }
  .history-map-visual {
    min-height: 300px;
  }
  .history-zone {
    min-width: 74px;
    min-height: 48px;
    font-size: 13px;
  }
  .history-globe-panel,
  .history-time-panel {
    padding: 14px;
  }
  .history-globe-shell {
    min-height: 420px;
  }
  .cshape-canvas-wrap {
    min-height: 360px;
  }
  .cshape-toolbar {
    display: grid;
  }
  .relation-topic-grid,
  .relation-edge-list {
    grid-template-columns: 1fr;
  }
  .scenario-metric-grid {
    grid-template-columns: 1fr;
  }
  .scenario-topline,
  .scenario-round-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .relation-modal {
    padding: 10px;
  }
  .relation-modal-shell {
    padding: 14px;
    max-height: 96vh;
  }
  .relation-modal-head {
    display: grid;
  }
  .relation-map {
    min-height: 560px;
  }
  .relation-center-label {
    width: 150px;
  }
  .history-region-marker {
    min-width: 52px;
  }
  .history-region-marker strong {
    font-size: 11px;
    padding: 2px 5px;
  }
  .history-region-marker em {
    max-width: 120px;
    font-size: 12px;
  }
  .history-era-strip {
    height: 52px;
  }
  .history-era-strip span {
    max-width: 74px;
    font-size: 11px;
  }
  .judgment-panel {
    grid-column: auto;
  }
  .floorplan-canvas {
    min-height: 360px;
    height: 76vw;
  }
  .site-map {
    min-height: 430px;
  }
  .bagua-example-stage {
    min-height: 640px;
  }
  .outside-label {
    max-width: 150px;
    font-size: 12px;
  }
  .good-palace-map {
    left: 14%;
    right: 14%;
  }
}
