/* ============================================================
   南昌大学安全准入初始密码查询器
   方向：Brutally minimal / 极致极简
   纯色平面、发丝规则线、精确对齐；不铺渐变网格、噪点、光晕与阴影。
   唯一动态装饰＝顶部模块的黑白节律反转 + 银色辉光 + 小幅上下晃动。
   ============================================================ */

:root {
  /* 色彩：暖近白主导 60% / 近黑 30% / 单一蓝 10% */
  --color-bg: #faf9f6;
  --color-surface: #ffffff;
  --color-surface-2: #efede7;
  --color-text: #1b1a18;
  --color-muted: #1b1a18; /* 辅助文字与正文同为近黑，不用浅灰 */
  --color-border: #dcd9d2;
  --color-accent: #1a45d1;
  --color-alert: #d00000; /* 示例标题专用红 */
  --color-ink: #12110f;

  /* 字体：中文宋体作展示字，中文黑体作正文，等宽字作数字与规则 */
  --font-display: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* 字阶 */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 16px;
  --fs-lg: 20px;
  --fs-formula: clamp(18px, 2.5vw, 26px);
  --fs-h2: clamp(36px, 5.4vw, 62px);
  --fs-display: clamp(28px, 3.8vw, 46px);

  /* 间距梯度 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 16px; --sp-4: 24px;
  --sp-5: 40px; --sp-6: 64px; --sp-7: 96px;

  --radius: 2px;
  --dur-fast: 180ms;
  --dur-base: 380ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.75;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 顶部警示条：黑底银字 ↔ 白底黑字节律交替 + 小幅上下晃动 ----------
   外层只负责吸顶且不动、同色底兜底；内层做 transform 位移。
   两层背景与文字共用同一个 4s 周期，保证背景与字色严格同步反转。 */
.topbar-sticky {
  position: sticky; top: 0; z-index: 20;
  background: var(--color-ink);
  animation: barInvert 4s ease-in-out infinite;
}
.topbar {
  background: var(--color-ink);
  animation: barInvert 4s ease-in-out infinite, barFloat 4s ease-in-out infinite;
}
@keyframes barInvert {
  0%, 42%  { background-color: #12110f; }
  50%, 92% { background-color: #ffffff; }
  100%     { background-color: #12110f; }
}
@keyframes barFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto;
  padding: var(--sp-4);
}

/* 黑底阶段＝银色辉光闪烁；白底阶段＝纯黑字且收掉辉光 */
.neon-text {
  margin: 0;
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 800; line-height: 1.5; letter-spacing: .06em;
  color: #e9eaf0; -webkit-text-fill-color: #e9eaf0;
  user-select: text; -webkit-user-select: text; cursor: text;
  text-shadow: 0 0 6px rgba(238, 240, 248, .62), 0 0 18px rgba(186, 192, 210, .38);
  animation: textInvert 4s ease-in-out infinite;
}
.neon-text::selection {
  background: var(--color-accent);
  color: #fff; -webkit-text-fill-color: #fff;
}
@keyframes textInvert {
  0% {
    opacity: 1; color: #e9eaf0; -webkit-text-fill-color: #e9eaf0;
    text-shadow: 0 0 7px rgba(240, 242, 250, .72), 0 0 20px rgba(190, 196, 214, .42);
  }
  19% { /* 黑底阶段的一次辉光呼吸 */
    opacity: .72; color: #e9eaf0; -webkit-text-fill-color: #e9eaf0;
    text-shadow: 0 0 2px rgba(240, 242, 250, .26), 0 0 8px rgba(190, 196, 214, .14);
  }
  42% {
    opacity: 1; color: #e9eaf0; -webkit-text-fill-color: #e9eaf0;
    text-shadow: 0 0 7px rgba(240, 242, 250, .72), 0 0 20px rgba(190, 196, 214, .42);
  }
  50%, 92% {
    opacity: 1; color: #111111; -webkit-text-fill-color: #111111; text-shadow: none;
  }
  100% {
    opacity: 1; color: #e9eaf0; -webkit-text-fill-color: #e9eaf0;
    text-shadow: 0 0 7px rgba(240, 242, 250, .72), 0 0 20px rgba(190, 196, 214, .42);
  }
}

/* ---------- 版心 ---------- */
.wrap {
  max-width: 1120px; margin: 0 auto;
  padding: var(--sp-7) var(--sp-4) var(--sp-7);
}

/* ---------- 首页：单栏，内容集中在偏左的舒适宽度 ---------- */
.home-main { max-width: 900px; }

/* 步骤标记（子页面仍在使用） */
.step {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-mono); font-size: var(--fs-xs);
  letter-spacing: .08em; color: var(--color-accent);
}

/* 引导语即主标题：沿用原大标题的字号与位置，两个元素合一后不留多余空白 */
.display {
  margin: 0 0 var(--sp-6);
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 700; line-height: 1.16; letter-spacing: -.03em;
  color: var(--color-text);
}

/* 三行目录：发丝规则线 + 左侧背景擦除 */
.choices { border-bottom: 1px solid var(--color-border); }
.choice {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 72px minmax(0, 1fr) 32px;
  align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 92px; padding: var(--sp-3) 0;
  border: 0; border-top: 1px solid var(--color-border);
  background: transparent; color: var(--color-text);
  font-family: var(--font-body); text-align: left; cursor: pointer;
}
.choice::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: var(--color-surface-2);
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--dur-base) var(--ease-out);
}
.choice:hover::before, .choice:focus-visible::before { transform: scaleX(1); }
.choice > * { position: relative; z-index: 1; }
.num {
  font-family: var(--font-mono); font-size: 18px; font-weight: 700;
  color: var(--color-accent); font-variant-numeric: tabular-nums;
}
.choice-body { display: flex; flex-direction: column; min-width: 0; }
.choice-title { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
.arrow {
  justify-self: end; font-size: 20px; color: var(--color-accent);
  transition: transform var(--dur-fast) var(--ease-out);
}
.choice:hover .arrow, .choice:focus-visible .arrow { transform: translateX(5px); }
.choice:active::before { background: #e7e4dc; }

/* ---------- 子页面 ---------- */
.back {
  display: inline-flex; align-items: center; min-height: 44px;
  margin: 0 0 var(--sp-5); padding: 0;
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600;
  color: var(--color-muted);
  transition: color var(--dur-fast) ease-out;
}
.back:hover { color: var(--color-accent); }

.detail-head { margin-bottom: var(--sp-6); }
.detail-head h2 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-display);
  font-size: var(--fs-h2); font-weight: 700;
  line-height: 1.1; letter-spacing: -.03em;
}
.intro {
  max-width: 34em; margin: 0;
  font-size: var(--fs-base); line-height: 1.85; color: var(--color-muted);
}

