/* =========================================================
   世界名画百科魔法书 — Magic-book / parchment aesthetic
   Supports iPad landscape (1024+) and TV (1920+).
   ========================================================= */

:root {
  /* Parchment palette */
  --paper:        #efe1c1;
  --paper-hi:     #f7ecd1;
  --paper-lo:     #d9c39a;
  --paper-deep:   #b7986a;
  --ink:          #2b1a0a;
  --ink-soft:     #4a3320;
  --ink-faded:    #7a5836;
  --sepia:        #5c3a1e;
  --wine:         #7a1f1f;
  --wax-red:      #8b1e1e;
  --gold:         #b8862c;
  --gold-hi:      #e7c66a;
  --gold-deep:    #6e4d12;
  --emerald:      #3d5b3a;
  --indigo-deep:  #1f2748;

  /* Type */
  --font-serif-en: 'Cormorant Garamond', 'IM Fell English', serif;
  --font-serif-zh: 'Noto Serif SC', 'Songti SC', serif;
  --font-hand-en:  'Caveat', cursive;
  --font-hand-zh:  'Ma Shan Zheng', 'Long Cang', 'ZCOOL XiaoWei', cursive;
  --font-display-en: 'IM Fell English SC', 'Cormorant Garamond', serif;
  --font-display-zh: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;

  --shadow-deep: 0 18px 40px rgba(40, 22, 6, 0.35), 0 4px 10px rgba(40,22,6,.2);
  --shadow-soft: 0 6px 18px rgba(60, 35, 10, .25);

  --frame-grad: linear-gradient(135deg, #d9b15a 0%, #f3dc8b 18%, #a6741c 38%, #f3dc8b 58%, #7c531a 80%, #d9b15a 100%);
}

/* Theme: museum (deep) */
[data-theme="museum"] {
  --paper: #1a120a;
  --paper-hi: #2a1d10;
  --paper-lo: #0e0805;
  --paper-deep: #000000;
  --ink: #f1e6cc;
  --ink-soft: #d6c39a;
  --ink-faded: #a78d63;
}

/* Theme: editorial (modern, light, clean) */
[data-theme="editorial"] {
  --paper: #f6f3ee;
  --paper-hi: #ffffff;
  --paper-lo: #ebe6dd;
  --paper-deep: #c9c1b1;
  --ink: #1a1814;
  --ink-soft: #3a342b;
  --ink-faded: #7c7569;
  --gold: #2a2a2a;
  --gold-hi: #b8b0a0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: #0f0a06;
  color: var(--ink);
  font-family: var(--font-serif-zh), var(--font-serif-en);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

/* =========================================================
   Fixed-canvas scale-to-fit (designed for iPad/TV)
   ========================================================= */
.fit-stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0a0604;
  overflow: hidden;
}
.fit-canvas {
  position: relative;
  width: 1366px;
  height: 900px;
  transform-origin: center center;
  flex: 0 0 auto;
}

button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* =========================================================
   Parchment backdrop
   ========================================================= */
.codex-root {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, var(--paper-hi) 0%, var(--paper) 35%, var(--paper-lo) 70%, var(--paper-deep) 100%);
  color: var(--ink);
  overflow: hidden;
}

.codex-root::before {
  /* paper grain */
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.28  0 0 0 0 0.18  0 0 0 0 0.08  0 0 0 0.32 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: .55;
}

.codex-root::after {
  /* vignette + edge stains */
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(40,22,6,.32) 100%),
    radial-gradient(circle at 8% 90%, rgba(70,35,10,.35), transparent 22%),
    radial-gradient(circle at 92% 12%, rgba(70,35,10,.28), transparent 18%);
  pointer-events: none;
  mix-blend-mode: multiply;
}

[data-theme="museum"] .codex-root::after {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,.7) 100%);
}
[data-theme="editorial"] .codex-root::before { opacity: .15; }
[data-theme="editorial"] .codex-root::after { background: none; }

/* =========================================================
   Top chrome — running header
   ========================================================= */
