:root {
  --bg-deep: #09111c;
  --bg-mid: #121f32;
  --bg-warm: #2a1710;
  --card-cool-top: rgba(80, 103, 134, 0.26);
  --card-cool-bottom: rgba(31, 43, 66, 0.72);
  --card-warm-top: rgba(123, 89, 62, 0.22);
  --card-warm-bottom: rgba(41, 29, 24, 0.72);
  --card-board-top: rgba(86, 93, 110, 0.3);
  --card-board-bottom: rgba(40, 44, 56, 0.78);
  --stroke: rgba(255, 255, 255, 0.13);
  --stroke-soft: rgba(255, 240, 212, 0.12);
  --text-main: #fbf3e6;
  --text-soft: #e1d3be;
  --text-faint: rgba(251, 243, 230, 0.72);
  --gold: #efc267;
  --gold-strong: #ffdf9b;
  --teal: #5f8ea5;
  --teal-deep: #2c475f;
  --warm-shadow: rgba(220, 145, 74, 0.18);
  --cool-shadow: rgba(101, 151, 194, 0.16);
  --cell-size: clamp(58px, 5.1vw, 82px);
  --piece-inset: 6px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 10% 8%, rgba(248, 193, 101, 0.15), transparent 22%),
    radial-gradient(circle at 90% 14%, rgba(99, 146, 193, 0.18), transparent 24%),
    radial-gradient(circle at 50% 54%, rgba(255, 216, 155, 0.06), transparent 30%),
    radial-gradient(circle at 80% 96%, rgba(103, 58, 41, 0.18), transparent 22%),
    linear-gradient(140deg, #0a111b 4%, #122032 38%, #141d2f 62%, #231712 100%);
  overflow: hidden;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 92%);
  opacity: 0.3;
}

body::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
    radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.16) 100%);
}

.app-shell {
  max-width: 1600px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px clamp(14px, 2vw, 24px);
  position: relative;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(38px);
  opacity: 0.7;
}

.app-shell::before {
  width: 280px;
  height: 160px;
  left: 28%;
  top: 42%;
  background: radial-gradient(circle, rgba(243, 176, 78, 0.16), transparent 72%);
}

.app-shell::after {
  width: 240px;
  height: 140px;
  right: 10%;
  top: 22%;
  background: radial-gradient(circle, rgba(97, 144, 188, 0.18), transparent 72%);
}

.workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(520px, 1.14fr) minmax(300px, 0.92fr);
  gap: 20px;
  height: calc(100vh - 32px);
  align-items: stretch;
}

