/* 拆站 CHAIZHAN —— 宣纸、朱砂、墨 */

:root {
  --rice: #f3ece0;
  --rice-deep: #e9e0cf;
  --ink: #1b1613;
  --ink-soft: #4a423b;
  --zhu: #c8321f;
  --zhu-deep: #a32414;
  --dai: #3d4a4a;
  --zhe: #8a6a4a;
  --jin: #e8b34a;
  --line: rgba(27, 22, 19, 0.16);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--rice);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.32;
  background-image:
    repeating-linear-gradient(0deg, rgba(27, 22, 19, 0.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(27, 22, 19, 0.028) 0 1px, transparent 1px 4px);
  mix-blend-mode: multiply;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------- 启动页 */

.landing {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 40px) 96px;
  text-align: center;
  position: relative;
}

.seal {
  width: 56px; height: 56px;
  margin: 0 auto 22px;
  background: var(--zhu);
  color: #fff8ee;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 56px;
  border-radius: 6px;
  letter-spacing: 0;
  box-shadow: 0 2px 0 var(--zhu-deep), 0 6px 18px rgba(200, 50, 31, 0.28);
  transform: rotate(-4deg);
  user-select: none;
}
.seal.small {
  width: 42px; height: 42px; font-size: 22px; line-height: 42px;
  margin-bottom: 12px; transform: rotate(3deg);
}

.title {
  font-family: var(--serif);
  font-size: clamp(48px, 12vw, 92px);
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 8px;
  text-indent: 0.16em;
  color: var(--ink);
}

.subtitle {
  margin: 0 0 34px;
  font-family: var(--serif);
  font-size: clamp(15px, 2.4vw, 19px);
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--ink-soft);
}

.go {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 18px;
}

.go input {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  font-size: 15px;
  font-family: var(--sans);
  color: var(--ink);
  background: rgba(255, 252, 245, 0.9);
  border: 1.5px solid var(--line);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.go input::placeholder { color: rgba(27, 22, 19, 0.35); }
.go input:focus {
  border-color: var(--zhu);
  box-shadow: 0 0 0 3px rgba(200, 50, 31, 0.12);
}

.go button {
  padding: 14px 30px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: #fff8ee;
  background: var(--zhu);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 2px 0 var(--zhu-deep);
}
.go button:hover { background: var(--zhu-deep); }
.go button:active { transform: translateY(2px); box-shadow: none; }

/* ---- 靶场 ---- */

.ranges {
  max-width: 800px;
  margin: 38px auto 0;
}

.ranges-hd {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 13px;
  text-align: left;
}
.ranges-hd h2 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
}
.ranges-hd h2::before {
  content: "";
  display: inline-block;
  width: 4px; height: 13px;
  margin-right: 9px;
  vertical-align: -1px;
  background: var(--zhu);
}
.ranges-hd span {
  font-size: 12px;
  color: rgba(27, 22, 19, 0.44);
  letter-spacing: 0.04em;
}

.range-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 700px) {
  .range-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 470px) {
  .range-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.chip {
  padding: 6px 14px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink-soft);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-style: solid; border-color: var(--zhu); color: var(--zhu); }

/* 靶场卡片：盖掉 chip 的胶囊样式 */
.chip.range {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 7px 7px 11px;
  background: rgba(255, 252, 245, 0.55);
  border: 1px solid var(--line);
  border-radius: 5px;
  text-align: left;
}
.chip.range:hover {
  color: inherit;
  border-color: var(--zhu);
  background: rgba(255, 252, 245, 0.96);
  transform: translateY(-2px);
  box-shadow: 0 9px 22px rgba(60, 40, 20, 0.11);
}
.chip.range b {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin: 9px 3px 3px;
}
.chip.range small {
  font-size: 11px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
  color: rgba(27, 22, 19, 0.46);
  margin: 0 3px;
}

/* ---- 缩略图：纯 CSS 画的版式骨架 ---- */

.thumb {
  position: relative;
  display: block;
  height: 68px;
  border-radius: 3px;
  background: #fdfcf9;
  border: 1px solid rgba(27, 22, 19, 0.1);
  overflow: hidden;
}
.thumb::before,
.thumb::after,
.thumb i {
  content: "";
  position: absolute;
  display: block;
}

