/* 第二輪：五科插畫、非對稱準備方向、收合設定與分組清單。 */
.tp3-subject-hero{display:grid;grid-template-columns:minmax(0,1fr) 132px;align-items:center;gap:16px}
.tp3-subject-hero__art{display:flex;align-items:center;justify-content:center;min-width:0}
.tp3-subject-hero__art .tp3-art{max-width:132px;max-height:132px}
.tp3-subject-hero .tp3-lead{margin-bottom:0}
.tp3-choice--subject{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 104px;align-items:center;gap:12px;min-height:152px;overflow:hidden}
.tp3-choice--subject .tp3-choice-head{align-self:start}
.tp3-choice--subject .tp3-choice-title{font-size:24px}
.tp3-choice--subject .tp3-choice-desc{align-self:end;margin:0;max-width:18ch}
.tp3-choice--subject .tp3-subject-art{grid-column:2;grid-row:1 / span 2;display:flex;align-items:center;justify-content:center;color:var(--subject-color,var(--tp3-ink-soft))}
.tp3-choice--subject .tp3-subject-art .tp3-art{width:104px;max-height:112px}
.tp3-choice--subject[data-subject-icon="chinese"]{--subject-color:var(--tp3-subject-chinese);background:linear-gradient(105deg,var(--tp3-surface) 62%,var(--tp3-subject-chinese-soft))}
.tp3-choice--subject[data-subject-icon="math"]{--subject-color:var(--tp3-subject-math);background:linear-gradient(105deg,var(--tp3-surface) 62%,var(--tp3-subject-math-soft))}
.tp3-choice--subject[data-subject-icon="english"]{--subject-color:var(--tp3-subject-english);background:linear-gradient(105deg,var(--tp3-surface) 62%,var(--tp3-subject-english-soft))}
.tp3-choice--subject[data-subject-icon="science"]{--subject-color:var(--tp3-subject-science);background:linear-gradient(105deg,var(--tp3-surface) 62%,var(--tp3-subject-science-soft))}
.tp3-choice--subject[data-subject-icon="social"]{--subject-color:var(--tp3-subject-social);background:linear-gradient(105deg,var(--tp3-surface) 62%,var(--tp3-subject-social-soft))}
.tp3-choice--subject .tp3-choice-head [data-tp-icon="arrow"]{margin-left:auto}
.tp3-setup{border-block:1px solid var(--tp3-line-strong);padding-block:4px}
.tp3-setup__summary{display:flex;align-items:center;gap:12px;min-height:56px;margin:0}
.tp3-setup__summary-text{font-weight:700;flex:1;min-width:0}
.tp3-setup__toggle{flex:none;min-width:72px;min-height:48px;border:0;background:transparent;color:var(--tp3-link);font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer}
.tp3-setup__panel{padding-block:4px 20px}
.tp3-setup__panel .tp3-field:last-child{margin-bottom:0}
#mode-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}
.tp3-mode{position:relative;display:flex;min-width:0;min-height:152px;padding:20px;border:1.5px solid var(--tp3-line-strong);border-radius:12px;color:var(--tp3-ink);text-decoration:none;overflow:hidden;transition:transform 140ms ease-out,border-color 140ms ease-out}
.tp3-mode:hover{color:var(--tp3-ink);border-color:var(--tp3-primary);transform:translateY(-2px)}
.tp3-mode__copy{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;position:relative;z-index:1}
.tp3-mode__title{font-family:var(--tp3-font-serif);font-size:24px;font-weight:700;line-height:1.35}
.tp3-mode__desc{font-size:17px;line-height:1.65;color:var(--tp3-ink-soft)}
.tp3-mode__meta{margin-top:auto;padding-top:8px;font-size:17px;line-height:1.55;color:var(--tp3-ink)}
.tp3-mode__art{display:flex;align-items:center;justify-content:center;flex:none;color:var(--tp3-ink-soft)}
.tp3-mode--quiz{grid-column:span 5;align-items:center;justify-content:space-between;gap:12px;background:var(--tp3-surface);border-style:dashed}
.tp3-mode--quiz .tp3-mode__art{transform:rotate(3deg)}
.tp3-mode--mid{grid-column:span 7;flex-direction:row-reverse;align-items:center;justify-content:space-between;gap:16px;background:var(--tp3-amber-soft);border-color:var(--tp3-amber)}
.tp3-mode--mid .tp3-mode__art .tp3-art{width:128px;max-width:14vw}
.tp3-mode--final{grid-column:span 7;align-items:flex-end;justify-content:space-between;gap:16px;background:var(--tp3-sage-soft);border-color:var(--tp3-sage);border-top-width:5px}
.tp3-mode--final .tp3-mode__art{align-self:center}
/* 自訂範圍：文字與插圖並排（不再用絕對定位，原本 meta 文字會壓到插圖）；整合版修正，375 與 1280 都驗過 */
.tp3-mode--custom{grid-column:span 5;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;background:var(--tp3-blue-soft);border-color:var(--tp3-blue)}
.tp3-mode--custom .tp3-mode__art{position:static;opacity:.85;align-self:flex-end}
.tp3-mode--custom .tp3-mode__art .tp3-art{width:92px;max-width:22vw;height:auto}
.tp3-mode--custom .tp3-mode__copy{flex:1 1 auto;padding-right:0}
.tp3-unit-group{margin:0 0 24px}
.tp3-unit-group:last-child{margin-bottom:0}
.tp3-unit-group__title{font-family:var(--tp3-font-sans);font-size:19px;margin:0 0 8px;display:flex;align-items:center;gap:12px}
.tp3-unit-group__title::after{content:"";height:1px;background:var(--tp3-line-strong);flex:1}
.tp3-unit-link{display:flex;align-items:center;gap:12px;min-height:56px;padding:10px 40px 10px 8px;position:relative}
.tp3-unit-link::after{content:"";position:absolute;right:12px;width:10px;height:10px;border-top:2px solid currentColor;border-right:2px solid currentColor;transform:rotate(45deg);color:var(--tp3-ink-soft)}
.tp3-unit-link:hover::after{color:var(--tp3-primary)}
.tp3-more-group{margin:0}
.tp3-more-group__note{margin:-4px 0 12px;color:var(--tp3-ink-soft);font-size:17px}
.tp3-more-group .tp3-row-link{position:relative;display:block;min-height:56px;padding:12px 40px 12px 8px}
.tp3-more-group .tp3-row-link::after{content:"";position:absolute;right:14px;top:24px;width:9px;height:9px;border-top:2px solid currentColor;border-right:2px solid currentColor;transform:rotate(45deg);color:var(--tp3-ink-soft)}
.tp3-more-group .tp3-row-title{display:block}
.tp3-more-group .tp3-row-desc{margin-top:2px}
.tp3-text-return{display:inline-flex;align-items:center;min-height:48px;font-weight:700}
@media (max-width:767px){
  #mode-grid{grid-template-columns:1fr}
  .tp3-mode--quiz,.tp3-mode--mid,.tp3-mode--final,.tp3-mode--custom{grid-column:1;min-height:144px}
  .tp3-mode--mid .tp3-mode__art .tp3-art{width:104px;max-width:28vw}
  .tp3-mode--custom{min-height:144px}
}
@media (max-width:639px){
  .tp3-subject-hero{grid-template-columns:minmax(0,1fr) 104px;gap:8px}
  .tp3-subject-hero__art .tp3-art{max-width:104px;max-height:112px}
  .tp3-choice--subject{grid-template-columns:minmax(0,1fr) 88px;min-height:136px;padding:14px}
  .tp3-choice--subject .tp3-subject-art .tp3-art{width:88px;max-height:96px}
  .tp3-choice--subject .tp3-choice-title{font-size:22px}
  .tp3-choice--subject .tp3-choice-desc{font-size:17px;line-height:1.55}
  .tp3-mode{padding:16px}
  .tp3-mode__title{font-size:22px}
}
@media (prefers-reduced-motion:reduce){.tp3-mode{transition:none}.tp3-mode:hover{transform:none}}
@media print{.tp3-setup__toggle{display:none}.tp3-setup__panel{display:none!important}}
