/* suan-pwa · 口算宝 v0.4.0（在线练习 + 打印双模式） */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fdf6ec;
  color: #2b2118;
}

.shell { max-width: 860px; margin: 0 auto; padding: 32px 16px 64px; }

.view[hidden] { display: none; }

/* ---------- 头部 ---------- */
.hero { text-align: center; }
.hero h1 { margin: 0; font-size: 34px; }
.hero p { margin: 8px 0 0; color: rgba(43,33,24,.7); }
.ver { display: inline-block; margin-top: 8px; font-size: 12px; opacity: .6; }

/* ---------- 首页模式卡片 ---------- */
.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 36px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  border: 2px solid #a5d6a7;
  border-radius: 20px;
  background: #e8f5e9;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.mode-card:hover { border-color: #f59e0b; transform: translateY(-2px); }
.mode-card.primary-mode { border-color: #90cdf4; background: #e3f2fd; }
.mode-emoji { font-size: 44px; }
.mode-name { font-size: 20px; font-weight: 700; }
.mode-desc { font-size: 13px; color: rgba(43,33,24,.6); }

/* ---------- 选年级 ---------- */
.view-title { text-align: center; font-size: 22px; margin: 8px 0 24px; }
.grade-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.grade-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 12px;
  border: 2px solid transparent;
  border-radius: 18px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.grade-card:nth-child(1) { background: #e3f2fd; border-color: #90caf9; } /* 学前班 浅蓝 */
.grade-card:nth-child(2) { background: #e8f5e9; border-color: #a5d6a7; } /* 一年级 浅绿 */
.grade-card:nth-child(3) { background: #fff9e0; border-color: #ffe082; } /* 二年级 浅黄 */
.grade-card:nth-child(4) { background: #fce4ec; border-color: #f8bbd0; } /* 三年级 浅粉 */
.grade-card:hover { border-color: #f59e0b; transform: translateY(-2px); }
.grade-card:active { transform: scale(.97); }
.grade-emoji { font-size: 34px; }
.grade-name { font-size: 18px; font-weight: 700; }
.grade-desc { font-size: 13px; color: rgba(43,33,24,.6); }

.back-btn { display: block; margin: 24px auto 0; max-width: 240px; }

/* ---------- 在线练习 ---------- */
.p-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.btn-quit {
  width: 36px; height: 36px;
  border: 1.5px solid #e5d5b8;
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  color: #6b5a44;
  flex-shrink: 0;
}
.p-progress-wrap { flex: 1; }
.p-progress { font-size: 14px; color: rgba(43,33,24,.7); margin-bottom: 6px; }
.p-bar {
  height: 8px;
  background: #efe3cc;
  border-radius: 999px;
  overflow: hidden;
}
.p-bar-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 999px;
  transition: width .3s;
}
.p-timer {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: rgba(43,33,24,.7);
  flex-shrink: 0;
}

.p-card {
  background: #fffdf6;
  border: 1px solid #f0e4cc;
  border-radius: 20px;
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(43,33,24,.06);
}
.p-question {
  font-size: 40px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 28px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.p-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}
.p-option {
  padding: 18px 8px;
  font-size: 26px;
  font-weight: 700;
  border: 2px solid #e5d5b8;
  border-radius: 14px;
  background: #faf3e6;
  color: #2b2118;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.p-option:nth-child(1) { background: #e8f5e9; border-color: #a5d6a7; }
.p-option:nth-child(2) { background: #e3f2fd; border-color: #90caf9; }
.p-option:nth-child(3) { background: #fff9e0; border-color: #ffe082; }
.p-option:nth-child(4) { background: #fce4ec; border-color: #f8bbd0; }
.p-option:hover { border-color: #f59e0b; }
.p-option:active { transform: scale(.96); }
.p-option:disabled { cursor: default; opacity: .75; }
.p-option.correct { background: #16a34a; border-color: #16a34a; color: #fff; opacity: 1; }
.p-option.wrong { background: #fecaca; border-color: #ef4444; color: #b91c1c; opacity: 1; animation: shake .35s; }
.p-option.reveal { border-color: #16a34a; color: #16a34a; background: #f0fdf4; opacity: 1; font-weight: 700; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.p-feedback {
  min-height: 28px;
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
}
.p-feedback.good { color: #16a34a; }
.p-feedback.bad { color: #ef4444; }
.p-next { margin-top: 12px; max-width: 220px; width: 100%; }

/* ---------- 成绩 ---------- */
.result-card {
  background: #fffdf6;
  border: 1px solid #f0e4cc;
  border-radius: 20px;
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(43,33,24,.06);
}
.result-emoji { font-size: 56px; }
.result-title { margin: 12px 0 24px; font-size: 22px; }
.result-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-size: 26px; font-weight: 700; color: #b45309; }
.stat-label { font-size: 13px; color: rgba(43,33,24,.6); }

.wrong-list {
  text-align: left;
  background: #fef2f2;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.wrong-list h3 { margin: 0 0 12px; font-size: 15px; color: #b91c1c; }
.wrong-item {
  font-size: 15px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  padding: 6px 0;
  color: #7f1d1d;
  border-bottom: 1px dashed #fecaca;
}
.wrong-item:last-child { border-bottom: none; }

.result-actions { display: flex; flex-direction: column; gap: 10px; }
.result-actions .btn { width: 100%; max-width: 280px; margin: 0 auto; }

/* ---------- 配置面板（打印模式） ---------- */
.config-panel {
  margin-top: 8px;
  padding: 24px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(43,33,24,.08);
}
.config-panel h2 { margin: 0 0 16px; font-size: 18px; }

.cfg-group { margin-bottom: 16px; }
.cfg-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(43,33,24,.75);
}
.cfg-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.cfg-item { min-width: 130px; }
.cfg-item.grow { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  font-size: 14px;
  border: 1.5px solid #e5d5b8;
  border-radius: 999px;
  background: #faf3e6;
  color: #5b4a36;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  font-family: inherit;
}
.chip:hover { border-color: #f59e0b; }
.chip.active { background: #f59e0b; border-color: #f59e0b; color: #fff; font-weight: 600; }

select, input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1.5px solid #e5d5b8;
  border-radius: 10px;
  background: #faf3e6;
  color: #2b2118;
  font-family: inherit;
}
input[type="text"] { max-width: 260px; }

.toggles { gap: 20px; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; user-select: none; }
.toggle input { accent-color: #f59e0b; width: 16px; height: 16px; }

.actions { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid #e5d5b8;
  border-radius: 12px;
  background: #faf3e6;
  color: #5b4a36;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn:hover { border-color: #f59e0b; color: #b45309; }
.btn.primary { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn.primary:hover { background: #d97706; }

.print-hint { font-size: 13px; color: #b45309; margin: 12px 0 0; }

/* ---------- 题卡 ---------- */
.sheet-area { margin-top: 24px; }
.sheet {
  background: #fff;
  border-radius: 8px;
  padding: 28px 32px;
  box-shadow: 0 2px 16px rgba(43,33,24,.1);
  margin-bottom: 24px;
  max-width: 794px;
  margin-left: auto;
  margin-right: auto;
}
.sheet-title { text-align: center; font-size: 22px; margin: 0 0 8px; letter-spacing: 2px; }
.sheet-meta {
  text-align: center;
  font-size: 14px;
  color: #6b5a44;
  margin: 0 0 20px;
  letter-spacing: 1px;
}
.problems {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 14px 20px;
}
.q {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 16px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap;
}
.q-num { font-size: 12px; color: #a08c6f; min-width: 24px; }
.q-text { font-weight: 500; }
.q-time { flex: 1; max-width: 48px; margin-left: 8px; border-bottom: 1px dashed #c9b691; min-height: 18px; }

.answer-grid { gap: 10px 20px; }
.answer-grid .q { color: #4a7c59; font-size: 14px; }

/* ---------- 页脚 ---------- */
.foot { margin-top: 24px; text-align: center; font-size: 14px; }
.foot a { color: #b45309; text-decoration: none; }

/* ---------- 手机适配 ---------- */
@media (max-width: 560px) {
  .mode-cards { grid-template-columns: 1fr; }
  .p-question { font-size: 34px; }
  .cfg-item { min-width: calc(50% - 8px); }
}

/* ---------- 小马 / 里程碑 / 红花 ---------- */
/* 🐎 emoji 本身朝左，跑左→右需水平翻转：翻转只作用于 emoji，
   号码牌是独立元素保持正向；容器负责奔跑位移和颠簸 */
/* 马鞍布：垂在马身侧面、盖过肚子下缘、微倾斜，像真的赛马号码布 */
.horse-run {
  position: fixed;
  left: -90px;
  bottom: 18%;
  font-size: 46px;
  z-index: 998;
  pointer-events: none;
  animation: horseGallop 2.6s linear forwards, horseBounce .44s ease-in-out 6;
}
.horse-emoji {
  display: block;
  transform: scaleX(-1);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.18));
}
.horse-badge {
  position: absolute;
  top: 38%;
  left: 34%;
  background: linear-gradient(180deg, #ffffff, #ffe8e8);
  border: 2px solid #ef4444;
  border-top-width: 3px;
  border-radius: 5px 5px 8px 8px;
  padding: 1px 7px 2px;
  font-size: 14px;
  font-weight: 800;
  color: #ef4444;
  line-height: 1.5;
  font-family: inherit;
  transform: rotate(-7deg);
  box-shadow: 0 3px 5px rgba(0,0,0,.28);
}
@keyframes horseGallop {
  0% { left: -90px; }
  100% { left: calc(100% + 50px); }
}
@keyframes horseBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.milestone {
  position: fixed;
  top: 14%;
  left: 50%;
  background: rgba(255,255,255,.96);
  border: 2px solid #f9a8d4;
  color: #be185d;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(190,24,93,.15);
  pointer-events: none;
  animation: milestonePop 1.4s ease forwards;
}
@keyframes milestonePop {
  0% { opacity: 0; transform: translateX(-50%) scale(.6); }
  15% { opacity: 1; transform: translateX(-50%) scale(1.08); }
  25% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

.result-flowers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  max-width: 380px;
  margin: 0 auto 12px;
  font-size: 24px;
  min-height: 30px;
}
.result-flowers span { animation: flowerPop .35s ease backwards; }
@keyframes flowerPop { from { transform: scale(0); } to { transform: scale(1); } }
.result-earn { font-size: 14px; font-weight: 700; color: #be185d; margin: 6px 0 2px; }
.result-star { color: #d97706; font-weight: 700; margin-bottom: 16px; font-size: 15px; }

.garden-entry {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid #a5d6a7;
  border-radius: 999px;
  background: #e8f5e9;
  color: #2e7d32;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.garden-entry:hover { border-color: #66bb6a; transform: translateY(-1px); }

.guide-link { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.foot-sep { margin: 0 8px; opacity: .4; }

.guide-card {
  background: #fffdf6;
  border: 1px solid #f0e4cc;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.guide-step { padding: 10px 0; border-bottom: 1px dashed #eee0c8; }
.guide-step:last-of-type { border-bottom: none; }
.guide-step b { font-size: 16px; color: #b45309; }
.guide-step p { font-size: 14px; color: #5b4a36; margin: 6px 0 0; line-height: 1.6; }
.guide-price-line { background: #fff8ec; border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.guide-note { font-size: 12px; color: #a08c6f; font-weight: 400; }
.guide-tip { font-size: 13px; color: #be185d; background: #fdf2f8; border-radius: 10px; padding: 10px 14px; margin-top: 8px; }

.flower-summary {
  max-width: 420px;
  margin: 20px auto 0;
  padding: 16px;
  background: #fffdf6;
  border: 1px solid #fde8c8;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(43, 33, 24, .05);
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reward-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid #f9a8d4;
  border-radius: 15px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}

.reward-card:hover {
  transform: translateY(-1px);
  border-color: #ec4899;
  box-shadow: 0 6px 14px rgba(190, 24, 93, .08);
}

.reward-card.orange-card { border-color: #fdba74; color: #c2410c; }
.reward-card.orange-card:hover { border-color: #f97316; box-shadow: 0 6px 14px rgba(234, 88, 12, .08); }

.reward-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  background: #fdf2f8;
  font-size: 20px;
  line-height: 1;
}

.reward-card.orange-card .reward-icon { background: #fff7ed; }
.reward-copy { display: grid; gap: 2px; min-width: 0; }
.reward-label { display: block; font-size: 12px; color: #9d7468; }
.reward-value { display: block; font-size: 16px; font-weight: 750; color: #be185d; white-space: nowrap; }
.reward-card.orange-card .reward-value { color: #c2410c; }

.summary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.summary-actions > [hidden] { display: none !important; }

.exchange-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 13px;
  border: 2px solid #fdba74;
  background: #ffedd5;
  color: #9a3412;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.garden-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 13px;
  border: 2px solid #bbf7d0;
  background: #ecfdf5;
  color: #166534;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all .15s;
}

.exchange-btn.ready {
  background: linear-gradient(135deg, #fb923c, #f97316);
  border-color: #f97316;
  color: #fff;
  animation: pulse 1.6s ease-in-out infinite;
}
.exchange-btn.ready:hover { transform: translateY(-2px); }
.exchange-btn:disabled { opacity: .65; cursor: default; }
.garden-entry:hover { border-color: #4ade80; transform: translateY(-1px); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,.45); }
  50% { box-shadow: 0 0 0 10px rgba(249,115,22,0); }
}
.gift-tip { font-size: 13px; color: #c2410c; margin: 12px 0 0; }

@media (max-width: 380px) {
  .flower-summary { padding: 13px; }
  .reward-grid, .summary-actions { gap: 8px; }
  .reward-card { padding: 9px 10px; gap: 8px; }
  .reward-value { font-size: 15px; }
  .exchange-btn, .garden-entry { padding: 10px 9px; font-size: 13px; }
}

.orange-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43,33,24,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.orange-pop {
  background: #fffdf6;
  border-radius: 24px;
  padding: 36px 44px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  animation: popIn .4s cubic-bezier(.2,1.4,.4,1);
}
@keyframes popIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.orange-big { font-size: 72px; line-height: 1; animation: orangeJump 1s ease-in-out infinite; position: relative; }
.orange-face { font-size: 34px; margin-top: -22px; position: relative; z-index: 1; }
@keyframes orangeJump {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-14px) rotate(6deg); }
}
.orange-pop p { font-size: 17px; margin: 14px 0 6px; }
.orange-pop b { color: #c2410c; font-size: 18px; }
.orange-confetti { font-size: 22px; letter-spacing: 8px; margin-bottom: 6px; }

.garden-progress { text-align: center; font-size: 15px; color: #6b5a44; margin: 0 0 8px; }
.garden-progress b { color: #c2410c; }
.garden-tree { max-width: 380px; margin: 0 auto; }
.garden-tree svg { width: 100%; display: block; }
.og-swing {
  animation: sway 3.2s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: top center;
}
@keyframes sway { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.garden-sub { font-size: 15px; color: #9a6713; border-bottom: 1px dashed #e5d5b8; padding-bottom: 6px; margin: 20px 0 12px; }
.garden-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.garden-grid .cell {
  background: #fff;
  border: 1px solid #eee0c8;
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
  font-size: 26px;
}
.garden-grid .cell small { display: block; font-size: 10px; color: #8a7a60; margin-top: 2px; }
.garden-grid .cell.locked { opacity: .35; filter: grayscale(1); }
.garden-records {
  background: #fff;
  border-radius: 14px;
  padding: 4px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.garden-records .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed #eee0c8;
  font-size: 14px;
}
.garden-records .item:last-child { border-bottom: none; }
.garden-records .face { font-size: 24px; }
.garden-records .name { font-weight: 700; }
.garden-records .meta { color: #a08c6f; font-size: 12px; margin-left: auto; text-align: right; }

.garden-entry {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  border: 2px solid #a5d6a7;
  border-radius: 999px;
  background: #e8f5e9;
  color: #2e7d32;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.garden-entry:hover { border-color: #66bb6a; transform: translateY(-1px); }

.guide-link { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.foot-sep { margin: 0 8px; opacity: .4; }

.guide-card {
  background: #fffdf6;
  border: 1px solid #f0e4cc;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.guide-step { padding: 10px 0; border-bottom: 1px dashed #eee0c8; }
.guide-step:last-of-type { border-bottom: none; }
.guide-step b { font-size: 16px; color: #b45309; }
.guide-step p { font-size: 14px; color: #5b4a36; margin: 6px 0 0; line-height: 1.6; }
.guide-price-line { background: #fff8ec; border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.guide-note { font-size: 12px; color: #a08c6f; font-weight: 400; }
.guide-tip { font-size: 13px; color: #be185d; background: #fdf2f8; border-radius: 10px; padding: 10px 14px; margin-top: 8px; }



.flower-big { text-align: center; font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.flower-tip { text-align: center; font-size: 13px; color: rgba(43,33,24,.55); margin: 0 0 20px; }
.flower-records {
  background: #fff;
  border-radius: 16px;
  padding: 8px 20px;
  max-width: 480px;
  margin: 0 auto 8px;
  box-shadow: 0 2px 12px rgba(43,33,24,.06);
}
.flower-record {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #eee0c8;
  font-size: 14px;
}
.flower-record:last-child { border-bottom: none; }
.flower-record b { color: #be185d; white-space: nowrap; }
.flower-empty { text-align: center; color: rgba(43,33,24,.5); padding: 20px 0; }

/* ---------- 打印 ---------- */
@page { size: A4; margin: 14mm; }

@media print {
  body { background: #fff; }
  .no-print, .hero, .mode-cards, .p-head, .p-card,
  #viewHome, #viewPracticeSetup, #viewPractice, #viewResult,
  #viewFlowers, #viewGarden, #viewGuide,
  .btn, .back-btn, .print-hint { display: none !important; }
  #viewPrint { display: block !important; }
  body.printing-award #viewPrint { display: none !important; }
  body.printing-award #viewAward { display: block !important; }
  .shell { max-width: none; padding: 0; }
  .sheet-area { margin-top: 0; }
  .sheet {
    box-shadow: none;
    border-radius: 0;
    margin: 0 auto;
    max-width: none;
    padding: 0;
  }
  .sheet.answers { page-break-before: always; }
  .q-time { border-bottom-color: #999; }
}

/* ---------- 背景音乐控件 ---------- */
.bgm-dock {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.bgm-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fcd34d;
  background: #fffbeb;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .15s;
}
.bgm-btn:active { transform: scale(.92); }
.bgm-btn.bgm-muted {
  background: #f3f4f6;
  border-color: #d1d5db;
  opacity: .75;
}
.bgm-btn.bgm-playing {
  animation: bgm-pulse 1.6s ease-in-out infinite;
}
@keyframes bgm-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
  50%      { box-shadow: 0 2px 14px rgba(245,158,11,.45); }
}
.bgm-panel {
  background: #fffbeb;
  border: 2px solid #fcd34d;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 168px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.bgm-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 6px;
}
.bgm-track {
  display: block;
  width: 100%;
  text-align: left;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 5px;
  font-size: 13px;
  color: #78350f;
  cursor: pointer;
}
.bgm-track.active {
  background: #f59e0b;
  color: #fff;
  border-color: #d97706;
}
.bgm-credit {
  font-size: 10px;
  color: #b45309;
  margin: 6px 0 0;
  opacity: .7;
}
.guide-credit {
  font-size: 11px;
  color: #92400e;
  opacity: .65;
  margin: 10px 0 0;
  text-align: center;
}
@media print {
  .bgm-dock { display: none; }
  .award-sheet {
    box-shadow: none;
    margin: 0;
    max-width: none;
    padding: 0;
  }
  .award-frame {
    border-width: 6px;
    padding: 30px 24px;
  }
  .award-title { font-size: 46px; }
  .award-tree { max-width: 430px; }
  .award-row { font-size: 17px; padding: 9px 12px; }
  .award-sheet, .award-frame * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.bgm-mute-btn {
  display: block;
  width: 100%;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: #991b1b;
  cursor: pointer;
}
.bgm-mute-btn.off {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

/* ---------- 荣誉奖状 ---------- */
.garden-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}
.award-btn {
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  color: #fff;
  border: none;
}
.award-toolbar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}
.award-print-btn {
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  color: #fff;
  border: none;
}
.award-sheet {
  background: #fffdf5;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  padding: 18px;
  max-width: 640px;
  margin: 0 auto;
}
.award-frame {
  border: 3px solid #fb923c;
  outline: 2px dashed #fdba74;
  outline-offset: -10px;
  border-radius: 10px;
  padding: 26px 20px;
  text-align: center;
  background: #fffbeb;
}
.award-kicker {
  font-size: 14px;
  color: #b45309;
  letter-spacing: 4px;
  margin: 0 0 6px;
}
.award-title {
  font-size: 34px;
  color: #c2410c;
  margin: 4px 0 8px;
  text-shadow: 1px 1px 0 #fde68a;
}
.award-sub {
  font-size: 15px;
  color: #92400e;
  margin: 0 0 12px;
}
.award-tree {
  max-width: 320px;
  margin: 0 auto 10px;
}
.award-tree svg { width: 100%; height: auto; }
.award-empty-tree {
  color: #b45309;
  opacity: .7;
  padding: 30px 0;
  font-size: 14px;
}
.award-ledger-title {
  font-size: 15px;
  color: #92400e;
  margin: 8px 0;
}
.award-ledger {
  max-width: 420px;
  margin: 0 auto;
  text-align: left;
}
.award-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px dashed #fcd34d;
  font-size: 14px;
  color: #78350f;
}
.award-row:nth-child(odd) { background: #fef3c7; border-radius: 6px; }
.a-seq { min-width: 48px; font-weight: 600; color: #c2410c; }
.a-face { font-size: 18px; }
.a-name { flex: 1; }
.a-date { color: #b45309; opacity: .75; font-size: 13px; }
.award-empty-ledger {
  text-align: center;
  color: #b45309;
  opacity: .7;
  padding: 14px 0;
}
.award-foot {
  margin-top: 16px;
  font-size: 12px;
  color: #b45309;
  opacity: .8;
}

.award-png-btn {
  background: #ecfdf5;
  color: #047857;
  border: 2px solid #6ee7b7;
}

/* ---------- 账号行 ---------- */
.account-row {
  text-align: center;
  margin: 14px 0 4px;
}
.account-link {
  font-size: 13px;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
}
.account-in {
  display: none;
  font-size: 13px;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 7px 14px;
}
/* ---------- 家长解锁弹窗 ---------- */
.unlock-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.unlock-card {
  background: #fffbeb;
  border-radius: 18px;
  max-width: 360px;
  width: 100%;
  padding: 26px 22px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.unlock-emoji { font-size: 42px; }
.unlock-card h3 {
  margin: 8px 0 10px;
  color: #92400e;
  font-size: 19px;
}
.unlock-desc {
  font-size: 14px;
  color: #78350f;
  line-height: 1.7;
  margin: 0 0 14px;
}
.unlock-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.unlock-input-wrap input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #fcd34d;
  border-radius: 10px;
  font-size: 15px;
  box-sizing: border-box;
  background: #fff;
}
.unlock-btn {
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.unlock-btn.secondary {
  background: #f3f4f6;
  color: #374151;
}
.unlock-btn:disabled { opacity: .6; }
.unlock-hint {
  font-size: 12px;
  color: #b45309;
  opacity: .8;
  margin: 10px 0 6px;
}
.unlock-checklink {
  display: block;
  margin: 8px 0;
  font-size: 14px;
  color: #2563eb;
  word-break: break-all;
}
.unlock-close {
  margin-top: 14px;
  background: none;
  border: none;
  color: #92400e;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
@media print {
  .account-row, .unlock-mask { display: none !important; }
}

/* ---------- 橘子园免费额度提示 ---------- */
.garden-quota {
  text-align: center;
  font-size: 13px;
  color: #92400e;
  background: #fef3c7;
  border: 1px dashed #fcd34d;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 8px auto 0;
  max-width: 480px;
}
.garden-quota.used-up {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
.garden-quota.unlocked {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}
