/* ============================================================
   半盏江湖 · 武侠风 UI 设计规范（提示词 C）
   ------------------------------------------------------------
   色板（唯一允许的五色）：
   --bg-ink        墨黑底   #0D0D0D
   --gold          鎏金     #C9A227
   --red-cinnabar  朱砂红   #A93B2F
   --paper         宣纸米白 #EFE6D0
   --gray-mist     青灰     #6B6B6B
   字体：系统书法字体栈（楷体优先，宋体回退）
   ============================================================ */

:root {
  /* 色板 Token */
  --bg-ink: #0D0D0D;
  --gold: #C9A227;
  --red-cinnabar: #A93B2F;
  --paper: #EFE6D0;
  --gray-mist: #6B6B6B;

  /* 字体 Token */
  --font-title: "KaiTi", "STKaiti", "楷体", "SimSun", "宋体", serif;
  --font-body: "Songti SC", "SimSun", "宋体", "Microsoft YaHei", sans-serif;

  /* 布局 Token */
  --section-gap: 80px;
  --section-gap-mobile: 40px;
  --radius-card: 4px;
  --line-gold: rgba(201, 162, 39, 0.55);
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;                 /* 正文 ≥16px，防 iOS 自动缩放 */
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

[hidden] { display: none !important; }

/* 触屏体验：去点击高亮、防双击缩放 */
button, a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 印章组件（红底白字） ---------- */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red-cinnabar);
  color: var(--paper);
  font-family: var(--font-title);
  font-weight: 500;
  border-radius: 6px;
  padding: 6px 8px;
  writing-mode: vertical-rl;
  letter-spacing: 4px;
  line-height: 1.1;
  box-shadow: inset 0 0 0 2px rgba(239, 230, 208, 0.35);
}

/* ---------- 按钮三态（提示词 C） ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;                /* 触控按钮 ≥44px */
  padding: 12px 36px;
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: 6px;
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: color 0.35s ease, border-color 0.35s ease;
}

/* 主按钮：鎏金描边，悬停墨色填充 */
.btn-primary {
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
}
.btn-primary .btn-ink {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, var(--gold) 0%, rgba(201, 162, 39, 0.85) 40%, transparent 70%);
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
  transform: scale(0.6);
}
.btn-primary:hover .btn-ink,
.btn-primary:focus-visible .btn-ink { opacity: 1; transform: scale(1.6); }
.btn-primary:hover,
.btn-primary:focus-visible { color: var(--bg-ink); }
.btn-primary .btn-text { position: relative; z-index: 1; }

/* 次按钮：宣纸白边 */
.btn-secondary {
  border: 1px solid var(--paper);
  color: var(--paper);
  background: transparent;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(239, 230, 208, 0.1);
}

