/* ==========================================================================
 * 悠然人生 · 像素风主题
 * --------------------------------------------------------------------------
 * 设计要点：
 *   1. 全部使用 CSS 变量，改 :root 就能整体换色（亮/暗主题靠 [data-theme] 切换）
 *   2. 卡片和按钮用硬边框 + 多层 box-shadow 模拟「方块」的立体像素感
 *   3. 不加载任何外部字体/图片，打开即用，Cloudflare Pages 直接托管
 * ========================================================================== */

/* ------------------------------- 主题变量 ------------------------------- */
:root {
  color-scheme: dark;

  --bg: #10161c;
  --bg-alt: #0b1015;
  --surface: #1b242d;
  --surface-2: #232f3a;
  --surface-3: #2c3a47;

  --border: #0a0e12;
  --border-soft: #38495a;

  --text: #eef3f7;
  --text-dim: #a3b3c2;
  --text-mute: #74889a;

  --red: #ef5350;
  --red-dark: #a93026;
  --red-lite: #ff8a80;
  --dirt: #8c6644;
  --stone: #8f9aa6;
  --gold: #f2c349;
  --diamond: #4fd4dc;
  --redstone: #ff6e62;
  --nether: #b04a6f;

  --shadow: 5px 5px 0 rgba(0, 0, 0, 0.45);
  --shadow-sm: 3px 3px 0 rgba(0, 0, 0, 0.4);
  --inset: inset 0 -4px 0 rgba(0, 0, 0, 0.22);

  /* 动效参数（全站共用同一套平滑曲线） */
  --ease: cubic-bezier(0.22, 0.73, 0.31, 1);
  --ease-spring: cubic-bezier(0.4, 1.4, 0.5, 1);
  --dur-fast: 0.15s;
  --dur: 0.22s;
  --dur-slow: 0.35s;

  --radius: 3px;
  --maxw: 1140px;
  --gap: 22px;

  --font-body: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
    system-ui, -apple-system, sans-serif;
  --font-pixel: "Press Start 2P", "Silkscreen", "Segoe UI", "Microsoft YaHei",
    "PingFang SC", system-ui, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #e8eee6;
  --bg-alt: #dbe4d6;
  --surface: #f7faf6;
  --surface-2: #eaf0e6;
  --surface-3: #dde6d8;

  --border: #4a5a44;
  --border-soft: #b6c4ae;

  --text: #1b241c;
  --text-dim: #47543f;
  --text-mute: #6c7a63;

  --red: #c62828;
  --red-dark: #8e1c1c;
  --red-lite: #ef5350;
  --gold: #c99a1c;

  --shadow: 5px 5px 0 rgba(74, 90, 68, 0.35);
  --shadow-sm: 3px 3px 0 rgba(74, 90, 68, 0.3);
  --inset: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

/* --------------------------------- 基础 --------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background-color: var(--bg);
  /* 像素网格背景：模拟地块纹理 */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 32px 32px;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red-lite);
  text-decoration: none;
}

a:hover {
  color: var(--gold);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-pixel);
  line-height: 1.5;
  letter-spacing: 0.02em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.5rem, 4.4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.15rem, 2.9vw, 1.7rem);
}

h3 {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}

p {
  margin: 0 0 1em;
  /* 中文长句排版：尽量避免末行只剩一两个字，读起来更顺 */
  text-wrap: pretty;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

li {
  margin-bottom: 0.45em;
}

li::marker {
  color: var(--red);
}

code,
kbd {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
  background: var(--surface-3);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1px 6px;
  color: var(--gold);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

::selection {
  background: var(--red);
  color: #0b1015;
}

/* 无障碍：仅屏幕阅读器可见 */
.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;
}

/* 跳转到主内容（键盘用户） */
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 200;
  background: var(--red);
  color: #0b1015;
  font-weight: 700;
  padding: 10px 16px;
  border: 3px solid var(--border);
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* -------------------------------- 布局 --------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}

.section {
  padding: 58px 0;
}

.section--alt {
  background: var(--bg-alt);
  border-top: 3px solid var(--border);
  border-bottom: 3px solid var(--border);
}

.section__head {
  margin-bottom: 30px;
}

.section__head p {
  color: var(--text-dim);
  margin: 0;
  max-width: 70ch;
}

.section__eyebrow {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}

.grid {
  display: grid;
  gap: var(--gap);
}

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

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

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: calc(var(--gap) * 1.5);
  align-items: start;
}