/* 图文志：标题 + 三张卡 + 正文线 */
.t-demo i {
  left: 9px; right: 9px; top: 8px; height: 6px; border-radius: 2px;
  background: rgba(27, 22, 19, 0.32);
}
.t-demo::before {
  left: 9px; top: 24px; width: 22px; height: 20px; border-radius: 2px;
  background: rgba(61, 74, 74, 0.2);
  box-shadow: 27px 0 0 rgba(61, 74, 74, 0.2), 54px 0 0 rgba(61, 74, 74, 0.2);
}
.t-demo::after {
  left: 9px; right: 9px; bottom: 7px; height: 10px;
  background: repeating-linear-gradient(to bottom, rgba(27, 22, 19, 0.12) 0 2px, transparent 2px 6px);
}

/* 简历：左侧竖栏 + 右面条目 */
.t-resume i {
  left: 8px; top: 7px; bottom: 7px; width: 25px; border-radius: 2px;
  background: rgba(44, 74, 94, 0.13);
}
.t-resume::before {
  left: 40px; right: 12px; top: 8px; height: 5px; border-radius: 2px;
  background: rgba(44, 74, 94, 0.4);
  box-shadow: 0 11px 0 -1px rgba(44, 74, 94, 0.22), 0 22px 0 -1px rgba(44, 74, 94, 0.22);
}
.t-resume::after {
  left: 40px; right: 9px; bottom: 8px; height: 14px;
  background: repeating-linear-gradient(to bottom, rgba(27, 22, 19, 0.11) 0 2px, transparent 2px 7px);
}

/* 落地页：顶部大色块 + 三档价格 */
.t-launch::before {
  left: 8px; right: 8px; top: 7px; height: 24px; border-radius: 2px;
  background: linear-gradient(135deg, rgba(240, 136, 60, 0.5), rgba(228, 99, 42, 0.55));
}
.t-launch i {
  left: 9px; bottom: 8px; width: 20px; height: 22px; border-radius: 2px;
  background: rgba(26, 26, 26, 0.1);
  box-shadow: 25px 0 0 rgba(26, 26, 26, 0.1), 50px 0 0 rgba(26, 26, 26, 0.1);
}
.t-launch::after {
  left: 9px; right: 9px; top: 37px; height: 2px;
  background: rgba(26, 26, 26, 0.12);
  box-shadow: 0 6px 0 rgba(26, 26, 26, 0.12);
}

/* 长文：居中窄栏 + 首字色块 */
.t-essay i {
  left: 13px; top: 9px; width: 11px; height: 11px; border-radius: 1px;
  background: rgba(163, 36, 20, 0.5);
}
.t-essay::before {
  left: 30px; right: 12px; top: 9px; height: 4px; border-radius: 2px;
  background: rgba(27, 22, 19, 0.34);
}
.t-essay::after {
  left: 12px; right: 12px; top: 26px; bottom: 9px;
  background: repeating-linear-gradient(to bottom, rgba(27, 22, 19, 0.12) 0 2px, transparent 2px 8px);
}

/* 说明书：居中卡片 + 表格横线 */
.t-about::before {
  left: 20px; right: 20px; top: 8px; height: 7px; border-radius: 2px;
  background: rgba(200, 50, 31, 0.42);
}
.t-about i {
  left: 20px; right: 20px; top: 22px; bottom: 8px;
  background: repeating-linear-gradient(to bottom, rgba(27, 22, 19, 0.1) 0 1px, transparent 1px 9px);
  border-top: 1px solid rgba(27, 22, 19, 0.12);
}
.t-about::after {
  left: 20px; width: 1px; top: 22px; bottom: 8px;
  background: rgba(27, 22, 19, 0.12);
}

.ranges-foot {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.95;
  color: rgba(27, 22, 19, 0.44);
  text-align: left;
  letter-spacing: 0.02em;
}

.err {
  margin: 12px auto 0;
  max-width: 560px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--zhu-deep);
  background: rgba(200, 50, 31, 0.07);
  border-left: 3px solid var(--zhu);
  border-radius: 3px;
  text-align: left;
}

.how, .legal {
  margin-top: 56px;
  text-align: left;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.how h2, .legal h2 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0 0 14px;
  color: var(--ink);
}
.how h2::before, .legal h2::before {
  content: "";
  display: inline-block;
  width: 4px; height: 15px;
  margin-right: 9px;
  vertical-align: -2px;
  background: var(--zhu);
}

.how ul { margin: 0; padding-left: 20px; }
.how li { font-size: 14px; line-height: 2; color: var(--ink-soft); }
.how b {
  display: inline-block;
  min-width: 2.2em;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink);
}

.legal p {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.legal strong { color: var(--zhu-deep); font-weight: 600; }

/* ---------------------------------------------------------- 游戏区 */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--rice-deep);
  touch-action: none;
}