.codex-header {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 30;
  padding: 22px 40px 14px;
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.codex-header > * { pointer-events: auto; }

.codex-title {
  display: flex; align-items: baseline; gap: 16px;
}
.codex-title .zh {
  font-family: var(--font-display-zh);
  font-size: 24px; letter-spacing: .12em;
  color: var(--ink);
}
.codex-title .en {
  font-family: var(--font-display-en);
  font-style: italic;
  font-size: 14px; letter-spacing: .22em;
  color: var(--ink-faded);
  text-transform: lowercase;
}
.codex-title .ornament {
  font-size: 16px; color: var(--gold-deep);
}

.codex-folio {
  font-family: var(--font-display-en);
  font-size: 13px; letter-spacing: .3em;
  color: var(--ink-faded);
  text-transform: uppercase;
}

/* =========================================================
   Cover (intro flourish) — could be hidden via tweak
   ========================================================= */

/* =========================================================
   Gallery view — bookshelf of paintings
   ========================================================= */
.gallery-stage {
  position: absolute; inset: 0;
  padding: 60px 40px 30px;
  display: flex; flex-direction: column;
}

.gallery-headline {
  text-align: center;
  margin: 0 0 18px;
  flex: 0 0 auto;
}
.gallery-headline .kicker {
  font-family: var(--font-hand-en);
  font-size: 20px; color: var(--wax-red);
  letter-spacing: .04em;
  transform: rotate(-1.5deg);
  display: inline-block;
}
.gallery-headline h1 {
  margin: 2px 0 4px;
  font-family: var(--font-display-zh);
  font-size: 44px; font-weight: 500;
  letter-spacing: .14em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,240,200,.6);
}
.gallery-headline .sub {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 16px; color: var(--ink-faded);
  letter-spacing: .08em;
}
.gallery-headline .rule {
  margin: 8px auto 0;
  width: 220px; height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 280 18'><path d='M0 9 H110 M170 9 H280' stroke='%236e4d12' stroke-width='1'/><circle cx='140' cy='9' r='4' fill='none' stroke='%236e4d12'/><circle cx='140' cy='9' r='1.4' fill='%236e4d12'/><path d='M120 9 L132 5 M120 9 L132 13 M160 9 L148 5 M160 9 L148 13' stroke='%236e4d12' stroke-width='.8' fill='none'/></svg>") center/contain no-repeat;
}

.gallery-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 18px 36px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  align-items: stretch;
  min-height: 0;
}

.gallery-card {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
  min-height: 0;
}
.gallery-card:hover { transform: translateY(-4px) rotate(.4deg); }
.gallery-card:nth-child(2n):hover { transform: translateY(-4px) rotate(-.4deg); }

.gallery-card .frame {
  position: relative;
  flex: 1 1 auto;
  width: auto;
  aspect-ratio: 3/4;
  max-height: 100%;
  padding: 10px;
  background: var(--frame-grad);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,.25),
    inset 0 0 12px rgba(120,80,20,.5),
    0 12px 24px rgba(30,18,5,.45),
    0 3px 6px rgba(30,18,5,.35);
}
.gallery-card .frame::before {
  /* inner bevel */
  content: '';
  position: absolute; inset: 8px;
  border: 1px solid rgba(110,77,18,.5);
  border-radius: 2px;
  pointer-events: none;
}
.gallery-card .canvas {
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  filter: saturate(.94) contrast(1.02);
}

.gallery-card .label-zh {
  margin-top: 8px;
  font-family: var(--font-display-zh);
  font-size: 16px; letter-spacing: .12em;
  color: var(--ink);
  line-height: 1.2;
}
.gallery-card .label-en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 12px; color: var(--ink-faded);
  letter-spacing: .04em;
  line-height: 1.2;
}
.gallery-card .artist {
  font-family: var(--font-hand-en);
  font-size: 14px; color: var(--wax-red);
  margin-top: 1px;
  line-height: 1.2;
}

