:root {
  --bg: #0b1220; --panel: #111a2e; --line: #23314f; --text: #eef3ff; --muted: #94a3c4;
  --cyan: #00b8fc; --cyan-2: #0090c8; --good: #22c55e; --bad: #ef4444; --gold: #fbbf24;
  --wood: #1a2440; --wood-top: #2b3a63;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overscroll-behavior: none; }
body { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; }
input { font: inherit; -webkit-user-select: text; user-select: text; }
#app { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: flex; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 46px; padding: .6em 1.2em;
  border-radius: 12px; border: 1px solid var(--line); background: #17223b; color: var(--text); font-weight: 700;
  cursor: pointer; text-decoration: none; transition: transform .1s, background .2s;
}
.btn:hover { background: #1f2d4d; }
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #04131f; }
.btn-primary:hover { background: #33c7ff; }
.btn-lg { font-size: 1.25rem; min-height: 58px; padding: .6em 2.4em; border-radius: 16px; }
.btn-shop { background: linear-gradient(135deg, #00b8fc, #7c3aed); border: 0; color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #17223b; cursor: pointer; font-size: 18px; }

/* ───────── 主頁 */
#home { align-items: center; justify-content: center; text-align: center; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 20%, rgba(0,184,252,.25), transparent 60%), radial-gradient(ellipse at 80% 100%, rgba(124,58,237,.25), transparent 55%), var(--bg); }
.home-inner { width: min(560px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.home-logo { width: min(240px, 60vw); }
.home-title { margin: 0; font-size: clamp(2.6rem, 11vw, 4.4rem); letter-spacing: .06em; line-height: 1.1; text-shadow: 0 0 30px rgba(0,184,252,.45); }
.home-title span { color: var(--cyan); }
.home-sub { margin: 0; color: var(--muted); font-size: 1.05rem; }
.home-mice { position: relative; height: 120px; width: 100%; }
.home-mice img { position: absolute; top: 10px; left: calc(50% - 50px + (var(--i) - 2) * 21%); width: 100px; height: 100px; object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.6)); animation: bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.45s); }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-4deg); } }
.home-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.home-row { display: flex; gap: 10px; }