/* 危险按钮：朱砂红底（预留，暂未用） */
.btn-danger {
  background: var(--red-cinnabar);
  color: var(--paper);
}
.btn-danger:hover,
.btn-danger:focus-visible { filter: brightness(1.15); }

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px calc(24px + env(safe-area-inset-right)) 12px calc(24px + env(safe-area-inset-left));
  background: rgba(13, 13, 13, 0.72);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
  transition: transform 0.4s ease;
}
.navbar.hidden-nav { transform: translateY(-100%); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-seal {
  writing-mode: horizontal-tb;
  letter-spacing: 2px;
  padding: 4px 8px;
  font-size: 15px;
}
.brand-name {
  font-family: var(--font-title);
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  position: relative;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--paper);
  opacity: 0.85;
  transition: opacity 0.3s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: -6px;
  height: 2px;
  background: var(--red-cinnabar);
  transition: right 0.3s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible { opacity: 1; }
.nav-links a:hover::after,
.nav-links a:focus-visible::after { right: 0; }  /* 当前页朱砂下划线（悬停态） */

/* 右上角「进入游戏」入口：鎏金描边按钮 */
.nav-game-btn {
  border: 1px solid var(--gold) !important;
  color: var(--gold) !important;
  padding: 7px 18px;
  border-radius: var(--radius-card);
  letter-spacing: 3px;
  opacity: 1 !important;
  transition: background 0.3s ease, color 0.3s ease !important;
}
.nav-game-btn::after { display: none; }   /* 去掉下划线，按钮不需要 */
.nav-game-btn:hover,
.nav-game-btn:focus-visible {
  background: var(--gold);
  color: var(--bg-ink) !important;
}

/* 导航账号区：登录/注册/用户名/退出 */
.nav-auth { display: flex; align-items: center; gap: 10px; }
.auth-link {
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--paper);
  opacity: 0.85;
  padding: 6px 10px;
  border: 1px solid transparent;
  transition: opacity 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.auth-link:hover,
.auth-link:focus-visible { opacity: 1; color: var(--gold); border-color: rgba(201, 162, 39, 0.5); }
.nav-user {
  font-family: var(--font-title);
  color: var(--gold);
  letter-spacing: 2px;
  font-size: 16px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 封面区 Hero（提示词 B） ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;                  /* iOS 地址栏适配，禁用 100vh */
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mountains {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 云雾缓慢飘动（唯一允许的山峦动效） */
.cloud { animation: drift 26s ease-in-out infinite alternate; }
.cloud.c2 { animation-duration: 34s; animation-delay: -8s; }
.cloud.c3 { animation-duration: 22s; animation-delay: -16s; }
@keyframes drift {
  from { transform: translateX(-14px); }
  to   { transform: translateX(18px); }
}

.bird { animation: glide 30s linear infinite; }
.bird:nth-of-type(2) { animation-delay: -10s; }
.bird:nth-of-type(3) { animation-delay: -20s; }
@keyframes glide {
  0%   { transform: translateX(-30px); opacity: 0; }
  8%   { opacity: 0.5; }
  92%  { opacity: 0.5; }
  100% { transform: translateX(60px); opacity: 0; }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
}

.hero-kicker {
  font-size: 17px;
  letter-spacing: 8px;
  color: var(--gray-mist);
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(44px, 9vw, 72px);   /* 书法大字 40~64px+ */
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(201, 162, 39, 0.25);
  margin-bottom: 18px;
}

/* 竖排诗句 */
.hero-poem {
  font-family: var(--font-title);
  font-size: 19px;
  letter-spacing: 6px;
  color: var(--paper);
  writing-mode: vertical-rl;
  margin: 0 auto 30px;
  height: 128px;
  opacity: 0.9;
}

.hero-seal {
  position: absolute;
  right: clamp(24px, 7vw, 90px);
  bottom: clamp(90px, 18vh, 160px);
  font-size: 22px;
  z-index: 2;
}

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-title);
  color: var(--gray-mist);
  letter-spacing: 4px;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* 文字逐行淡入（提示词 A：唯一允许动效之一） */
.hero-kicker { animation: fadeInUp 0.9s ease 0.2s both; }
.hero-title  { animation: fadeInUp 0.9s ease 0.8s both; }
.hero-poem   { animation: fadeInUp 0.9s ease 1.4s both; }
.hero .btn-primary { animation: fadeInUp 0.9s ease 2.0s both; }
.hero-seal   { animation: fadeIn 1.2s ease 2.6s both; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 入场后 Hero 退场 */
.hero.exited { animation: heroFade 0.8s ease both; }
@keyframes heroFade {
  to { opacity: 0; transform: translateY(-60px) scale(0.98); }
}

/* ---------- 主界面 ---------- */
.main {
  position: relative;
  z-index: 5;
  background: var(--bg-ink);
  padding-top: 20px;
}

.section { padding: var(--section-gap) 24px; max-width: 1080px; margin: 0 auto; }

.section-title {
  font-family: var(--font-title);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 10px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 18px;
}

.section-lead {
  text-align: center;
  color: var(--gray-mist);
  margin: 20px auto 44px;
  max-width: 560px;
}

/* 分隔线：金线 + 云纹（禁止普通直线） */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 10px;
}
.divider-line {
  width: 90px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-gold), transparent);
}
.cloud-mark { flex-shrink: 0; }