.gallery-card .seal {
  position: absolute; top: -6px; right: -6px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--wax-red);
  color: #f8e6c8;
  font-family: var(--font-display-zh);
  font-size: 10px; letter-spacing: .03em;
  box-shadow: 0 3px 8px rgba(80,10,10,.5), inset 0 0 5px rgba(0,0,0,.35);
  transform: rotate(-12deg);
  text-align: center; line-height: 1.1;
  white-space: pre;
}
.gallery-card.featured .seal {
  background: #6e4d12;
  color: #f7e0a8;
}

/* "Open this codex" CTA on the featured card */
.gallery-card.featured .frame::after {
  content: '';
  position: absolute; inset: -10px;
  border: 1px dashed rgba(110,77,18,.6);
  border-radius: 8px;
  pointer-events: none;
  animation: spinDash 80s linear infinite;
}
@keyframes spinDash {
  from { transform: rotate(0); } to { transform: rotate(360deg); }
}

.gallery-foot {
  text-align: center;
  margin-top: 12px;
  flex: 0 0 auto;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 12px; color: var(--ink-faded);
  letter-spacing: .12em;
}
.gallery-foot .zh {
  font-family: var(--font-hand-zh);
  font-style: normal;
  font-size: 16px;
  color: var(--wax-red);
  margin-right: 10px;
}

/* =========================================================
   Painting deep view
   ========================================================= */
.painting-stage {
  position: absolute; inset: 0;
  padding: 70px 36px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 28px;
}
.painting-stage.no-panel { grid-template-columns: 1fr; }

.painting-canvas-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

.painting-frame {
  position: relative;
  padding: 22px;
  background: var(--frame-grad);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,.28),
    inset 0 0 18px rgba(120,80,20,.55),
    0 24px 48px rgba(20,12,4,.55),
    0 8px 14px rgba(20,12,4,.4);
  max-height: 100%;
  display: flex;
}
.painting-frame::before {
  content: '';
  position: absolute; inset: 14px;
  border: 1px solid rgba(110,77,18,.55);
  border-radius: 2px;
  pointer-events: none;
}
.painting-frame::after {
  content: '';
  position: absolute; inset: 18px;
  border-top: 1px solid rgba(255,230,170,.4);
  border-left: 1px solid rgba(255,230,170,.4);
  border-right: 1px solid rgba(80,50,10,.4);
  border-bottom: 1px solid rgba(80,50,10,.4);
  pointer-events: none;
}