/* -------------------------------- 卡片 --------------------------------- */
.card {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card--flat {
  box-shadow: none;
}

.card--hover:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.45);
}

.card__icon {
  font-size: 1.9rem;
  line-height: 1;
  margin-bottom: 12px;
  display: block;
}

.card h3 {
  margin-bottom: 0.4em;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card__text {
  color: var(--text-dim);
  margin: 0;
}

/* 卡片顶部红石装饰条 */
.card--stripe {
  position: relative;
  overflow: hidden;
}

.card--stripe::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 8px,
    var(--red-dark) 8px 16px
  );
}

/* -------------------------------- 按钮 --------------------------------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-edge: rgba(0, 0, 0, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  padding: 13px 20px;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--btn-edge), var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: transform 0.08s var(--ease), box-shadow 0.08s var(--ease), filter var(--dur) var(--ease);
}

.btn:hover {
  color: var(--btn-fg);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--btn-edge), 1px 1px 0 rgba(0, 0, 0, 0.35);
}

.btn--primary {
  --btn-bg: var(--red);
  --btn-fg: #ffffff;
  --btn-edge: var(--red-dark);
}

.btn--gold {
  --btn-bg: var(--gold);
  --btn-fg: #241c05;
  --btn-edge: #b98d18;
}

.btn--ghost {
  --btn-bg: transparent;
  box-shadow: none;
}

.btn--sm {
  font-size: 0.68rem;
  padding: 9px 14px;
}

.btn--block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
}

/* ------------------------------ 导航栏 --------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(16, 22, 28, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 4px solid var(--border);
}

[data-theme="light"] .nav {
  background: rgba(232, 238, 230, 0.95);
}

/* 页面滚动后给导航一点下沉感，配合 app.js 里设置的 data-scrolled */
.nav[data-scrolled="true"] {
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 0.92rem;
  white-space: nowrap;
}

.brand:hover {
  color: var(--red-lite);
}

/* 纯 CSS 像素红石方块 logo */
.brand__logo {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background:
    linear-gradient(var(--red) 0 42%, var(--red-dark) 42% 100%);
  background-image:
    /* 顶部高光 */
    linear-gradient(var(--red-lite) 0 10%, transparent 10%),
    /* 中间一道暗纹，模拟红石块的分块质感 */
    linear-gradient(90deg, transparent 30%, rgba(0, 0, 0, 0.22) 30% 62%, transparent 62%),
    /* 红石块本体：上亮下暗 */
    linear-gradient(var(--red) 0 42%, var(--red-dark) 42% 100%);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  list-style: none;
  padding: 0;
}

.nav__links li {
  margin: 0;
}

.nav__link {
  display: block;
  padding: 9px 12px;
  color: var(--text-dim);
  font-size: 0.94rem;
  font-weight: 600;
  border: 3px solid transparent;
  border-radius: var(--radius);
}

.nav__link:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav__link[aria-current="page"] {
  color: var(--red-lite);
  background: var(--surface-2);
  border-color: var(--border);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.25rem;
  background: var(--surface-2);
  color: var(--text);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

/* ------------------------------- 状态徽章 ------------------------------- */
/* 注意：服务器状态模块已从页面移除（导航徽章 + 首页实时状态面板），
   以下 .status / .panel / .stat-grid 规则目前已无元素使用，保留以便日后恢复。
   要恢复的话，把 HTML 里的 data-status 元素加回去、并让 config.server.statusApi 指向可用接口即可。 */
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 11px;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  white-space: nowrap;
}

.status__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-mute);
  flex: 0 0 9px;
}

.status[data-state="online"] {
  color: var(--red-lite);
}

.status[data-state="online"] .status__dot {
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.6);
  animation: pulse 2s infinite;
}

.status[data-state="offline"] {
  color: var(--redstone);
}

