/* ==========================================================================
   css/base.css —— 全局基底
   说明：重置、宣纸纸纹、毛边、卷轴木轴、竹节分隔、区块标题、
        按钮 / 标签 / 波纹 / 错落渐入、图标配色、页脚。
        所有板块样式都建立在这一层之上。
   ========================================================================== */

/* ==========================================================================
   全局触感修复（放在最前，后面的规则可以正常覆盖它）
   1. 去掉移动端点击时浏览器自带的浅蓝遮罩，以及长按弹出的系统菜单
   2. 表单控件走自绘外观
   3. 焦点圈只用 :focus-visible：鼠标 / 触摸点击不画圈，键盘 Tab 导航有金色描边
   ========================================================================== */

/* 1-a 根元素：同一条属性写两遍，兼容只认 rgba 的老安卓 WebKit */
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html,
body {
  -webkit-tap-highlight-color: transparent;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-touch-callout: none;
}

/* 1-b 所有可点击元素 */
a,
button,
.btn,
.card,
.pact,
.pt,
.quiz-opt,
input,
label,
[role="button"],
[tabindex] {
  -webkit-tap-highlight-color: transparent;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-touch-callout: none;
}

/* 2 表单控件：去掉系统默认皮肤，避免与自绘样式打架 */
input,
button,
textarea,
select {
  -webkit-appearance: none;
  appearance: none;
}

/* 3-a 鼠标 / 触摸点出来的焦点，不画圈 */
a:focus,
button:focus,
.btn:focus,
.card:focus,
.pact:focus,
.pt:focus,
.quiz-opt:focus,
input:focus,
label:focus,
[role="button"]:focus,
[tabindex]:focus {
  outline: none;
}

/* 3-b 键盘 Tab 走到时给金色描边
   必须写在上一条之后：两者同权重，靠源码顺序决定胜负 */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.card:focus-visible,
.pact:focus-visible,
.pt:focus-visible,
.quiz-opt:focus-visible,
input:focus-visible,
label:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ 重置 */
*,
*::before,
*::after { box-sizing: border-box; }

html,
body { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-song);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url('../assets/svg/paper-noise.svg'),
    radial-gradient(circle at 14% 6%, rgba(201, 162, 39, .10), transparent 46%),
    radial-gradient(circle at 86% 82%, rgba(178, 58, 43, .07), transparent 44%),
    linear-gradient(180deg, #f8f3e8 0%, var(--paper) 38%, #f1e9d9 100%);
  background-attachment: fixed;
  background-size: 240px 240px, auto, auto, auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 弹层打开时锁住页面滚动 */
body.modal-open { overflow: hidden; }

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

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }

ul, ol { padding: 0; list-style: none; }

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

button,
input,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

::selection { background: rgba(178, 58, 43, .22); }

/* --------------------------------------------------------- 卷轴木轴（上下） */
.scroll-rod {
  position: fixed;
  left: 0;
  right: 0;
  z-index: var(--z-rod);
  height: 22px;
  pointer-events: none;
  background:
    linear-gradient(180deg, #e2d7bd 0%, #cbbd9c 38%, #a2916f 72%, #8b7c5e 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .5),
    inset 0 -3px 6px rgba(31, 28, 26, .22);
}

.scroll-rod::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, .7), transparent);
}

.rod-top { top: 0; }
.rod-top::after { bottom: 0; }

.rod-bottom { bottom: 0; }
.rod-bottom::after { top: 0; }

/* 轴头：可点击（首屏那条回顶部） */
.rod-knob {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  background: url('../assets/svg/rod-knob.svg') center / contain no-repeat;
  filter: drop-shadow(0 3px 6px rgba(31, 28, 26, .3));
}

.rod-knob.knob-l { left: -10px; }
.rod-knob.knob-r { right: -10px; }

.rod-top .rod-knob { pointer-events: auto; cursor: pointer; }
.rod-top .rod-knob:hover { filter: drop-shadow(0 5px 12px rgba(201, 162, 39, .55)) brightness(1.06); }