/* ---------- 卡片（宣纸米白底 + 金边 + 顶部朱砂线） ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  position: relative;
  background: rgba(239, 230, 208, 0.05);
  border: 1px solid var(--line-gold);
  border-radius: var(--radius-card);
  border-top: 2px solid var(--red-cinnabar);
  padding: 34px 26px 28px;
  transition: transform 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}
.card:hover,
.card:focus-within {
  transform: translateY(-6px);
  background: rgba(239, 230, 208, 0.09);
  border-color: var(--gold);
}

.card-mark {
  display: block;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.card h3 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 500;
  color: var(--paper);
  letter-spacing: 6px;
  margin-bottom: 12px;
}
.card p { color: var(--gray-mist); font-size: 16px; }

/* ---------- 文章列表 ---------- */
.article-list {
  max-width: 820px;
  margin: 30px auto 0;
  border-top: 1px solid rgba(201, 162, 39, 0.3);
}

.article-item {
  position: relative;
  padding: 26px 16px 26px 26px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.18);
  transition: background 0.3s ease, padding-left 0.3s ease;
}
.article-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 32px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
  background: var(--bg-ink);
}
.article-item:hover,
.article-item:focus-within {
  background: rgba(239, 230, 208, 0.04);
  padding-left: 34px;
}

.article-date {
  display: inline-block;
  font-size: 14px;
  color: var(--gray-mist);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.article-title {
  font-family: var(--font-title);
  font-size: 21px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.article-summary {
  color: rgba(239, 230, 208, 0.72);
  font-size: 16px;
}

/* 卷轴展开（入场时文章列表） */
.article-list.roll-in .article-item { animation: rollIn 0.7s ease both; }
.article-list.roll-in .article-item:nth-child(1) { animation-delay: 0.05s; }
.article-list.roll-in .article-item:nth-child(2) { animation-delay: 0.15s; }
.article-list.roll-in .article-item:nth-child(3) { animation-delay: 0.25s; }
.article-list.roll-in .article-item:nth-child(4) { animation-delay: 0.35s; }
.article-list.roll-in .article-item:nth-child(5) { animation-delay: 0.45s; }
@keyframes rollIn {
  from { opacity: 0; transform: translateX(-18px) scaleY(0.96); }
  to   { opacity: 1; transform: translateX(0) scaleY(1); }
}

/* ---------- 页脚 ---------- */
.footer {
  position: relative;
  z-index: 5;
  background: var(--bg-ink);
  border-top: 1px solid rgba(201, 162, 39, 0.25);
  padding: 44px 24px 52px;
  text-align: center;
}
.footer-seal {
  writing-mode: horizontal-tb;
  font-size: 16px;
  padding: 6px 10px;
  margin-bottom: 18px;
}
.footer-text {
  font-family: var(--font-title);
  color: var(--gold);
  letter-spacing: 4px;
  font-size: 17px;
  margin-bottom: 8px;
}
.footer-copy { color: var(--gray-mist); font-size: 14px; }

/* ---------- 账号弹窗（注册/登录） ---------- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(13, 13, 13, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease both;
}
.auth-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid var(--line-gold);
  border-radius: 8px;
  border-top: 3px solid var(--red-cinnabar);
  padding: 40px 32px 32px;
  text-align: center;
  animation: authIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-seal {
  writing-mode: horizontal-tb;
  font-size: 18px;
  padding: 6px 10px;
  margin: 0 auto 16px;
}
.auth-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 8px;
  color: var(--gold);
  margin-bottom: 20px;
}
.auth-tabs {
  display: flex;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  font-family: var(--font-title);
  font-size: 17px;
  letter-spacing: 6px;
  color: var(--gray-mist);
  border-bottom: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
  min-height: 44px;
}
.auth-tab.active { color: var(--gold); border-bottom-color: var(--red-cinnabar); }
.auth-form { text-align: left; }
.auth-field { display: block; margin-bottom: 18px; }
.auth-field > span {
  display: block;
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--gray-mist);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: rgba(13, 13, 13, 0.8);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 4px;
  color: var(--paper);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease;
}
.auth-field input:focus { border-color: var(--gold); }
.auth-field input::placeholder { color: rgba(239, 230, 208, 0.35); }
.auth-msg {
  min-height: 22px;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--red-cinnabar);
  margin: 4px 0 12px;
}
.auth-msg.ok { color: var(--gold); }
.auth-submit { width: 100%; letter-spacing: 8px; }
.auth-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  color: var(--gray-mist);
  transition: color 0.3s ease;
}
.auth-close:hover,
.auth-close:focus-visible { color: var(--gold); }

/* ---------- 铃铛音乐开关（提示词 E） ---------- */
.bell {
  position: fixed;
  right: calc(24px + env(safe-area-inset-right));
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 60;
  width: 56px;
  height: 56px;                     /* ≥44px 可点 */
  border: 1px solid rgba(201, 162, 39, 0.5);
  border-radius: 50%;
  background: rgba(13, 13, 13, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease, opacity 0.3s ease;
}
.bell-svg { width: 30px; height: 38px; }

/* 播放中：鎏金 + 微风摇铃 */
.bell.playing { border-color: var(--gold); }
.bell.playing .bell-svg { animation: ringSwing 2.2s ease-in-out infinite; transform-origin: 50% 8%; }
@keyframes ringSwing {
  0%, 100% { transform: rotate(0deg); }
  20%      { transform: rotate(-7deg); }
  40%      { transform: rotate(6deg); }
  60%      { transform: rotate(-4deg); }
  80%      { transform: rotate(3deg); }
}
.bell.playing .bell-svg path { fill: var(--gold); }
.bell.playing .bell-svg .bell-clapper { fill: var(--bg-ink); }
.bell.playing .bell-svg .bell-ring { fill: var(--bg-ink); opacity: 0.3; }

/* 静音：青灰 + 静止 + 半透明 */
.bell.muted {
  border-color: var(--gray-mist);
  opacity: 0.75;
}
.bell.muted .bell-svg { animation: none; }
.bell.muted .bell-svg path { fill: var(--gray-mist); }
.bell.muted .bell-svg .bell-clapper { fill: var(--bg-ink); }

/* ---------- 开场动画层（提示词 E 代码版） ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-ink);
  overflow: hidden;
  cursor: pointer;
}

.intro-duel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10vw;
  opacity: 0;
  animation: introDuel 1.2s ease 0.1s both;
}
@keyframes introDuel {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

.sword {
  width: clamp(56px, 9vw, 96px);
  height: auto;
  opacity: 0;
}
.sword-a { animation: swordInA 0.55s ease 0.35s both; }
.sword-b { animation: swordInB 0.55s ease 0.45s both; }
@keyframes swordInA {
  from { opacity: 0; transform: translateX(40px) rotate(-32deg); }
  to   { opacity: 1; transform: translateX(0) rotate(-26deg); }
}
@keyframes swordInB {
  from { opacity: 0; transform: translateX(-40px) rotate(32deg); }
  to   { opacity: 1; transform: translateX(0) rotate(26deg); }
}

/* 双剑交错残影 */
.sword-a .sword-group { animation: clashA 0.5s ease 0.7s both; }
.sword-b .sword-group { animation: clashB 0.5s ease 0.7s both; }
@keyframes clashA {
  0%   { transform: translateX(0) rotate(0); }
  45%  { transform: translateX(26px) rotate(6deg); }
  100% { transform: translateX(0) rotate(0); }
}
@keyframes clashB {
  0%   { transform: translateX(0) rotate(0); }
  45%  { transform: translateX(-26px) rotate(-6deg); }
  100% { transform: translateX(0) rotate(0); }
}

/* 金色剑光（对剑瞬间挥出） */
.sword .slash { stroke-dasharray: 240; stroke-dashoffset: 240; }
.sword-a .slash { animation: slashA 0.5s ease 0.68s both; }
.sword-b .slash { animation: slashB 0.5s ease 0.68s both; }
@keyframes slashA {
  0%   { stroke-dashoffset: 240; opacity: 0; }
  60%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes slashB {
  0%   { stroke-dashoffset: 240; opacity: 0; }
  60%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* 剑锋相交：撞击环 */
.impact-ring {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  margin-top: -60px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: impact 0.6s ease 0.68s both;
}
.impact-ring.ring-b { animation-delay: 0.86s; }
@keyframes impact {
  0%   { transform: scale(0.2); opacity: 0; }
  40%  { opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* 第 2 幕：水墨散开 */
.intro-ink {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 50%, rgba(13, 13, 13, 0) 55%, rgba(13, 13, 13, 1) 78%);
  animation: inkSpread 1.0s ease 1.2s both;
}
@keyframes inkSpread {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* 第 3 幕：波澜扩散（墨滴入纸） */
.intro-ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  opacity: 0;
  animation: ripple 1.1s ease-out 2.2s both;
}
.intro-ripple::before,
.intro-ripple::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(201, 162, 39, 0.65);
  border-radius: 50%;
  animation: rippleRing 1.1s ease-out infinite;
}
.intro-ripple::after { animation-delay: 0.3s; }
@keyframes rippleRing {
  0%   { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(11); opacity: 0; }
}
@keyframes ripple {
  0%   { opacity: 0; transform: scale(0.6); }
  20%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

/* 第 4 幕：滴入界面（主界面淡入由 JS 切类） */
.intro.done { pointer-events: none; }
.intro.fade-out { animation: introOut 0.6s ease both; }
@keyframes introOut {
  to { opacity: 0; visibility: hidden; }
}

.intro-skip {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gray-mist);
  font-size: 14px;
  letter-spacing: 3px;
  opacity: 0;
  animation: fadeIn 1s ease 0.8s both;
}

/* ---------- 游戏容器（提示词 F） ---------- */
.game-shell {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--bg-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right))
           calc(20px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
}
.game-shell.fade-in { animation: fadeIn 0.5s ease both; }
.game-shell.fade-out { animation: heroFade 0.4s ease both reverse; }

.btn-back {
  /* v3.5.1 修复：原左上角大字按钮遮挡游戏正文顶部 → 改为右上角小悬浮按钮
     （游戏状态栏右侧在 PC 宽屏为空位、手机竖屏仅盖状态栏统计尾部，不遮 #log 正文）
     保留全部点击跳转功能，仅调整位置与尺寸；半透明毛玻璃保证可读且不刺眼 */
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: calc(8px + env(safe-area-inset-right));
  left: auto;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  letter-spacing: 2px;
  line-height: 1.4;
  z-index: 2;
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid rgba(201, 162, 39, 0.55);
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
/* v3.5.1 手机竖屏：按钮更小，避让刘海/灵动岛 */
@media (max-width: 768px) {
  .btn-back {
    top: calc(6px + env(safe-area-inset-top));
    right: calc(6px + env(safe-area-inset-right));
    min-height: 32px;
    padding: 4px 12px;
    font-size: 12px;
    letter-spacing: 1px;
  }
}

.game-placeholder {
  text-align: center;
  max-width: 90vw;
}
.game-seal {
  writing-mode: horizontal-tb;
  font-size: 40px;
  width: 96px;
  height: 96px;
  border-radius: 14px;
  margin: 0 auto 26px;
  animation: sealPulse 3s ease-in-out infinite;
}
@keyframes sealPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(239, 230, 208, 0.35), 0 0 0 0 rgba(169, 59, 47, 0.4); }
  50%      { box-shadow: inset 0 0 0 2px rgba(239, 230, 208, 0.35), 0 0 26px 6px rgba(169, 59, 47, 0.35); }
}
.game-hint {
  font-family: var(--font-title);
  font-size: 22px;
  letter-spacing: 6px;
  color: var(--gold);
  margin-bottom: 10px;
}
.game-hint-sub {
  font-size: 15px;
  color: var(--gray-mist);
  letter-spacing: 2px;
}

/* 游戏 iframe：撑满容器（游戏内自适配） */
.game-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* ---------- 响应式：手机（≤768px 切单列） ---------- */
@media (max-width: 768px) {
  :root { --section-gap: var(--section-gap-mobile); }

  .nav-links { gap: 16px; }
  .nav-links a { font-size: 15px; letter-spacing: 1px; }
  .brand-name { font-size: 19px; }
  .nav-auth { gap: 4px; }
  .auth-link { padding: 4px 6px; font-size: 14px; letter-spacing: 1px; }
  .nav-user { max-width: 64px; font-size: 14px; }
  .nav-game-btn { padding: 5px 12px; letter-spacing: 1px; }

  .hero-poem { font-size: 17px; height: 112px; }

  .card-grid { grid-template-columns: 1fr; gap: 18px; }

  .section-title { font-size: 28px; letter-spacing: 6px; }

  .article-title { font-size: 19px; }
  .article-item { padding-left: 18px; }

  .footer { padding: 36px 16px 44px; }

  .sword { width: 64px; }
  .intro-duel { gap: 14vw; }
}

/* 尊重系统减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