.painting-img-host {
  position: relative;
  background: #0a0604;
  overflow: hidden;
}
.painting-img-host img {
  display: block;
  height: 660px;
  width: auto;
  max-width: 100%;
  user-drag: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* hotspots */
.hotspot {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  display: grid; place-items: center;
  z-index: 5;
}
.hotspot .core {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff6c8 0%, #ffd56b 35%, #c89220 70%, #6b4609 100%);
  box-shadow:
    0 0 0 2px rgba(255, 230, 150, .35),
    0 0 18px 4px rgba(255, 200, 90, .65),
    0 0 40px 10px rgba(255, 180, 70, .35);
  position: relative;
  z-index: 2;
}
.hotspot .ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 220, 140, .55);
  animation: hotspot-ripple 2.4s ease-out infinite;
}
.hotspot .ring.r2 { animation-delay: .8s; }
.hotspot .ring.r3 { animation-delay: 1.6s; }
@keyframes hotspot-ripple {
  0%   { transform: scale(.45); opacity: 0; }
  10%  { opacity: .9; }
  100% { transform: scale(1.8); opacity: 0; }
}
.hotspot:hover .core { transform: scale(1.2); }
.hotspot.active .core {
  background: radial-gradient(circle at 30% 30%, #fff 0%, #ffe28a 30%, #d97a1a 70%, #5a1d04 100%);
  box-shadow: 0 0 0 2px rgba(255,240,180,.6), 0 0 28px 8px rgba(255,160,60,.8);
}
.hotspot .label {
  position: absolute;
  white-space: nowrap;
  bottom: 100%; left: 50%;
  transform: translate(-50%, -4px);
  padding: 4px 10px;
  background: rgba(40, 22, 6, .92);
  color: #f6e4bf;
  font-family: var(--font-display-zh);
  font-size: 12px; letter-spacing: .12em;
  border-radius: 2px;
  opacity: 0;
  transition: opacity .18s, transform .18s;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
}
.hotspot .label::after {
  content: '';
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(40,22,6,.92);
}
.hotspot:hover .label, .hotspot.active .label {
  opacity: 1; transform: translate(-50%, -8px);
}

/* magnifier */
.magnifier {
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 8;
  box-shadow:
    inset 0 0 0 6px #6e4d12,
    inset 0 0 0 8px #f3dc8b,
    inset 0 0 0 12px #6e4d12,
    0 12px 30px rgba(0,0,0,.55),
    0 0 0 1px rgba(0,0,0,.4);
  overflow: hidden;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity .15s;
  background-color: #0a0604;
}
.magnifier.on { opacity: 1; }
.magnifier::after {
  /* handle */
  content: '';
  position: absolute;
  right: -42px; bottom: -42px;
  width: 70px; height: 14px;
  background: linear-gradient(180deg, #b8862c, #6e4d12);
  border-radius: 6px;
  transform: rotate(45deg);
  transform-origin: left center;
  box-shadow: 0 4px 8px rgba(0,0,0,.5);
}

/* hint chip below painting */
.painting-hint {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--font-hand-zh);
  font-size: 16px; color: var(--ink-soft);
  letter-spacing: .04em;
}
.painting-hint .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe28a, #c89220);
  box-shadow: 0 0 10px 2px rgba(255,200,90,.6);
}
.painting-hint .en {
  font-family: var(--font-hand-en);
  color: var(--ink-faded);
  font-size: 18px;
}

/* back button */
.back-btn {
  position: absolute;
  top: 22px; left: 40px;
  z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(80,50,20,.08);
  border: 1px solid rgba(80,50,20,.25);
  color: var(--ink-soft);
  font-family: var(--font-display-zh);
  font-size: 13px; letter-spacing: .18em;
  transition: background .2s;
}
.back-btn:hover { background: rgba(80,50,20,.18); }
.back-btn .arrow { font-size: 18px; line-height: 1; }
.back-btn .en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-faded);
  margin-left: 6px;
}

/* =========================================================
   Knowledge card (right panel)
   ========================================================= */
.knowledge-card {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  padding: 28px 28px 18px;
  background:
    linear-gradient(180deg, rgba(255,245,215,.55), rgba(220,195,150,.35)),
    var(--paper);
  border: 1px solid rgba(110,77,18,.35);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 6px var(--paper),
    inset 0 0 0 7px rgba(110,77,18,.3),
    0 20px 40px rgba(20,12,4,.35);
  overflow: hidden;
}
.knowledge-card::before {
  /* corner flourishes */
  content: '';
  position: absolute; inset: 14px;
  border: 1px solid rgba(110,77,18,.3);
  pointer-events: none;
  border-radius: 2px;
}
.knowledge-card::after {
  /* grain inside card */
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='9'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0 0.08  0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/></svg>");
  mix-blend-mode: multiply;
  pointer-events: none;
  opacity: .55;
}

.kc-head {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; margin-bottom: 14px;
}
.kc-eyebrow {
  font-family: var(--font-hand-en);
  font-size: 20px; color: var(--wax-red);
  letter-spacing: .04em;
  transform: rotate(-2deg);
  display: inline-block;
}
.kc-title-zh {
  font-family: var(--font-display-zh);
  font-size: 38px; letter-spacing: .08em;
  color: var(--ink);
  line-height: 1;
  margin: 4px 0 4px;
}
.kc-title-en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 18px; color: var(--ink-faded);
  letter-spacing: .04em;
}
.kc-folio {
  font-family: var(--font-display-en);
  font-size: 11px; letter-spacing: .3em;
  color: var(--ink-faded);
  align-self: flex-start;
  white-space: nowrap;
  margin-top: 6px;
}

