/* =====================================================================
   汉字的演变 · The Evolution of Chinese Characters
   样式表 / Stylesheet

   风格：克制的编辑 / 博物馆风。宣纸般的暖白 + 朱红印章作点缀，
   宋体标题、干净无衬线正文、细线与柔和阴影、克制的动效。
   Restrained editorial / gallery look: warm paper white, a vermilion
   seal accent, serif display, clean sans body, hairlines, soft motion.
   ===================================================================== */

:root {
  /* 兽骨质感 · 暖牙白 + 朱红 + 暖金 / oracle-bone palette: warm bone, cinnabar, gold */
  --paper:    #E9DFC8;   /* 兽骨底 / bone base */
  --paper-2:  #F4EEDD;   /* 打磨过的骨白（卡片）/ polished bone (cards) */
  --paper-3:  #DBCDAD;   /* 深一点的骨黄 / deeper bone */
  --ink:      #33291D;   /* 焦褐墨 / warm ink brown */
  --ink-soft: #7A6A54;   /* 次要文字 / secondary text */
  --line:     rgba(51,41,29,0.18);  /* 细线 / hairline */
  --seal:     #C4472E;   /* 朱红（印章/主点缀）/ cinnabar seal red */
  --seal-deep:#A5391F;
  --gold:     #C89438;   /* 暖金（奖励/高亮）/ warm gold */
  --ok:       #C89438;   /* 答对高亮 = 暖金 / "correct" = gold */
  --radius:   14px;
  --shadow-s: 0 1px 2px rgba(51,41,29,0.08);
  --shadow-m: 0 3px 14px rgba(51,41,29,0.10);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong",
           "SimSun", Georgia, "Times New Roman", serif;
  --sans:  "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
           -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* 让 hidden 属性对所有元素生效（覆盖 .big-btn 的 display）/ make [hidden] win over display rules */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
/* 兽骨纹理：斑驳色块 + 细微裂纹噪点 / bone texture: mottled patches + faint noise */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 18% 12%, rgba(255,250,235,0.55) 0%, transparent 42%),
    radial-gradient(ellipse at 82% 20%, rgba(210,190,150,0.35) 0%, transparent 46%),
    radial-gradient(ellipse at 40% 88%, rgba(198,175,135,0.30) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(255,250,238,0.35) 0%, transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

/* =====================================================================
   互动特效层：彩带画布 + 气泡容器 / FX layer: confetti canvas + bubbles
   ===================================================================== */
#fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 900; }
#bubble-layer { position: fixed; inset: 0; pointer-events: none; z-index: 890; overflow: hidden; }
.bubble {
  position: fixed; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 32% 30%, rgba(255,255,255,0.9), rgba(200,148,56,0.45) 60%, rgba(196,71,46,0.15));
  animation: bubbleUp var(--bt, 900ms) cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes bubbleUp {
  0%   { transform: translateY(0) scale(0.3); opacity: 0; }
  20%  { opacity: 0.9; }
  100% { transform: translateY(var(--by, -90px)) translateX(var(--bx, 0)) scale(1); opacity: 0; }
}

/* =====================================================================
   语言切换 / language toggle
   ===================================================================== */
.lang-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 100;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.04em;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: color .2s, border-color .2s;
}
.lang-toggle:hover { color: var(--ink); border-color: var(--ink-soft); }
.lang-flag { display: none; }

/* =====================================================================
   视图切换 / view switching
   ===================================================================== */
.view { display: none; min-height: 100vh; padding: 32px 22px 72px; }
.view.active { display: block; animation: fadeIn .45s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   首页 / home
   ===================================================================== */
#view-home { display: none; }
#view-home.active { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.home-inner { max-width: 640px; }

/* 水墨 / 印章主视觉 / ink + seal hero mark */
.mascot { margin-bottom: 26px; }
.mascot-svg { width: clamp(120px, 26vw, 168px); height: auto; }

.home-title { margin-bottom: 14px; }
.home-title span {
  display: block;
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.1rem, 6.5vw, 3.4rem);
  letter-spacing: 0.08em; color: var(--ink); line-height: 1.25;
}
.home-sub {
  font-size: clamp(0.92rem, 2.6vw, 1.05rem);
  line-height: 1.7; color: var(--ink-soft);
  max-width: 30em; margin: 0 auto 34px;
}

