/* =========================================================
   堕忘者官网 · 手机端样式（≤ 720px）
   ---------------------------------------------------------
   引入方式（每个页面 head 里）：
     <link rel="stylesheet" href="styles.css"   media="(min-width:721px)">
     <link rel="stylesheet" href="styles-m.css" media="(max-width:720px)">

   所以本文件是「自成一体」的：手机端不会加载 styles.css，
   这里把所有用到的组件重新定义了一遍，可以放心单独改。
   视觉语言（琥珀 CRT 终端）与桌面版一致，
   只是改成单列堆叠、字更大、触控目标 ≥44px。
   ========================================================= */

:root {
  --bg:         #050403;
  --bg-2:       #0a0805;
  --panel:      #0d0a06;
  --panel-2:    #141008;
  --line:       #8a5e10;
  --line-soft:  rgba(232, 160, 32, .22);
  --amber:      #e8a020;
  --amber-b:    #ffc043;
  --amber-d:    #8a5e10;
  --amber-fade: rgba(232, 160, 32, .35);
  --text:       #d8c090;
  --text-hi:    #f0dfae;
  --text-dim:   #8a7248;
  --text-faint: #4a3f28;
  --red:        #e05030;
  --green:      #b8c840;
  --radius:     4px;

  /* 手机端字号：比桌面大一点，好读也好点 */
  --fs-base:  15px;
  --fs-sub:   13px;
  --fs-card:  13.5px;
  --fs-small: 12px;

  /* 开机动画 iframe 的宽度上限：
     只要窗口比它宽，就以它居中显示（这样 550C 动画在手机上
     大小一致）；比它窄的小屏才用 100% */
  --pw: 390px;

  --mono: "SF Mono", Menlo, Monaco, Consolas, "Courier New",
          "Noto Sans Mono CJK SC", "PingFang SC", "Microsoft YaHei", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  font-size: var(--fs-base);
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;   /* 防横向溢出 */
}

/* ---------- 全屏扫描线 + CRT 暗角 ---------- */
body::before {
  content: "";
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  z-index: 900;
  background: repeating-linear-gradient(to bottom,
    rgba(232, 160, 32, .035) 0, rgba(232, 160, 32, .035) 1px,
    transparent 1px, transparent 3px);
}
body::after {
  content: "";
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  pointer-events: none;
  z-index: 899;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .82) 100%);
}

/* ---------- 背景粒子网格（site.js 驱动） ---------- */
#bgGrid {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  display: block;
  pointer-events: none;
}

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

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

code {
  font-family: var(--mono);
  font-size: .82em;
  padding: 2px 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--amber);
  overflow-wrap: anywhere;
}

h1, h2, h3 { font-weight: 700; letter-spacing: .05em; color: var(--text-hi); }

/* 终端光标 */
.cur {
  display: inline-block;
  width: .55em; height: 1em;
  background: var(--amber);
  vertical-align: -.12em;
  margin-left: .12em;
  box-shadow: 0 0 8px var(--amber-fade);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* =========================================================
   顶栏（手机上收成「LOGO + ☰」，导航从下方滑出）
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 8, 5, .96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .14em;
  color: var(--amber);
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 0 12px var(--amber-fade);
}
.logo .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.6s ease-in-out infinite;
  flex: none;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
/* 手机上收起英文名与尾随光标，避免顶栏拥挤 */
.logo .en,
.logo::after { display: none; }

/* ☰ 菜单按钮：触控目标 44×44 */
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 44px; height: 44px;
  font-family: var(--mono);
  font-size: 19px;
  line-height: 1;
  color: var(--amber);
  background: rgba(232, 160, 32, .06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.menu-btn:active { background: rgba(232, 160, 32, .18); border-color: var(--amber); }

/* 导航：从顶栏下方展开的面板 */
.nav {
  position: absolute;
  left: 0; right: 0; top: 100%;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px 14px;
  background: rgba(10, 8, 5, .99);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  max-height: 70vh;
  overflow-y: auto;
}
.nav.open { display: flex; }

.nav a {
  display: block;
  width: 100%;
  font-size: 14.5px;
  letter-spacing: .1em;
  padding: 13px 14px;
  min-height: 46px;
  color: var(--text-dim);
  border: 1px solid transparent;
  border-bottom: 1px dotted var(--line-soft);
  border-radius: 0;
  text-decoration: none;
}
.nav a:last-child { border-bottom: none; }
.nav a:active { background: rgba(232, 160, 32, .1); color: var(--amber); }
.nav a.active {
  color: var(--bg);
  background: var(--amber);
  border-color: var(--amber);
  border-bottom-color: transparent;
  font-weight: 700;
  border-radius: var(--radius);
  box-shadow: 0 0 14px var(--amber-fade);
}

/* =========================================================
   布局
   ========================================================= */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 14px 56px;
  position: relative;
  z-index: 1;
}

