:root {
  --bg: #03040a;
  --gold: #d8b75a;
  --gold-bright: #f4d77b;
  --ink: #f7f2df;
  --muted: #9aa5b8;
  --line: rgba(244, 215, 123, 0.22);
  --glass: rgba(7, 9, 19, 0.72);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(216, 183, 90, 0.16), transparent 16%),
    radial-gradient(circle at 50% 50%, rgba(71, 104, 166, 0.12), transparent 42%),
    linear-gradient(160deg, #02030a 0%, #070816 52%, #02030a 100%);
  color: var(--ink);
}

a,
button {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.86;
}

.brand-corner {
  position: fixed;
  top: 24px;
  left: 26px;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  pointer-events: none;
}

.metal-logo {
  display: grid;
  min-width: 88px;
  min-height: 42px;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #f4d77b;
  background: linear-gradient(135deg, #fff5bd 0%, #d8b75a 26%, #8f6f27 48%, #ffe799 70%, #b48931 100%);
  background-clip: text;
  -webkit-background-clip: text;
  box-shadow: none;
  font-family: "SimSun", "Songti SC", "Noto Serif SC", serif;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34),
    0 -1px 0 rgba(78, 55, 18, 0.8),
    0 0 18px rgba(244, 215, 123, 0.28);
}

.vertical-copy {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.vertical-title,
.vertical-subtitle {
  margin: 0;
  font-family: "SimSun", "Songti SC", "Noto Serif SC", serif;
  letter-spacing: 0;
  text-orientation: upright;
  writing-mode: vertical-rl;
}

.vertical-title {
  color: var(--gold-bright);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.18;
  text-shadow: 0 0 18px rgba(216, 183, 90, 0.28);
}

.vertical-subtitle {
  color: rgba(247, 242, 223, 0.76);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.16;
  text-shadow: 0 0 14px rgba(216, 183, 90, 0.18);
}

.star-atlas {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 3vh 3vw 110px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  contain: layout paint style;
}

.star-atlas.dragging {
  cursor: grabbing;
}

.orbit-lines,
.orbit-map {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(92vw, 92vh);
  height: min(92vw, 92vh);
  max-width: 900px;
  max-height: 900px;
  transform: translate(-50%, -50%);
  contain: layout paint style;
}

.orbit-map {
  overflow: visible;
}

.orbit-lines {
  overflow: visible;
  filter: drop-shadow(0 0 18px rgba(216, 183, 90, 0.13));
}

.orbit-lines line {
  stroke: var(--line);
  stroke-width: 1.28;
  vector-effect: non-scaling-stroke;
}

.hex-node {
  position: absolute;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  margin: 0;
  border: 1px solid rgba(244, 215, 123, 0.2);
  border-radius: 50%;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 50%, rgba(244, 215, 123, 0.18), transparent 62%),
    rgba(6, 8, 18, 0.34);
  box-shadow: 0 0 16px rgba(216, 183, 90, 0.1);
  opacity: 1;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.hex-node:hover,
.hex-node.active {
  z-index: 5;
  border-color: rgba(244, 215, 123, 0.96);
  box-shadow: 0 0 34px rgba(244, 215, 123, 0.32);
}

.hex-lines {
  display: grid;
  gap: 2px;
  width: 21px;
}

.hex-line {
  height: 1.7px;
  border-radius: 999px;
  background: var(--gold-bright);
  box-shadow: 0 0 8px rgba(244, 215, 123, 0.35);
}

.hex-line.yin {
  background: linear-gradient(90deg, var(--gold-bright) 0 40%, transparent 40% 60%, var(--gold-bright) 60%);
}

.matrix-map {
  display: none !important;
}

.hex-tooltip {
  position: fixed;
  z-index: 20;
  min-width: 92px;
  padding: 8px 11px;
  border: 1px solid rgba(244, 215, 123, 0.26);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(5, 6, 13, 0.92);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  text-align: center;
}

.hex-tooltip strong {
  display: block;
  color: var(--gold-bright);
  font-size: 14px;
}

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

.flash-dock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(620px, calc(100vw - 28px));
  min-height: 70px;
  padding: 12px 14px 12px 18px;
  border: 1px solid rgba(244, 215, 123, 0.22);
  border-radius: 999px;
  background: rgba(7, 9, 19, 0.72);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
  backdrop-filter: blur(22px);
}

.flash-dock strong,
.flash-dock span {
  display: block;
  letter-spacing: 0;
}

.flash-dock strong {
  color: var(--gold-bright);
  font-size: 17px;
}

.flash-dock span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.flash-button {
  display: inline-grid;
  min-width: 108px;
  min-height: 46px;
  place-items: center;
  border-radius: 999px;
  color: #17110a;
  background: linear-gradient(135deg, #f4d77b, #ba8f35);
  box-shadow: 0 12px 34px rgba(216, 183, 90, 0.2);
  font-weight: 800;
}

.detail-panel {
  position: fixed;
  z-index: 30;
  top: 22px;
  right: 22px;
  bottom: 22px;
  width: min(430px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  overflow: auto;
  color: var(--ink);
  background: var(--glass);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  transform: translateX(calc(100% + 40px));
  transition: transform 220ms ease;
  backdrop-filter: blur(24px);
}

.detail-panel.open {
  transform: translateX(0);
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  font-size: 22px;
}

.detail-index {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.detail-panel h2 {
  margin: 0;
  font-size: 42px;
}

.detail-symbol {
  margin: 8px 0 16px;
  color: #d7dfec;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-tags span {
  padding: 6px 9px;
  border: 1px solid rgba(244, 215, 123, 0.22);
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(216, 183, 90, 0.08);
  font-size: 12px;
}

.detail-panel section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-panel h3 {
  margin: 0 0 8px;
  color: var(--gold-bright);
  font-size: 15px;
}

.detail-panel p {
  margin: 0;
  color: #d5deec;
  line-height: 1.75;
}

.yao-row {
  margin-top: 10px;
  color: #d5deec;
  line-height: 1.65;
}

.yao-row strong {
  color: var(--ink);
}

.modern-grid {
  display: grid;
  gap: 14px;
}

@media (max-width: 760px) {
  html,
  body {
    overflow: auto;
  }

  .star-atlas {
    position: relative;
    min-height: 100vh;
    padding: 18px 10px 118px;
  }

  .brand-corner {
    top: 16px;
    left: 14px;
    gap: 12px;
  }

  .metal-logo {
    min-width: 64px;
    min-height: 34px;
    font-size: 26px;
  }

  .vertical-copy {
    gap: 7px;
  }

  .vertical-title {
    font-size: 22px;
  }

  .vertical-subtitle {
    font-size: 15px;
  }

  .hex-node {
    width: 28px;
    height: 28px;
    margin: 0;
  }

  .hex-lines {
    width: 18px;
    gap: 2px;
  }

  .flash-dock {
    bottom: 12px;
    border-radius: 22px;
  }

  .detail-panel {
    inset: 10px;
    width: auto;
    border-radius: 22px;
  }
}