/* 去掉飘动装饰 / floating decorations removed */
.floaty { display: none; }

/* =====================================================================
   按钮 / buttons
   ===================================================================== */
.big-btn {
  display: inline-block;
  padding: 13px 34px;
  font-family: var(--sans); font-size: 1rem; letter-spacing: 0.06em;
  color: var(--paper-2); background: var(--seal);
  border: none; border-radius: 8px;
  cursor: pointer; transition: background .2s, transform .12s;
}
.big-btn:hover { background: var(--seal-deep); }
.big-btn:active { transform: translateY(1px); }

/* 克制的点击反馈（JS 临时添加）/ subtle tap feedback */
.bounce { animation: tap .25s ease; }
@keyframes tap { 50% { transform: scale(0.97); } }
.pulse { /* 不再脉动 / no pulsing */ }

/* 返回 / back（幽灵按钮）/ ghost back button */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.03em;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; margin-bottom: 22px; transition: color .2s, border-color .2s;
}
.back-btn:hover { color: var(--ink); border-color: var(--ink-soft); }

/* =====================================================================
   汉字网格 / character grid
   ===================================================================== */
.grid-title {
  text-align: center; font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.25rem, 4vw, 1.8rem); letter-spacing: 0.06em;
  color: var(--ink); line-height: 1.5; margin: 4px 0 30px;
}
.char-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 2.4vw, 20px);
  max-width: 760px; margin: 0 auto;
}
@media (max-width: 520px) { .char-grid { grid-template-columns: repeat(2, 1fr); } }

.char-card {
  position: relative; aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  cursor: pointer; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.char-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); border-color: var(--ink-soft); }
.char-card:active { transform: translateY(-1px); }
.char-card .cc-glyph {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.2rem, 10vw, 3.4rem); line-height: 1; color: var(--ink);
}
.char-card .cc-label {
  font-size: clamp(0.66rem, 2.2vw, 0.8rem); letter-spacing: 0.05em;
  color: var(--ink-soft);
}
.char-card.tint { background: var(--paper-2); }  /* 统一卡片底色 / uniform card */
.cc-soon { display: none; }

/* =====================================================================
   详情页 / detail
   ===================================================================== */
#view-detail { max-width: 600px; margin: 0 auto; text-align: center; }

.detail-head { margin: 2px 0 18px; }
.d-pinyin {
  display: block; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 2rem); letter-spacing: 0.04em; color: var(--ink);
}
.d-meaning {
  display: block; font-size: clamp(0.9rem, 3vw, 1.05rem);
  letter-spacing: 0.04em; color: var(--ink-soft); margin-top: 2px;
}

/* 像画框 / framed like an artwork */
.stage-wrap {
  position: relative; width: min(86vw, 380px);
  margin: 8px auto 6px; padding: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-m);
  cursor: pointer; user-select: none; touch-action: pan-y;
}
#glyph-svg { display: block; width: 100%; height: auto; }
.tap-hint {
  position: absolute; bottom: 10px; left: 0; right: 0;
  font-size: 0.72rem; letter-spacing: 0.04em; color: var(--ink-soft);
  opacity: 0.7; pointer-events: none;
}
.tap-hint.hide { display: none; }

/* 时间轴 / timeline */
.timeline {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 4px; width: min(92vw, 440px); margin: 18px auto 4px;
}
.tl-node {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer; font-family: var(--sans);
}
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--paper); border: 1.5px solid var(--ink-soft);
  transition: background .25s, border-color .25s, transform .25s;
}
.tl-node.active .tl-dot { background: var(--seal); border-color: var(--seal); transform: scale(1.25); }
.tl-label { font-size: 0.68rem; letter-spacing: 0.03em; color: var(--ink-soft); }
.tl-node.active .tl-label { color: var(--ink); }