/* 木轴要给页面留出上下空间 */
.page {
  position: relative;
  padding-top: 22px;
  padding-bottom: 22px;
}

/* 页面左右毛边（手撕纸的抖边） */
.page::before,
.page::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 26px;
  pointer-events: none;
  background: url('../assets/svg/rough-edge.svg') center / 100% 100% no-repeat;
  opacity: .55;
}

.page::before { left: 0; }
.page::after { right: 0; transform: scaleX(-1); }

/* -------------------------------------------------------------- 版心与分区 */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

.sec {
  position: relative;
  padding: var(--sec-pad) 0;
}

.sec > .wrap { position: relative; z-index: 1; }

/* 宣纸面板：给内容一层厚一点的底 */
.panel {
  position: relative;
  background:
    url('../assets/svg/paper-noise.svg') 0 0 / 240px 240px,
    linear-gradient(180deg, rgba(255, 253, 246, .94), rgba(246, 240, 228, .96));
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--inner);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: url('../assets/svg/rough-edge.svg') center / 100% 100% no-repeat;
  opacity: .35;
}

/* -------------------------------------------------------- 竹节 / 墨点分隔 */
.sep {
  position: relative;
  height: 60px;
  margin: 0 auto;
  max-width: 720px;
  background: url('../assets/svg/ink-divider.svg') center / contain no-repeat;
  opacity: .8;
}

.sep.tight { height: 40px; max-width: 460px; }

/* -------------------------------------------------------------- 区块标题 */
.sec-head {
  position: relative;
  text-align: center;
  margin-bottom: 46px;
}

.sec-head .kicker {
  font-family: var(--font-kai);
  font-size: .78rem;
  letter-spacing: .42em;
  text-indent: .42em;
  color: var(--gold);
  margin-bottom: 12px;
}

.sec-head h2 {
  font-size: clamp(1.6rem, 4.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: .14em;
  text-indent: .14em;
  line-height: 1.4;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}

.sec-head h2 .dot { color: var(--red); }

.sec-head .sub {
  margin-top: 14px;
  font-family: var(--font-kai);
  font-size: clamp(.88rem, 2.4vw, 1.02rem);
  letter-spacing: .06em;
  color: var(--ink-soft);
}

/* 标题下的一道淡墨 */
.sec-head .brush {
  width: 132px;
  height: 12px;
  margin: 18px auto 0;
  opacity: .7;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(31, 28, 26, .45), transparent 72%);
}

/* ----------------------------------------------------------------- 按钮 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  overflow: hidden;
  padding: .74em 1.8em;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fdf8ee;
  font-family: var(--font-kai);
  font-size: 1rem;
  letter-spacing: .12em;
  box-shadow: 0 6px 18px rgba(178, 58, 43, .26), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}

.btn:hover {
  transform: translateY(-3px);
  background: var(--red-deep);
  box-shadow: 0 13px 28px rgba(178, 58, 43, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.btn:active {
  transform: translateY(1px) scale(.985);
  box-shadow: 0 3px 10px rgba(178, 58, 43, .3);
}

.btn.ghost {
  background: rgba(255, 253, 246, .6);
  color: var(--red);
  border-color: rgba(178, 58, 43, .7);
  box-shadow: 0 4px 14px rgba(31, 28, 26, .08);
}

.btn.ghost:hover {
  background: rgba(178, 58, 43, .09);
  box-shadow: 0 12px 24px rgba(178, 58, 43, .16);
}

.btn.gold {
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #3a2c06;
  box-shadow: 0 6px 18px rgba(201, 162, 39, .34);
}

.btn.gold:hover {
  background: linear-gradient(180deg, #edd894, var(--gold));
  box-shadow: 0 13px 28px rgba(201, 162, 39, .42);
}

.btn.small { padding: .5em 1.15em; font-size: .86rem; letter-spacing: .1em; }

/* ----------------------------------------------------------------- 标签 */
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  overflow: hidden;
  padding: .3em .85em;
  border: 1px solid rgba(201, 162, 39, .6);
  border-radius: 999px;
  background: rgba(255, 253, 246, .72);
  font-family: var(--font-kai);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--ink-2);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
              background .22s var(--ease), border-color .22s var(--ease);
}

