/* Shared ergonomics; the original palette and layout stay available. */
html{scroll-padding-top:150px}body{min-width:0}html[data-template]{color-scheme:light}html[data-template=doubao]{color-scheme:dark}
body.modal-open{overflow:hidden}main,.row>*,.grid>*,.hero-copy,.section-head>*,.page-head>*,.dialog-body>*{min-width:0}
.btn{white-space:normal;text-align:center;overflow-wrap:anywhere}.btn:active{transform:translateY(1px)}a,button{touch-action:manipulation}
h1,h2,h3,p,label,.notice,.card,.toast{overflow-wrap:anywhere}.section-head,.page-head{flex-wrap:wrap}.row{max-width:100%}input,select,textarea{max-width:100%;min-width:0}
.pathway,.card{transition:border-color .18s,box-shadow .18s,transform .18s}.pathway:hover{border-color:var(--accent);box-shadow:var(--shadow);transform:translateY(-2px)}
dialog{width:min(720px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 40px);overflow:hidden;background:var(--paper);margin:auto;padding:0;box-shadow:0 30px 100px #080d2540}
dialog[open]{display:flex;flex-direction:column;animation:dialog-enter .18s ease-out}.dialog-head{background:var(--paper);padding:20px 24px;gap:18px;flex:none;position:relative}.dialog-head h2{min-width:0;line-height:1.5;font-size:20px}.dialog-head [data-close]{width:44px;height:44px;flex:none;padding:10px;border:1px solid var(--line);border-radius:50%}.dialog-body{padding:24px;overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-gutter:stable}.dialog-actions{flex-wrap:wrap;position:sticky;bottom:-24px;background:var(--paper);padding:14px 0;margin-bottom:0;border-top:1px solid var(--line)}.dialog-body .form-error:empty{display:none}.dialog-body .form-error{padding:12px;background:color-mix(in srgb,var(--red) 9%,var(--paper));border-radius:8px}.toast-stack{max-width:calc(100vw - 32px);padding-bottom:env(safe-area-inset-bottom)}.toast{overflow-wrap:anywhere}.comparison{max-width:100%;overscroll-behavior-x:contain}.signature{color-scheme:light}
@keyframes dialog-enter{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.template-card{padding:24px;position:relative}.template-card.is-current{outline:2px solid var(--accent);outline-offset:2px}.template-swatch{height:136px;display:grid;grid-template-columns:2fr 1fr 1fr 1fr;overflow:hidden;border-radius:12px;margin-bottom:20px}.template-swatch span{display:block}.template-card h3{margin-bottom:6px}.template-card p{min-height:52px}.template-current{padding:20px 24px;margin-bottom:26px}.template-card .row{margin-top:22px}.template-status{color:var(--accent);font-size:13px;font-weight:700}.template-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:12px;color:white;background:var(--accent);margin-bottom:16px}
/* Doubao source palette: #0f0f1a / #1a1a2e / #6366f1 / #a855f7. */
html[data-template=doubao]{--ink:#f1f5f9;--muted:#a9b5ca;--bg:#0f0f1a;--paper:#1a1a2e;--line:#343451;--accent:#a8a6ff;--accent-soft:#292747;--navy:#16162a;--gold:#fbbf24;--red:#ffa39f;--shadow:0 12px 40px #05051245;--radius:20px}
[data-template=doubao] body{background:radial-gradient(ellipse at 10% 0,#6366f11c,transparent 40%),radial-gradient(ellipse at 95% 40%,#a855f70e,transparent 45%),var(--bg)}
[data-template=doubao] .topbar{background:#0f0f1ae8;border-color:#2d2d4a}[data-template=doubao] .brand-mark{background:linear-gradient(135deg,#6366f1,#a855f7)}[data-template=doubao] .brand-mark svg{display:none}[data-template=doubao] .brand-mark:after{content:'🤖';font-size:23px}
[data-template=doubao] .hero{padding-top:40px}[data-template=doubao] .hero-panel{background:radial-gradient(ellipse at 75% 40%,#6366f12b,transparent 50%),linear-gradient(135deg,#17172b,#131321);border:1px solid #343456;min-height:470px;border-radius:24px}[data-template=doubao] .hero-copy{padding:56px 48px}[data-template=doubao] .hero h1{font-size:clamp(34px,4.2vw,56px);line-height:1.35}[data-template=doubao] .hero h1 span{background:linear-gradient(100deg,#a5b4fc,#e0a3ff);background-clip:text;color:transparent}[data-template=doubao] .hero .kicker{color:#c3b9ff}[data-template=doubao] .hero p{color:#a9b5ca}[data-template=doubao] .hero-bottom small{color:#a9b5ca}
[data-template=doubao] .orb-core{width:176px;height:176px;border-radius:50%;background:radial-gradient(circle at 30% 25%,#a291ff,#6366f1 50%,#49237b);box-shadow:0 0 100px #7c59f655,inset -12px -20px 30px #21154455;border-color:#b7a7ff66;transform:none}[data-template=doubao] .orb-core svg{display:none}[data-template=doubao] .orb-core:after{content:'🤖';font-size:80px}[data-template=doubao] .orbit:before,[data-template=doubao] .orbit:after{border-color:#8e7dff40}[data-template=doubao] .orbit-label{background:#22223aeb;border-color:#6e5aa75c;color:#e2ddff}
[data-template=doubao] .btn.primary,[data-template=doubao] .btn.light{background:linear-gradient(135deg,#6366f1,#a855f7);border-color:#8b75f2;color:#fff;box-shadow:0 4px 20px #6366f122}[data-template=doubao] .btn:hover{background:#2b2b49}[data-template=doubao] .btn.primary:hover,[data-template=doubao] .btn.light:hover{background:linear-gradient(135deg,#7679ff,#b568fa);box-shadow:0 6px 24px #6366f140}
[data-template=doubao] :is(.pathway,.toolbar,.auth-layout,.attachment-card,.dialog-head,.toast,.switches button){background:var(--paper);color:var(--ink);border-color:var(--line)}[data-template=doubao] :is(input,select,textarea){background:#141424;border-color:#3d3d5c;color:#f1f5f9}[data-template=doubao] .card:hover{border-color:#7063a7;box-shadow:0 12px 35px #6366f115}[data-template=doubao] .cover{background:linear-gradient(135deg,#24243d,#2d2450)}[data-template=doubao] .cover .icon{color:#b7abf9}[data-template=doubao] .cover .tag{background:#17172aeb;color:#d4c8ff}
[data-template=doubao] .tag.gold{background:#3c321e;color:#fbd27c}[data-template=doubao] .tag.gray{background:#2a2c42;color:#c1cadb}[data-template=doubao] .tag.red{background:#452c38;color:#ffb1b5}[data-template=doubao] .notice{background:#25253c;border-color:#494361;color:#ddd5f7}[data-template=doubao] .notice.amber{background:#342b24;border-color:#685139;color:#f3d3a1}[data-template=doubao] .notice.error{background:#392535;border-color:#643849;color:#ffb1b5}[data-template=doubao] .demo-bar{background:#262238;color:#c4b8e1}
[data-template=doubao] :is(.profile-band,.plan.super,.auth-aside){background:linear-gradient(130deg,#272448,#312249);border-color:#5e4889}[data-template=doubao] .table th{background:#25253e;color:#c7c1e1}[data-template=doubao] .table tr:hover td{background:#22223a}[data-template=doubao] :is(.agreement,.content-panel pre){background:#141424;color:#cdd4e4;border-color:var(--line)}[data-template=doubao] .delivery-card{background:linear-gradient(135deg,#23223a,#1a1a2e);border-color:#4c436a}[data-template=doubao] .attachment-icon{background:#2c2946;color:#bdb2ff}[data-template=doubao] .course-directory .chapter.active{background:#30294d;color:#ddd4ff;box-shadow:inset 3px 0 #a894ff}[data-template=doubao] .risk-box{background:#322534;border-color:#704359}[data-template=doubao] dialog::backdrop{background:#060610b8}[data-template=doubao] .dialog-head{background:linear-gradient(110deg,#25223d,#1a1a2e)}[data-template=doubao] .academy-player{border-color:#514879}[data-template=doubao] .player-speed{background:#27243f;border-color:#514879}
/* Editorial: a quiet, paper-led reading experience. */
html[data-template=editorial]{--ink:#252824;--muted:#6e7168;--bg:#f6f2e9;--paper:#fffdf8;--line:#dfd9cb;--accent:#a54026;--accent-soft:#f6e6dc;--navy:#282d29;--gold:#9b7738;--radius:5px;--shadow:0 10px 28px #6652370d}
[data-template=editorial] body{background:var(--bg)}[data-template=editorial] h1,[data-template=editorial] h2{font-family:Georgia,'Noto Serif SC','Songti SC','SimSun',serif;font-weight:600;letter-spacing:0}[data-template=editorial] .topbar{background:#f6f2e9f5;border-bottom:1px solid #252824}[data-template=editorial] .brand-mark{border-radius:3px;background:#a54026}[data-template=editorial] .nav{gap:22px}[data-template=editorial] .nav a.active:after{height:1px;bottom:18px}[data-template=editorial] .btn{border-radius:3px}[data-template=editorial] .btn.primary:hover{background:#83341f}[data-template=editorial] .hero{padding-top:36px}[data-template=editorial] .hero-panel{background:#ebe4d4;color:var(--ink);border-radius:0;border-top:3px solid #252824;border-bottom:1px solid #bdb49e;min-height:445px;grid-template-columns:1.55fr .85fr}[data-template=editorial] .hero-copy{padding:48px 46px}[data-template=editorial] .hero h1{line-height:1.42;max-width:680px}[data-template=editorial] .hero h1 span{color:#a54026}[data-template=editorial] .hero p,[data-template=editorial] .hero-bottom small{color:#66695e}[data-template=editorial] .hero .kicker{color:#a54026}[data-template=editorial] .hero .btn.ghost{color:#514b41!important}[data-template=editorial] .hero .btn.light{background:#282d29;color:#fff;border-color:#282d29}[data-template=editorial] .hero-bottom{border-top-color:#bdb49e}[data-template=editorial] .orb-core{border-radius:0;transform:rotate(-8deg);background:#a54026;box-shadow:16px 16px 0 #dac8a8;border:none}[data-template=editorial] .orb-core svg{color:#fff6df}[data-template=editorial] .orbit:before{border-radius:0;border-color:#b8aa8e;transform:rotate(12deg);width:225px;height:270px}[data-template=editorial] .orbit:after{display:none}[data-template=editorial] .orbit-label{border-radius:2px;background:#fffdf8;color:#66543d;border-color:#c5b89b;box-shadow:4px 4px 0 #d9ccb4}[data-template=editorial] .ol-1{left:0;top:65px}[data-template=editorial] .ol-2{right:12px;top:170px}
[data-template=editorial] .pathway{border-radius:3px;background:#fffdf8;border-color:#d6cdbc;padding:24px 20px}[data-template=editorial] .pathway-icon{background:transparent;border:1px solid #d8bfab;border-radius:50%;color:#a54026}[data-template=editorial] .section-head{padding-top:22px;border-top:1px solid #bdb49e}[data-template=editorial] .section-head .kicker{letter-spacing:3px;font-size:10px}[data-template=editorial] .cover{background:#e8e1d1}[data-template=editorial] .cover .icon{color:#857250}[data-template=editorial] .card{box-shadow:none}[data-template=editorial] .card:hover{border-color:#a54026}[data-template=editorial] .toolbar{background:#fffdf8;border-radius:3px}[data-template=editorial] .profile-band{border-radius:0;background:#282d29}[data-template=editorial] .auth-layout{background:#fffdf8;border-radius:6px}[data-template=editorial] .delivery-card{background:#fbf6eb;border-color:#d6c7ad;border-radius:6px}[data-template=editorial] dialog{border-radius:8px;border-top:4px solid #a54026}[data-template=editorial] .dialog-head{background:#f6f2e9}[data-template=editorial] .dialog-head h2{font-family:Georgia,'SimSun',serif}[data-template=editorial] .plan.super{background:#282d29;border-color:#282d29}[data-template=editorial] .academy-player{border-radius:6px;border-color:#282d29}
/* Aurora: light, precise workspace surfaces with generous touch targets. */
html[data-template=aurora]{--ink:#173355;--muted:#546e8a;--bg:#eef5ff;--paper:#ffffff;--line:#d4e2f3;--accent:#235cda;--accent-soft:#e7efff;--navy:#122f65;--gold:#9c7229;--radius:24px;--shadow:0 16px 44px #265caa12}
[data-template=aurora] body{background:radial-gradient(ellipse at 100% 0,#bfeaf455,transparent 45%),var(--bg)}[data-template=aurora] .topbar{background:#f7fbfff0;border-bottom-color:#d4e2f3}[data-template=aurora] .brand-mark{background:linear-gradient(135deg,#235cda,#089baf);border-radius:50%}[data-template=aurora] .nav{gap:5px}[data-template=aurora] .nav a{padding:9px 12px;border-radius:30px}[data-template=aurora] .nav a.active{background:#e2edff}[data-template=aurora] .nav a.active:after{display:none}[data-template=aurora] .btn{border-radius:24px}[data-template=aurora] .btn.primary{background:#235cda;box-shadow:0 5px 16px #235cda20}[data-template=aurora] .btn.primary:hover{background:#1849ba}[data-template=aurora] .hero-panel{background:radial-gradient(ellipse at 85% 25%,#c2f4f3,transparent 55%),linear-gradient(120deg,#dce9ff,#edf8ff);border:1px solid #cfdef5;min-height:440px;color:#173355;border-radius:32px}[data-template=aurora] .hero-copy{padding:48px}[data-template=aurora] .hero h1{letter-spacing:-1.8px}[data-template=aurora] .hero h1 span{color:#235cda}[data-template=aurora] .hero .kicker{color:#235cda}[data-template=aurora] .hero p,[data-template=aurora] .hero-bottom small{color:#476580}[data-template=aurora] .hero-bottom{border-color:#bbd3ed}[data-template=aurora] .hero .btn.ghost{color:#315679!important}[data-template=aurora] .hero .btn.light{background:#235cda;border-color:#235cda;color:#fff}[data-template=aurora] .orb-core{background:linear-gradient(145deg,#fff,#c5dfff);border-radius:44px;box-shadow:12px 22px 50px #407fc92e,inset 0 0 0 1px #fff;border-color:#b9d6f9;transform:rotate(-10deg)}[data-template=aurora] .orb-core svg{color:#326bce}[data-template=aurora] .orbit:before,[data-template=aurora] .orbit:after{border-color:#6fafd84a}[data-template=aurora] .orbit-label{background:#ffffffd9;color:#315679;border-color:#c2def2;border-radius:24px;box-shadow:0 10px 24px #2b69b515}[data-template=aurora] .pathway{border-radius:22px;background:#ffffffcc;box-shadow:0 6px 24px #2a60a508}[data-template=aurora] .pathway-icon{background:linear-gradient(135deg,#e6efff,#e0f7f7);border-radius:50%}[data-template=aurora] .cover{background:linear-gradient(125deg,#dfebff,#e2f5f8)}[data-template=aurora] .cover .icon{color:#4e81bf}[data-template=aurora] .card:hover{border-color:#9cbcf2;box-shadow:var(--shadow)}[data-template=aurora] .toolbar{border-radius:24px;padding:12px}[data-template=aurora] .toolbar input,[data-template=aurora] .toolbar select{border-radius:18px}[data-template=aurora] .profile-band{background:linear-gradient(115deg,#153a7d,#126377);border-radius:28px}[data-template=aurora] .plan.super{background:linear-gradient(140deg,#153a7d,#126377);border-color:#285d8d}[data-template=aurora] .delivery-card{background:linear-gradient(135deg,#eaf2ff,#f2fcff);border-color:#c8def4}[data-template=aurora] dialog{border-radius:28px;border-color:#b9d3f5}[data-template=aurora] .dialog-head{background:linear-gradient(110deg,#edf4ff,#effbff)}[data-template=aurora] .academy-player{border-color:#2e5e9b;border-radius:24px}
@media(min-width:1000px){[data-template=editorial] .hero-bottom strong{font-family:Georgia,'SimSun',serif;font-size:20px}}
@media(max-width:1100px){[data-template=aurora] .nav a{padding:9px 7px}[data-template=editorial] .nav{gap:14px}}
@media(max-width:800px){[data-template=aurora] .nav a,[data-template=editorial] .nav a{padding:8px 6px}[data-template=editorial] .nav a.active:after{bottom:0}[data-template=doubao] .hero-panel,[data-template=editorial] .hero-panel,[data-template=aurora] .hero-panel{grid-template-columns:1fr;min-height:0}[data-template=doubao] .hero-copy,[data-template=editorial] .hero-copy,[data-template=aurora] .hero-copy{padding:34px}.template-grid{grid-template-columns:1fr}}
@media(max-width:520px){html{scroll-padding-top:170px}.hero-bottom{flex-wrap:wrap;gap:16px 24px}.hero-bottom>div{flex:1 1 100px}.hero h1{letter-spacing:-1px}[data-template=doubao] .hero-copy,[data-template=editorial] .hero-copy,[data-template=aurora] .hero-copy{padding:30px 22px}[data-template=doubao] .hero h1,[data-template=editorial] .hero h1,[data-template=aurora] .hero h1{font-size:32px}[data-template=aurora] .hero-panel{border-radius:22px}.section-head .btn{padding:8px 10px}.topbar .brand{font-size:21px}.dialog-head{padding:16px;gap:12px}.dialog-head h2{font-size:18px}dialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px - env(safe-area-inset-bottom));border-radius:20px}.dialog-body{padding:18px 16px max(18px,env(safe-area-inset-bottom));scrollbar-gutter:auto}.dialog-actions{bottom:-18px;gap:8px}.dialog-actions .btn{flex:1;min-height:46px}.template-card{padding:20px}.template-swatch{height:100px}.btn.small{min-height:40px}.account-links .btn{min-height:40px}.toolbar input{min-width:0;flex-basis:100%}.toolbar .btn{flex:1}.pathway{min-height:100px}.card-action{flex-wrap:wrap}.academy-controls .btn{min-width:40px;min-height:40px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Restore Doubao's centered hero and knowledge-statistics composition. */
[data-template=doubao] .hero-panel{display:block;text-align:center;border:0;background:radial-gradient(ellipse at 50% 30%,#6366f11f,transparent 65%);border-radius:0;min-height:0}
[data-template=doubao] .hero-copy{max-width:950px;margin:auto;padding:54px 30px 42px}
[data-template=doubao] .hero h1{max-width:820px;margin:auto;font-weight:800;line-height:1.25;font-size:clamp(32px,4.4vw,56px)}
[data-template=doubao] .hero p{max-width:640px;margin:24px auto 32px;font-size:17px}
[data-template=doubao] .hero-copy>.row{justify-content:center;gap:16px}
[data-template=doubao] .hero-bottom{justify-content:center;border:0;margin-top:44px;padding-top:0;gap:60px}
[data-template=doubao] .hero-bottom strong{font-size:30px;background:linear-gradient(135deg,#818cf8,#d58cff);background-clip:text;color:transparent}
[data-template=doubao] .hero-bottom small{font-size:13px}
[data-template=doubao] .orbit{display:none}
[data-template=doubao] .pathway{border-radius:16px}
@media(max-width:520px){[data-template=doubao] .hero-copy{padding:28px 2px 24px}[data-template=doubao] .hero h1{font-size:32px}[data-template=doubao] .hero p{font-size:15px}[data-template=doubao] .hero-copy>.row .btn{width:100%}[data-template=doubao] .hero-bottom{gap:14px;margin-top:30px;flex-wrap:nowrap}[data-template=doubao] .hero-bottom>div{flex:1 1 0}[data-template=doubao] .hero-bottom strong{font-size:25px}[data-template=doubao] .hero-bottom small{font-size:11px}}

.template-preview{display:block;aspect-ratio:16/10;border:1px solid var(--line);border-radius:12px;overflow:hidden;margin-bottom:12px;background:var(--bg)}.template-preview img{display:block;width:100%;height:100%;object-fit:cover;object-position:top}.template-card>.template-swatch{height:12px;border-radius:4px;margin-bottom:22px}.template-card p{min-height:0}
@media(max-width:800px){input,textarea,select{font-size:16px}.player-speed{font-size:13px}}

/* Dark surfaces must cover all membership, checkout and learning components. */
[data-template=doubao] :is(.metric,.comparison,.step b,.select-card,.pill-nav button){background:var(--paper);color:var(--ink);border-color:var(--line)}
[data-template=doubao] .pill-nav button.active,[data-template=doubao] .step.active b{background:#6556d9;color:#fff;border-color:#8d7cf0}
[data-template=doubao] .select-card.selected{background:#2c2847;border-color:#a8a6ff}
[data-template=doubao] .course-directory .chapter{background:var(--paper);color:#b8c4d8;border-color:var(--line)}
[data-template=doubao] .course-directory .chapter.active{background:#30294d;color:#e5ddff;box-shadow:inset 3px 0 #a894ff}
[data-template=doubao] .profile-avatar{background:linear-gradient(135deg,#6556d9,#964ec6)}

[data-template=doubao] .delivery-card label{color:var(--muted)}

.tool-read-more,.tool-intro-link:hover h3{color:var(--accent)}.tool-detail-content figcaption,.attachment-info p{color:var(--muted)}
[data-template=doubao] .content-panel p{color:#c9d0df}
[data-template=editorial] .content-panel p,[data-template=aurora] .content-panel p{color:var(--muted)}
[data-template=editorial] .table th,[data-template=aurora] .table th{background:var(--accent-soft);color:var(--muted)}
[data-template=editorial] .table tr:hover td,[data-template=aurora] .table tr:hover td{background:var(--bg)}

html[data-template=original]{--muted:#5b6f75}html[data-template=editorial]{--muted:#66695f}

/* Management tables become readable cards on narrow screens; actions stay visible. */
@media(max-width:600px){
.admin-main .comparison{border:0;background:transparent;overflow:visible;border-radius:0}
.admin-main .comparison .table{width:100%;min-width:0;display:block}
.admin-main .table thead{display:none}.admin-main .table tbody{display:grid;gap:14px}
.admin-main .table tr{display:block;background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:10px 4px;max-width:100%}
.admin-main .table td{display:block;border:0;padding:8px 12px;max-width:100%;width:auto;white-space:normal;overflow-wrap:anywhere;min-width:0}
.admin-main .table td[data-label]:before{content:attr(data-label);display:block;margin-bottom:5px;color:var(--muted);font-size:11px;letter-spacing:.4px}
.admin-main .table td .row{gap:8px}.admin-main .table td .btn{min-height:40px}.admin-main .table td>small{white-space:normal}
}
