/* public/css/style.css — 手账宣纸风（对齐 sketches/004-v30-prototype 定稿配色） */
:root {
  --paper: #f5e9cc;      /* 宣纸底 */
  --paper2: #fffdf4;     /* 卡片 */
  --card: #fffdf4;
  --ink: #3f3428;        /* 墨 */
  --ink-soft: #8a7a63;   /* 灰 */
  --muted: #8a7a63;
  --line: #e6d7b6;
  --accent: #b23a2b;
  --red-deep: #99301f;
  --gold: #c9a35c;
  --green: #5a8f4e;
  --accent-ink: #fff6e9;
  --map-area: #f7edd6;
  --map-border: #c9a96b;
  --map-emphasis: #eddcb4;
  --map-label: #8a6a3f;
  --lit: #e4b96f;
  --province-hot: #e2a14f;
  --tape1: #d9a84e;
  --tape2: #b8c4a8;
  --font: 'KaiTi', 'STKaiti', 'SimKai', serif;
  --rfont: 'ZCOOL KuaiLe', 'KaiTi', 'STKaiti', 'Kaiti SC', serif;
  --radius: 12px;
  --shadow: 0 4px 14px rgba(120,90,40,.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background:
    radial-gradient(ellipse at 18% 6%, rgba(255,255,255,.5), transparent 42%),
    radial-gradient(ellipse at 88% 96%, rgba(178,58,43,.05), transparent 45%),
    repeating-linear-gradient(0deg, rgba(201,163,92,.05) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(201,163,92,.03) 0 1px, transparent 1px 34px),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.05'/></svg>"),
    var(--paper);
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.7;
  /* 底部 Tab 栏固定，给内容留出空间避免遮挡 */
  padding-bottom: 72px;
}

.tape {
  position: fixed; width: 110px; height: 30px; opacity: .45; z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,.15); pointer-events: none;
}
.tape.l { left: 40px; top: -8px; background: var(--tape1); transform: rotate(-16deg); }
.tape.r { right: 40px; top: -8px; background: var(--tape2); transform: rotate(14deg); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 30px 8px; flex-wrap: wrap; gap: 10px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lang-capsule{display:inline-flex;border:1.5px solid #b23a2b;border-radius:999px;overflow:hidden;margin-right:10px;font-family:system-ui,sans-serif;font-size:12.5px;line-height:1}
.lang-capsule button{border:0;background:transparent;padding:6px 11px;cursor:pointer;color:#b23a2b;font-size:12.5px}
.lang-capsule button.on{background:#b23a2b;color:#fff6e9}
.back-btn {
  font-family: var(--font); font-size: 18px; width: 36px; height: 36px;
  border: 1.5px solid var(--map-border); background: var(--paper2); color: var(--ink);
  border-radius: 50%; cursor: pointer; transition: .2s;
}
.back-btn:hover { background: var(--map-emphasis); }
.logo { font-size: 28px; letter-spacing: 5px; }
.stamp {
  background: var(--accent); color: var(--accent-ink); font-size: 13px;
  padding: 5px 7px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--accent-ink);
  letter-spacing: 2px; transform: rotate(-4deg);
}
/* 导航栏（面包屑层级链，替代右上角 breadcrumb 文字） */
.navbar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 0 30px 4px; font-size: 14px; letter-spacing: 2px;
}
.navbar a {
  color: var(--accent); text-decoration: none; cursor: pointer; transition: .15s;
}
.navbar a:hover { text-decoration: underline; }
.navbar .sep { color: var(--ink-soft); font-size: 13px; }
.navbar .current { color: var(--ink); font-weight: bold; }

/* 我的收藏手帐（个人统计页） */
.stats-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 0 18px; flex-wrap: wrap; gap: 10px;
}
.stats-head h2 { font-size: 26px; letter-spacing: 4px; }
.stats-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.stat-card {
  background: var(--paper2); border: 1px solid rgba(160,130,80,.35);
  border-radius: var(--radius); padding: 18px 14px; text-align: center;
  box-shadow: 0 4px 14px rgba(90,60,30,.10);
}
.stat-num {
  font-size: 34px; color: var(--accent); letter-spacing: 2px; line-height: 1.2;
}
.stat-label { font-size: 14px; color: var(--ink-soft); letter-spacing: 2px; margin-top: 4px; }
.stats-ranks {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.rank-badge {
  background: var(--paper2); border: 1px solid rgba(160,130,80,.35);
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 15px; letter-spacing: 1px; box-shadow: 0 4px 14px rgba(90,60,30,.10);
}
.rank-badge .rank-num {
  color: var(--accent); font-weight: bold; font-size: 20px; letter-spacing: 1px;
}
.stats-museum-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.stats-museum-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #fffdf4; border: 1px solid rgba(160,130,80,.35);
  border-radius: 10px; padding: 12px 10px; text-align: center;
}
.stats-museum-item img { width: 46px; height: 46px; }
.stats-museum-item .nm { font-size: 14px; letter-spacing: 1px; }

main { max-width: 1200px; margin: 0 auto; padding: 6px 24px 40px; }
.view { display: none; }
.view.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.map-wrap {
  position: relative; background: var(--paper2);
  border: 1px solid rgba(160,130,80,.3); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(90,60,30,.18); overflow: hidden;
}
.map-box { width: 100%; height: 560px; }
.map-wrap.pop { animation: popOnce .5s ease; }
@keyframes popOnce {
  0% { transform: scale(1); } 35% { transform: scale(1.018); } 100% { transform: scale(1); }
}
.map-wrap.zoom-out { animation: zoomOut .34s ease forwards; }
@keyframes zoomOut { to { transform: scale(1.08); opacity: .92; } }

/* 地图页顶部点亮进度条（对齐原型 .map-head/.plabel/.track/.fill） */
.map-head { padding: 2px 2px 10px; }
.map-head .plabel { font-size: 13px; color: var(--ink); margin-bottom: 6px; letter-spacing: 1px; }
.map-head .plabel b { color: var(--accent); font-size: 15px; font-family: KaiTi, serif; }
.map-head .track { height: 8px; background: #e8dcbd; border-radius: 99px; overflow: hidden; }
.map-head .track .fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #d88a52, var(--accent));
  border-radius: 99px; transition: width .5s;
}

.hint { text-align: center; font-size: 14px; color: var(--ink-soft); margin: 14px 0; letter-spacing: 2px; }
.empty-note {
  text-align: center; font-size: 16px; color: var(--ink-soft);
  padding: 60px 20px; letter-spacing: 2px;
}

/* 馆卡抽屉（对齐原型 .sheet/.backdrop：<768px 底部滑出，≥768px 居中弹窗） */
.backdrop {
  position: fixed; inset: 0; background: rgba(40,28,12,.45); z-index: 85;
  display: none;
}
.backdrop.open { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%); transition: transform .28s;
  box-shadow: 0 -8px 30px rgba(60,40,10,.25);
}
.sheet.open { transform: translateY(0); }
@media (min-width: 768px) {
  .sheet { left: 50%; width: 400px; transform: translate(-50%, 105%); }
  .sheet.open { transform: translate(-50%, 0); }
}
.sheet-handle { width: 40px; height: 4px; background: #d8c49a; border-radius: 99px; margin: 2px auto 12px; }
.sheet-row { display: flex; gap: 12px; align-items: center; }
.seal-mid {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-size: 12px; letter-spacing: 2px;
  transform: rotate(-6deg); box-shadow: 0 2px 6px rgba(178,58,43,.3);
}
.seal-mid.off { background: #a39683; box-shadow: none; }
.sheet-name { font-size: 19px; font-family: var(--rfont); }
.sheet-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sheet-intro {
  font-size: 12.5px; color: var(--ink); line-height: 1.8;
  margin: 10px 0 8px; background: var(--paper); border-radius: 10px; padding: 10px 12px;
}
.sheet-state { font-size: 11px; color: var(--muted); margin-bottom: 12px; text-align: center; }
.sheet .btn { margin-bottom: 8px; }
.sheet .btn.primary {
  background: linear-gradient(180deg, #c04635, var(--accent)); color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(178,58,43,.35), inset 0 1px 0 rgba(255,255,255,.18);
}
.sheet .btn.primary:disabled { background: #b99f96; box-shadow: none; }
.sheet .btn.ghost {
  background: rgba(251,241,220,.9); color: var(--accent);
  border: 1.5px solid rgba(178,58,43,.55); border-radius: 999px;
  font-family: var(--rfont); letter-spacing: 1px;
}
.sheet .btn.wfull { width: 100%; }

.btn-row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.btn-row.left { justify-content: flex-start; }
.btn-row.center { justify-content: center; }
.btn {
  font-family: var(--font); font-size: 15px; letter-spacing: 2px;
  padding: 8px 20px; border-radius: 24px; cursor: pointer;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent);
  transition: .2s;
}
.btn:hover { background: rgba(178,58,43,.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.fill { background: var(--accent); color: var(--accent-ink); }
.btn.fill:hover { background: #9c3124; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; background: rgba(60,45,20,.45); display: none;
  align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal.open { display: flex; }
.modal-card {
  background: var(--paper2); border-radius: var(--radius); padding: 28px 30px;
  width: min(460px, 92vw); max-height: 88vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(40,25,8,.4); text-align: center;
  border: 1px solid rgba(160,130,80,.4);
}
.modal-card h4 { font-size: 20px; letter-spacing: 3px; margin-bottom: 10px; }
.modal-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.9; margin-bottom: 16px; }
.modal-card .story-body {
  text-align: left; font-size: 15px; line-height: 2; margin: 14px 0;
  max-height: 44vh; overflow: auto; white-space: pre-wrap;
}

/* 登录区 */
.login-area {
  margin-top: 26px; background: var(--paper2); border: 1px solid rgba(160,130,80,.3);
  border-radius: var(--radius); padding: 24px 28px;
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center;
}
.login-area .welcome { font-size: 21px; letter-spacing: 3px; width: 100%; text-align: center; }
.login-area input {
  font-family: var(--font); font-size: 15px; border: 1.5px solid var(--map-border);
  background: #fffdf4; border-radius: 8px; padding: 8px 12px; width: 190px; outline: none;
}
.login-area .guest { font-size: 13px; color: var(--ink-soft); width: 100%; text-align: center; }

/* 博物馆页 */
.museum-head { display: flex; align-items: center; gap: 16px; margin: 10px 0 4px; flex-wrap: wrap; }
.museum-head img { width: 64px; height: 64px; border-radius: 8px; }
.museum-head h2 { font-size: 28px; letter-spacing: 4px; }
.museum-divider { width: 52px; height: 3px; background: var(--accent); border-radius: 2px; margin: 12px 0 10px; }
.lit-tag {
  background: var(--accent); color: var(--accent-ink); font-size: 13px;
  padding: 4px 10px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--accent-ink);
  transform: rotate(-3deg); letter-spacing: 2px; display: inline-block;
}
.lit-tag.off { background: var(--ink-soft); }
.museum-intro { font-size: 15px; color: var(--ink-soft); margin: 8px 0 22px; letter-spacing: 1px; }

.panel {
  background: var(--paper2); border: 1px solid rgba(160,130,80,.3);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(90,60,30,.10);
}
.panel h3 { font-size: 19px; letter-spacing: 3px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-tip { font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.stamp-mini {
  font-size: 11px; color: var(--accent); border: 1.5px solid var(--accent);
  border-radius: 6px; padding: 2px 7px; letter-spacing: 2px; font-style: normal;
}
.stamp-mini.demo { background: var(--accent); color: var(--accent-ink); }
.guide-text { font-size: 15px; line-height: 2; color: var(--ink); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.acard {
  background: #fffdf4; border: 1px solid rgba(160,130,80,.35); border-radius: 10px;
  cursor: pointer; transition: .2s; position: relative;
  box-shadow: 0 3px 10px rgba(90,60,30,.12);
}
.acard:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(90,60,30,.18); }
.acard.loading { opacity: .75; cursor: wait; }
.acard .ph {
  height: 110px; display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: rgba(255,255,255,.92);
  background: linear-gradient(135deg, #c9a96b, #a9845a);
  border-radius: 10px 10px 0 0;
  position: relative; overflow: hidden;
}
.acard .ph .card-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.acard:nth-child(3n) .ph { background: linear-gradient(135deg, #9db28f, #7d9571); }
.acard:nth-child(3n+1) .ph { background: linear-gradient(135deg, #c08a6b, #a06a4e); }
.acard .meta { padding: 10px 12px; }
.acard .meta .nm { font-size: 15px; letter-spacing: 1px; }
.acard .meta .ds { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.acard .meta .ds.intro {
  font-size: 13px; color: #a08a63; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.acard .done {
  position: absolute; top: 10px; right: 10px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; padding: 3px 7px; border-radius: 5px;
  box-shadow: inset 0 0 0 1.5px var(--accent-ink); transform: rotate(5deg); letter-spacing: 1px;
}

/* 拍照识藏品 */
.identify-upload { margin: 4px 0 12px; text-align: center; }
.identify-upload-btn {
  min-width: min(360px, 100%); padding: 14px 30px; font-size: 17px;
}
.identify-progress { margin: 14px 0 4px; }
.identify-bar {
  height: 9px; border-radius: 6px; background: rgba(160,130,80,.2);
  overflow: hidden; border: 1px solid rgba(160,130,80,.3);
}
.identify-bar-fill {
  height: 100%; width: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #c9a96b, var(--accent));
  animation: identifyLoading 1.15s ease-in-out infinite;
}
.identify-progress.warning .identify-bar-fill {
  background: var(--accent); animation: none; width: 100%;
}
.identify-status { font-size: 14px; color: var(--ink-soft); margin-top: 8px; letter-spacing: 1px; }
.identify-progress.warning .identify-status { color: var(--accent); }
.identify-candidates {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px;
  margin-top: 14px;
}
.ucard {
  background: #fffdf4; border: 1.5px solid rgba(160,130,80,.35); border-radius: 10px;
  padding: 13px 14px; cursor: pointer; text-align: left; transition: .2s;
  font-family: var(--font); color: var(--ink);
}
.ucard:hover { transform: translateY(-2px); box-shadow: 0 7px 16px rgba(90,60,30,.16); }
.ucard.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(178,58,43,.12); }
.ucard:disabled { opacity: .68; cursor: wait; }
.ucard .nm { font-size: 16px; letter-spacing: 1px; }
.ucard .ds { font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.6; }
.identify-actions { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
@keyframes identifyLoading {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(30%); }
  100% { transform: translateX(100%); }
}

.acard .ua-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.acard .ua-btn { padding: 5px 11px; font-size: 13px; border-radius: 18px; }
.acard .ua-btn.danger { border-color: #a03c30; color: #a03c30; }
.acard .ua-btn.danger:hover { background: rgba(160,60,48,.08); }

.story-source { font-size: 13px; color: var(--ink-soft); margin-top: 10px; line-height: 1.8; }
.story-source a { color: var(--accent); }
.disclaimer { font-size: 12px; color: #a08a63; margin-top: 6px; }

/* Toast 提示 */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: rgba(90,70,50,.92); color: #fff6e9; font-size: 14px;
  padding: 10px 20px; border-radius: 24px; letter-spacing: 1px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 底部三 Tab 导航（拍照首页 / 地图打卡 / 我的收藏） */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex;
  background: rgba(246,236,212,.97);
  border-top: 1px solid rgba(160,130,80,.4);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 14px rgba(90,60,30,.12);
}
.tab-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: transparent; cursor: pointer;
  font-family: var(--font); color: var(--ink-soft);
  font-size: 12px; letter-spacing: 2px;
  padding: 6px 4px; border-radius: 10px; transition: .2s;
}
.tab-btn .tab-emoji { font-size: 20px; line-height: 1; }
.tab-btn:hover { background: rgba(178,58,43,.06); }
.tab-btn.active { color: var(--accent); background: rgba(178,58,43,.08); }

/* 全屏空视图骨架容器（识别/故事/登录页，内容由后续任务卡填充） */
.view-content {
  padding: 48px 20px;
  text-align: center;
  font-size: 16px;
  color: var(--ink-soft);
  letter-spacing: 2px;
}

/* 地图缩放控件 */
.zoom-ctl {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 8px; background: rgba(246,236,212,.94);
  border: 1px solid rgba(160,130,80,.45); border-radius: 22px;
  box-shadow: 0 5px 16px rgba(90,60,30,.24); z-index: 6;
}
.zbtn {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--accent); background: var(--paper2); color: var(--accent);
  font-size: 18px; line-height: 1; font-family: var(--font); transition: .15s;
}
.zbtn:hover { background: var(--accent); color: var(--accent-ink); }
.zrange {
  -webkit-appearance: slider-vertical;
  width: 24px; height: 120px;
  cursor: pointer; accent-color: var(--accent);
}

/* 移动端适配 */
@media (max-width: 768px) {
  body { font-size: 15px; }
  .topbar { padding: 14px 14px 6px; }
  .navbar { padding: 0 14px 4px; font-size: 13px; }
  .logo { font-size: 21px; letter-spacing: 3px; }
  .stamp { font-size: 11px; }
  main { padding: 4px 12px 30px; }
  .map-box { height: 52vh; min-height: 330px; }
  .hint { font-size: 13px; }
  .login-area { padding: 18px 16px; }
  .login-area input { width: 100%; }
  body { padding-bottom: 64px; }
  .tab-btn { font-size: 11px; }
  .museum-head h2 { font-size: 23px; }
  .panel { padding: 16px 16px; }
  .panel h3 { font-size: 17px; }
  .guide-text, .modal-card .story-body { font-size: 14px; }
  .acard .meta .nm { font-size: 14px; }
  .acard .meta .ds, .acard .meta .ds.intro { font-size: 13px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .identify-upload-btn { min-width: 100%; }
  .identify-candidates { grid-template-columns: 1fr; }
  .btn { padding: 8px 16px; font-size: 14px; }
  .zoom-ctl { right: 10px; padding: 8px 6px; }
  .zrange { height: 90px; }
  .stats-head h2 { font-size: 22px; }
  .stat-num { font-size: 28px; }
  .stats-museum-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ============ V0.21 动效（只用 transform/opacity，不触发重排） ============ */

/* 藏品卡「收藏」章：右下角压边，逆时针 15°，加 .stamp-in 时盖章一次 */
.collect-stamp {
  position: absolute;
  left: 78%;
  top: 80%;
  width: 61%;
  transform: translate(-50%, -50%) rotate(-15deg);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
}
.collect-stamp.stamp-in {
  animation: stampIn 0.35s cubic-bezier(.22, .9, .3, 1.2) forwards;
}
@keyframes stampIn {
  0%   { transform: translate(-50%,-50%) scale(2.2) rotate(-29deg); opacity: 0; }
  55%  { transform: translate(-50%,-50%) scale(.9) rotate(-12deg); opacity: 1; }
  75%  { transform: translate(-50%,-50%) scale(1.05) rotate(-17deg); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1) rotate(-15deg); opacity: 1; }
}

/* 卡片滑入：进视口时加 .in，只播一次；带 hover 时保留抬升 */
.acard.card-in-anim,
.ucard.card-in-anim {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .4s ease-out, transform .4s ease-out;
}
.acard.card-in-anim.in,
.ucard.card-in-anim.in {
  opacity: 1;
  transform: translateY(0);
}
.acard.card-in-anim.in:hover,
.ucard.card-in-anim.in:hover {
  transform: translateY(-3px);
}
.acard.card-in-anim.in.loading {
  opacity: .75;
}
.guide-text.card-in-anim {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .4s ease-out, transform .4s ease-out;
}
.guide-text.card-in-anim.in {
  opacity: 1;
  transform: translateY(0);
}

/* 伪放大过渡：全国图点北京 → 放大钻出，省图缩放淡入 */
#mapBoxHome.zoom-out-anim {
  animation: zoomOutToProvince 0.45s ease-in forwards;
  transform-origin: 60% 35%;
}
#mapBoxProvince.zoom-in-anim {
  animation: zoomInFromHome 0.45s ease-out forwards;
}
@keyframes zoomOutToProvince {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes zoomInFromHome {
  0%   { transform: scale(.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 首页底部 V0.21 说明 */
.hint.v21-note {
  margin: 0 0 14px;
  font-size: 12px;
  color: #8a7a5f;
  letter-spacing: 1px;
}

/* ============ V0.30 原型对齐（sketches/004-v30-prototype 定稿，逐项同参数） ============ */
#view-home .view-content,
#view-identify .view-content,
#view-story .view-content {
  padding: 14px;
  text-align: left;
  font-size: inherit;
  color: inherit;
  letter-spacing: normal;
}

/* 全屏页顶栏（识别/故事） */
.view-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(8px + env(safe-area-inset-top, 0px));
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  border-bottom: 1px dashed var(--line);
}
.view-head .back {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 10px; font-size: 12px; color: var(--ink); cursor: pointer;
  font-family: inherit;
}
.view-head .head-title { font-weight: 700; font-size: 14px; }

/* Hero 拍照卡：渐变底、无边框、28px 圆角、双层柔阴影、内嵌相机 SVG */
.hero {
  background: linear-gradient(160deg, #fffdf4 30%, #fbf0d8);
  border: none; border-radius: 28px;
  box-shadow: 0 10px 30px rgba(120,90,40,.14), 0 2px 6px rgba(120,90,40,.08);
  padding: 22px 16px 18px; text-align: center; position: relative; overflow: hidden;
}
.hero::before,
.hero::after {
  content: ""; position: absolute; width: 86px; height: 18px;
  background: rgba(201,163,92,.4); transform: rotate(-4deg);
}
.hero::before { top: -6px; left: -24px; }
.hero::after { bottom: -6px; right: -24px; }
.hero-stamp {
  width: 64px; height: 64px; margin: 2px auto 10px;
  display: flex; align-items: center; justify-content: center;
}
.hero h1 { font-family: var(--rfont); font-size: 30px; letter-spacing: 4px; color: var(--red-deep); }
.hero .sub { color: var(--muted); font-size: 13px; margin: 6px 0 16px; }

/* 按钮：主按钮渐变红+内高光+投影；ghost 浅黄底红边红字胶囊 */
.btn { transition: transform .06s, box-shadow .15s, background .2s; }
.btn:active { transform: scale(.97); }
.btn.primary {
  border: none;
  background: linear-gradient(180deg, #c04635, var(--accent));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(178,58,43,.35), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn.primary:disabled { background: #b99f96; box-shadow: none; }
.btn.ghost {
  background: rgba(251,241,220,.9); color: var(--accent);
  border: 1.5px solid rgba(178,58,43,.55);
  border-radius: 999px; font-family: var(--rfont); letter-spacing: 1px;
}
.btn.wfull { width: 100%; }
.btn-big { font-size: 17px; padding: 15px; width: 100%; border-radius: 14px; }

.link-btn {
  background: none; border: none; color: var(--muted); font-size: 12px;
  text-decoration: underline; cursor: pointer; font-family: inherit;
  display: block; margin: 4px auto 0;
}
.hint2 { font-size: 11px; color: var(--muted); font-weight: 400; }
.sect-head { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 2px 10px; }
.sect-head h3 { font-family: var(--rfont); font-size: 18px; }

/* 最近收录横滑 */
.strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.mini-card {
  flex: 0 0 118px; background: var(--card); border: 1px solid #eee0c2; border-radius: 14px;
  overflow: hidden; box-shadow: 0 4px 12px rgba(120,90,40,.12); cursor: pointer;
}
.mini-ph {
  height: 84px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: KaiTi, STKaiti, serif; font-size: 30px;
}
.mini-ph img { width: 100%; height: 100%; object-fit: cover; }
.mini-meta { padding: 7px 8px 9px; font-size: 12px; text-align: center; }
.mini-meta .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta .ds { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-tag {
  display: inline-block; font-size: 10px; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px;
  margin-left: 4px; vertical-align: 1px;
}

/* 地图入口卡 */
.map-entry {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; margin-top: 2px;
}
.map-entry .t1 { font-weight: 700; font-size: 15px; }
.map-entry .t1 b { color: var(--accent); font-family: KaiTi, serif; font-size: 17px; }
.map-entry .sub { color: var(--muted); font-size: 12px; margin: 5px 0 9px; }
.map-entry .arrow { font-size: 13px; color: var(--accent); font-weight: 600; }

/* 中式回纹边框：四角回纹 SVG 角饰 + 细红框（抄原型 .cn-frame） */
.cn-frame {
  position: relative; border: 1.5px solid rgba(178,58,43,.45); border-radius: 8px;
  padding: 16px 14px; margin-top: 6px; background: rgba(255,253,244,.4);
  background-repeat: no-repeat; background-size: 26px 26px;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='M3 25 V9 Q3 3 9 3 H25' fill='none' stroke='%23b23a2b' stroke-width='1.8' opacity='.8'/><path d='M7 25 V11 Q7 7 11 7 H25' fill='none' stroke='%23b23a2b' stroke-width='1.2' opacity='.55'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><g transform='rotate(90 14 14)'><path d='M3 25 V9 Q3 3 9 3 H25' fill='none' stroke='%23b23a2b' stroke-width='1.8' opacity='.8'/><path d='M7 25 V11 Q7 7 11 7 H25' fill='none' stroke='%23b23a2b' stroke-width='1.2' opacity='.55'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><g transform='rotate(180 14 14)'><path d='M3 25 V9 Q3 3 9 3 H25' fill='none' stroke='%23b23a2b' stroke-width='1.8' opacity='.8'/><path d='M7 25 V11 Q7 7 11 7 H25' fill='none' stroke='%23b23a2b' stroke-width='1.2' opacity='.55'/></g></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><g transform='rotate(270 14 14)'><path d='M3 25 V9 Q3 3 9 3 H25' fill='none' stroke='%23b23a2b' stroke-width='1.8' opacity='.8'/><path d='M7 25 V11 Q7 7 11 7 H25' fill='none' stroke='%23b23a2b' stroke-width='1.2' opacity='.55'/></g></svg>");
  background-position: left top, right top, right bottom, left bottom;
}

/* 识别页三步 */
.id-photo {
  width: 100%; height: 210px; border: 1.5px solid rgba(178,58,43,.4);
  border-radius: 14px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); cursor: pointer; overflow: hidden; margin-bottom: 14px;
}
.id-photo.has { border-style: solid; }
.id-photo img { width: 100%; height: 100%; object-fit: contain; background: #f2ead6; }
.id-photo .big { font-size: 40px; }
.id-btns { display: flex; gap: 10px; }
.id-btns .btn { flex: 1; }
.progress-wrap { margin-top: 16px; }
.cand-q { font-family: var(--rfont); font-size: 20px; margin-bottom: 12px; text-align: center; color: var(--red-deep); }
#view-identify .identify-candidates { display: block; margin-top: 0; }
.cand {
  width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px 10px 10px; margin-bottom: 10px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(120,90,40,.1); font-family: inherit;
  display: flex; align-items: center; gap: 12px;
}
.cand:active { border-color: var(--accent); }
.cand-ph {
  width: 56px; height: 56px; flex: 0 0 56px; border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: KaiTi, STKaiti, serif; font-size: 24px;
}
.cand-txt { flex: 1; min-width: 0; }
.cand .nm { font-weight: 700; font-size: 15px; }
.cand .ds { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.cand.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(178,58,43,.12); }
.cand:disabled { opacity: .68; cursor: wait; }
.cand.card-in-anim {
  opacity: 0; transform: translateY(24px);
  transition: opacity .4s ease-out, transform .4s ease-out;
}
.cand.card-in-anim.in { opacity: 1; transform: translateY(0); }
.cand.card-in-anim.in:hover { transform: translateY(-3px); }

/* 故事全屏页：收藏章右上角、逆时针 15°（Kai 定稿位置） */
.story-wrap { position: relative; }
.story-stamp {
  position: absolute; top: -6px; right: 2px; width: 74px; height: 74px;
  transform: rotate(-15deg); opacity: .9; pointer-events: none;
}
.story-page h2 { font-family: var(--rfont); font-size: 24px; margin-bottom: 6px; padding-right: 60px; }
.story-page .meta { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.story-page .text { font-size: 14.5px; line-height: 2.05; white-space: pre-line; }
.story-page .story-source { margin-top: 14px; font-size: 12.5px; color: #3a6ea5; }
.story-page .story-source a { color: #3a6ea5; }
.story-page .disclaimer { font-size: 11px; color: var(--muted); margin-top: 12px; line-height: 1.7; }
.story-actions { margin-top: 18px; }
.save-note { font-size: 11px; color: var(--muted); text-align: center; margin-top: 8px; }
.saved-badge {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(90,143,78,.12); border: 1px solid var(--green);
  color: var(--green); border-radius: 12px; padding: 13px;
  font-size: 14px; font-weight: 600;
}

/* 数字用站酷快乐体（统计页数字） */
.stat-num { font-family: var(--rfont); }

/* ============ V0.30 登录页（对齐原型 .auth-tabs/.field/.auth-note/.auth-card） ============ */
#view-auth .view-content {
  padding: 14px;
  text-align: left;
  font-size: inherit;
  color: inherit;
  letter-spacing: normal;
}
.auth-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 18px 20px;
  max-width: 380px;
  margin: 14px auto;
}
.auth-tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.auth-tabs button {
  flex: 1;
  border: none;
  background: var(--card);
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
}
.auth-tabs button.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  margin-bottom: 10px;
  background: var(--card);
  font-family: inherit;
}
.field:focus { outline: 2px solid rgba(178,58,43,.35); }
.auth-panel .btn.primary {
  border: none;
  background: linear-gradient(180deg, #c04635, var(--accent));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(178,58,43,.35), inset 0 1px 0 rgba(255,255,255,.18);
}
.auth-panel .btn.primary:disabled { background: #b99f96; box-shadow: none; }
.auth-panel .btn.wfull { width: 100%; }
.auth-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 14px;
  text-align: center;
}
.auth-card {
  background: var(--card);
  border: 1px dashed var(--accent);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}
.auth-card h3 {
  font-family: var(--rfont);
  font-size: 17px;
  margin-bottom: 6px;
}
.auth-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 12px;
}

/* ===== V0.31 英文界面：字体与排版（html[data-lang] 由 i18n.js 维护）===== */
html[data-lang="en"] {
  --font: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --rfont: 'IM Fell English', 'EB Garamond', Georgia, serif;
}
/* 硬编码 KaiTi 的数字/首字回退，英文界面换衬线 */
html[data-lang="en"] .map-head .plabel b,
html[data-lang="en"] .map-entry .t1 b { font-family: 'EB Garamond', Georgia, serif; }
html[data-lang="en"] .mini-ph,
html[data-lang="en"] .cand-ph { font-family: 'EB Garamond', Georgia, serif; }
/* 英文排版习惯：标题字距、长文行距、按钮不换行 */
html[data-lang="en"] .hero h1 { letter-spacing: .012em; }
html[data-lang="en"] .story-page .text,
html[data-lang="en"] .guide-text,
html[data-lang="en"] .museum-intro,
html[data-lang="en"] .sheet-intro,
html[data-lang="en"] .panel-tip,
html[data-lang="en"] .auth-note { line-height: 1.7; }
html[data-lang="en"] .btn { white-space: nowrap; }

/* ===== V0.32 语音讲解：方案 A 卡片播放器（对照 sketches/006-v32-tts-preview 变体 A） ===== */
.player-card {
  margin: 12px 0 2px; padding: 12px 14px 10px; position: relative;
  background: linear-gradient(180deg, var(--card), #faf3dd);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 3px 12px rgba(120, 90, 40, .14);
}
.player-card .row { display: flex; align-items: center; gap: 12px; }
.pbtn {
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; flex: none;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent);
  position: relative; font-family: inherit;
}
.pbtn svg { width: 18px; height: 18px; fill: currentColor; }
.pbtn .ring {
  position: absolute; inset: -5px; border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--red-deep) 50%, transparent); opacity: 0;
}
.pbtn.playing .ring { opacity: 1; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pbtn:disabled { cursor: default; opacity: .6; }
.pinfo { flex: 1; min-width: 0; }
.pinfo .ttl { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pinfo .ttl .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.pinfo .ttl .eq i {
  width: 3px; background: var(--accent); border-radius: 1px; height: 4px; opacity: .6;
}
.pinfo .ttl .eq.on i { animation: eq 0.9s ease-in-out infinite; }
.pinfo .ttl .eq i:nth-child(2) { animation-delay: .2s; }
.pinfo .ttl .eq i:nth-child(3) { animation-delay: .4s; }
.pinfo .ttl .eq i:nth-child(4) { animation-delay: .1s; }
.pinfo .ttl .eq i:nth-child(5) { animation-delay: .3s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 13px; } }
.pinfo .st { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pinfo .st b { color: var(--accent); font-weight: 700; }
.pbar { margin-top: 9px; height: 4px; border-radius: 2px; background: var(--line); position: relative; }
.pbar .fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
}
.pbar .knob {
  position: absolute; top: 50%; left: 0; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); transform: translate(-50%, -50%); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.ptip { font-size: 10.5px; color: var(--muted); margin-top: 8px; display: flex; justify-content: space-between; }

/* 英文界面：播放器文案字体与字号对齐 sketch（html[data-lang] 由 i18n.js 维护） */
html[data-lang="en"] .player-card .ttl,
html[data-lang="en"] .player-card .st,
html[data-lang="en"] .player-card .ptip { font-family: 'EB Garamond', Georgia, serif; }
html[data-lang="en"] .player-card .ttl { font-size: 13px; }
html[data-lang="en"] .player-card .st { font-size: 11px; }