.kc-tabs {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 6px 4px;
  border-bottom: 1px solid rgba(110,77,18,.3);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.kc-tab {
  position: relative;
  padding: 6px 10px 8px;
  font-family: var(--font-display-zh);
  font-size: 12px; letter-spacing: .12em;
  color: var(--ink-faded);
  border-radius: 2px;
  transition: color .2s;
}
.kc-tab .en {
  display: block;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 10px;
  letter-spacing: .06em;
  color: rgba(122, 88, 54, .6);
  margin-top: 1px;
}
.kc-tab:hover { color: var(--ink); }
.kc-tab.on {
  color: var(--wax-red);
}
.kc-tab.on::after {
  content: '';
  position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px;
  background: var(--wax-red);
  border-radius: 2px;
}

.kc-body {
  flex: 1;
  position: relative;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(110,77,18,.45) transparent;
}
.kc-body::-webkit-scrollbar { width: 6px; }
.kc-body::-webkit-scrollbar-thumb { background: rgba(110,77,18,.4); border-radius: 4px; }

.kc-section h3 {
  margin: 6px 0 6px;
  font-family: var(--font-display-zh);
  font-size: 17px; letter-spacing: .08em;
  color: var(--sepia);
  display: flex; align-items: baseline; gap: 8px;
}
.kc-section h3 .en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 12px; color: var(--ink-faded);
  letter-spacing: .04em;
  font-weight: 400;
}
.kc-section p {
  margin: 0 0 12px;
  font-family: var(--font-serif-zh);
  font-size: 14.5px; line-height: 1.75;
  color: var(--ink);
  text-wrap: pretty;
}
.kc-section p .en {
  display: block;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 13px; color: var(--ink-faded);
  margin-top: 2px;
  line-height: 1.55;
}

.kc-quote {
  position: relative;
  margin: 10px 0 14px;
  padding: 10px 14px 10px 28px;
  font-family: var(--font-hand-zh);
  font-size: 17px;
  color: var(--sepia);
  border-left: 3px double rgba(110,77,18,.5);
  background: rgba(255, 230, 170, .25);
}
.kc-quote::before {
  content: '“';
  position: absolute; left: 6px; top: -2px;
  font-family: var(--font-display-en);
  font-size: 36px;
  color: var(--wax-red);
  opacity: .7;
}
.kc-quote .en {
  display: block;
  font-family: var(--font-hand-en);
  font-size: 16px;
  color: var(--ink-faded);
  margin-top: 4px;
}
.kc-quote cite {
  display: block;
  margin-top: 6px;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 11px; color: var(--ink-faded);
  letter-spacing: .14em;
}

.kc-figure {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
  background: rgba(255, 230, 170, .22);
  border: 1px dashed rgba(110, 77, 18, .35);
  border-radius: 2px;
}
.kc-figure .thumb {
  width: 88px; height: 88px;
  background-size: cover; background-position: center;
  border: 1px solid var(--gold-deep);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.kc-figure .meta { font-family: var(--font-serif-zh); font-size: 13px; line-height: 1.55; color: var(--ink-soft); }
.kc-figure .meta strong { color: var(--ink); }
.kc-figure .meta .en { font-family: var(--font-serif-en); font-style: italic; color: var(--ink-faded); font-size: 11px; display: block; }

/* technique cards */
.tech-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 10px 0 12px;
}
.tech-list .tech {
  padding: 10px;
  background: rgba(255, 230, 170, .25);
  border: 1px solid rgba(110, 77, 18, .25);
  border-radius: 2px;
}
.tech-list .tech .name {
  font-family: var(--font-display-zh);
  font-size: 13px; color: var(--wax-red);
  letter-spacing: .08em;
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 4px;
}
.tech-list .tech .name .en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 11px; color: var(--ink-faded);
  letter-spacing: 0;
}
.tech-list .tech p {
  margin: 0;
  font-family: var(--font-serif-zh);
  font-size: 12.5px; line-height: 1.55; color: var(--ink-soft);
}