.workspace::before {
  content: "";
  position: absolute;
  inset: 12px 31% 12px 31%;
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(255, 219, 157, 0.04), transparent 30%, rgba(92, 141, 184, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.left-rail,
.right-rail {
  min-height: 0;
  display: grid;
  gap: 18px;
}

.left-rail {
  grid-template-rows: auto minmax(0, 1fr);
}

.right-rail {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.eyebrow,
.panel-tag {
  margin: 0;
  color: rgba(251, 243, 230, 0.76);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.eyebrow-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: none;
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.eyebrow-link:hover {
  color: var(--gold-strong);
  text-shadow: 0 0 14px rgba(255, 223, 155, 0.18);
}

.hero-copy h1 {
  margin: 10px 0 12px;
  font-family: "STZhongsong", "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.95rem, 2.9vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fff8ee 10%, #f4d6a0 100%);
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
}

.hero-line {
  display: block;
}

.hero-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.82;
}

.mode-block {
  margin-top: 18px;
}

.mode-heading {
  margin: 0 0 12px;
  color: var(--text-faint);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.mode-switcher {
  display: grid;
  gap: 10px;
}

.mode-option {
  appearance: none;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--text-main);
  cursor: pointer;
  background:
    radial-gradient(circle at top right, rgba(255, 222, 165, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 20px rgba(0, 0, 0, 0.14);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.mode-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 225, 166, 0.28);
}

.mode-option.active {
  border-color: rgba(240, 196, 109, 0.44);
  background:
    radial-gradient(circle at top right, rgba(255, 225, 166, 0.18), transparent 36%),
    linear-gradient(145deg, rgba(240, 196, 109, 0.14), rgba(255, 255, 255, 0.05));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 223, 155, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mode-option strong,
.mode-option-label,
.mode-option-meta {
  display: block;
}

.mode-option-label {
  margin-bottom: 6px;
  color: rgba(255, 243, 220, 0.76);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mode-option strong {
  font-size: 1rem;
  line-height: 1.2;
}

.mode-option-meta {
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

.build-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 26px rgba(0, 0, 0, 0.18);
}

.build-pill span {
  color: var(--text-faint);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.build-pill strong {
  color: var(--gold-strong);
  font-size: 0.92rem;
}

.glass-card,
.badge {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  box-shadow:
    0 24px 58px rgba(3, 8, 18, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
}

.glass-card::before,
.badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%);
  pointer-events: none;
}

.glass-card::after,
.badge::after {
  content: "";
  position: absolute;
  inset: auto 18px 0 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  pointer-events: none;
}

.glass-card {
  border-radius: 28px;
}

.intro-panel {
  min-height: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(243, 189, 96, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(84, 96, 116, 0.32), rgba(32, 39, 54, 0.82));
}

.intro-panel::after {
  inset: 22px 22px auto;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 224, 164, 0.8), rgba(255, 224, 164, 0.08));
}

.timeline-panel {
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 216, 156, 0.08), transparent 28%),
    linear-gradient(180deg, var(--card-cool-top), var(--card-cool-bottom));
}

.solver-panel {
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 100% 0%, rgba(95, 142, 165, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(80, 92, 112, 0.26), rgba(33, 41, 56, 0.8));
}

.help-panel {
  min-height: 0;
  padding: 18px;
  background:
    radial-gradient(circle at 100% 100%, rgba(170, 110, 73, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(92, 79, 71, 0.24), rgba(43, 38, 41, 0.8));
}

.board-panel {
  min-height: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 219, 156, 0.1), transparent 24%),
    linear-gradient(180deg, var(--card-board-top), var(--card-board-bottom));
}

.board-panel::before {
  background:
    radial-gradient(circle at 50% 42%, rgba(243, 178, 75, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%);
}

.hero-badges {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.badge {
  padding: 18px 18px 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(84, 99, 122, 0.34), rgba(34, 44, 63, 0.82));
}

.hero-badges .badge:nth-child(1) {
  box-shadow:
    0 20px 44px rgba(3, 8, 18, 0.28),
    0 0 0 1px rgba(255, 214, 144, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-badges .badge:nth-child(2) {
  background: linear-gradient(180deg, rgba(86, 102, 126, 0.32), rgba(34, 44, 63, 0.82));
}

.hero-badges .badge:nth-child(3) {
  background: linear-gradient(180deg, rgba(74, 96, 120, 0.34), rgba(31, 42, 62, 0.82));
}

.badge-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.badge strong {
  display: block;
  position: relative;
  font-size: clamp(1.08rem, 1.7vw, 1.42rem);
  line-height: 1.16;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 6px 0 0;
  font-size: 1.18rem;
  line-height: 1.28;
}

.status-pill,
.tiny-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 0.86rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.tiny-pill {
  min-height: 28px;
  font-size: 0.78rem;
}

.board-frame {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: 32px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 236, 201, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(55, 60, 74, 0.86), rgba(68, 76, 92, 0.56));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -24px 34px rgba(11, 7, 4, 0.16);
}

.board-frame::before,
.board-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.board-frame::before {
  inset: 14px;
  border-radius: 26px;
  border: 1px solid rgba(255, 228, 176, 0.1);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  padding: 1px;
}

.board-frame::after {
  inset: auto 26px 18px 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.board-stage {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  padding-bottom: 16px;
}

.board-ambient {
  position: absolute;
  inset: 8% 6% auto;
  height: 42%;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 224, 173, 0.18), transparent 68%),
    radial-gradient(circle at 60% 60%, rgba(116, 161, 201, 0.1), transparent 72%);
  filter: blur(16px);
  pointer-events: none;
}

.board-exit {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: calc(var(--cell-size) * 2 - 10px);
  height: 18px;
  transform: translateX(-50%);
  border-radius: 0 0 20px 20px;
  background: linear-gradient(180deg, #f6d68c, #8e5629);
  color: #43220c;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 18px;
  text-align: center;
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(243, 187, 92, 0.24);
}

.board {
  position: relative;
  width: calc(var(--cell-size) * 4);
  height: calc(var(--cell-size) * 5);
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.16), transparent 18%),
    radial-gradient(circle at 80% 84%, rgba(255, 185, 110, 0.14), transparent 18%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0, rgba(255, 255, 255, 0.015) 3px, transparent 3px, transparent 7px),
    linear-gradient(160deg, #2d1d18 4%, #482a1c 52%, #6a4630 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -24px 30px rgba(0, 0, 0, 0.2),
    0 26px 52px rgba(0, 0, 0, 0.34);
}

.board::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--cell-size) - 1px),
      rgba(255, 255, 255, 0.08) calc(var(--cell-size) - 1px),
      rgba(255, 255, 255, 0.08) var(--cell-size)
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--cell-size) - 1px),
      rgba(255, 255, 255, 0.08) calc(var(--cell-size) - 1px),
      rgba(255, 255, 255, 0.08) var(--cell-size)
    );
  opacity: 0.46;
}