.status[data-state="offline"] .status__dot {
  background: var(--redstone);
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(239, 83, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 83, 80, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------- Hero -------------------------------- */
.hero {
  position: relative;
  padding: 76px 0 66px;
  overflow: hidden;
  border-bottom: 4px solid var(--border);
  background:
    radial-gradient(1100px 420px at 78% -8%, rgba(239, 83, 80, 0.16), transparent 62%),
    radial-gradient(760px 380px at 8% 108%, rgba(79, 212, 220, 0.12), transparent 66%),
    var(--bg-alt);
}

/* 地平线式的方块装饰带 */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  opacity: 0.5;
  background: repeating-linear-gradient(
    90deg,
    var(--red) 0 20px,
    var(--red-dark) 20px 40px,
    var(--stone) 40px 60px
  );
}

.hero__grid {
  display: grid;
  /* 已移除右侧实时状态面板，改为单列内容并水平居中 */
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
  gap: 0;
  align-items: center;
}

.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.hero h1 {
  margin-bottom: 0.5em;
}

.hero h1 em {
  font-style: normal;
  color: var(--red-lite);
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.hero__lead {
  font-size: 1.06rem;
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 26px;
}

/* IP 复制框 */
.ipbox {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.ipbox__field {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 12px;
  background: var(--bg);
  border: 3px solid var(--border-soft);
  border-radius: var(--radius);
}

.ipbox__label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  font-family: var(--font-pixel);
}

.ipbox__value {
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--red-lite);
  word-break: break-all;
  user-select: all;
}

.ipbox__hint {
  font-size: 0.85rem;
  color: var(--text-mute);
  margin: 0;
}

/* 右侧统计面板（服务器状态模块已移除，当前无元素使用，保留备用） */
.panel {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface-2);
  border-bottom: 3px solid var(--border);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat {
  padding: 18px 16px;
  border-right: 3px solid var(--border);
  border-bottom: 3px solid var(--border);
}

.stat:nth-child(2n) {
  border-right: 0;
}

.stat:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.stat__value {
  font-family: var(--font-pixel);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  color: var(--red-lite);
  line-height: 1.3;
}

/* 「稳定运行」实时计时器：天数字大一点，时分秒小一点，等宽数字防跳动 */
.since {
  display: inline-block;
  font-family: var(--font-pixel);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
  font-size: clamp(0.95rem, 2vw, 1.25rem);
  line-height: 1.5;
}

.since__days {
  font-size: 1.35em;
  color: var(--red-lite);
}

.since__hms {
  color: var(--text-dim);
  font-size: 0.85em;
  margin-left: 0.1em;
}

.stat__label {
  font-size: 0.82rem;
  color: var(--text-mute);
}

.panel__foot {
  padding: 13px 16px;
  background: var(--bg-alt);
  border-top: 3px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-mute);
}

/* ------------------------------ 步骤 / 时间线 ------------------------------ */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--gap);
}

.step {
  position: relative;
  padding: 20px 20px 20px 76px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: #ffffff;
  background: var(--red);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.step h3 {
  margin-bottom: 0.35em;
}

.step p {
  margin: 0;
  color: var(--text-dim);
}

/* -------------------------------- 玩法卡 -------------------------------- */
.mode {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.mode__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mode__icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.mode__title {
  margin: 0;
}

.tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  background: var(--surface-3);
  border: 2px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-dim);
}

.tag--red {
  background: var(--red);
  border-color: var(--red-dark);
  color: #ffffff;
}

.tag--gold {
  background: var(--gold);
  border-color: #b98d18;
  color: #241c05;
}

.tag--diamond {
  background: var(--diamond);
  border-color: #2c8f96;
  color: #06282b;
}

/* 勾选列表 */
.checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 9px;
}

.checks li {
  position: relative;
  padding-left: 28px;
  margin: 0;
  color: var(--text-dim);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 13px;
  height: 13px;
  background: var(--red);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

/* ------------------------------- 新闻列表 ------------------------------- */
/* 注：首页公告改用「单条富卡片」形式（见文件末尾的 .ann 系列样式），
   这套列表式新闻样式目前没有元素使用，保留备用：
   日后要做多条公告列表，把 <ul class="news" data-list="news"
   data-list-template="#tpl-news"></ul> 和对应模板加回页面即可。 */
.news {
  display: grid;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.news__item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-left-width: 6px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: 0;
}

.news__item[data-pinned="true"] {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, rgba(242, 195, 73, 0.1), transparent 40%), var(--surface);
}

.news__date {
  font-family: Consolas, monospace;
  font-size: 0.86rem;
  color: var(--text-mute);
  padding-top: 3px;
}

.news__title {
  margin: 0 0 0.35em;
  font-size: 1rem;
}