.layer { position: absolute; top: 0; left: 0; }

.back { z-index: 1; }

.page {
  z-index: 2;
  border: 0;
  background: transparent;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}

.fx {
  z-index: 3;
  cursor: none;
  width: 100%;
  height: 100%;
}

/* ---- HUD ---- */

.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(243, 236, 224, 0.92), rgba(243, 236, 224, 0));
}
.hud > * { pointer-events: auto; }

.hud-left { display: flex; align-items: center; gap: 14px; }

.brand {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink);
  padding: 2px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  user-select: none;
}

.progress-wrap { display: flex; align-items: center; gap: 8px; }

.progress-bar {
  width: clamp(90px, 22vw, 220px);
  height: 8px;
  background: rgba(27, 22, 19, 0.1);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.progress-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--zhe), var(--zhu));
  transition: width 0.18s ease-out;
}

#progress-text {
  font-family: var(--sans);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  min-width: 34px;
}

.hud-right { display: flex; align-items: center; gap: 8px; }

.weapon {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 4px;
  user-select: none;
}
.weapon b {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--ink);
  line-height: 1.2;
}
.weapon small { font-size: 11px; color: rgba(27, 22, 19, 0.5); }

.icon-btn {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink-soft);
  background: rgba(255, 252, 245, 0.85);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--zhu); border-color: var(--zhu); }

/* ---- 覆盖层 ---- */

.loading, .pause-note, .cleared {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(243, 236, 224, 0.9);
  backdrop-filter: blur(2px);
}
.loading[hidden], .pause-note[hidden], .cleared[hidden] { display: none; }

.loading-inner { text-align: center; }

.spinner {
  width: 34px; height: 34px;
  margin: 0 auto 18px;
  border: 3px solid rgba(200, 50, 31, 0.18);
  border-top-color: var(--zhu);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading p {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0;
}

/* ---- 整页位置条 ---- */

.rail {
  position: absolute;
  right: 9px;
  top: 98px;
  bottom: 30px;
  width: 3px;
  z-index: 20;
  background: rgba(27, 22, 19, 0.12);
  border-radius: 2px;
  pointer-events: none;
}
.rail[hidden] { display: none; }
.rail i {
  position: absolute;
  left: -1px;
  width: 5px;
  border-radius: 3px;
  background: var(--zhu);
  box-shadow: 0 0 0 2px rgba(243, 236, 224, 0.8);
  will-change: transform;
}

/* ---- 开场提示 ---- */

.hint {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 25;
  pointer-events: none;
  animation: hint-in 0.45s ease-out both;
}
.hint[hidden] { display: none; }
.hint.out { animation: hint-out 0.45s ease-in forwards; }
.hint-inner {
  background: rgba(243, 236, 224, 0.94);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 15px 24px 13px;
  box-shadow: 0 10px 28px rgba(27, 22, 19, 0.16);
}
.hint-title {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--zhu-deep);
  margin: 0 0 9px;
}
.hint-keys {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  max-width: 520px;
}
.hint-keys li {
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.hint-keys kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  margin-right: 3px;
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--ink);
  background: #fffaf0;
  border: 1px solid rgba(27, 22, 19, 0.28);
  border-bottom-width: 2px;
  border-radius: 3px;
}
.hint-go {
  margin: 9px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: rgba(74, 66, 59, 0.68);
}
@keyframes hint-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes hint-out {
  to { opacity: 0; transform: translate(-50%, 8px); }
}
@media (max-width: 620px) {
  .hint-keys { max-width: 74vw; }
  .hint { bottom: 18px; }
}

.pause-note div, .cleared-inner {
  text-align: center;
  background: var(--rice);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 30px 46px;
  box-shadow: 0 12px 36px rgba(27, 22, 19, 0.14);
}
.pause-note h3, .cleared h3 {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  margin: 0 0 8px;
  color: var(--ink);
}
.pause-note p, .cleared p {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
}

.btn {
  margin-top: 20px;
  padding: 11px 26px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: #fff8ee;
  background: var(--zhu);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--zhu-deep);
  transition: background 0.15s;
}
.btn:hover { background: var(--zhu-deep); }

/* ---- 小屏提示 ---- */

@media (hover: none) and (pointer: coarse) {
  .go, .examples, .how { display: none; }
  .landing::after {
    content: "拆站需要键盘和鼠标，请换到电脑上打开。";
    display: block;
    margin-top: 40px;
    padding: 18px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--ink-soft);
    border: 1px dashed var(--line);
    border-radius: 4px;
  }
}
