/* Shared visual language for every textbook. Subject illustrations remain untouched. */
:root{--ks-bg:#faf9f6;--ks-surface:#fff;--ks-ink:#243b30;--ks-muted:#6c756d;--ks-accent:#204f3a;--ks-soft:#eef3ec;--ks-line:#e1e5dd;--ks-radius:16px;--ks-font:system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;--paper:var(--ks-bg);--cream:var(--ks-surface);--ink:var(--ks-ink);--muted:var(--ks-muted);--green:var(--ks-accent);--teal:var(--ks-accent);--red:var(--ks-accent);--line:var(--ks-line);--lime:#edf3de;--sans:var(--ks-font)}
html{background:var(--ks-bg);scroll-behavior:auto}body{margin:0;background:var(--ks-bg);color:var(--ks-ink);font-family:var(--ks-font);font-size:16px;line-height:1.75}h1,h2,h3,h4{font-family:var(--ks-font);letter-spacing:normal;text-wrap:balance}p{text-wrap:pretty}button,input,select,textarea{font-family:var(--ks-font)}button{border-radius:10px;min-height:44px;font-weight:500;box-shadow:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #789d7b;outline-offset:3px}button:not(:disabled):hover{border-color:#a3b8a5}button:disabled{opacity:.5}dialog{border:1px solid var(--ks-line);border-radius:20px;color:var(--ks-ink);background:white;padding:28px;max-width:min(560px,calc(100vw - 32px))}dialog::backdrop{background:rgb(22 40 30 / 35%)}
.ks-header{background:white;border-bottom:1px solid var(--ks-line);position:relative;z-index:30}.ks-header-inner{max-width:1280px;margin:0 auto;padding:18px 32px;display:flex;align-items:center;gap:32px;min-height:82px}.ks-brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ks-ink);flex-shrink:0;line-height:1.4}.ks-logo{display:grid;place-items:center;width:44px;height:44px;background:var(--ks-accent);border-radius:14px;color:white}.ks-brand strong{display:block;font-size:20px;font-weight:700}.ks-brand small{display:block;font-size:11px;color:var(--ks-muted);margin-top:3px}.ks-nav{display:flex;gap:8px;margin-left:auto;align-items:center}.ks-nav a{display:block;text-decoration:none;color:var(--ks-muted);padding:9px 16px;border-radius:9px;font-size:14px;white-space:nowrap}.ks-nav a[aria-current=page]{background:var(--ks-soft);color:var(--ks-accent);font-weight:650}.ks-nav a:hover{background:var(--ks-soft);color:var(--ks-accent)}.ks-book-link{color:var(--ks-accent);text-decoration:none;font-size:13px;border:1px solid var(--ks-line);border-radius:10px;padding:9px 14px;white-space:nowrap}.ks-footer{max-width:1216px;margin:48px auto 0;border-top:1px solid var(--ks-line);padding:24px 0 32px;display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;color:var(--ks-muted);font-size:12px;background:transparent}.ks-footer a{color:inherit;text-decoration:none}.ks-footer nav{display:flex;gap:20px}body>footer:not(.ks-footer){display:none}
.ks-chinese> .topbar{display:none}.ks-chinese .grade-main{max-width:1216px}.ks-chinese .solid,.ks-chinese button.solid,.ks-chinese .view-switch button[aria-pressed=true]{background:var(--ks-accent);border-color:var(--ks-accent);color:white}.ks-chinese .role-buttons button,.ks-chinese .view-strip,.ks-chinese .chapter,.ks-chinese .edition-card{border-color:var(--ks-line)}.ks-chinese .hero{border-radius:0}.ks-chinese .hero-text h1{letter-spacing:normal}.ks-chinese .page-layout{max-width:1280px}.ks-chinese .role-dock{border-color:var(--ks-line);background:white}
.ks-math .book-top,.ks-math>.topbar,.ks-history>.topbar{height:auto;min-height:62px;padding:12px max(32px,calc((100vw - 1216px)/2));background:white;border-bottom:1px solid var(--ks-line);position:static;display:flex;justify-content:space-between;gap:20px;box-shadow:none}.ks-math .book-brand,.ks-math>.topbar>.brand,.ks-history>.topbar>.brand,.ks-history>.topbar>.site-home,.ks-math .top-actions>a{display:none}.ks-math .book-top:before,.ks-math>.topbar:before{content:'数学 · 七年级上册';font-size:13px;color:var(--ks-muted);white-space:nowrap}.ks-history>.topbar:before{content:'历史 · 七年级上册';font-size:13px;color:var(--ks-muted);white-space:nowrap}.ks-history .topnav{margin-left:0;gap:6px}.ks-history .topnav button{border-radius:9px;padding:8px 14px;border:0;min-height:40px;font-size:14px}.ks-history .topnav button.active{background:var(--ks-soft);color:var(--ks-accent);border:0;font-weight:650}.ks-history .progress-label{font-size:12px;color:var(--ks-muted);border:0}.ks-math .book-shell,.ks-math>.shell,.ks-history>.shell{max-width:1280px;margin:0 auto;grid-template-columns:240px minmax(0,1fr)}.ks-math .book-sidebar,.ks-math .sidebar,.ks-history .sidebar{background:var(--ks-bg);border-right:1px solid var(--ks-line);padding:28px 18px;top:16px;max-height:calc(100dvh - 32px)}.ks-math #bookMain,.ks-math #main,.ks-history #main{padding:32px;min-width:0}.ks-math .book-overview h1{font-size:20px;line-height:1.5}.ks-math .book-heading h2,.ks-history .chapter-header h1{font-size:32px;line-height:1.4;letter-spacing:normal}.ks-math .eyebrow,.ks-history .eyebrow{color:var(--ks-muted);font-size:12px;letter-spacing:normal}.ks-math .home-nav,.ks-math .memory-home-link{border-radius:10px;background:white;border:1px solid var(--ks-line);color:var(--ks-accent)}.ks-math .chapter-nav button.active,.ks-math .navitem.active,.ks-history .toc-item.current{background:var(--ks-accent);border-color:var(--ks-accent);color:white;border-radius:10px}.ks-math .chapter-nav button.active span{color:#e3ebe0}.ks-history .toc-item{border-radius:10px;line-height:1.6}.ks-history .unit-name{color:var(--ks-muted);font-size:12px;letter-spacing:normal}.ks-math .chapter-card,.ks-math .surface,.ks-math .scope-banner,.ks-math .info-details,.ks-math .memory-unit,.ks-history .idea,.ks-history .point,.ks-history .story-bit,.ks-history .teach,.ks-history .reading-map{background:white;border:1px solid var(--ks-line);border-radius:var(--ks-radius);box-shadow:none}.ks-math .metrics{gap:8px;font-size:12px;color:var(--ks-muted)}.ks-math .metrics span{background:transparent;border:0;padding:0 12px 0 0}.ks-math .steps,.ks-history .steps{display:flex;gap:6px;overflow-x:auto;padding:6px;background:var(--ks-soft);border:1px solid var(--ks-line);border-radius:12px;margin:20px 0 24px}.ks-math .steps button,.ks-history .steps button{background:transparent;border:0;border-radius:9px;padding:10px 14px;min-height:48px;white-space:nowrap;color:var(--ks-muted);font-size:14px}.ks-math .steps button.active,.ks-history .steps button.active{background:white;color:var(--ks-accent);border:0;box-shadow:0 1px 3px rgb(0 0 0 / 8%);font-weight:650}.ks-math .steps button small,.ks-history .steps button b{font-family:var(--ks-font);font-size:11px;margin-right:6px;opacity:.65;font-variant-numeric:tabular-nums}.ks-math .primary,.ks-history .primary{background:var(--ks-accent);border-color:var(--ks-accent);color:white}.ks-math .primary:hover,.ks-history .primary:hover{background:#163e2c;color:white}.ks-math .parent-brief,.ks-history .parent-brief{border:1px solid var(--ks-line);background:white;border-radius:12px;padding:14px 18px;font-size:14px}.ks-math .parent-brief summary,.ks-history .parent-brief summary{font-weight:550}.ks-history .chapter-header .hook{font-family:var(--ks-font);font-size:16px;line-height:1.8}.ks-history .illustration{border:1px solid var(--ks-line);border-radius:16px;overflow:hidden;background:white}.ks-history .illustration figcaption{padding:12px 16px;font-size:12px;color:var(--ks-muted)}.ks-history .story-bit h3,.ks-history .point h3{font-size:18px}.ks-history .story-bit p,.ks-history .point p{font-size:15px;line-height:1.9}.ks-history .catalog,.ks-math main:not(#bookMain):not(#main):not(#memoryMain){max-width:1216px;margin:40px auto;padding:0 32px}.ks-history .catalog h1,.ks-math main>h1{font-size:32px}.ks-history .catalog-card{background:white;border-color:var(--ks-line);border-radius:16px}.ks-history .catalog-card h2{font-size:19px}.ks-history .catalog-card .text{padding:20px}.ks-history .catalog-grid{gap:20px}.ks-history .teach-path li.active{background:var(--ks-accent);color:white}.ks-math>.shell .sidebar h1{font-size:22px}.ks-math>div[style]:first-of-type{background:var(--ks-soft)!important;color:var(--ks-muted)!important;font-size:12px}.ks-math>div[style]:first-of-type a{color:var(--ks-accent)!important}
@media(min-width:901px){.ks-math .steps button{flex:1}.ks-history .steps button{flex:1}.ks-history .sidebar{align-self:start}}
@media(max-width:900px){.ks-header-inner{padding:16px 24px;gap:16px;flex-wrap:wrap}.ks-nav{order:3;width:100%;margin:0;justify-content:space-between;gap:4px}.ks-nav a{flex:1;text-align:center;padding:8px 12px}.ks-book-link{margin-left:auto}.ks-math .book-shell,.ks-math>.shell,.ks-history>.shell{grid-template-columns:minmax(0,1fr)}.ks-math #bookMain,.ks-math #main,.ks-history #main{padding:24px}.ks-history .sidebar{top:0;max-height:100dvh}.ks-history .topnav{order:initial;flex-basis:auto;overflow-x:auto;min-width:0}.ks-history .topnav button{white-space:nowrap}.ks-math .book-top,.ks-math>.topbar,.ks-history>.topbar{padding:10px 24px;gap:12px;flex-wrap:wrap}.ks-history .topnav{width:100%;justify-content:space-between}.ks-history>.topbar:before{display:none}.ks-footer{margin:32px 24px 0;padding-bottom:max(24px,env(safe-area-inset-bottom))}.ks-math .book-heading h2,.ks-history .chapter-header h1{font-size:28px}.ks-history .catalog{padding:0 24px}.ks-history .menu-toggle{display:block}.ks-history .scrim{z-index:40}.ks-history .sidebar.open{z-index:50}}
@media(max-width:480px){.ks-header-inner{padding:14px 18px;gap:12px}.ks-brand strong{font-size:18px}.ks-logo{width:40px;height:40px;border-radius:12px}.ks-book-link{font-size:12px;padding:8px 10px}.ks-nav a{font-size:13px;padding:8px}.ks-math #bookMain,.ks-math #main,.ks-history #main{padding:20px 16px}.ks-math .book-top,.ks-math>.topbar,.ks-history>.topbar{padding:10px 16px}.ks-math .top-actions{gap:2px}.ks-math .top-actions button{font-size:12px;padding:7px 9px}.ks-history .topnav button{font-size:12px;padding:8px}.ks-history .catalog{padding:0 16px}.ks-math .steps button,.ks-history .steps button{padding:9px 12px;font-size:13px}.ks-footer{margin-left:18px;margin-right:18px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{animation:none!important;transition:none!important}}
.ks-math .memory-home-link{display:block;padding:10px 14px;text-decoration:none;font-size:14px;line-height:1.6}.ks-history .topnav button.active:after{display:none}@media(max-width:900px){.ks-history .menu-toggle{width:auto;min-width:44px}.ks-history .menu-toggle:after{content:' 本册目录';font-size:13px;font-family:var(--ks-font)}}
@media(max-width:900px){.ks-math .book-sidebar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:16px 24px;border-right:0;border-bottom:1px solid var(--ks-line);max-height:none}.ks-math .book-sidebar .book-overview,.ks-math .book-sidebar #bookNav,.ks-math .book-sidebar .storage-note{display:none}.ks-math .book-sidebar .home-nav,.ks-math .book-sidebar .memory-home-link{width:auto;flex:1;margin:0;white-space:nowrap;font-size:13px;padding:9px 12px;min-height:44px;text-align:center}}@media(max-width:480px){.ks-math .book-sidebar{padding:12px 16px}}