.news__text {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* --------------------------------- 表格 -------------------------------- */
.table-wrap {
  overflow-x: auto;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

th,
td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 3px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-family: var(--font-pixel);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: var(--surface-2);
}

td code {
  white-space: nowrap;
}

/* --------------------------------- FAQ --------------------------------- */
details {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0;
  margin-bottom: 12px;
}

summary {
  cursor: pointer;
  padding: 15px 18px;
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+";
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #ffffff;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
}

details[open] summary::before {
  content: "−";
}

details[open] summary {
  color: var(--red-lite);
  border-bottom: 3px solid var(--border);
}

details p {
  padding: 15px 18px;
  margin: 0;
  color: var(--text-dim);
}

/* ------------------------------- 页内导航 ------------------------------- */
.pagehead {
  padding: 46px 0 34px;
  background: var(--bg-alt);
  border-bottom: 4px solid var(--border);
  background-image:
    radial-gradient(760px 320px at 88% -20%, rgba(239, 83, 80, 0.14), transparent 60%);
}

.pagehead h1 {
  margin-bottom: 0.4em;
}

.pagehead p {
  color: var(--text-dim);
  margin: 0;
  max-width: 66ch;
}

.crumb {
  font-size: 0.86rem;
  color: var(--text-mute);
  margin-bottom: 14px;
}

.crumb a {
  color: var(--text-dim);
}

/* 锚点小节标题 */
.subhead {
  margin-top: 46px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--border);
}

.subhead:first-child {
  margin-top: 0;
}

/* ------------------------------- 提示条 ------------------------------- */
.notice {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-left-width: 6px;
  border-left-color: var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  color: var(--text-dim);
}

.notice__icon {
  font-size: 1.3rem;
  line-height: 1.3;
}

.notice strong {
  color: var(--text);
}

.notice p:last-child {
  margin: 0;
}

/* ------------------------------ 指令列表 ------------------------------ */
.cmdlist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.cmdlist li {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 12px 16px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  margin: 0;
}

.cmdlist code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--red-lite);
  font-weight: 700;
}

/* ------------------------------- Toast ------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 140%);
  z-index: 300;
  padding: 13px 22px;
  font-family: var(--font-pixel);
  font-size: 0.75rem;
  color: #ffffff;
  background: var(--red);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.toast[data-show="true"] {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast[data-variant="error"] {
  background: var(--redstone);
  color: #fff;
}

/* -------------------------------- 页脚 -------------------------------- */
.footer {
  margin-top: 0;
  padding: 46px 0 30px;
  background: var(--bg-alt);
  border-top: 4px solid var(--border);
  color: var(--text-dim);
  font-size: 0.92rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer h4 {
  font-size: 0.72rem;
  color: var(--text);
  margin-bottom: 0.9em;
  letter-spacing: 0.08em;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin-bottom: 0.5em;
}

.footer a {
  color: var(--text-dim);
}

.footer a:hover {
  color: var(--red-lite);
}

.footer__about p {
  max-width: 44ch;
  color: var(--text-mute);
}

.footer__bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 3px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-mute);
}

/* ------------------------------- 响应式 ------------------------------- */
@media (max-width: 1000px) {
  .footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero__grid,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .nav__toggle {
    display: block;
    margin-left: auto;
  }

  .nav__links {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 12px 18px 18px;
    background: var(--bg-alt);
    border-bottom: 4px solid var(--border);
    display: none;
  }

  .nav__links[data-open="true"] {
    display: flex;
  }

  .nav__link {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .nav__actions .status {
    display: none;
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 84px;
  }

  body {
    font-size: 15.5px;
  }

  .section {
    padding: 42px 0;
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news__item {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .cmdlist li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .step {
    padding: 18px 18px 18px 18px;
  }

  .step::before {
    position: static;
    margin-bottom: 12px;
  }

  .footer__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .btn-row .btn {
    width: 100%;
  }
}

/* --------------------------- 图片展示 + 灯箱 --------------------------- */

/* 图片卡片：悬停上浮 + 阴影，模拟像素风卡片质感 */
.gallery__item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.gallery__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

/* 按钮化整张图为可点击区域，方便键盘聚焦与无障碍 */
.gallery__btn {
  display: block;
  border: 0;
  background: none;
  padding: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.gallery__btn:focus-visible {
  outline: 2px solid var(--red-lite);
  outline-offset: 2px;
}

.gallery__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-spring);
}
.gallery__item:hover .gallery__img {
  transform: scale(1.04);
}

/* 图片底部渐变遮罩 + 标题/标签 */
.gallery__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 16px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .2) 60%, transparent);
  color: #fff;
}
.gallery__title {
  font-size: 1.05rem;
  margin: 0 0 2px;
}
.gallery__caption {
  font-size: .82rem;
  margin: 0;
  color: rgba(255, 255, 255, .85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 灯箱：点击图片后全屏放大查看 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .92);
  padding: 24px;
  animation: fadeIn .2s ease;
}
.lightbox__close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  opacity: .85;
  line-height: 1;
}
.lightbox__close:hover { opacity: 1; }
.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.lightbox__meta {
  max-width: 720px;
  margin: 18px auto 0;
  text-align: center;
  color: #fff;
}
.lightbox__title {
  font-size: 1.25rem;
  margin: 0 0 6px;
}
.lightbox__caption {
  font-size: .9rem;
  color: rgba(255, 255, 255, .8);
  margin: 0;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --------------------------- 独特玩法卡片 --------------------------- */
/* 截图在上、文字在下的卡片：截图本身是游戏界面，文字盖在图上会挡住内容，所以放在图外 */
.playcard {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.playcard:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.45);
}
.playcard__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}
.playcard__btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
.playcard__btn img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-spring);
}
.playcard:hover .playcard__btn img {
  transform: scale(1.03);
}
.playcard__meta {
  padding: 14px 16px 18px;
}
.playcard__title {
  font-size: 1.05rem;
  margin: 10px 0 0;
}
.playcard__text {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin: 6px 0 0;
}

