/* 小步码上 · 公共样式 xb-core（2026-10-27 第3版）
 * 只管 xb- 开头的类：不碰 body、h1、p、按钮、卡片等页面自己的样式，页面外观完全由各码自己定。
 * 想换颜色、字体、圆角，在页面里设这些变量（写在 body 或任一外层元素上都行）：
 *   --xb-accent 主色  --xb-accent-dark 深一档  --xb-ink 文字  --xb-paper 浮层底色
 *   --xb-font 字体  --xb-radius 圆角  --xb-brand-bg / --xb-brand-fg 页底品牌条
 * 任何一条都可以在页面里用更具体的选择器覆盖。
 */

/* ---------- 页底品牌条（必有，细细一条） ---------- */
.xb-brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); margin: 0;
  background: var(--xb-brand-bg, rgba(0,0,0,.05)); color: var(--xb-brand-fg, #4a5060);
  font: 13px/1.5 var(--xb-font, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif); }
.xb-brand-main { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.xb-brand-logo { height: 18px; width: auto; display: inline-block; vertical-align: middle; }
.xb-brand-back { font-weight: 600; }
.xb-brand-back::before { content: "｜"; opacity: .5; margin-right: 4px; }
.xb-brand-home { color: inherit; font-weight: 700; text-decoration: none; white-space: nowrap; }
.xb-brand-fine { flex-basis: 100%; font-size: 11px; opacity: .75; }

/* ---------- 提示条、护照印章 ---------- */
.xb-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%); z-index: 9000; display: flex; align-items: center; gap: 12px;
  background: var(--xb-paper, #fff); color: var(--xb-ink, #1f2430); border-radius: 18px; padding: 10px 16px 10px 10px; box-shadow: 0 6px 24px rgba(0,0,0,.22);
  font: 16px/1.4 var(--xb-font, -apple-system, "PingFang SC", sans-serif); transition: transform .35s; max-width: 92vw; }
.xb-toast.xb-show { transform: translate(-50%, 0); }
.xb-seal { flex: none; width: 58px; height: 58px; border-radius: 50%; border: 3px solid #d8392b; color: #d8392b; font-weight: 900; font-size: 14px; line-height: 1.15;
  display: flex; align-items: center; justify-content: center; text-align: center; transform: rotate(-12deg); animation: xb-sealin .5s; }
@keyframes xb-sealin { from { transform: scale(1.8) rotate(-12deg); } to { transform: scale(1) rotate(-12deg); } }