/* 滑块 / slider */
.stage-slider {
  -webkit-appearance: none; appearance: none;
  width: min(92vw, 440px); height: 3px; margin: 10px auto 2px; display: block;
  background: var(--line); border-radius: 999px; outline: none;
}
.stage-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper-2); border: 1.5px solid var(--ink); cursor: pointer;
  box-shadow: var(--shadow-s);
}
.stage-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper-2); border: 1.5px solid var(--ink); cursor: pointer;
}

/* 说明文字 / caption */
.d-caption {
  min-height: 3.2em; max-width: 440px; margin: 16px auto 4px; padding: 0 8px;
}
.d-caption .cap-zh { display: block; font-family: var(--serif); font-size: clamp(0.98rem, 3.4vw, 1.12rem); color: var(--ink); }
.d-caption .cap-en { display: block; font-size: 0.85em; color: var(--ink-soft); margin-top: 5px; }

/* 上一步 / 下一步 / step buttons */
.step-nav { display: flex; justify-content: center; gap: 16px; margin: 14px 0; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1rem; color: var(--ink); background: transparent;
  border: 1px solid var(--line); cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.round-btn:hover { border-color: var(--ink-soft); background: var(--paper-3); }
.round-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* 知识 / note —— 像展签 / like a gallery label */
.d-fact {
  max-width: 440px; margin: 16px auto; padding: 14px 18px; text-align: left;
  background: var(--paper-2); border: 1px solid var(--line);
  border-left: 3px solid var(--seal); border-radius: 6px;
  font-size: clamp(0.85rem, 3vw, 0.95rem); line-height: 1.65; color: var(--ink);
}
.d-fact b { color: var(--seal-deep); font-weight: 600; }
.d-fact .fact-en { display: block; color: var(--ink-soft); font-size: 0.9em; margin-top: 4px; }

/* 占位（保留容错）/ placeholder fallback */
.detail-placeholder {
  max-width: 440px; margin: 18px auto; padding: 22px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.95rem; line-height: 1.7; color: var(--ink-soft);
}
.detail-placeholder .ph-glyph { font-family: var(--serif); font-size: 3.4rem; color: var(--ink); display: block; margin-bottom: 10px; }
.detail-placeholder code { background: var(--paper-3); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

.next-char-btn { margin-top: 20px; background: var(--ink); }
.next-char-btn:hover { background: #000; }

/* =====================================================================
   首页板块导航 / home section board
   ===================================================================== */
:root { --ok: var(--gold); }  /* 答对用暖金（和铜绿点缀区分）/ "correct" = warm gold, distinct from teal */

.section-board {
  display: flex; flex-direction: column; gap: 14px;
  width: min(92vw, 460px); margin: 4px auto 0; text-align: left;
}
.section-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 16px 18px; background: var(--paper-2);
  border: 1.5px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-s); cursor: pointer; font-family: var(--sans);
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.section-card:hover { transform: translateY(-3px) scale(1.015); box-shadow: var(--shadow-m); border-color: var(--seal); background: #FBF6E8; }
.section-card:hover .sc-glyph { background: var(--seal); color: #FBF3E2; transform: rotate(-4deg) scale(1.06); }
.section-card:active { transform: translateY(-1px) scale(0.99); }
.section-card.pressed { animation: cardPop .32s ease; }
@keyframes cardPop { 0%,100%{ transform: translateY(-3px) scale(1.015);} 40%{ transform: translateY(-5px) scale(1.06);} }
.section-card .sc-glyph {
  flex: none; width: 54px; height: 54px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.85rem; color: var(--seal);
  background: var(--paper-3); border-radius: 14px;
  transition: background .18s ease, color .18s ease, transform .18s cubic-bezier(.34,1.56,.64,1);
}
.section-card .sc-text { display: flex; flex-direction: column; gap: 3px; }
.section-card .sc-title { font-family: var(--serif); font-size: 1.04rem; letter-spacing: 0.03em; color: var(--ink); }
.section-card .sc-title small { font-weight: normal; font-style: italic; color: var(--ink-soft); font-size: 0.78em; margin-left: 6px; }
.section-card .sc-desc { font-size: 0.8rem; line-height: 1.5; color: var(--ink-soft); }
.section-card.soon { cursor: default; opacity: 0.6; }
.section-card.soon:hover { transform: none; box-shadow: var(--shadow-s); border-color: var(--line); }
.sc-soon-tag {
  margin-left: auto; align-self: center; white-space: nowrap;
  font-size: 0.64rem; letter-spacing: 0.06em; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
}

/* =====================================================================
   猜一猜甲骨文 / Guess the Oracle (quiz)
   ===================================================================== */
#view-quiz { max-width: 560px; margin: 0 auto; text-align: center; }
.quiz-head {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 440px; margin: 0 auto 4px;
  font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-soft);
}
.quiz-score { color: var(--seal-deep); font-weight: 600; }
/* 血条 / hearts (HP) */
.quiz-hearts { display: inline-flex; gap: 3px; }
.quiz-hearts .heart { color: var(--seal); font-size: 1.15rem; line-height: 1; transition: color .3s ease, transform .3s ease; }
.quiz-hearts .heart.lost { color: rgba(51,41,29,0.18); transform: scale(0.8); }
.quiz-prompt {
  font-family: var(--serif); font-size: clamp(1.1rem, 3.6vw, 1.4rem);
  color: var(--ink); margin: 8px 0 16px;
}
.quiz-stage {
  position: relative;
  width: min(64vw, 240px); margin: 0 auto 20px; padding: 10px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-m);
}
#quiz-svg { display: block; width: 100%; height: auto; }
/* 裂纹（答对时画出）/ crack drawn on a correct answer */
.quiz-crack { stroke-dasharray: 260; stroke-dashoffset: 260; opacity: 0; }
.quiz-crack.cracking { animation: crackDraw .5s ease forwards; }
@keyframes crackDraw { 0%{opacity:0;stroke-dashoffset:260;} 12%{opacity:1;} 100%{opacity:0.9;stroke-dashoffset:0;} }
/* 答对：字形迸开一下 / correct: glyph pops */
#quiz-stage.burst #quiz-svg { animation: qBurst .55s ease; }
@keyframes qBurst { 0%{transform:scale(1);} 28%{transform:scale(1.12) rotate(-2deg);} 60%{transform:scale(0.98) rotate(1deg);} 100%{transform:scale(1);} }
/* 答错：抖动 + 变红 / wrong: shake + flash red */
#quiz-stage.shake { animation: qShake .45s ease; }
@keyframes qShake { 0%,100%{transform:translateX(0);} 15%{transform:translateX(-9px) rotate(-1.5deg);} 35%{transform:translateX(9px) rotate(1.5deg);} 55%{transform:translateX(-7px);} 75%{transform:translateX(7px);} }
#quiz-stage.shake #quiz-glyph path { stroke: var(--seal); }
/* 飘分 / floating points */
.quiz-plus {
  position: absolute; left: 50%; top: 26%; transform: translate(-50%, 0);
  font-family: var(--serif); font-weight: 700; font-size: 1.5rem; color: var(--gold);
  opacity: 0; pointer-events: none; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.quiz-plus.show { animation: plusUp 1s ease forwards; }
@keyframes plusUp {
  0%{opacity:0; transform:translate(-50%,12px) scale(.6);}
  22%{opacity:1; transform:translate(-50%,-4px) scale(1.1);}
  100%{opacity:0; transform:translate(-50%,-46px) scale(1);}
}
.quiz-options {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: 440px; margin: 0 auto;
}
@media (max-width: 420px) { .quiz-options { gap: 8px; } }
.quiz-option {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; font-family: var(--sans);
  transition: transform .12s ease, border-color .2s, background .2s;
}
.quiz-option:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--ink-soft); }
.quiz-option .qo-glyph { font-family: var(--serif); font-size: clamp(1.8rem, 7vw, 2.3rem); line-height: 1; color: var(--ink); }
.quiz-option .qo-label { font-size: 0.68rem; letter-spacing: 0.02em; color: var(--ink-soft); }
.quiz-option:disabled { cursor: default; }
.quiz-option.correct { border-color: var(--ok); background: rgba(183,137,47,0.13); }
.quiz-option.correct .qo-glyph, .quiz-option.correct .qo-label { color: var(--ok); }
.quiz-option.wrong { opacity: 0.4; animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.quiz-feedback { min-height: 2.2em; max-width: 440px; margin: 16px auto 4px; }
.quiz-feedback .qf-zh { display: block; font-family: var(--serif); color: var(--ink); font-size: 1rem; }
.quiz-feedback .qf-en { display: block; color: var(--ink-soft); font-size: 0.82em; margin-top: 3px; }
#quiz-next { margin-top: 6px; }

.quiz-result { max-width: 440px; margin: 36px auto 0; }
.quiz-result .qr-score { font-family: var(--serif); font-size: 3.2rem; color: var(--seal); line-height: 1; }
.quiz-result .qr-score small { color: var(--ink-soft); font-size: 0.38em; letter-spacing: 0.04em; }
.quiz-result .qr-msg { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); margin: 12px 0 4px; }
.quiz-result .qr-msg-en { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 26px; }
.quiz-result .qr-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.quiz-result .qr-actions .big-btn:last-child { background: var(--ink); }

/* =====================================================================
   什么是甲骨文 / What Are Oracle Bones? (story panels)
   ===================================================================== */
#view-about { max-width: 660px; margin: 0 auto; }
.about-title {
  text-align: center; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 2.1rem); letter-spacing: 0.06em;
  color: var(--ink); margin: 4px 0 30px;
}
/* 一步一屏 / one step at a time */
.about-stage { min-height: 360px; display: flex; justify-content: center; overflow: visible; cursor: pointer; }
.about-step {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 18px; max-width: 460px; width: 100%;
}
.about-step.entering { animation: abEnter .6s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes abEnter { 0%{opacity:0; transform:translateY(-46px) scale(.88) rotate(-3deg);} 60%{opacity:1;} 100%{opacity:1; transform:none;} }

.ab-fig {
  position: relative; width: min(74vw, 264px); aspect-ratio: 6/5;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-m);
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease, border-color .18s ease;
}
.about-stage:hover .ab-fig { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 22px rgba(51,41,29,0.15); border-color: var(--seal); }
.ab-fig > svg { width: 78%; height: auto; }
/* 裂纹覆盖层（点一下画出）/ crack overlay drawn on tap */
.ab-crack { position: absolute; inset: 6%; display: block; pointer-events: none; }
.ab-crack svg { width: 100%; height: 100%; }
.ab-crack path { stroke-dasharray: 300; stroke-dashoffset: 300; opacity: 0; }
.ab-fig.cracking .ab-crack path { animation: crackDraw .3s ease forwards; }
/* 裂 → 抖 → 坠落 / crack → shiver → the bone drops off screen */
.ab-fig.cracking { animation: abShiver .3s ease; }
@keyframes abShiver { 0%,100%{transform:none;} 20%{transform:translate(-5px,-2px) rotate(-2deg);} 50%{transform:translate(5px,1px) rotate(2deg);} 80%{transform:translate(-3px,0) rotate(-1deg);} }
.ab-fig.falling { animation: figFall .6s cubic-bezier(.5,0,.85,.4) forwards; z-index: 20; }
@keyframes figFall {
  0%   { transform: none; opacity: 1; }
  14%  { transform: rotate(-6deg) translateY(-10px); }        /* 先向后仰一下 / tip back */
  100% { transform: rotate(26deg) translateY(115vh); opacity: 0; }  /* 翻转坠落 / tumble down */
}