/* --------------------------- 动效平滑（补充层） --------------------------- */
/*
 * 全站动效微调，统一走 :root 里的 --ease / --dur 变量。
 * 注意：这里只给「原本没有 transition」的元素补过渡；
 *       已经有 transition 的元素（.card / .btn / .gallery__item / .toast）
 *       保持原样不动，否则会把它们的位移过渡整个覆盖掉。
 */

/* 导航栏滚动阴影：配合 app.js 的 data-scrolled，淡入淡出而不是硬切 */
.nav {
  transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

/* 主题切换 / 链接悬停：底色和文字颜色柔化过渡，避免生硬跳变 */
body,
.footer,
.hero,
.section,
.step,
.stat,
.brand,
.nav__link,
.tag,
a {
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

/* 滚动渐入：配合 app.js 的 IntersectionObserver，进入视口时淡入并轻微上浮 */
/*
 * 隐藏态用 :not(.is-visible) 声明，而不是给 .is-visible 写死 transform。
 * 因为 .reveal.is-visible 和 .card--hover:hover 特异性相同（0-2-0），
 * 若后者写死 transform: translateY(0) 会把卡片悬停上浮的效果压掉。
 * 这样写的话，is-visible 一加上 transform 就回落到元素自身的规则，hover 照常生效。
 */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  }
  .reveal:not(.is-visible) {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* 滚动条：更轻薄，配合整体清爽感 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-alt);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border: 2px solid var(--bg-alt);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--red-dark);
}

/* ==========================================================================
 * 质感与表现增强（追加层）
 * --------------------------------------------------------------------------
 * 在不改主题变量、不引外部资源的前提下提升整体质感：
 *   1. 全站胶片颗粒噪点 + 背景色晕，让纯色底不再「平」
 *   2. 卡片/方块加立体切面（顶部高光 + 底部压暗）与悬停红石辉光
 *   3. 红石装饰条走动、按钮流光、首屏漂浮像素方块等小动效
 *   4. 滚动进度条 + 回到顶部按钮
 * 系统开启「减少动效」时，前面已有的全局规则会自动把所有动画停用。
 * ========================================================================== */

/* --------------------- 1. 全局质感：背景色晕 + 胶片颗粒 --------------------- */
body {
  background-size: auto, auto, 32px 32px, 32px 32px;
  background-image:
    radial-gradient(1200px 640px at 85% -8%, rgba(239, 83, 80, 0.055), transparent 60%),
    radial-gradient(900px 560px at 4% 112%, rgba(79, 212, 220, 0.05), transparent 62%),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
}

/* 胶片颗粒：全屏极淡噪点（内联 SVG，无外部资源），盖在一切之上但不挡点击 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------- 2. 卡片立体切面 + 悬停辉光 --------------------- */
.card {
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -7px 0 rgba(0, 0, 0, 0.2);
}

/* 平卡不受立体切面影响（玩法页的服务端模组分组卡） */
.card--flat {
  box-shadow: none;
}

.card--hover:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    9px 9px 0 rgba(0, 0, 0, 0.45),
    0 0 26px rgba(239, 83, 80, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -7px 0 rgba(0, 0, 0, 0.18);
}

/* 步骤卡、玩法截图卡、IP 复制框同样补上切面，保持全站统一 */
.step,
.playcard,
.ipbox {
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -7px 0 rgba(0, 0, 0, 0.2);
}