.breadcrumb {
  font-size: var(--fs-small);
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--text-dim); }

.page-title {
  font-size: clamp(1.5rem, 7vw, 2rem);
  letter-spacing: .07em;
  color: var(--amber);
  text-shadow: 0 0 16px var(--amber-fade);
  line-height: 1.35;
}
.page-sub {
  color: var(--text-dim);
  font-size: var(--fs-sub);
  margin-top: 10px;
  max-width: 100%;
}

/* =========================================================
   区块
   ========================================================= */
section.block { margin-top: 34px; }

section.block > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  letter-spacing: .16em;
  color: var(--amber);
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(232, 160, 32, .2);
}
section.block > h2::before {
  content: "//";
  color: var(--amber-d);
  letter-spacing: 0;
  font-weight: 400;
}

/* =========================================================
   卡片 / 网格：手机上强制单列
   ========================================================= */
.grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  grid-template-columns: 1fr;
}

.card {
  position: relative;
  padding: 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}
/* 四角标记 */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  border-color: var(--text-faint);
  z-index: 2;
  pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-top: 1px solid; border-left: 1px solid; }
.card::after { bottom: -1px; right: -1px; border-bottom: 1px solid; border-right: 1px solid; }
.card:active { border-color: var(--amber); background: var(--panel-2); }

.card h3 {
  font-size: 14px;
  letter-spacing: .08em;
  color: var(--amber-b);
  margin-bottom: 8px;
}
.card p { font-size: var(--fs-card); color: var(--text-dim); }
.card b { color: var(--text-hi); font-weight: 700; }

.card .tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .18em;
  padding: 3px 9px;
  margin-bottom: 10px;
  color: var(--amber);
  border: 1px solid var(--line);
  background: rgba(232, 160, 32, .08);
}

/* 占位框 */
.placeholder {
  margin-top: 14px;
  padding: 18px 16px;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--text-faint);
  border: 1px dashed var(--line-soft);
  background: rgba(232, 160, 32, .025);
}

/* =========================================================
   键值表：手机上改成「标签在上、值在下」
   ========================================================= */
.kv {
  margin-top: 14px;
  padding: 6px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  font-size: var(--fs-card);
}
.kv > * { padding: 10px 0; border-bottom: 1px dotted var(--line-soft); }
.kv dt {
  color: var(--amber);
  font-size: 11px;
  letter-spacing: .14em;
  padding-bottom: 0;
  border-bottom: none;
}
.kv dd { color: var(--text); padding-top: 2px; }
.kv > *:last-child { border-bottom: none; }
.kv > *:nth-last-child(2) { border-bottom: 1px dotted var(--line-soft); }

/* =========================================================
   序号列表
   ========================================================= */
.m-list {
  list-style: none;
  margin-top: 14px;
  padding: 4px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.m-list li {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  font-size: var(--fs-card);
  border-bottom: 1px dotted var(--line-soft);
}
.m-list li:last-child { border-bottom: none; }
.m-list .no {
  flex: none;
  min-width: 52px;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: .04em;
}
.m-list li span:last-child { color: var(--text-dim); }

/* =========================================================
   开发进度条
   ========================================================= */
.meter {
  margin-top: 14px;
  padding: 16px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.meter .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--fs-small);
  letter-spacing: .08em;
  color: var(--text-dim);
}
.meter .row span:last-child {
  font-size: 17px;
  font-weight: 700;
  color: var(--amber);
  text-shadow: 0 0 10px var(--amber-fade);
}
.meter .bar {
  position: relative;
  height: 10px;
  margin-top: 10px;
  background: #000;
  border: 1px solid var(--line);
  overflow: hidden;
}
.meter .fill {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg,
    var(--amber) 0, var(--amber) 5px,
    rgba(232, 160, 32, .4) 5px, rgba(232, 160, 32, .4) 10px);
  box-shadow: 0 0 12px var(--amber-fade);
  transition: width 1.4s cubic-bezier(.22, .75, .2, 1);
}