.ab-title { display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--serif); font-weight: 600; font-size: 1.22rem; color: var(--ink); letter-spacing: 0.03em; }
.ap-num {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 0.82rem; color: var(--paper-2);
  background: var(--seal); border-radius: 50%;
}
.ab-body { font-size: 0.98rem; line-height: 1.75; color: var(--ink-soft); max-width: 30em; }

/* 进度点 / progress dots */
.about-dots { display: flex; justify-content: center; gap: 9px; margin: 22px 0 8px; }
.ab-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--paper-3);
  border: 1px solid var(--line); transition: background .25s, transform .25s, opacity .25s; }
.ab-dot.done { background: var(--seal); opacity: 0.45; }
.ab-dot.on { background: var(--seal); transform: scale(1.4); }
.about-hint { text-align: center; font-size: 0.82rem; color: var(--ink-soft);
  animation: hintPulse 1.7s ease-in-out infinite; }
@keyframes hintPulse { 0%,100%{opacity:0.45;} 50%{opacity:0.9;} }

.about-foot { text-align: center; margin-top: 30px; }

/* =====================================================================
   甲骨文拼图 / Oracle jigsaw
   ===================================================================== */
#view-puzzle { max-width: 520px; margin: 0 auto; text-align: center; }
.puzzle-prompt {
  font-family: var(--serif); font-size: clamp(1.05rem, 3.4vw, 1.3rem);
  color: var(--ink); margin: 6px 0 10px;
}
.puzzle-target {
  font-family: var(--serif); font-size: 1.05rem; letter-spacing: 0.04em;
  color: var(--ink-soft); margin-bottom: 6px;
}
.puzzle-board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  width: min(78vw, 320px); aspect-ratio: 1; margin: 14px auto;
}
.puzzle-tile {
  aspect-ratio: 1; padding: 0; overflow: hidden; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.puzzle-tile svg { display: block; width: 100%; height: 100%; }
.puzzle-tile:hover { border-color: var(--ink-soft); }
.puzzle-tile.sel { border-color: var(--seal); box-shadow: inset 0 0 0 2px var(--seal); }
.puzzle-tile:active { transform: scale(0.97); }
/* 拼好后去掉缝隙与边框，露出完整字 / once solved, drop gaps & borders */
.puzzle-board.solved { gap: 0; }
.puzzle-board.solved .puzzle-tile { border-color: transparent; border-radius: 0; cursor: default; }
.puzzle-feedback { min-height: 1.8em; margin: 8px auto 4px; }
.puzzle-feedback .pz-line { font-family: var(--serif); color: var(--seal-deep); font-size: 1.05rem; }
.puzzle-actions { display: flex; gap: 14px; justify-content: center; align-items: center; margin-top: 8px; }

/* =====================================================================
   查甲骨文字典 / Oracle dictionary
   ===================================================================== */
#view-dict { max-width: 720px; margin: 0 auto; }
.dict-title {
  text-align: center; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.4rem, 5vw, 2rem); letter-spacing: 0.06em;
  color: var(--ink); margin: 2px 0 18px;
}
.dict-search { text-align: center; }
.dict-input {
  width: min(92%, 460px); padding: 12px 16px;
  font-family: var(--sans); font-size: 1.05rem; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
  outline: none; text-align: center; transition: border-color .2s;
}
.dict-input:focus { border-color: var(--seal); }