.block {
  display: grid; grid-template-columns: 72px minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--color-border);
}
.block-index {
  font-family: var(--font-mono); font-size: var(--fs-sm);
  color: var(--color-accent); padding-top: 4px;
  font-variant-numeric: tabular-nums;
}
.block-body { min-width: 0; }
.block-body h3 {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-sm); font-weight: 700;
  letter-spacing: .12em; color: var(--color-muted);
}
.formula {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-mono); font-size: var(--fs-formula);
  font-weight: 700; line-height: 1.6; letter-spacing: -.01em;
  color: var(--color-accent); word-break: break-word;
  user-select: text; -webkit-user-select: text;
}
.formula:last-child { margin-bottom: 0; }

.examples { display: grid; gap: var(--sp-5); }
.ex-tag {
  margin: 0 0 var(--sp-3);
  /* 示例标题：红色 + 比下方「账号 / 初始密码」标签大一档（13px → 18px）；字体与字重不变 */
  font-size: 18px; color: var(--color-alert);
}
.ex dl {
  margin: 0; display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-5);
}
.ex dt { font-size: var(--fs-sm); color: var(--color-muted); }
.ex dd {
  margin: 0; font-family: var(--font-mono);
  font-size: 18px; font-weight: 700; color: var(--color-text);
  word-break: break-all; user-select: text; -webkit-user-select: text;
}
.ex dd.pw { color: var(--color-accent); }

.caps-note {
  margin: 0; padding: var(--sp-3) 0;
  font-size: var(--fs-sm); font-weight: 700; color: var(--color-text);
}

/* ---------- 子页面底部提示：与顶部警示条同一套视觉格式 ----------
   同样拆两层：外壳只做背景反转且不动，内层做位移，避免边缘露缝。
   文字直接复用 .neon-text，故字号、字重、字色反转与辉光完全一致。 */
.notice-shell {
  margin-top: var(--sp-6);
  background: var(--color-ink);
  animation: barInvert 4s ease-in-out infinite;
}
.notice-bar {
  background: var(--color-ink);
  animation: barInvert 4s ease-in-out infinite, barFloat 4s ease-in-out infinite;
}
.notice-inner {
  max-width: 1120px; margin: 0 auto;
  padding: var(--sp-4);
}

/* ---------- 页脚 ---------- */
.site-foot { border-top: 1px solid var(--color-border); }
.foot-inner {
  max-width: 1120px; margin: 0 auto;
  padding: var(--sp-5) var(--sp-4) var(--sp-6);
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: var(--sp-2) var(--sp-5);
  font-size: var(--fs-xs); line-height: 1.9; color: var(--color-muted);
}
.foot-inner p { margin: 0; }
.foot-inner a {
  color: var(--color-text); text-decoration: none;
  border-bottom: 1px solid var(--color-accent);
}
.foot-inner a:hover { color: var(--color-accent); }

/* ---------- 一次编排好的入场序列（错峰 80ms，共 2 组） ---------- */
@media (prefers-reduced-motion: no-preference) {
  .stage .reveal {
    animation: rise var(--dur-base) var(--ease-out) both;
    animation-delay: var(--d, 0ms);
  }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 响应式：意图明确的堆叠，而非自动挤压缩放 ---------- */
@media (max-width: 900px) {
  .wrap { padding-top: var(--sp-6); }
}
@media (max-width: 600px) {
  .wrap { padding: var(--sp-5) var(--sp-3) var(--sp-6); }
  .topbar-inner, .notice-inner { padding: var(--sp-4) var(--sp-3); }
  .choice { grid-template-columns: 40px minmax(0, 1fr) 20px; gap: var(--sp-2); min-height: 84px; }
  .num { font-size: 14px; }
  .choice-title { font-size: 17px; }
  .block { grid-template-columns: 40px minmax(0, 1fr); padding: var(--sp-4) 0; }
  .ex dl { grid-template-columns: 1fr; gap: 2px; }
  .ex dd { margin-bottom: var(--sp-2); }
  .foot-inner { flex-direction: column; }
}

/* ---------- 降级：关闭全部动效，警示文字改为纯色保证可读 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .neon-text {
    opacity: 1; color: #e9eaf0; -webkit-text-fill-color: #e9eaf0;
    text-shadow: 0 0 6px rgba(238, 240, 248, .4);
  }
  .choice::before { transform: scaleX(0); }
}