.playcard:hover {
  transform: translate(-2px, -2px);
  box-shadow:
    9px 9px 0 rgba(0, 0, 0, 0.45),
    0 0 26px rgba(239, 83, 80, 0.14);
}

/* --------------------- 3. 红石装饰条：走动动画 --------------------- */
.card--stripe::before {
  background-size: 16px 100%;
  animation: stripeWalk 0.9s linear infinite;
}

@keyframes stripeWalk {
  to {
    background-position: 16px 0;
  }
}

/* --------------------- 4. 按钮：悬停流光 --------------------- */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}

.btn:hover::after {
  animation: btnSheen 0.55s var(--ease);
}

@keyframes btnSheen {
  from {
    left: -70%;
  }
  to {
    left: 130%;
  }
}

/* --------------------- 5. 图标方块槽（物品栏质感） --------------------- */
.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  font-size: 1.5rem;
  line-height: 1;
  background: var(--surface-2);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* --------------------- 6. 标题区点缀 --------------------- */
.section__eyebrow {
  position: relative;
  padding-left: 18px;
}

.section__eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 9px;
  height: 9px;
  background: var(--red);
  border: 2px solid var(--border);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.section__head h2 {
  text-shadow: 0 0 20px rgba(239, 83, 80, 0.14);
}

/* --------------------- 7. 首屏：漂浮像素方块 + 标题辉光 --------------------- */
.hero__cubes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero__cube {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: cubeFloat 7s ease-in-out infinite;
}

.hero__cube--dirt {
  background: linear-gradient(var(--dirt) 0 40%, #6e4e31 40% 100%);
  left: 7%;
  top: 26%;
  animation-duration: 6.5s;
}

.hero__cube--diamond {
  background: linear-gradient(#7fe6ec 0 40%, var(--diamond) 40% 100%);
  left: 90%;
  top: 20%;
  width: 14px;
  height: 14px;
  animation-duration: 8s;
  animation-delay: 0.8s;
}

.hero__cube--gold {
  background: linear-gradient(#ffe08a 0 40%, var(--gold) 40% 100%);
  left: 13%;
  top: 74%;
  width: 13px;
  height: 13px;
  animation-duration: 7.5s;
  animation-delay: 0.4s;
}

.hero__cube--stone {
  background: linear-gradient(#aab4bf 0 40%, var(--stone) 40% 100%);
  left: 81%;
  top: 66%;
  animation-duration: 9s;
  animation-delay: 1.4s;
}

.hero__cube--redstone {
  background: linear-gradient(var(--red-lite) 0 40%, var(--red) 40% 100%);
  left: 63%;
  top: 12%;
  width: 12px;
  height: 12px;
  animation-duration: 6s;
  animation-delay: 2s;
}

@keyframes cubeFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-16px) rotate(7deg);
  }
}

.hero h1 em {
  animation: heroGlow 3.4s ease-in-out infinite;
}

@keyframes heroGlow {
  0%,
  100% {
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5), 0 0 12px rgba(239, 83, 80, 0.22);
  }
  50% {
    text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5), 0 0 26px rgba(239, 83, 80, 0.5);
  }
}

/* --------------------- 8. 导航滚动后的红石底线 --------------------- */
.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--red-dark) 60%, var(--red));
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: opacity var(--dur) var(--ease), transform var(--dur-slow) var(--ease);
}

.nav[data-scrolled="true"]::after {
  opacity: 0.9;
  transform: scaleX(1);
}

/* --------------------- 9. 统计数字辉光 --------------------- */
.stat__value {
  text-shadow: 0 0 18px rgba(239, 83, 80, 0.3);
}

/* --------------------- 10. 图片展示：取景框角标 + 悬停光晕 --------------------- */
.gallery__item::before,
.gallery__item::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0.72;
  transition: opacity var(--dur) var(--ease);
}

.gallery__item::before {
  top: 10px;
  left: 10px;
  border-top: 3px solid #fff;
  border-left: 3px solid #fff;
}

.gallery__item::after {
  top: 10px;
  right: 10px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
}

.gallery__item:hover::before,
.gallery__item:hover::after {
  opacity: 1;
}

.gallery__item:hover {
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), 0 0 24px rgba(239, 83, 80, 0.14);
}

/* --------------------- 11. 灯箱：放大淡入 --------------------- */
.lightbox {
  animation: lightboxIn 0.25s var(--ease);
}