/* 输入结果：一排大字形 / typed result: a row of big oracle glyphs */
.dict-result {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  min-height: 8px; margin: 20px auto 6px;
}
.ot {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px;
}
.ot img, .ot svg { display: block; width: 64px; height: 64px; }
.ot.big img, .ot.big svg { width: 110px; height: 110px; }
/* JPG 字形是黑字白底：用 multiply 让白底融进卡片 / blend white JPG bg into the card */
.ob-img { mix-blend-mode: multiply; }
.ot-cap { font-size: 0.78rem; color: var(--ink-soft); letter-spacing: 0.02em; }
.ot.missing { border-style: dashed; }
.ot .ot-x { font-size: 3rem; color: var(--line); line-height: 1; }
.ot.big .ot-x { width: 110px; height: 110px; display: grid; place-items: center; }

/* 字库 / library */
.dict-lib-head {
  margin: 26px 0 12px; text-align: center;
  font-family: var(--serif); font-size: 1rem; letter-spacing: 0.04em; color: var(--ink-soft);
}
.dict-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px; max-height: 56vh; overflow-y: auto; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
.gal-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.gal-item:hover { border-color: var(--seal); transform: translateY(-2px); }
.gal-item img, .gal-item svg { width: 46px; height: 46px; display: block; }
.gal-item span { font-size: 0.72rem; color: var(--ink-soft); }

.dict-credit { text-align: center; font-size: 0.74rem; color: var(--ink-soft); margin: 16px 0 0; }
.dict-credit a { color: var(--seal-deep); }

@media (min-width: 768px) { .view { padding: 40px 28px 88px; } }