/* =========================================================
   首屏 Hero
   ========================================================= */
.hero {
  position: relative;
  padding: 34px 18px 30px;
  text-align: center;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 46px rgba(232, 160, 32, .04);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border-color: var(--amber);
  z-index: 2;
  pointer-events: none;
}
.hero::before { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.hero::after { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.hero h1 {
  font-size: clamp(2rem, 11vw, 2.6rem);
  letter-spacing: .1em;
  color: var(--amber);
  line-height: 1.3;
  text-shadow: 0 0 20px var(--amber-fade), 0 0 46px rgba(232, 160, 32, .14);
}
.hero-en {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.hero p {
  color: var(--text-dim);
  font-size: var(--fs-card);
  margin: 16px auto 0;
  max-width: 100%;
}
.hero b { color: var(--text-hi); }

/* 按钮组：手机上竖排、占满宽度，好点 */
.cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

/* =========================================================
   按钮（触控目标 ≥ 44px）
   ========================================================= */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .12em;
  padding: 12px 20px;
  color: var(--amber);
  background: rgba(232, 160, 32, .04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease;
}
.btn:active {
  color: var(--amber-b);
  border-color: var(--amber);
  background: rgba(232, 160, 32, .16);
}

.btn-primary {
  color: var(--bg);
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 700;
  box-shadow: 0 0 18px rgba(232, 160, 32, .22);
}
.btn-primary:active { color: var(--bg); background: var(--amber-b); }

/* =========================================================
   弹窗（攻略页的「点击查看」）
   ========================================================= */
.modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 2, 1, .9);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal.open { display: flex; }

.modal-box {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 32px 20px 20px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--amber);
  box-shadow: 0 0 44px rgba(232, 160, 32, .18), inset 0 0 44px rgba(232, 160, 32, .04);
}
.modal-box::before {
  content: "// SYSTEM MESSAGE";
  position: absolute;
  top: -1px; left: -1px;
  font-size: 9px;
  letter-spacing: .16em;
  padding: 3px 9px;
  background: var(--amber);
  color: var(--bg);
}
.modal-box p {
  font-size: var(--fs-card);
  color: var(--text);
  margin: 14px 0 18px;
}
.modal-box .btn { width: 100%; }

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 44px;
  padding: 22px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: var(--fs-small);
  letter-spacing: .06em;
  line-height: 1.9;
  border-top: 1px solid var(--line);
}
.fnote { color: #3a3122; margin-top: 6px; }

/* =========================================================
   顶部滚动进度条
   ========================================================= */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  z-index: 950;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

/* =========================================================
   滚动淡入（JS 可用时才隐藏内容）
   ========================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, .75, .2, 1);
  transition-delay: var(--d, 0ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* =========================================================
   开机动画 iframe
   ---------------------------------------------------------
   桌面上它是 100% × 100% 占满窗口（styles.css 里的规则）。
   手机上改成固定宽度上限：
     · 窗口比 --pw 宽  → 以 --pw 居中显示（手机大小一致）
     · 窗口比 --pw 窄  → 退化成 100%（小屏铺满）
   这样 550C 动画内部的 100vw / 100vh 也能拿到合理尺寸。
   手机端外面套了一层全屏黑底 #bootWrap（z-index:3000），负责盖住
   首页和扫描线/暗角；iframe 只负责把动画本身按 --pw 居中显示。
   收尾时给 #bootWrap 加 .done 淡出，再由 index.html 把整块删掉。
   ========================================================= */
/* 全屏黑底容器：开机时彻底盖住首页 + 扫描线/暗角（z-index 要压过 900） */
#bootWrap {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  opacity: 1;
  -webkit-transition: opacity .6s ease;
          transition: opacity .6s ease;
}
#bootWrap.done {
  opacity: 0;
  pointer-events: none;
}

#bootFrame {
  position: relative;
  top: auto; right: auto; bottom: auto; left: auto;
  width: min(100%, var(--pw));
  height: min(100%, var(--pw));
  margin: 0;
  border: 0;
  background: #000;
  display: block;
  opacity: 1;
}
#bootFrame.done {
  opacity: 0;
  pointer-events: none;
}

/* =========================================================
   无障碍：减少动态
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  #bootFrame { display: none !important; }
}
