/* 第二輪：單層頁首、手機首屏與回訪動線。 */
.tp3-header{position:relative;z-index:60}
.tp3-header__inner{flex-wrap:nowrap;min-height:64px;padding-block:6px;gap:8px}
.tp3-brand{min-width:0;gap:8px}
.tp3-brand__name{font-size:17px;white-space:nowrap}
.tp3-header-links{margin-left:auto}
.tp3-header-links a{font-size:17px}
.tp3-menu-toggle{display:none;width:48px;height:48px;min-width:48px;align-items:center;justify-content:center;border:1.5px solid var(--tp3-line-strong);border-radius:10px;background:var(--tp3-surface);color:var(--tp3-ink);cursor:pointer}
.tp3-menu-toggle svg{width:25px;height:25px}
.tp3-menu-toggle:focus-visible,.tp3-header-links a:focus-visible{outline:3px solid var(--tp3-amber);outline-offset:2px}
.tp3-grade-nav a{font-size:17px;padding-inline:0}
body:not([data-page="home"]):not([data-page="grade"]) .tp3-grade-nav{display:none!important}
.tp3-home-continue{display:none;align-items:center;min-height:48px;width:max-content;max-width:100%;color:var(--tp3-primary);font-weight:700;text-underline-offset:4px}
.tp3-home-continue.is-visible{display:inline-flex}
.tp3-home-hero .tp3-art-host{margin:0}
.tp3-home-hero .tp3-art--hero{width:100%;height:auto;max-height:180px}
#grade-grid .tp3-choice{height:100%}
#grade-grid .tp3-choice[data-current="true"]{border-color:var(--tp3-primary);box-shadow:inset 0 0 0 1px var(--tp3-primary)}
#grade-grid .tp3-badge{font-size:17px}
@media (max-width:767px){
  .tp3-header__inner{padding-inline:12px}
  .tp3-brand__logo{width:30px;height:30px}
  .tp3-menu-toggle{display:inline-flex;margin-left:auto}
  .tp3-header-links{display:none;position:absolute;top:63px;left:0;right:0;margin:0;padding:8px 12px 12px;background:var(--tp3-paper);border-bottom:1.5px solid var(--tp3-line-strong);box-shadow:var(--tp3-shadow-2)}
  .tp3-header-links.is-open{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .tp3-header-links a{justify-content:center;padding:8px 4px;background:var(--tp3-surface);border:1px solid var(--tp3-line)}
  .tp3-grade-nav__inner{padding-inline:8px}
}
@media (max-width:639px){
  body[data-page="home"] .tp3-main{padding-block:10px 36px}
  body[data-page="home"] .tp3-home-hero{display:grid;grid-template-columns:minmax(0,1fr) 126px;align-items:center;gap:8px;margin:0;--tp3-stack-gap:6px}
  body[data-page="home"] .tp3-home-hero .tp3-kicker{font-size:17px;letter-spacing:.03em;margin:0}
  body[data-page="home"] .tp3-home-hero .tp3-kicker::before{width:1em}
  body[data-page="home"] .tp3-home-hero .tp3-title{font-size:25px;line-height:1.25;margin:0;white-space:nowrap}
  body[data-page="home"] .tp3-home-hero .tp3-lead{font-size:17px;line-height:1.5;margin:0}
  body[data-page="home"] .tp3-home-hero #week-hint{font-size:17px;line-height:1.45;margin:0}
  body[data-page="home"] .tp3-home-hero .tp3-home-art{align-self:center}
  body[data-page="home"] #grades{margin-block:12px 40px;--tp3-stack-gap:8px}
  body[data-page="home"] #grades .tp3-title{font-size:24px;margin:0}
  body[data-page="home"] #grades .tp3-lead{display:none}
  body[data-page="home"] #grade-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  body[data-page="home"] #grade-grid .tp3-choice{min-height:52px;padding:8px 12px;display:flex;align-items:center}
  body[data-page="home"] #grade-grid .tp3-choice-head{gap:6px;width:100%}
  body[data-page="home"] #grade-grid .tp3-choice-title{font-size:21px}
  body[data-page="home"] #grade-grid .tp3-choice-desc{display:none}
  body[data-page="home"] #grade-grid .tp3-badge{margin-left:auto;padding:2px 5px;font-size:14px}
  body[data-page="home"] .tp3-home-lower{margin-block:32px;--tp3-stack-gap:12px}
  body[data-page="home"] .tp3-home-lower .tp3-title{font-size:25px}
}
@media (min-width:640px){
  .tp3-home-hero{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(240px,.75fr);align-items:center;gap:24px}
  .tp3-home-hero .tp3-home-art{grid-column:2;grid-row:1}
  .tp3-home-hero .tp3-home-copy{grid-column:1;grid-row:1}
}
@media (prefers-reduced-motion:reduce){.tp3-header-links{transition:none}}
@media print{.tp3-menu-toggle{display:none!important}}

/* ===== 整合版新增（integrate，1151101）：頁尾回報鈕、舊頁工具列、精簡版回首頁鈕 ===== */
.tp3-footer__report { margin: 0; }
.tp3-footer__report-btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--tp3-link, #5B7183);
  font: inherit;
  font-size: var(--tp3-fs-small, 15px);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.tp3-footer__report-btn:hover { color: var(--tp3-primary, #A94A3C); }
.tp3-footer__report-btn:focus-visible { outline: 3px solid var(--tp3-focus, #A94A3C); outline-offset: 2px; }
.tp3-legacy-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-block: 8px; }
.tp3-legacy-tools .tp-grade-nav { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-right: auto; }
.tp3-legacy-tools .tp-header-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tp3-home-pill {
  position: fixed;
  left: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--tp3-line-strong, #D5C8AE);
  border-radius: 999px;
  background: var(--tp3-surface, #FFFCF7);
  color: var(--tp3-ink, #3B352C);
  box-shadow: 0 2px 8px rgba(59, 53, 44, 0.18);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  opacity: 0.94;
}
.tp3-home-pill:hover { opacity: 1; color: var(--tp3-primary, #A94A3C); }
.tp3-home-pill svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 480px) { .tp3-home-pill { padding: 0; justify-content: center; } .tp3-home-pill__text { display: none; } }
@media print { .tp3-home-pill, .tp3-footer__report, .tp3-legacy-tools { display: none !important; } }