/* mini-game (guess the technique) */
.game-card {
  margin: 4px 0 14px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255,235,180,.5), rgba(220,180,120,.3)),
    rgba(255,245,215,.6);
  border: 1px dashed rgba(110,77,18,.45);
  border-radius: 3px;
}
.game-card .q {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-display-zh);
  font-size: 14px; color: var(--sepia);
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.game-card .q .badge {
  font-family: var(--font-hand-en);
  background: var(--wax-red);
  color: #f6e4bf;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .1em;
}
.game-card .opts { display: grid; gap: 6px; }
.game-card .opt {
  text-align: left;
  padding: 8px 12px;
  font-family: var(--font-serif-zh);
  font-size: 13.5px;
  color: var(--ink);
  background: rgba(255,255,255,.4);
  border: 1px solid rgba(110,77,18,.3);
  border-radius: 2px;
  transition: background .15s, transform .15s;
}
.game-card .opt:hover { background: rgba(255, 230, 170, .55); transform: translateX(2px); }
.game-card .opt.correct {
  background: rgba(60, 100, 60, .25);
  border-color: rgba(60, 100, 60, .6);
  color: #224422;
}
.game-card .opt.wrong {
  background: rgba(120, 30, 30, .15);
  border-color: rgba(120, 30, 30, .5);
  color: var(--wax-red);
}
.game-card .feedback {
  margin-top: 10px;
  font-family: var(--font-hand-zh);
  font-size: 15px;
  color: var(--sepia);
}

/* audio button */
.kc-audio {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 10px;
  padding: 6px 10px 6px 8px;
  background: var(--wax-red);
  color: #f6e4bf;
  border-radius: 999px;
  font-family: var(--font-display-zh);
  font-size: 12px; letter-spacing: .12em;
  box-shadow: 0 4px 10px rgba(80,10,10,.35);
  transition: transform .15s, box-shadow .15s;
}
.kc-audio:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(80,10,10,.45); }
.kc-audio .icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  font-size: 11px;
}
.kc-audio.playing .icon::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.6);
  animation: pulse 1.2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.9); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* close panel */
.kc-close {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  font-family: var(--font-display-en);
  font-size: 18px;
  transition: background .2s;
}
.kc-close:hover { background: rgba(110,77,18,.15); color: var(--wax-red); }

/* =========================================================
   Painting view — hotspot rail (left side bottom of stage)
   ========================================================= */
.hotspot-rail {
  position: absolute;
  left: 36px; bottom: 18px;
  display: flex; flex-wrap: wrap; gap: 8px;
  z-index: 30;
  max-width: calc(100% - 480px);
}
.hotspot-rail .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: rgba(60,30,10,.08);
  border: 1px solid rgba(110,77,18,.3);
  border-radius: 999px;
  font-family: var(--font-display-zh);
  font-size: 12px; letter-spacing: .14em;
  color: var(--ink-soft);
  transition: all .2s;
}
.hotspot-rail .chip .glow {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe28a, #c89220);
  box-shadow: 0 0 6px 1px rgba(255,200,90,.6);
}
.hotspot-rail .chip.on {
  background: var(--ink);
  color: #f7e8c4;
  border-color: var(--ink);
}
.hotspot-rail .chip.on .glow {
  background: radial-gradient(circle at 30% 30%, #fff, #ffd56b);
  box-shadow: 0 0 10px 2px rgba(255,210,120,.8);
}

/* =========================================================
   Page-turn transition
   ========================================================= */
.page-anim {
  animation: pageTurn .55s cubic-bezier(.4,.0,.2,1) both;
  transform-origin: left center;
}
@keyframes pageTurn {
  0%   { transform: perspective(1600px) rotateY(60deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: perspective(1600px) rotateY(0); opacity: 1; }
}

.fade-in { animation: fadeIn .45s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

/* bilingual toggle */
body[data-bilingual="off"] .en,
body[data-bilingual="off"] .label-en,
body[data-bilingual="off"] .kc-title-en,
body[data-bilingual="off"] .gallery-headline .sub,
body[data-bilingual="off"] .painting-hint .en {
  display: none;
}