@keyframes lightboxIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --------------------- 12. 滚动进度条 + 回到顶部 --------------------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  z-index: 220;
  background: linear-gradient(90deg, var(--red), var(--gold));
  box-shadow: 0 0 12px rgba(239, 83, 80, 0.55);
  pointer-events: none;
  transition: width 0.1s linear;
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  color: #fff;
  background: var(--red);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--red-dark), var(--shadow-sm);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
    filter var(--dur) var(--ease), box-shadow 0.08s var(--ease);
}

.to-top[data-show="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.to-top:hover {
  filter: brightness(1.12);
}

.to-top:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--red-dark), 1px 1px 0 rgba(0, 0, 0, 0.35);
}

/* --------------------- 13. 页脚顶部：像素纹理条（呼应首屏地平线） --------------------- */
.footer {
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    rgba(239, 83, 80, 0.55) 0 18px,
    rgba(169, 48, 38, 0.55) 18px 36px,
    rgba(143, 154, 166, 0.35) 36px 54px
  );
  opacity: 0.8;
}

/* ==========================================================================
 * 里程碑时间轴 + 公告卡片
 * --------------------------------------------------------------------------
 * · .timeline  / .tl__*  —— 首页「服务器里程碑」：左侧红石轨道 + 节点方块 + 图文卡
 * · .annlist  / .ann__*  —— 首页「最新公告」：单条富卡片（兑换码、礼包、注意事项）
 * 两者都沿用站点既有的像素风变量（--red / --gold / --border / --shadow）。
 * ========================================================================== */

/* --------------------------- 里程碑：时间轴 --------------------------- */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  display: grid;
  gap: 24px;
}

/* 左侧红石轨道：从亮到暗渐变，像一条通电的红石线 */
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    var(--red-lite),
    var(--red) 32%,
    var(--red-dark) 72%,
    var(--stone)
  );
  box-shadow: 0 0 14px rgba(239, 83, 80, 0.32);
}

.tl__item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 18px;
  margin: 0;
}

/* 轨道上的节点方块 */
.tl__marker {
  grid-column: 1;
  justify-self: center;
  width: 15px;
  height: 15px;
  margin-top: 26px;
  background: var(--red);
  border: 3px solid var(--border);
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4), 0 0 10px rgba(239, 83, 80, 0.45);
}

.tl__card {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -7px 0 rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.tl__card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 rgba(0, 0, 0, 0.45), 0 0 26px rgba(239, 83, 80, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 -7px 0 rgba(0, 0, 0, 0.18);
}

.tl__media {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
}

.tl__btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.tl__btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}

.tl__btn img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-spring);
}

.tl__card:hover .tl__btn img {
  transform: scale(1.04);
}

.tl__body {
  padding: 20px 22px 22px;
  align-self: center;
}

.tl__date {
  display: inline-block;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--gold);
  background: var(--bg);
  border: 2px solid var(--border-soft);
  border-radius: 999px;
  padding: 3px 11px;
}

.tl__title {
  margin: 12px 0 6px;
}

.tl__text {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ----------------------------- 公告卡片 ----------------------------- */
.annlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.ann {
  position: relative;
  margin: 0;
  padding: 24px 26px 22px;
  background: linear-gradient(100deg, rgba(242, 195, 73, 0.09), transparent 46%),
    var(--surface);
  border: 3px solid var(--border);
  border-left: 8px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -7px 0 rgba(0, 0, 0, 0.2);
}

/* 正文控制在一行别太长，读起来不累 */
.ann > * {
  max-width: 78ch;
}

.ann__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ann__date {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
  color: var(--text-mute);
}

.ann__title {
  margin: 0 0 14px;
  color: var(--gold);
}

.ann__line {
  margin: 0 0 12px;
  color: var(--text-dim);
}

/* 兑换区：把兑换码和复制按钮框在一起，一眼就能找到 */
.ann__redeem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 16px;
  margin: 0 0 14px;
  background: var(--bg);
  border: 3px solid var(--border-soft);
  border-radius: var(--radius);
}

.ann__redeem .ann__line {
  margin: 0;
}

/* 兑换框里的按钮行贴着中线对齐，不要多出的上边距 */
.ann__redeem .btn-row {
  margin-top: 0;
}

.ann__code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: transparent;
  border: 0;
  border-bottom: 2px dashed var(--gold);
  border-radius: 0;
  padding: 2px 4px;
}

.ann__sub {
  margin: 18px 0 10px;
  font-size: 0.95rem;
  color: var(--text);
}

