/* 小满漫画记词 · shared shell: warm paper, white cards, hairline borders, one teal accent. Used by every page. */
:root{
  --bg:#fbf6ee; --surface:#fffdf8; --surface-2:#fbf4e9; --line:#ecdfcd; --line-2:#ddcdb6;
  --ink:#3b2f2a; --ink-2:#76675d; --ink-3:#a8998c;
  --brand:#e2774f; --brand-2:#fde6db; --brand-ink:#b95a35; --wheat:#f2c14e;
  --marker:#ffe7a3; --marker-soft:#fff4d3; --red:#c4553f; --red-soft:#f9e3dd; --ok:#3d7b57; --ok-soft:#e1f0e5;
  --c0:#f6cbc4; --c1:#cde8d7; --c2:#f6e3a3; --c3:#cddff4; --c4:#e3d3f0; --c5:#f8d9b8;
  --r:14px; --r-sm:10px;
  --sh:0 1px 2px rgba(90,60,30,.05),0 8px 24px -10px rgba(90,60,30,.14);
  --sh-lg:0 2px 4px rgba(70,50,25,.06),0 14px 36px rgba(70,50,25,.10);
  --f-word:"Nunito",ui-rounded,"Arial Rounded MT Bold",system-ui,sans-serif;
  --f-read:"Source Serif 4",Georgia,"Times New Roman",serif;
  --f-zh:"Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  --f-ipa:"Noto Sans","Segoe UI",system-ui,sans-serif;
  --top:58px; --side:256px;
  --shadow:var(--sh); --f-title:var(--f-zh); /* aliases used by older pages */
  color-scheme:light;
}
.ui-icon{width:20px;height:20px;display:inline-block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg)}
body{color:var(--ink);font-family:var(--f-zh);font-size:15px;line-height:1.6;-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit}
a{color:inherit}
:focus-visible{outline:3px solid var(--marker);outline-offset:2px;border-radius:6px}