.chip:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(201, 162, 39, .12);
  box-shadow: 0 8px 18px rgba(31, 28, 26, .1);
}

.chip.on {
  border-color: var(--red);
  background: rgba(178, 58, 43, .12);
  color: var(--red);
  box-shadow: 0 6px 16px rgba(178, 58, 43, .16);
}

.chip-level {
  border-color: rgba(178, 58, 43, .45);
  color: var(--red);
  background: rgba(178, 58, 43, .07);
  white-space: nowrap;
  flex-shrink: 0;
}

.chip-note {
  font-size: .72rem;
  color: var(--ink-soft);
  letter-spacing: .04em;
}

/* 波纹反馈 */
.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, .5);
  transform: scale(0);
  animation: jc-rip .62s ease-out forwards;
}

.chip .ripple,
.btn.ghost .ripple,
.pact .ripple { background: rgba(178, 58, 43, .2); }

@keyframes jc-rip {
  to { transform: scale(2.6); opacity: 0; }
}

/* ------------------------------------------------------------ 错落渐入 */
/* 只在 JS 就绪后隐藏，脚本万一失败页面也不会空白 */
html.jc-ready .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}

html.jc-ready .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------- 图标统一配色 */
.icon-svg {
  width: 100%;
  height: 100%;
  color: var(--ink);
  overflow: visible;
}

.icon-svg .acc { stroke: var(--red); }
.icon-svg .gold { stroke: var(--gold); }
.icon-svg .fill-ink { fill: var(--ink); stroke: none; }
.icon-svg .fill-red { fill: var(--red); stroke: none; }
.icon-svg .fill-gold { fill: var(--gold); stroke: none; }

.seal-svg {
  width: 100%;
  height: 100%;
  color: var(--red);
}

/* -------------------------------------------------------- 横向长卷容器 */
.scroll-x {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(178, 58, 43, .5) transparent;
}

.scroll-x::-webkit-scrollbar { height: 8px; }
.scroll-x::-webkit-scrollbar-track { background: rgba(31, 28, 26, .06); border-radius: 999px; }
.scroll-x::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(201, 162, 39, .8), rgba(178, 58, 43, .8));
  border-radius: 999px;
}

/* 长卷两端提示：告诉用户可以横着拖 */
.scroll-hint-x {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  margin-top: 14px;
  font-family: var(--font-kai);
  font-size: .78rem;
  letter-spacing: .22em;
  color: var(--ink-soft);
  opacity: .8;
}

.scroll-hint-x::before,
.scroll-hint-x::after {
  content: "";
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(31, 28, 26, .4));
}

.scroll-hint-x::after { transform: scaleX(-1); }

/* ----------------------------------------------------------------- 页脚 */
.site-foot {
  position: relative;
  padding: 52px 0 64px;
  text-align: center;
  border-top: var(--line-gold);
  background: linear-gradient(180deg, rgba(246, 240, 228, .5), rgba(229, 217, 193, .55));
}

.site-foot .f-slogan {
  font-family: var(--font-kai);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  letter-spacing: .26em;
  text-indent: .26em;
  color: var(--ink);
}

.site-foot .f-note {
  margin-top: 12px;
  font-family: var(--font-kai);
  font-size: .86rem;
  letter-spacing: .12em;
  color: var(--ink-soft);
}

.site-foot .f-line {
  width: 90px;
  height: 12px;
  margin: 22px auto;
  opacity: .6;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(178, 58, 43, .5), transparent 72%);
}

.site-foot .f-meta {
  font-size: .78rem;
  letter-spacing: .1em;
  color: var(--ink-soft);
}

.site-foot .f-meta b { color: var(--red); font-weight: 700; }

/* 通用小字 */
.tiny {
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--ink-soft);
}

/* 屏幕阅读器专用 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 尊重系统的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html.jc-ready .reveal { opacity: 1; transform: none; }
}