.ann__foot {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 2px dashed var(--border-soft);
  text-align: center;
  color: var(--text-dim);
}

/* ------------------------- 里程碑 / 公告 响应式 ------------------------- */
@media (max-width: 760px) {
  .tl__card {
    grid-template-columns: minmax(0, 1fr);
  }

  .tl__body {
    padding: 16px 18px 18px;
  }

  .tl__marker {
    margin-top: 15px;
  }
}

@media (max-width: 640px) {
  .tl__item {
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 12px;
  }

  .timeline::before {
    left: 6px;
  }

  .ann {
    padding: 20px 18px 18px;
    border-left-width: 6px;
  }
}

/* ==========================================================================
 * 合成配方页 —— 摆法网格 / 配方卡片 / 搜索筛选
 * --------------------------------------------------------------------------
 * 配方数据由 tools/build-recipes.js 从「合成配方/」里的 JSON 生成，
 * 这里只负责显示：左边是像素风 3×3 摆法网格，右边是名称与材料清单。
 * ========================================================================== */

/* ---------------------------- 搜索与分类筛选 ---------------------------- */
.recfilter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  margin-bottom: 22px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.recfilter__search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  min-width: 0;
  padding: 8px 12px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease);
}

.recfilter__search:focus-within {
  border-color: var(--red);
}

.recfilter__search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

.recfilter__search input::placeholder {
  color: var(--text-mute);
}

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

.recfilter__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
}

.recfilter__btn:hover {
  transform: translateY(-1px);
  color: var(--text);
}

.recfilter__btn[aria-pressed="true"] {
  color: #fff;
  background: var(--red-dark);
}

.recfilter__num {
  font-family: var(--font-pixel);
  font-size: 0.58rem;
  opacity: 0.7;
}

.recfilter__empty {
  margin: 0 0 22px;
  padding: 14px 16px;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 2px dashed var(--border-soft);
  border-radius: var(--radius);
}

/* ------------------------------ 配方卡片 ------------------------------ */
.rec {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.rec:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.45);
}

/* 被搜索 / 筛选过滤掉的卡片。
   这里用 class 而不是 hidden 属性：卡片本身是 flex，
   浏览器默认的 [hidden]{display:none} 会被作者样式里的 display 覆盖掉。 */
.rec.is-hidden {
  display: none !important;
}

.rec__body {
  flex: 1 1 auto;
  min-width: 0;
}

.rec__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.rec__count {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--gold);
}

.rec__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.rec__kind {
  font-size: 0.78rem;
  color: var(--text-mute);
}

.rec__summary {
  margin: 0 0 6px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.rec__id {
  display: block;
  font-size: 0.72rem;
  color: var(--text-mute);
  word-break: break-all;
}

/* ---------------------------- 3×3 摆法网格 ---------------------------- */
.recshape {
  --cell: 34px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, var(--cell));
  grid-auto-rows: var(--cell);
  gap: 3px;
  padding: 4px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}

/* 无序合成：材料排成一行，不做成九宫格（否则会让人以为位置有讲究） */
.recshape--shapeless {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
  max-width: calc(var(--cell) * 3 + 14px);
  min-height: calc(var(--cell) + 8px);
}

.reccell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  color: #10161c;
  background: var(--cell, var(--surface-3));
  border: 2px solid rgba(0, 0, 0, 0.32);
  border-radius: 2px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  user-select: none;
  cursor: help;
}

/* 底色偏深的材料（深板岩、深色橡木、失活珊瑚……）换成白字，保证看得清 */
.reccell--light {
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}

.reccell--empty {
  background: repeating-linear-gradient(45deg, var(--surface-3) 0 4px, transparent 4px 8px);
  border-style: dashed;
  border-color: var(--border-soft);
  cursor: default;
  opacity: 0.45;
}

.reccell--plus {
  border: 0;
  background: none;
  color: var(--text-mute);
  font-size: 1rem;
  cursor: default;
  text-shadow: none;
}

@media (max-width: 640px) {
  .rec {
    flex-direction: column;
    gap: 12px;
  }

  .recshape {
    --cell: 30px;
  }

  .recfilter {
    align-items: stretch;
  }
}

/* ------------------------------- 打印 -------------------------------- */
@media print {
  .nav,
  .toast,
  .footer__grid,
  .btn-row {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card,
  .panel,
  .step,
  .table-wrap {
    box-shadow: none;
    break-inside: avoid;
  }
}