/* ---------- 浮层（提醒、存图） ---------- */
.xb-modal { position: fixed; inset: 0; background: rgba(20,24,35,.55); z-index: 9100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.xb-box { background: var(--xb-paper, #fff); color: var(--xb-ink, #1f2430); border-radius: var(--xb-radius, 20px); padding: 18px; max-width: 420px; width: 100%; text-align: center; max-height: 90vh; overflow: auto;
  font: 17px/1.6 var(--xb-font, -apple-system, "PingFang SC", sans-serif); }
.xb-modal-pic { width: 90px; height: auto; display: block; margin: 0 auto 6px; }
.xb-modal-title { font-size: 20px; font-weight: 900; margin: 6px 0; }
.xb-modal-small { font-size: 13px; opacity: .75; margin: 4px 0; }
.xb-save-img { width: 100%; height: auto; display: block; border-radius: 12px; border: 2px solid #e1e5ee; }
.xb-btn { display: flex; width: 100%; align-items: center; justify-content: center; min-height: 52px; margin-top: 10px; border: 0; border-radius: 14px;
  background: var(--xb-accent, #2f7de1); color: #fff; font: 800 18px/1.2 var(--xb-font, -apple-system, "PingFang SC", sans-serif); text-decoration: none; cursor: pointer; touch-action: manipulation; }
.xb-btn:active { transform: translateY(2px); }
.xb-btn-light { background: transparent; color: var(--xb-accent-dark, #1b4f9c); border: 2px solid var(--xb-accent, #2f7de1); }

/* ---------- 柱状图（XB.bars） ---------- */
.xb-bars { display: grid; grid-template-columns: max-content 1fr; gap: 8px 8px; align-items: center; }
.xb-bar { display: contents; }
.xb-bl { font-weight: 800; text-align: right; white-space: nowrap; }
.xb-mine .xb-bl { color: var(--xb-accent-dark, #1b4f9c); }
.xb-mine .xb-bl::after { content: "←你"; font-size: 12px; margin-left: 2px; }
.xb-track { position: relative; display: flex; height: 32px; border-radius: 10px; overflow: hidden; background: rgba(0,0,0,.07); }
.xb-real { display: block; height: 100%; background: var(--xb-accent, #2f7de1); transition: width .6s; }
.xb-demo { display: block; height: 100%; transition: width .6s; background: repeating-linear-gradient(-45deg, rgba(0,0,0,.22) 0 6px, rgba(0,0,0,.1) 6px 12px); }
.xb-num { position: absolute; right: 8px; top: 0; line-height: 32px; font-size: 14px; }
.xb-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; opacity: .8; margin-top: 6px; }
.xb-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.xb-lr { background: var(--xb-accent, #2f7de1); } .xb-ld { background: repeating-linear-gradient(-45deg, rgba(0,0,0,.22) 0 4px, rgba(0,0,0,.1) 4px 8px); }

/* ---------- 音频按钮（.xb-player） ---------- */
.xb-player { display: flex; align-items: center; gap: 12px; }
.xb-pbtn { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--xb-accent, #2f7de1); color: #fff; font-size: 22px; cursor: pointer; touch-action: manipulation; }
.xb-pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.xb-ptitle { font-weight: 800; }
.xb-pnote { font-size: 13px; opacity: .75; }
.xb-pbar { display: block; height: 6px; margin-top: 6px; border-radius: 3px; overflow: hidden; background: rgba(0,0,0,.1); }
.xb-pbar i { display: block; height: 100%; width: 0; background: var(--xb-accent, #2f7de1); }

/* ---------- 刮刮卡、翻翻卡、拖动排序（只给机关，外观页面自己定） ---------- */
.xb-scratch { position: relative; overflow: hidden; }
.xb-scratch > canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.xb-flip { cursor: pointer; transition: transform .18s; }
.xb-flip.xb-turning { transform: scaleX(0); }
.xb-flip > .xb-back { display: none; }
.xb-flip.xb-flipped > .xb-front { display: none; }
.xb-flip.xb-flipped > .xb-back { display: block; }
.xb-sort-item { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.xb-sort-item.xb-dragging { position: relative; z-index: 5; cursor: grabbing; box-shadow: 0 8px 20px rgba(0,0,0,.18); }

/* ---------- 倒计时圆环 ---------- */
.xb-cd { display: flex; align-items: center; gap: 16px; --xb-p: 0deg; }
.xb-cd .xb-btn { width: auto; padding: 0 22px; margin: 0; }
.xb-cd-ring { color: var(--xb-ink, #1f2430); width: 96px; height: 96px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, var(--xb-paper, #fff) 58%, transparent 59%), conic-gradient(var(--xb-accent, #2f7de1) var(--xb-p), rgba(0,0,0,.1) 0); }
.xb-cd-num { font-size: 32px; line-height: 1; }
.xb-cd-ring small { font-size: 12px; opacity: .7; }

/* ---------- 护照、家长看板 ---------- */
.xb-pp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.xb-pp-cell { position: relative; border: 2px dashed rgba(0,0,0,.18); border-radius: 14px; padding: 10px 6px; text-align: center; text-decoration: none; color: inherit; min-height: 74px; }
.xb-pp-cell b { display: block; font-size: 18px; }
.xb-pp-cell span { display: block; font-size: 13px; line-height: 1.3; opacity: .8; }
.xb-pp-cell.xb-on { border: 2px solid #f0b6ae; background: rgba(255,240,236,.8); }
.xb-pp-seal { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #d8392b; color: #d8392b; font-style: normal;
  font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; transform: rotate(-14deg); background: rgba(255,255,255,.7); }
.xb-pp-sum { text-align: center; font-size: 13px; opacity: .8; }
.xb-pb { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.xb-pb th, .xb-pb td { border-bottom: 1px solid rgba(0,0,0,.1); padding: 6px 4px; text-align: left; vertical-align: top; }
.xb-pb-small { font-size: 12px; opacity: .75; }

@media (prefers-reduced-motion: reduce) { .xb-toast, .xb-flip, .xb-real, .xb-demo, .xb-seal { transition: none; animation: none; } }