/* ---------- top bar ---------- */
.topbar{position:sticky;top:0;z-index:40;height:var(--top);display:flex;align-items:center;gap:12px;padding:0 20px;background:rgba(255,253,249,.94);backdrop-filter:saturate(1.2) blur(8px);border-bottom:1px solid var(--line)}
.tb-back{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px 0 8px;border:1px solid var(--line);border-radius:999px;background:var(--surface);text-decoration:none;font-size:14px;font-weight:500;color:var(--ink-2);white-space:nowrap}
.tb-back:hover{border-color:var(--line-2);color:var(--ink)}
.tb-back svg{width:18px;height:18px}
.tb-menu{display:none;width:36px;height:36px;border:1px solid var(--line);border-radius:10px;background:var(--surface);cursor:pointer;place-items:center;padding:0}
.tb-menu svg{width:18px;height:18px}
.tb-brand{display:flex;align-items:center;gap:8px;text-decoration:none;font-weight:900;font-size:16px;letter-spacing:.06em;white-space:nowrap}
.tb-brand i{width:28px;height:28px;border-radius:9px;background:var(--wheat);color:var(--ink);box-shadow:0 2px 0 #c99a2e;display:grid;place-items:center;font:900 15px var(--f-zh);font-style:normal;letter-spacing:0}
.tb-crumb{display:flex;align-items:center;gap:6px;min-width:0;font-size:14px;color:var(--ink-3)}
.tb-crumb a{text-decoration:none;color:var(--ink-2)}.tb-crumb a:hover{color:var(--brand)}
.tb-crumb b{color:var(--ink);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tb-crumb .sep{color:var(--line-2)}
.tb-right{margin-left:auto;display:flex;align-items:center;gap:10px}
.tb-global{margin-left:auto;display:flex;align-items:center;gap:4px}
.tb-global a{display:flex;align-items:center;gap:6px;height:36px;padding:0 13px;border-radius:10px;text-decoration:none;color:var(--ink-2);font-size:14px;font-weight:700}
.tb-global a:hover{background:var(--surface-2);color:var(--ink)}
.tb-global a.on{background:var(--brand-2);color:var(--brand-ink)}
.tb-global .ui-icon{width:17px;height:17px}
.mobile-nav{display:none}
.tb-prog{display:flex;align-items:center;gap:8px;font:700 13px var(--f-word);color:var(--ink-2);white-space:nowrap}
.tb-prog .bar{width:96px}

/* ---------- side outline ---------- */
.shell{display:grid;grid-template-columns:var(--side) minmax(0,1fr);min-height:calc(100vh - var(--top))}
.shell.noside{grid-template-columns:minmax(0,1fr)}
.side-nav{position:sticky;top:var(--top);height:calc(100vh - var(--top));overflow:auto;border-right:1px solid var(--line);background:var(--surface-2);padding:18px 12px 28px}
.sn-course{padding:4px 10px 14px;border-bottom:1px solid var(--line);margin-bottom:10px}
.sn-course small{display:block;font-size:12px;color:var(--ink-3)}
.sn-course b{display:block;font-size:15px;line-height:1.4;margin:2px 0 8px}
.sn-ch{margin:6px 0 10px}
.sn-ch h3{margin:0;padding:6px 10px;font-size:12px;font-weight:700;color:var(--ink-3);letter-spacing:.08em;display:flex;justify-content:space-between}
.sn-ch h3 span{font:700 12px var(--f-word);letter-spacing:0}
.sn-item{display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:10px;text-decoration:none;font-size:14px;color:var(--ink-2)}
.sn-item:hover{background:var(--surface);color:var(--ink)}
.sn-item .id{font:800 11px var(--f-word);color:var(--ink-3);width:26px;display:flex;align-items:center}
.sn-item .id .ui-icon{width:15px;height:15px}
.sn-item .nm{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sn-item .st{width:16px;height:16px;border-radius:50%;border:1.5px solid var(--line-2);flex:none;display:grid;place-items:center}
.sn-item .st.half{border-color:var(--brand);background:conic-gradient(var(--brand) var(--p,0%),transparent 0)}
.sn-item .st.done{border-color:var(--ok);background:var(--ok)}
.sn-item .st.done::after{content:"";width:6px;height:3px;border-left:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}
.sn-item.cur{background:var(--brand-2);color:var(--brand-ink);font-weight:700}
.sn-item.cur .id{color:var(--brand)}
.sn-item.rv .id{font-size:13px}
.side-scrim{display:none}

/* ---------- common atoms ---------- */
.card-s{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--sh)}
.bar{height:8px;border-radius:99px;background:#ece4d6;overflow:hidden}
.bar i{display:block;height:100%;border-radius:inherit;background:var(--brand);width:0;transition:width .3s}
.btn-p{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:42px;padding:0 20px;border:0;border-radius:12px;background:var(--brand);color:#fff;font-weight:700;font-size:15px;text-decoration:none;cursor:pointer;box-shadow:0 3px 0 var(--brand-ink)}
.btn-p:hover{filter:brightness(1.06)}
.btn-p:active{transform:translateY(1px);box-shadow:none}
.btn-g{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;padding:0 16px;border:1px solid var(--line-2);border-radius:12px;background:var(--surface);color:var(--ink);font-weight:500;font-size:14px;text-decoration:none;cursor:pointer}
.btn-g:hover{border-color:var(--ink-3)}
.pill{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;padding:2px 10px;border-radius:999px;background:var(--brand-2);color:var(--brand-ink)}
.pill.warm{background:#fbe7b0;color:#8a6412}
.pill.red{background:var(--red-soft);color:var(--red)}
.stamp{display:inline-grid;place-items:center;font:900 15px var(--f-word);color:var(--red);border:2px solid var(--red);border-radius:8px;padding:2px 8px;transform:rotate(-3deg);background:var(--surface)}
.muted{color:var(--ink-3)}

@media (max-width:1100px){
  .shell{grid-template-columns:minmax(0,1fr)}
  .tb-menu{display:grid}
  .side-nav{position:fixed;left:0;top:var(--top);bottom:0;height:auto;width:min(300px,86vw);z-index:45;transform:translateX(-102%);transition:transform .25s ease;box-shadow:var(--sh-lg)}
  body.nav-open .side-nav{transform:none}
  body.nav-open .side-scrim{display:block;position:fixed;inset:var(--top) 0 0 0;background:rgba(40,30,20,.28);z-index:44}
  .tb-prog{display:none}
}
@media (max-width:640px){
  body.has-tabbar{padding-bottom:68px}
  .topbar{padding:0 12px;gap:8px}
  .tb-brand span,.tb-crumb .hide-s{display:none}
  .tb-back{padding:0 10px 0 6px}
  .tb-back span{display:none}
  .tb-global{display:none}
  .tb-right{margin-left:auto}
  .mobile-nav{position:fixed;display:grid;grid-template-columns:repeat(4,1fr);left:0;right:0;bottom:0;z-index:60;height:64px;padding:5px 8px calc(5px + env(safe-area-inset-bottom));background:rgba(255,253,249,.97);border-top:1px solid var(--line);box-shadow:0 -8px 28px rgba(80,55,25,.08);backdrop-filter:blur(10px)}
  .mobile-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;text-decoration:none;color:var(--ink-3);font-size:11px;font-weight:700;border-radius:10px}
  .mobile-nav a .ui-icon{width:20px;height:20px}
  .mobile-nav a.on{color:var(--brand-ink);background:var(--brand-2)}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* Activation, account status and legal footer */
.xm-access-gate{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:24px;background:rgba(48,42,38,.58);backdrop-filter:blur(9px)}
.xm-gate-card{width:min(440px,100%);padding:30px 28px;border:1px solid var(--line);border-radius:24px;background:var(--surface);box-shadow:var(--sh-lg);text-align:center}
.xm-gate-lock{display:grid;place-items:center;width:52px;height:52px;margin:0 auto 12px;border-radius:16px;background:var(--brand-2);font-size:24px}.xm-gate-card h2{margin:0;font:900 24px/1.3 var(--f-serif)}.xm-gate-card p{margin:10px 0 18px;color:var(--ink-2);line-height:1.7}.xm-gate-card small{display:block;margin-top:12px;color:var(--ink-3);line-height:1.6}
.xm-activate-form{display:flex;gap:8px}.xm-activate-form input{min-width:0;flex:1;height:46px;padding:0 14px;border:1px solid var(--line-2);border-radius:12px;background:#fff;font:800 16px var(--f-word);text-transform:uppercase;letter-spacing:.06em}.xm-activate-form button{height:46px;padding:0 20px;border:0;border-radius:12px;background:var(--brand);color:#fff;font-weight:900;cursor:pointer}.xm-activate-form button:disabled{opacity:.6}.xm-gate-error{min-height:22px;margin-top:8px;color:var(--red);font-size:13px;font-weight:700}
.xm-api-toast{position:fixed;left:50%;bottom:28px;z-index:10020;max-width:min(88vw,560px);padding:11px 18px;border-radius:99px;background:var(--ink);color:#fff;font-size:13px;font-weight:700;opacity:0;transform:translate(-50%,18px);transition:.2s;pointer-events:none}.xm-api-toast.on{opacity:1;transform:translate(-50%,0)}
.xm-site-footer{padding:28px 20px 92px;text-align:center;color:var(--ink-3);font-size:12px;line-height:1.8}.xm-site-footer a{color:inherit}.xm-site-footer span+span::before,.xm-site-footer a+span::before,.xm-site-footer span+a::before{content:" · ";margin:0 4px}
.xm-account{padding:22px 24px}.xm-account h2{margin:0 0 12px;font-size:18px}.xm-account p{margin:6px 0;color:var(--ink-2)}.xm-account-ok{color:var(--ok)!important;font-weight:800}.xm-devices{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.xm-devices span{display:flex;flex-direction:column;padding:7px 11px;border-radius:10px;background:var(--surface-2);font-size:13px;font-weight:700}.xm-devices small{color:var(--ink-3);font-weight:500}.xm-account .xm-gate-card{width:auto;padding:12px 0 0;border:0;box-shadow:none;text-align:left}.xm-account .xm-gate-card .xm-gate-lock,.xm-account .xm-gate-card h2{display:none}
.xm-course-locked{position:relative;filter:saturate(.55);opacity:.78}.xm-course-locked:hover{opacity:1}.xm-lock-chip{position:absolute!important;right:10px!important;top:auto!important;bottom:10px;background:rgba(255,253,248,.94)!important;color:var(--ink)!important}.xm-course-locked .im:after{content:"";position:absolute;inset:0;background:linear-gradient(transparent 55%,rgba(54,43,35,.13));pointer-events:none}
.scene.locked .im::after,.rc.locked::after{content:"🔒";position:absolute;right:10px;top:10px;display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:rgba(255,253,248,.94);box-shadow:var(--sh)}
@media(max-width:640px){.xm-gate-card{padding:24px 18px}.xm-activate-form{flex-direction:column}.xm-activate-form button{width:100%}.xm-site-footer{padding-bottom:100px}}
@media (max-width:640px){.topbar>.tb-brand:first-child span{display:inline}}

/* ---------- book identity (v2): serif display type, chapter colours, paper grain, page-turn navigation ---------- */
:root{
  --f-serif:"Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif; /* v3: headings back to heavy sans; name kept so pages need no edits */
  /* chapter colours = the six pastel label colours on the maps; --chN is the readable deep tone, --chbN the pastel */
  --ch1:#cf6656; --ch2:#4f9a72; --ch3:#b98a1f; --ch4:#4f86b8; --ch5:#8a6bb8; --ch6:#c87a3a;
  --chb1:#f6cbc4; --chb2:#cde8d7; --chb3:#f6e3a3; --chb4:#cddff4; --chb5:#e3d3f0; --chb6:#f8d9b8;
  --cloth:#ead9bc; --cloth-2:#dcc6a1; --gold:#f2c14e;
}
body{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E")}
.serif{font-family:var(--f-serif)}
.ch-dot{display:inline-block;width:8px;height:8px;border-radius:2px;background:var(--chc,var(--brand));margin-right:6px;vertical-align:1px}
.sn-ch h3{border-left:3px solid var(--chc,var(--line-2));padding-left:8px;margin-left:2px}
/* page turn between pages (Chrome / Edge; other browsers just navigate) */
@view-transition{navigation:auto}
@keyframes vt-turn-out{to{transform:perspective(2200px) rotateY(-75deg);opacity:0;filter:brightness(.85)}}
@keyframes vt-in{from{opacity:.0}}
::view-transition-old(root){animation:vt-turn-out .55s cubic-bezier(.5,.05,.4,1) both;transform-origin:left center;z-index:2}
::view-transition-new(root){animation:vt-in .35s ease-out both;z-index:1}
@media (prefers-reduced-motion:reduce){::view-transition-old(root),::view-transition-new(root){animation:none}}

/* ================= hub pages v6 (学习 / 课程 / 课程中心 / 复习 / 我的): shared layout and components ================= */
.hub{width:100%;max-width:1180px;margin:0 auto;padding:34px 28px 80px;display:flex;flex-direction:column;gap:34px}
.ph{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px 24px}
.ph small{display:block;font-size:13px;font-weight:700;color:var(--brand-ink);letter-spacing:.04em}
.ph h1{margin:6px 0 0;font-size:32px;line-height:1.2;font-weight:900;letter-spacing:.01em}
.ph p{margin:6px 0 0;font-size:15px;color:var(--ink-2)}
.sec{display:flex;flex-direction:column;gap:16px;scroll-margin-top:calc(var(--top) + 70px)}
.sec-hd{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:8px 16px}
.sec-hd h2{margin:0;font-size:21px;font-weight:900;display:flex;align-items:center;gap:10px}
.sec-hd h2 .dot{width:10px;height:10px;border-radius:3px;background:var(--zc,var(--brand))}
.sec-hd p{margin:4px 0 0;font-size:14px;color:var(--ink-3)}
.sec-hd .more{font-size:14px;font-weight:700;color:var(--brand-ink);text-decoration:none;display:inline-flex;align-items:center;gap:2px}
.sec-hd .more .ui-icon{width:16px;height:16px}
.box{background:var(--surface);border:1px solid var(--line);border-radius:22px;box-shadow:var(--sh)}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.btn-p.lg{height:50px;padding:0 26px;font-size:16px;border-radius:14px}
.btn-p .ui-icon,.btn-g .ui-icon{width:18px;height:18px}
.btn-g.lg{height:50px;padding:0 22px;font-size:15px;border-radius:14px}
.chip-s{display:inline-flex;align-items:center;gap:5px;font-size:12.5px;font-weight:700;border-radius:99px;padding:3px 10px;background:var(--surface-2);color:var(--ink-2)}
.chip-s.ok{background:var(--ok-soft);color:var(--ok)}.chip-s.go{background:var(--brand-2);color:var(--brand-ink)}.chip-s.soon{background:#efe9df;color:var(--ink-3)}
.chip-s .ui-icon{width:14px;height:14px}

/* scene card: the illustration is the hero of the card */
.scene{position:relative;display:flex;flex-direction:column;text-decoration:none;color:inherit;background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--sh);transition:transform .18s,box-shadow .18s}
.scene:hover{transform:translateY(-3px);box-shadow:var(--sh-lg)}
.scene .im{position:relative;aspect-ratio:4/3;overflow:hidden;background:var(--surface-2)}
.scene .im img{width:100%;height:100%;object-fit:cover;object-position:50% 34%;display:block;transition:transform .5s}
.scene:hover .im img{transform:scale(1.04)}
.scene .im .stamp{position:absolute;left:12px;top:12px;font-size:13px;color:var(--chc,var(--red));border-color:var(--chc,var(--red))}
.scene .im .chip-s{position:absolute;right:12px;top:12px;box-shadow:0 2px 6px rgba(60,40,20,.15)}
.scene .bd{padding:14px 16px 16px;display:flex;flex-direction:column;gap:6px;flex:1}
.scene h3{margin:0;font-size:17px;font-weight:900;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.scene h3 em{font:800 12px var(--f-word);font-style:normal;color:var(--ink-3)}
.scene p{margin:0;font-size:13px;color:var(--ink-2);line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.scene .pr{margin-top:auto;padding-top:8px;display:flex;align-items:center;gap:10px;font:800 12px var(--f-word);color:var(--ink-3)}
.scene .pr .bar{flex:1;height:6px}
.scene .pr .bar i{background:var(--chc,var(--brand))}

/* stat tile */
.stat{padding:16px 18px;border-radius:18px;background:var(--surface);border:1px solid var(--line);display:flex;flex-direction:column;gap:2px;text-decoration:none;color:inherit}
a.stat:hover{border-color:var(--line-2)}
.stat span{font-size:13px;color:var(--ink-3);display:flex;align-items:center;gap:6px}
.stat span .ui-icon{width:16px;height:16px}
.stat b{font:900 28px/1.2 var(--f-word)}
.stat b small{font-size:14px;color:var(--ink-3);font-weight:800;margin-left:2px}

/* course cover (static version of the shelf book) */
.cover-s{position:relative;width:100%;max-width:230px;aspect-ratio:3/4;border-radius:5px 12px 12px 5px;overflow:hidden;background:#f7ecd9;box-shadow:inset 0 0 0 1px rgba(120,90,50,.15),0 18px 30px -16px rgba(80,50,20,.55),0 2px 4px rgba(80,50,20,.15)}
.cover-s::before{content:"";position:absolute;left:0;top:0;bottom:0;width:16px;z-index:2;background:linear-gradient(90deg,var(--zd,var(--brand-ink)),var(--zc,var(--brand)) 70%,rgba(255,255,255,.35) 72%,var(--zc,var(--brand)) 78%)}
.cover-s img{position:absolute;left:16px;right:0;top:0;height:66%;width:calc(100% - 16px);object-fit:cover;object-position:50% 30%}
.cover-s::after{content:"";position:absolute;left:16px;right:0;top:40%;height:28%;background:linear-gradient(transparent,#f7ecd9)}
.cover-s .lab{position:absolute;z-index:3;left:26px;right:10px;bottom:12px;background:var(--surface);border-radius:10px;padding:9px 11px;box-shadow:0 2px 0 var(--line-2)}
.cover-s .lab small{display:block;font-size:10.5px;font-weight:700;color:var(--zd,var(--brand-ink))}
.cover-s .lab b{display:block;font-size:15px;line-height:1.3;font-weight:900}
.cover-s .stk{position:absolute;z-index:3;right:10px;top:10px;width:46px;height:46px;border-radius:50%;background:var(--wheat);display:grid;place-items:center;text-align:center;font:900 10.5px/1.15 var(--f-zh);transform:rotate(10deg);box-shadow:0 2px 0 #c99a2e}

/* empty state */
.empty{display:flex;align-items:center;gap:16px;padding:18px 20px;border-radius:18px;background:var(--surface-2);color:var(--ink-2);font-size:14px}
.empty img{width:96px;flex:none}

@media (max-width:1000px){.grid4{grid-template-columns:1fr 1fr}.grid3{grid-template-columns:1fr 1fr}}
@media (max-width:640px){
  .hub{padding:20px 14px 92px;gap:26px}
  .ph h1{font-size:25px}
  .grid3{grid-template-columns:1fr}
  .scene{flex-direction:row}
  .scene .im{aspect-ratio:auto;width:120px;flex:none}
  .scene .im .chip-s{display:none}
  .scene .bd{padding:12px 14px}
  .scene p{-webkit-line-clamp:1}
}
