:root {
  --ink: #eef2ed;
  --muted: #9ea8a2;
  --coal: #090b0b;
  --panel: rgba(14, 18, 17, 0.82);
  --panel-solid: #111615;
  --line: rgba(214, 232, 211, 0.16);
  --red: #ff4b4f;
  --teal: #31d4b2;
  --brass: #d7aa4b;
  --violet: #8673ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 28% 12%, rgba(49, 212, 178, 0.14), transparent 26rem),
    radial-gradient(circle at 80% 84%, rgba(255, 75, 79, 0.12), transparent 22rem),
    linear-gradient(135deg, #070909 0%, #131816 52%, #090b0b 100%);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 18px;
  padding: 18px;
}

.map-stage,
.oracle-panel {
  border: 1px solid var(--line);
  background: rgba(8, 11, 11, 0.7);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-stage {
  min-height: calc(100vh - 36px);
  position: relative;
}

.topbar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px;
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  color: var(--red);
  font-size: clamp(48px, 8vw, 108px);
  line-height: 0.9;
  font-weight: 900;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.44);
}

.date-card {
  min-width: 138px;
  padding: 14px 16px;
  border: 1px solid rgba(215, 170, 75, 0.45);
  background: rgba(9, 11, 11, 0.74);
  text-align: right;
}

.date-card span,
.date-card strong {
  display: block;
}

.date-card span {
  color: var(--muted);
  font-size: 12px;
}

.date-card strong {
  margin-top: 4px;
  color: var(--brass);
  font-size: 22px;
}

.map-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #050707;
}

.base-map {
  width: min(100%, calc((100vh - 36px) * 1.284));
  max-height: calc(100vh - 36px);
  object-fit: contain;
  opacity: 0.72;
  filter: contrast(1.08) saturate(0.72);
}

.map-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.58), transparent 22%, transparent 70%, rgba(0, 0, 0, 0.48)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 96px);
}

.region-layer,
.bagua-ring {
  position: absolute;
  width: min(100%, calc((100vh - 36px) * 1.284));
  aspect-ratio: 1075 / 837;
  max-height: calc(100vh - 36px);
  z-index: 5;
}

.region-pin {
  position: absolute;
  translate: -50% -50%;
  display: grid;
  grid-template-columns: 10px max-content;
  gap: 7px;
  align-items: center;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  padding: 6px;
}

.region-pin::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(49, 212, 178, 0.14), 0 0 22px rgba(49, 212, 178, 0.7);
}

.region-pin span {
  padding: 4px 7px;
  background: rgba(7, 9, 9, 0.72);
  border: 1px solid rgba(238, 242, 237, 0.16);
  font-size: 12px;
  white-space: nowrap;
}

.region-pin.hot::before {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 75, 79, 0.16), 0 0 24px rgba(255, 75, 79, 0.76);
}

.region-pin.warn::before {
  background: var(--brass);
  box-shadow: 0 0 0 5px rgba(215, 170, 75, 0.16), 0 0 22px rgba(215, 170, 75, 0.7);
}

.region-pin.selected span {
  color: #07100e;
  background: var(--teal);
  border-color: var(--teal);
}

.trigram {
  position: absolute;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 75, 79, 0.48);
  color: var(--red);
  background: rgba(5, 7, 7, 0.7);
  font-size: 34px;
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.trigram.active {
  color: #070909;
  background: var(--brass);
  border-color: var(--brass);
}

.trigram[data-bagua="乾"] { left: 6%; top: 25%; }
.trigram[data-bagua="坎"] { left: 48%; top: 11%; }
.trigram[data-bagua="艮"] { right: 9%; top: 23%; }
.trigram[data-bagua="震"] { right: 6%; top: 47%; }
.trigram[data-bagua="巽"] { right: 28%; bottom: 20%; }
.trigram[data-bagua="离"] { left: 36%; bottom: 7%; }
.trigram[data-bagua="坤"] { left: 22%; bottom: 28%; }
.trigram[data-bagua="兑"] { left: 5%; top: 51%; }

.compass-core {
  position: absolute;
  left: 50%;
  top: 53%;
  translate: -50% -50%;
  z-index: 6;
  width: 154px;
  height: 154px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  border: 5px solid rgba(215, 170, 75, 0.78);
  background:
    radial-gradient(circle, rgba(215, 170, 75, 0.34), rgba(12, 12, 10, 0.82) 63%),
    repeating-conic-gradient(from 0deg, rgba(215, 170, 75, 0.9) 0 10deg, transparent 10deg 20deg);
  box-shadow: 0 0 48px rgba(215, 170, 75, 0.34);
}

.compass-core span {
  display: block;
  font-size: 42px;
  font-weight: 900;
}

.compass-core small {
  color: var(--brass);
  font-size: 12px;
}

.oracle-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: auto;
}

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

label {
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  margin-top: 6px;
  color: var(--ink);
  background: #0b1110;
  border: 1px solid var(--line);
  padding: 10px 11px;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(49, 212, 178, 0.16);
}

.summary-card,
.rule-card,
.ranking-card,
.detail-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
}

.summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.summary-head h2 {
  flex: 1;
  margin: 0;
  min-width: 0;
  max-width: none;
  font-size: clamp(22px, 2.1vw, 28px);
  line-height: 1.1;
  text-align: right;
  overflow-wrap: anywhere;
}

.oracle-text {
  color: #cfd7d1;
  line-height: 1.72;
  margin: 14px 0;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badges span {
  border: 1px solid rgba(215, 170, 75, 0.3);
  color: var(--brass);
  padding: 6px 8px;
  font-size: 12px;
}

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

.rule-card h3,
.ranking-card h3,
.detail-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

ul {
  margin: 0;
  padding-left: 18px;
  color: #d7ded9;
  line-height: 1.65;
  font-size: 14px;
}

.good h3 {
  color: var(--teal);
}

.bad h3 {
  color: var(--red);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title button {
  color: #07100e;
  border: 0;
  background: var(--brass);
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 800;
}

.rank-list {
  display: grid;
  gap: 9px;
}

.rank-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.rank-no {
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
}

.rank-name {
  display: block;
  font-weight: 800;
}

.rank-reason {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.rank-score {
  color: var(--teal);
  font-weight: 900;
}

.detail-card p {
  color: #cfd7d1;
  line-height: 1.65;
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 7px 12px;
  margin: 0;
  font-size: 13px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
}

.notice {
  margin: 0;
  color: #858f89;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .map-stage {
    min-height: 74vh;
  }

  .base-map,
  .region-layer,
  .bagua-ring {
    width: 100%;
    max-height: none;
  }

  .oracle-panel {
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .shell {
    padding: 0;
    gap: 0;
  }

  .map-stage,
  .oracle-panel {
    border-left: 0;
    border-right: 0;
  }

  .topbar {
    padding: 16px;
  }

  .date-card {
    min-width: 104px;
  }

  .date-card strong {
    font-size: 18px;
  }

  .map-stage {
    min-height: 62vh;
  }

  .trigram {
    width: 42px;
    height: 42px;
    font-size: 25px;
  }

  .compass-core {
    width: 104px;
    height: 104px;
  }

  .compass-core span {
    font-size: 31px;
  }

  .region-pin span {
    display: none;
  }

  .control-strip,
  .grid-two {
    grid-template-columns: 1fr;
  }
}