/* ───────── HUD */
#game { flex-direction: column; }
.hud { display: flex; align-items: center; gap: 10px; padding: 8px max(12px, env(safe-area-inset-left)); padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(7,12,24,.92); border-bottom: 1px solid var(--line); z-index: 5; }
.hud-day { display: flex; flex-direction: column; line-height: 1.15; min-width: 84px; }
.hud-day span { font-weight: 900; font-size: 1.1rem; }
.hud-day small, .hud-score small { color: var(--muted); font-size: .75rem; }
.hud-score { display: flex; flex-direction: column; line-height: 1.15; }
.hud-score b { font-size: 1.3rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.hud-hearts { font-size: 1.25rem; letter-spacing: 2px; }
.hud-hearts .on { color: #f43f5e; text-shadow: 0 0 8px rgba(244,63,94,.6); }
.hud-hearts .off { color: #334155; }
.hud-hearts.hit { animation: hit .5s; }
@keyframes hit { 30% { transform: scale(1.4); } }
.hud-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.book-btn { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 14px 0 10px; border-radius: 12px; cursor: pointer; font-weight: 800;
  border: 2px solid var(--gold); background: linear-gradient(180deg, #7c2d12, #5b1f0c); color: #fde68a; box-shadow: 0 0 0 0 rgba(251,191,36,.6); animation: glow 2.5s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 14px 2px rgba(251,191,36,.45); } }
.book-ico { width: 24px; height: 28px; border-radius: 3px 5px 5px 3px; background: linear-gradient(90deg, #451a03 0 4px, #b45309 4px); position: relative; }
.book-ico::after { content: "G"; position: absolute; inset: 0 0 0 4px; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #fde68a; }

/* ───────── 店面 */
.shop { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, #14213d 0%, #101a31 55%, #0d1528 100%); }
.shop-wall { position: absolute; inset: 0 0 auto 0; height: 55%; pointer-events: none; overflow: hidden;
  background: repeating-linear-gradient(90deg, transparent 0 118px, rgba(255,255,255,.03) 118px 120px),
  linear-gradient(180deg, transparent 62%, rgba(0,184,252,.12) 62% 63%, transparent 63%); }
.shop-wall img { position: absolute; right: 4%; top: 10%; width: 72px; opacity: .22; }
.customers { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--slots, 1), minmax(0, 1fr)); gap: 8px; padding: 10px 10px 0; align-items: end; }
.customers.choose .customer:not(:disabled) { animation: pulse 1s infinite; }
@keyframes pulse { 50% { filter: drop-shadow(0 0 12px var(--cyan)); } }
.slot { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.customer { position: relative; display: flex; flex-direction: column; align-items: center; border: 0; background: none; padding: 0; cursor: pointer; width: 100%; max-width: 280px; height: 100%; justify-content: flex-end; }
.customer .bubble { position: relative; background: #fff; color: #0f172a; border-radius: 14px; padding: 8px 10px; margin-bottom: 6px; width: 100%;
  box-shadow: 0 6px 18px rgba(0,0,0,.35); text-align: left; font-size: clamp(.82rem, 2.3vw, 1rem); line-height: 1.35; }
.customer .bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
.customer .bubble p { margin: 0; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.customer .tag { display: inline-block; font-size: .7rem; font-weight: 900; padding: 1px 6px; border-radius: 6px; margin-bottom: 3px; background: #e0f2fe; color: #0369a1; }
.customer.demand .tag { background: #fef3c7; color: #b45309; }
.customer.demand .bubble { box-shadow: 0 0 0 3px #fbbf24, 0 6px 18px rgba(0,0,0,.35); }
.customer .avatar { width: clamp(84px, min(22vw, 20vh), 170px); flex: 0 1 auto; min-height: 0; }
.customer .avatar svg { display: block; width: 100%; height: auto; }
.customer .patience { width: 70%; height: 8px; border-radius: 4px; background: rgba(0,0,0,.45); overflow: hidden; margin-top: -2px; position: relative; z-index: 2; }
.customer .patience i { display: block; height: 100%; background: var(--good); transform-origin: left; }
.customer .mood { position: absolute; right: 8%; bottom: 30px; font-size: 1.4rem; }
.customer.picked .avatar { filter: drop-shadow(0 0 10px var(--cyan)); }
.customer.enter { animation: walkin .5s ease-out; }
@keyframes walkin { from { transform: translateY(30px); opacity: 0; } }
.customer.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.customer.leave.happy { animation: leaveUp .9s ease-in forwards; }
.customer.leave.angry { animation: leaveSide .9s ease-in forwards; }
@keyframes leaveUp { to { transform: translateY(-30px) scale(.9); opacity: 0; } }
@keyframes leaveSide { 30% { transform: translateX(-10px); } to { transform: translateX(120%); opacity: 0; } }
.fx { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-weight: 900; font-size: 1.6rem; pointer-events: none; animation: floatUp .9s ease-out forwards; white-space: nowrap; z-index: 3; }
.fx.plus { color: var(--gold); text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.fx.minus { color: #fca5a5; font-size: 1.1rem; }
@keyframes floatUp { to { transform: translate(-50%, -50px); opacity: 0; } }

/* ───────── 櫃檯 */
.counter-wrap { position: relative; z-index: 2; padding: 0 10px max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--wood-top) 0 10px, var(--wood) 10px); border-top: 3px solid var(--cyan); box-shadow: 0 -10px 30px rgba(0,0,0,.4); }
.counter-hint { text-align: center; color: var(--muted); font-size: .8rem; padding: 14px 0 6px; }
.counter { --cols: 6; --gap: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); max-width: 900px; margin: 0 auto; }
.counter .item { width: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); }
.item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; cursor: pointer;
  background: #fff; border: 3px solid transparent; color: #0f172a; min-width: 0; transition: transform .12s, border-color .12s; }
.item.gaming { background: linear-gradient(180deg, #eef6ff, #dbe6f5); }
.item img { width: 100%; height: clamp(44px, 11vh, 110px); object-fit: contain; pointer-events: none; }
.item span { font-size: clamp(.62rem, 1.7vw, .8rem); font-weight: 800; line-height: 1.15; text-align: center; overflow-wrap: anywhere; min-height: 2.3em; display: flex; align-items: center; }
.item:hover { transform: translateY(-3px); }
.item.selected { border-color: var(--cyan); transform: translateY(-6px); box-shadow: 0 0 0 3px rgba(0,184,252,.35), 0 10px 18px rgba(0,0,0,.4); }
.item.wrong { border-color: var(--bad); animation: shake .4s; }
.item.sold { animation: sold .5s; }
@keyframes sold { 40% { transform: scale(1.1); border-color: var(--good); } }
.item.restock { animation: restock .45s ease-out; }
@keyframes restock { from { transform: scale(.4); opacity: 0; } }

.toast { position: absolute; left: 50%; top: 70px; transform: translate(-50%, -20px); padding: 8px 16px; border-radius: 999px; background: #1e293b; border: 1px solid var(--line);
  font-weight: 800; opacity: 0; pointer-events: none; transition: .2s; z-index: 20; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: #14532d; border-color: var(--good); }
.toast.bad { background: #7f1d1d; border-color: var(--bad); }
.banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 15; width: min(460px, 90vw); text-align: center;
  background: rgba(8,14,28,.95); border: 2px solid var(--cyan); border-radius: 18px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.6); pointer-events: none; }
.banner b { display: block; font-size: 2rem; color: var(--cyan); }
.banner span { display: block; margin-top: 6px; color: var(--text); line-height: 1.5; }
.banner.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }

/* ───────── 型錄 */
.book { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 30; display: flex; flex-direction: column;
  background: #fdf8ec; color: #1f2937; box-shadow: -12px 0 40px rgba(0,0,0,.5); transform: translateX(105%); transition: transform .25s ease; border-left: 8px solid #7c2d12; }
.book.open { transform: none; }
.book[hidden] { display: none; }
.book-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: #7c2d12; color: #fde68a; }
.book-title { font-weight: 900; font-size: 1.1rem; }
.book-title small { font-size: .75rem; color: #fecaca; margin-left: 4px; font-weight: 700; }
.book-head .icon-btn { background: rgba(0,0,0,.25); border-color: transparent; color: #fde68a; }
.book-watch { display: flex; gap: 8px; padding: 6px 12px; background: #fef3c7; min-height: 38px; align-items: center; }
.book-watch small { color: #92400e; }
.watch { display: flex; align-items: center; gap: 6px; font-size: 1.2rem; flex: 1; max-width: 140px; }
.watch i { display: block; flex: 1; height: 7px; border-radius: 4px; background: #ef4444; transform-origin: left; }
.book-tools { padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid #e7dcc2; }
.book-tools input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 2px solid #e7dcc2; background: #fff; color: #111; font-size: 16px; }
.book-tabs { display: flex; gap: 6px; }
.book-tabs button { flex: 1; padding: 6px; border-radius: 8px; border: 1px solid #e7dcc2; background: #fff; cursor: pointer; font-weight: 700; color: #57534e; }
.book-tabs button.on { background: #7c2d12; color: #fde68a; border-color: #7c2d12; }
.book-body { flex: 1; overflow-y: auto; padding: 8px 12px 16px; -webkit-overflow-scrolling: touch; }
.book-list { display: flex; flex-direction: column; gap: 6px; }
.book-item { display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px; border-radius: 10px; border: 1px solid #efe5cf; background: #fff; cursor: pointer; }
.book-item:hover { border-color: #b45309; }
.book-item img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.book-item b { display: block; color: #111827; }
.book-item small { display: block; color: #6b7280; font-size: .78rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-empty { color: #6b7280; text-align: center; margin-top: 30px; }
.book-back { border: 0; background: none; color: #b45309; font-weight: 800; cursor: pointer; padding: 4px 0 8px; font-size: 1rem; }
.detail img { display: block; width: 160px; height: 160px; object-fit: contain; margin: 0 auto; }
.detail h3 { margin: 8px 0 4px; font-size: 1.05rem; line-height: 1.4; }
.detail-tag { margin: 0 0 8px; font-size: .8rem; color: #0369a1; font-weight: 700; }
.detail-tag.gaming { color: #7c3aed; }
.detail h4 { margin: 10px 0 4px; color: #7c2d12; }
.detail ul { margin: 0; padding-left: 1.1em; line-height: 1.55; font-size: .92rem; -webkit-user-select: text; user-select: text; }
.detail li { margin-bottom: 4px; }
.book-src { font-size: .7rem; color: #a8a29e; text-align: center; padding: 4px 0 max(6px, env(safe-area-inset-bottom)); }

/* ───────── 結算 */
#over { flex-direction: column; background: radial-gradient(ellipse at 50% 0%, rgba(0,184,252,.2), transparent 60%), var(--bg); }
.over-inner { flex: 1; overflow-y: auto; padding: 20px 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.over-title { margin: 6px 0 0; font-size: 1.8rem; }
.over-score { text-align: center; }
.over-score small { display: block; color: var(--muted); }
.over-score b { font-size: 3.2rem; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.1; }
.over-stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; color: var(--muted); }
.over-stats b { color: var(--text); }
.submit-row { display: flex; gap: 8px; width: min(440px, 100%); }
.submit-row[hidden] { display: none; }
.submit-row input { flex: 1; min-width: 0; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: #0f1830; color: var(--text); font-size: 16px; }
.submit-msg { margin: 0; color: var(--cyan); min-height: 1.2em; text-align: center; }
.board { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.board h3 { margin: 0 0 6px; font-size: 1rem; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-list li { display: grid; grid-template-columns: 34px 1fr auto 70px; gap: 6px; align-items: center; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .95rem; }
.board-list li.me { background: rgba(0,184,252,.18); border-radius: 8px; }
.board-list li.muted { display: block; color: var(--muted); text-align: center; }
.board-list .rk { text-align: center; font-weight: 900; }
.board-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .dy { color: var(--muted); font-size: .8rem; }
.board-list .sc { text-align: right; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.shop-note { width: min(440px, 100%); margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.shop-note b { color: var(--text); }
.over-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); background: rgba(7,12,24,.95); border-top: 1px solid var(--line); }
.over-actions .btn { padding: .6em .4em; font-size: .95rem; }

/* 分享 */
.btn-share, .btn.btn-share:hover { background: linear-gradient(135deg, #f59e0b, #ec4899); border: 0; color: #fff; min-width: 200px; }
.share-dlg { width: min(460px, 94vw); }
.share-preview { display: block; width: min(220px, 60%); aspect-ratio: 4 / 5; margin: 0 auto 8px; border-radius: 10px; background: #0b1220; box-shadow: 0 8px 24px rgba(0,0,0,.5); object-fit: cover; }
.share-text { margin: 0 0 10px; font-size: .85rem; line-height: 1.5; color: var(--muted); white-space: pre-line; -webkit-user-select: text; user-select: text; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-grid .btn { white-space: nowrap; padding-left: .5em; padding-right: .5em; }
.share-note { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.45); font-size: .88rem; line-height: 1.55; color: var(--text); }
.share-note b { color: #86efac; }
.share-hint { margin: 8px 0 0; min-height: 1.2em; color: var(--cyan); font-size: .85rem; text-align: center; }

/* ───────── 對話框 */
.dlg { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); width: min(480px, 92vw); max-height: 86dvh; padding: 18px; }
.dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg h2 { margin: 0 0 10px; }
.dlg form { display: flex; justify-content: center; margin-top: 12px; }
.dlg .board { width: 100%; max-height: 55dvh; overflow-y: auto; }
.how { padding-left: 1.2em; line-height: 1.6; margin: 0; }
.how li { margin-bottom: 6px; }
.how b { color: var(--cyan); }

/* 寬螢幕翻型錄時，店面往左讓位，顧客不會被蓋住 */
@media (min-width: 1000px) {
  #game { transition: right .25s ease; }
  #app.book-open #game { right: 440px; }
}

/* ───────── 手機直式 */
@media (max-width: 640px) {
  .hud { gap: 6px; }
  .hud-day { min-width: 64px; }
  .hud-day span { font-size: 1rem; }
  .hud-hearts { font-size: 1rem; letter-spacing: 0; }
  .book-btn { height: 42px; padding: 0 10px 0 8px; }
  .book-btn span:last-child { display: none; }
  .icon-btn { width: 36px; height: 36px; }
  .counter { --cols: 4; --gap: 6px; }
  .counter-hint { padding: 10px 0 4px; }
  .customers { gap: 4px; padding: 6px 4px 0; }
  .customer .bubble { padding: 6px 7px; border-radius: 10px; }
  .customer .mood { font-size: 1.1rem; bottom: 22px; }
  .shop-wall img { display: none; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .counter { --cols: 12; }
  .item span { display: none; }
  .customer .avatar { width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

.btn-share:hover { filter: brightness(1.12); }
 
/* ───────── 櫃檯產品線分頁、型錄分頁 */
.counter-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 900px; margin: 0 auto 8px; }
.ctab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: #17223b; color: var(--text); font-weight: 800; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.ctab i { font-style: normal; min-width: 1.4em; padding: 0 5px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: .75rem; }
.ctab.on { background: var(--cyan); border-color: var(--cyan); color: #04131f; }
.ctab.on i { background: rgba(4,19,31,.2); }
.ctab[hidden] { display: none; }
.counter .item[hidden] { display: none; }
/* 一條產品線可能有十幾件：櫃檯限高、內部捲動，顧客不被擠掉 */
.counter { max-height: 38vh; max-height: 38dvh; overflow-y: auto; overscroll-behavior: contain; padding: 4px 2px 6px; align-content: flex-start; }
.counter-wrap { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
#bookTabs { display: flex; flex-wrap: wrap; gap: 6px; }
#bookTabs::-webkit-scrollbar { display: none; }
#bookTabs button { flex: 0 0 auto; padding: 6px 10px; border-radius: 8px; border: 1px solid #e7dcc2; background: #fff; cursor: pointer; font-weight: 700; color: #57534e; }
#bookTabs button.on { background: #7c2d12; color: #fde68a; border-color: #7c2d12; }
@media (max-width: 640px) {
  .counter-tabs { gap: 4px; margin-bottom: 6px; }
  .ctab { flex: 1 0 auto; padding: 5px 8px; font-size: .78rem; }
  #bookTabs button { padding: 5px 8px; font-size: .85rem; }
}

/* 小螢幕（320 寬）：分享彈窗按鈕不折行 */
@media (max-width: 360px) {
  .share-dlg { padding: 14px; }
  .share-grid .btn { font-size: .88rem; }
}
/* 手機橫向（高度很矮）：首頁可捲動並縮小、型錄頂部精簡，讓清單有空間 */
@media (max-height: 500px) {
  #home { justify-content: flex-start; padding: 12px 0; }
  .home-inner { gap: 6px; }
  .home-logo { width: 160px; }
  .home-title { font-size: 2.2rem; }
  .home-mice { height: 70px; }
  .home-mice img { width: 64px; height: 64px; }
  .book-head { padding: 4px 12px; }
  .book-watch { min-height: 26px; padding: 2px 12px; }
  .book-tools { padding: 6px 12px 4px; gap: 6px; }
  .book-tools input { padding: 6px 10px; }
  #bookTabs { gap: 4px; }
  #bookTabs button { padding: 3px 7px; font-size: .78rem; }
}

/* 挑戰版：首頁標記與口號 */
.challenge-badge { display: inline-block; margin-top: -4px; padding: 4px 20px; border-radius: 999px; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1f1300; font-weight: 900; letter-spacing: .25em; box-shadow: 0 0 22px rgba(245,158,11,.55); }
.home-slogan { margin: 4px 0 0; font-size: clamp(1.15rem, 5vw, 1.6rem); font-weight: 900; color: var(--gold); text-shadow: 0 2px 12px rgba(0,0,0,.5); }
@media (max-height: 500px) { .home-slogan { font-size: 1.05rem; margin: 0; } .challenge-badge { padding: 2px 14px; } }