.board::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 34%, rgba(255, 215, 164, 0.06) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(12, 8, 5, 0.18));
  pointer-events: none;
}

.piece {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 12px 10px;
  border: none;
  border-radius: 24px;
  color: #fff9ef;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition:
    left 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.22s ease,
    box-shadow 0.22s ease,
    filter 0.22s ease;
  box-shadow:
    0 14px 24px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  z-index: 8;
}

.piece::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.24), transparent 36%),
    linear-gradient(180deg, transparent 44%, rgba(0, 0, 0, 0.08));
  pointer-events: none;
}

.piece::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -18px;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 68%);
  pointer-events: none;
}

.piece:hover {
  transform: translateY(-2px);
}

.piece.selected {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 2px rgba(255, 240, 205, 0.96),
    0 18px 32px rgba(0, 0, 0, 0.28),
    0 0 0 12px rgba(255, 219, 165, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  filter: brightness(1.08) saturate(1.04);
}

.piece-name,
.piece-role {
  position: relative;
  z-index: 1;
}

.piece-name {
  display: block;
  font-family: "STZhongsong", "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(0.96rem, 1.5vw, 1.24rem);
  letter-spacing: 0.08em;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.28);
}

.piece-role {
  display: block;
  margin-top: 6px;
  color: rgba(255, 249, 239, 0.82);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.piece.hero {
  background: linear-gradient(155deg, #e07c57, #b23828 62%, #681a17 100%);
}

.piece.horizontal {
  background: linear-gradient(155deg, #d9b25a, #a8702c 64%, #674515 100%);
}

.piece.horizontal-b {
  background: linear-gradient(155deg, #b59ed8, #6d4c92 64%, #42295f 100%);
}

.piece.horizontal-c {
  background: linear-gradient(155deg, #72b5aa, #2d6f66 64%, #194540 100%);
}

.piece.vertical-a {
  background: linear-gradient(155deg, #77a4c4, #395a74 68%, #223546 100%);
}

.piece.vertical-b {
  background: linear-gradient(155deg, #729d89, #39594b 68%, #22342d 100%);
}

.piece.vertical-c {
  background: linear-gradient(155deg, #a384c0, #654282 68%, #402953 100%);
}

.piece.vertical-d {
  background: linear-gradient(155deg, #d6a066, #905e2d 68%, #593613 100%);
}

.piece.soldier {
  background: linear-gradient(155deg, #cc715b, #86362a 68%, #511813 100%);
  border-radius: 18px;
}

.move-lane {
  position: absolute;
  z-index: 10;
  border-radius: 24px;
  pointer-events: none;
  border: 1px solid rgba(255, 228, 168, 0.18);
  background:
    linear-gradient(140deg, rgba(255, 236, 191, 0.16), rgba(255, 208, 136, 0.08)),
    radial-gradient(circle at center, rgba(255, 236, 191, 0.08), transparent 72%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 243, 216, 0.06),
    0 10px 20px rgba(25, 14, 7, 0.16);
}

.move-lane::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(255, 239, 202, 0.22);
  border-radius: 18px;
}

.move-lane.up,
.move-lane.down {
  background:
    linear-gradient(180deg, rgba(255, 226, 169, 0.16), rgba(255, 202, 130, 0.08)),
    radial-gradient(circle at center, rgba(255, 236, 191, 0.08), transparent 72%);
}

.move-lane.left,
.move-lane.right {
  background:
    linear-gradient(90deg, rgba(255, 226, 169, 0.16), rgba(255, 202, 130, 0.08)),
    radial-gradient(circle at center, rgba(255, 236, 191, 0.08), transparent 72%);
}

.move-hint {
  position: absolute;
  z-index: 18;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.move-hint:hover {
  transform: translate(-50%, -50%) scale(1.08);
  filter: brightness(1.04);
}

.move-hint-core {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #4b2a14;
  background:
    linear-gradient(145deg, rgba(255, 248, 228, 0.98), rgba(247, 206, 120, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.26),
    0 0 20px rgba(243, 186, 92, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.move-hint-core::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 22px;
  border: 1px solid rgba(255, 236, 191, 0.28);
  opacity: 0.7;
}

.move-hint-icon {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}

.move-hint-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #7f3e22, #4a1f10);
  color: #fff2da;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.24);
}

.move-hint::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 28px;
  background: radial-gradient(circle, rgba(255, 226, 169, 0.18), transparent 72%);
  animation: hint-pulse 1.7s ease-in-out infinite;
  z-index: -1;
}

.board-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.insight-card {
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 20px rgba(0, 0, 0, 0.12);
}

.insight-card:nth-child(1) {
  background:
    radial-gradient(circle at top left, rgba(98, 142, 179, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
}

.insight-card:nth-child(2) {
  background:
    radial-gradient(circle at top left, rgba(239, 194, 103, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
}

.insight-card:nth-child(3) {
  background:
    radial-gradient(circle at top left, rgba(188, 122, 84, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
}

.insight-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.insight-card strong {
  display: block;
  line-height: 1.42;
  font-size: 0.94rem;
}

.victory-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(90%, 360px);
  padding: 18px 22px;
  border-radius: 24px;
  transform: translate(-50%, -50%);
  background: linear-gradient(160deg, rgba(44, 90, 73, 0.95), rgba(21, 46, 35, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.34),
    0 0 36px rgba(118, 182, 146, 0.16);
  text-align: center;
  z-index: 26;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.victory-banner strong {
  display: block;
  margin-bottom: 8px;
  font-family: "STZhongsong", "Noto Serif SC", "Songti SC", serif;
  font-size: 1.2rem;
}

.victory-banner span {
  color: rgba(250, 242, 229, 0.86);
  line-height: 1.6;
}

.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.95);
}

.control-row,
.timeline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.control-row {
  margin-top: 16px;
}

.action-btn {
  appearance: none;
  min-height: 42px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease;
}

.action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.action-btn.primary {
  background: linear-gradient(145deg, #efc467, #d98b3f);
  color: #3b220d;
  box-shadow:
    0 14px 28px rgba(196, 131, 53, 0.34),
    0 0 24px rgba(234, 178, 82, 0.16);
}

.action-btn.accent {
  background: linear-gradient(145deg, #6f97af, #35526c);
  box-shadow:
    0 14px 28px rgba(46, 76, 101, 0.28),
    0 0 24px rgba(86, 138, 180, 0.14);
}

.action-btn.subtle {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.action-btn.wide {
  flex: 1 1 140px;
}

.status-message,
.solver-message {
  margin: 14px 2px 0;
  min-height: 2.8em;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 0.95rem;
}

.range-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-faint);
  font-size: 0.9rem;
}

.timeline-range {
  width: 100%;
  margin: 0 0 12px;
  accent-color: var(--gold);
}

.history-list {
  display: grid;
  gap: 8px;
  flex: 1;
  min-height: 0;
  margin-top: 14px;
  padding-right: 4px;
  overflow: auto;
  mask-image: linear-gradient(180deg, transparent 0, black 18px, black calc(100% - 18px), transparent 100%);
}

.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.history-item:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.14);
}

.history-item.active {
  border-color: rgba(240, 196, 109, 0.42);
  background: linear-gradient(145deg, rgba(240, 196, 109, 0.16), rgba(255, 255, 255, 0.06));
}

.history-item:disabled {
  cursor: not-allowed;
}

.history-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.04);
  color: var(--gold);
  font-weight: 800;
  flex-shrink: 0;
}

.history-meta {
  flex: 1;
  min-width: 0;
}

.history-title {
  margin: 0 0 3px;
  font-weight: 700;
  font-size: 0.94rem;
}

.history-subtitle {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.8rem;
}

.solution-summary {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  line-height: 1.68;
}

.tips-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 0.94rem;
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@media (max-width: 1320px) {
  :root {
    --cell-size: clamp(56px, 4.8vw, 74px);
  }

  .workspace {
    grid-template-columns: minmax(270px, 0.9fr) minmax(470px, 1.08fr) minmax(280px, 0.9fr);
  }

  .hero-copy h1 {
    font-size: clamp(1.9rem, 2.7vw, 3.2rem);
  }
}

@media (max-height: 820px) {
  :root {
    --cell-size: clamp(52px, 4.4vw, 68px);
  }

  .app-shell {
    padding: 12px;
  }

  .workspace {
    height: calc(100vh - 24px);
  }

  .intro-panel,
  .board-panel,
  .timeline-panel,
  .solver-panel,
  .help-panel {
    padding: 16px;
  }

  .hero-copy h1 {
    font-size: clamp(1.7rem, 2.5vw, 2.8rem);
  }

  .hero-text {
    font-size: 0.9rem;
    line-height: 1.68;
  }
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: auto;
    padding: 18px 14px 22px;
  }

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

  .workspace::before {
    display: none;
  }

  .left-rail,
  .right-rail {
    grid-template-rows: auto;
  }

  .hero-badges {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 860px) {
  .hero-badges,
  .board-insights {
    grid-template-columns: 1fr;
  }

  .mode-option {
    padding: 12px 14px;
  }

  .intro-panel,
  .board-panel,
  .timeline-panel,
  .solver-panel,
  .help-panel {
    padding: 16px;
  }

  .move-hint-core {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 560px) {
  body {
    overflow: auto;
  }

  .app-shell {
    padding-inline: 12px;
  }

  .board-frame {
    padding: 12px;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-step {
    width: 38px;
    height: 38px;
  }

  .action-btn.wide {
    flex-basis: 100%;
  }
}
