/* Visual foundation retained from the user-approved V3 prototype. */

/* 布局概念：第一版的"晨间读报纸面"配色（冷调纸白、墨色、知更鸟蛋青主色、胸口橙红只用于未读与大事），套用第二版的单栏留白布局 */
:root{
  --bg:#f3f6f6; --surface:#ffffff; --surface-2:#e9efef; --ink:#172126; --muted:#56676c; --faint:#8a989c; --line:#d6e0e1;
  --accent:#1d7a7b; --accent-ink:#ffffff; --accent-soft:#dcefee; --accent-deep:#145a5b;
  --robin:#cf5226; --robin-soft:#fbe7dd; --beak:#e0a23a; --egg:#93d0cb;
  --ok:#2c7a51; --ok-soft:#e1f2e8; --warn:#9a6512; --warn-soft:#f8eed8; --bad:#b83232; --bad-soft:#f9e2e2;
  --mark:#fff0b8;
  --shadow:0 1px 2px rgba(23,33,38,.06), 0 4px 16px rgba(23,33,38,.06);
  --font-display:"Noto Serif SC","Songti SC","STSong","SimSun",serif;
  --font-body:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Segoe UI",sans-serif;
  --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --r:10px; --wrap:1180px; --col:760px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#10161a; --surface:#172024; --surface-2:#1e292e; --ink:#e1e9eb; --muted:#93a4a9; --faint:#6e7e83; --line:#2a363b;
    --accent:#58bab6; --accent-ink:#0d1c1d; --accent-soft:#163131; --accent-deep:#3f9894;
    --robin:#ef8656; --robin-soft:#3a2318; --beak:#f2c46b; --egg:#4fa9a4;
    --ok:#6fcf97; --ok-soft:#163023; --warn:#f2c46b; --warn-soft:#33290f; --bad:#f08080; --bad-soft:#3a1d1d;
    --mark:#4a3f12;
    --shadow:0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#10161a; --surface:#172024; --surface-2:#1e292e; --ink:#e1e9eb; --muted:#93a4a9; --faint:#6e7e83; --line:#2a363b;
  --accent:#58bab6; --accent-ink:#0d1c1d; --accent-soft:#163131; --accent-deep:#3f9894;
  --robin:#ef8656; --robin-soft:#3a2318; --beak:#f2c46b; --egg:#4fa9a4;
  --ok:#6fcf97; --ok-soft:#163023; --warn:#f2c46b; --warn-soft:#33290f; --bad:#f08080; --bad-soft:#3a1d1d;
  --mark:#4a3f12;
  --shadow:0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme:dark;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--bg); color:var(--ink); font-family:var(--font-body); font-size:15.5px; line-height:1.75}
body::before{content:""; position:fixed; inset:0 0 auto; height:env(safe-area-inset-top,0px); z-index:30; background:var(--surface)}
a{color:var(--accent); text-decoration:none}
button,input,select,textarea{font:inherit; color:inherit}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:4px}
h1,h2,h3{font-family:var(--font-display); line-height:1.4; text-wrap:balance; margin:0}
p{margin:0}
mark{background:var(--mark); color:inherit; border-radius:2px; padding:0 1px}
.wrap{max-width:var(--wrap); margin:0 auto; padding-left:max(16px, env(safe-area-inset-left,0px)); padding-right:max(16px, env(safe-area-inset-right,0px))}
.col{max-width:var(--col); margin:0 auto}
.mono{font-family:var(--font-mono); font-variant-numeric:tabular-nums}
.muted{color:var(--muted)} .faint{color:var(--faint)} .small{font-size:13.5px}
.eyebrow{font-size:12.5px; letter-spacing:.08em; color:var(--muted); font-weight:600}

.proto-note{background:var(--surface-2); border-bottom:1px solid var(--line); font-size:12.5px; color:var(--muted)}
.proto-note .wrap{padding-block:6px}
.proto-note b{color:var(--robin)}

/* ---------- 顶部导航（第一版） ---------- */
header.top{position:sticky; top:env(safe-area-inset-top,0px); z-index:20; background:var(--surface); border-bottom:1px solid var(--line)}
header.top .wrap{display:flex; align-items:center; gap:18px; padding-block:10px}
.brand{display:flex; align-items:center; gap:8px; font-family:var(--font-display); font-weight:700; font-size:19px; color:var(--ink); white-space:nowrap}
.brand svg{width:28px; height:28px; flex:none}
nav.main{display:flex; gap:2px; overflow-x:auto; scrollbar-width:none; min-width:0; flex:1}
nav.main::-webkit-scrollbar{display:none}
nav.main a{padding:6px 12px; border-radius:8px; color:var(--muted); white-space:nowrap; font-size:14.5px; display:flex; gap:6px; align-items:center}
nav.main a:hover{background:var(--surface-2); color:var(--ink)}
nav.main a.on{background:var(--accent-soft); color:var(--accent); font-weight:600}
.count{font-family:var(--font-mono); font-size:11px; min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--robin); color:#fff; display:inline-flex; align-items:center; justify-content:center}
.top-right{display:flex; align-items:center; gap:10px; white-space:nowrap}
.date{font-size:13px; color:var(--muted)}
.icon-btn{border:1px solid var(--line); background:var(--surface); border-radius:8px; padding:4px 9px; cursor:pointer; color:var(--muted); font-size:13px}
.icon-btn:hover{color:var(--ink)}

main{padding-block:28px 72px}
section.view{display:none}
section.view.on{display:block}

/* ---------- 通用组件（第一版） ---------- */
.panel{background:var(--surface); border:1px solid var(--line); border-radius:var(--r)}
.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line); background:var(--surface); border-radius:8px; padding:6px 14px; cursor:pointer; font-size:14px; color:var(--ink); white-space:nowrap}
.btn:hover{border-color:var(--accent); color:var(--accent)}
.btn.primary{background:var(--accent); border-color:var(--accent); color:var(--accent-ink); font-weight:600}
.btn.primary:hover{filter:brightness(1.06); color:var(--accent-ink)}
.btn.sm{padding:3px 10px; font-size:13px}
.btn.ghost{border-color:transparent; background:transparent; color:var(--muted)}
.btn.ghost:hover{color:var(--ink); background:var(--surface-2)}
.btn.on{background:var(--accent-soft); border-color:var(--accent); color:var(--accent)}
.btn[disabled]{opacity:.6; cursor:default}
.chip{display:inline-flex; align-items:center; gap:4px; padding:1px 9px; border-radius:999px; font-size:12.5px; border:1px solid var(--line); color:var(--muted); background:var(--surface); white-space:nowrap}
.chip.cat{border-color:transparent; background:var(--surface-2); color:var(--ink)}
.chip.mine{border-color:transparent; background:var(--accent-soft); color:var(--accent); font-weight:600}
.chip.top{border-color:transparent; background:var(--robin-soft); color:var(--robin); font-weight:600}
.pill{display:inline-block; font-size:12px; font-weight:600; padding:1px 8px; border-radius:6px; white-space:nowrap}
.st-pending{background:var(--surface-2); color:var(--muted)}
.st-new{background:var(--accent-soft); color:var(--accent)}
.st-learning{background:var(--robin-soft); color:var(--robin)}
.st-mastered{background:var(--ok-soft); color:var(--ok)}
.st-failed{background:var(--bad-soft); color:var(--bad)}
.page-head{display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px}
.page-head h1{font-size:28px}
.page-head p{margin:4px 0 0; color:var(--muted)}
select{border:1px solid var(--line); border-radius:8px; padding:5px 8px; background:var(--surface)}

/* ---------- 知更鸟元素 ---------- */
.eggs{display:inline-flex; gap:5px; align-items:flex-end; vertical-align:middle}
.eggs svg{width:12px; height:16px}
.eggs .today{animation:wob 2.4s ease-in-out infinite; transform-origin:50% 90%}
@keyframes wob{0%,80%,100%{transform:rotate(0)} 85%{transform:rotate(-8deg)} 90%{transform:rotate(8deg)} 95%{transform:rotate(-4deg)}}

/* ---------- 首页（第二版布局） ---------- */
.hello{display:grid; gap:6px; margin-bottom:30px}
.hello h1{font-size:32px; font-weight:600}
.hello .sub{display:flex; flex-wrap:wrap; align-items:center; gap:8px 10px; color:var(--muted); font-size:14.5px}
.tasks-wrap{margin-bottom:38px}
.branch{position:relative; height:46px}
.branch::after{content:""; position:absolute; left:0; right:0; bottom:6px; height:3px; border-radius:2px; background:var(--accent); opacity:.25}
.branch .leaf{position:absolute; bottom:4px; width:9px; height:6px; border-radius:0 9px 0 9px; background:var(--accent); opacity:.6}
.branch .bird{position:absolute; bottom:7px; width:40px; height:34px; transform:translateX(-50%); transition:left .7s cubic-bezier(.5,1.6,.5,1)}
.branch .bird.hop{animation:hop .5s ease}
@keyframes hop{0%,100%{transform:translateX(-50%) translateY(0)} 40%{transform:translateX(-50%) translateY(-14px)}}
.tasks{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px}
.task{display:grid; gap:2px; padding:14px 16px; border-radius:var(--r); background:var(--surface); border:1px solid var(--line); color:var(--ink); transition:border-color .2s, transform .2s}
.task:hover{border-color:var(--accent); transform:translateY(-2px)}
.task b{font-weight:600; font-size:15.5px}
.task span{font-size:13px; color:var(--muted)}
.task.done{background:var(--accent-soft); border-color:transparent}
.task.done b::after{content:" ✓"; color:var(--accent)}
.block{margin-bottom:38px; display:grid; gap:14px}
.block-head{display:flex; justify-content:space-between; align-items:baseline; gap:12px}
.block-head h2{font-size:20px}
.block-head a{font-size:14px}
.top3{display:grid; gap:4px}
.top3 a{display:grid; grid-template-columns:30px minmax(0,1fr); gap:4px 10px; padding:12px 14px; border-radius:var(--r); color:var(--ink)}
.top3 a:hover{background:var(--surface)}
.top3 .rk{font-family:var(--font-display); font-size:22px; line-height:1.3; color:var(--robin); grid-row:span 2}
.top3 b{font-weight:600; font-size:16.5px; line-height:1.55}
.top3 a:hover b{color:var(--accent)}
.top3 span.w{color:var(--muted); font-size:14.5px}
.top3 a.read b{font-weight:500; color:var(--muted)}
.feature{display:grid; grid-template-columns:minmax(0,1fr) auto; gap:16px; align-items:center; padding:20px 22px; border-radius:var(--r); background:var(--surface); border:1px solid var(--line); color:var(--ink)}
.feature:hover{border-color:var(--accent)}
.feature h3{font-size:21px; margin:4px 0 6px}
.feature .go{width:42px; height:42px; border-radius:50%; background:var(--accent); color:var(--accent-ink); display:flex; align-items:center; justify-content:center; font-size:19px}
.more{font-size:14.5px; color:var(--muted)}
.ask-box{display:flex; gap:8px; padding:6px; border-radius:var(--r); background:var(--surface); border:1px solid var(--line); align-items:center}
.ask-box:focus-within{border-color:var(--accent)}
.ask-box input{flex:1; min-width:0; border:0; outline:none; background:transparent; padding:6px 10px}
.ask-note{font-size:13.5px; color:var(--faint)}

/* ---------- 早报列表（第二版布局） ---------- */
.tabs{display:flex; gap:4px 18px; flex-wrap:wrap; margin-bottom:6px; font-size:14.5px; border-bottom:1px solid var(--line)}
.tabs button{border:0; background:none; padding:6px 0; cursor:pointer; color:var(--muted); border-bottom:2px solid transparent; margin-bottom:-1px}
.tabs button:hover{color:var(--ink)}
.tabs button.on{color:var(--accent); border-bottom-color:var(--accent); font-weight:600}
.hint{display:flex; justify-content:space-between; gap:10px; align-items:center; font-size:13.5px; color:var(--muted); background:var(--surface-2); border-radius:8px; padding:8px 12px; margin:14px 0 4px}
.link{border:0; background:none; padding:0; cursor:pointer; color:var(--accent); font-size:14px}
.link:hover{text-decoration:underline; text-underline-offset:3px}
.items{display:grid}
.item{display:grid; grid-template-columns:26px minmax(0,1fr); gap:0 10px; padding:20px 0; border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0}
.item .n{font-family:var(--font-display); font-size:19px; line-height:1.45; color:var(--robin); text-align:center}
.item .n .unread{display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--robin); margin-top:9px}
.item h3{font-family:var(--font-body); font-size:17px; font-weight:650; line-height:1.55; margin-bottom:6px}
.item h3 a{color:var(--ink)}
.item h3 a:hover{color:var(--accent)}
.item.read h3 a{color:var(--muted); font-weight:500}
.item .sum{color:var(--muted); font-size:15px; line-height:1.8}
.item .meta{display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:8px; font-size:13px; color:var(--faint); min-height:28px; flex-wrap:wrap}
.acts{display:flex; gap:2px; opacity:0; transition:opacity .2s}
.item:hover .acts, .item:focus-within .acts{opacity:1}
@media (hover:none){ .acts{opacity:1} }
.term{cursor:pointer; text-decoration:underline dotted; text-decoration-color:var(--accent); text-underline-offset:4px; text-decoration-thickness:1.5px}
.term:hover{background:var(--accent-soft)}
.term.known{text-decoration:underline solid; text-decoration-color:var(--accent)}

/* ---------- 早报详情（第一版风格面板） ---------- */
.crumbs{display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:14px; font-size:14px}
.crumbs a{color:var(--muted)} .crumbs a:hover{color:var(--accent)}
.article{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:28px 34px; min-width:0}
.article-head{display:grid; gap:10px; padding-bottom:18px; border-bottom:1px solid var(--line); margin-bottom:6px}
.article-head h1{font-size:28px}
.news-meta{display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:12.5px; color:var(--muted)}
.score{font-family:var(--font-mono); font-size:12px; color:var(--muted)}
.scene{background:var(--surface-2); border-radius:8px; padding:10px 14px; font-size:14.5px}
.article h2{font-size:20px; margin:28px 0 10px}
.article p, .article li{max-width:46em}
.article p{margin:.7em 0}
.article ul{padding-left:1.2em}
.article li{margin:4px 0}
.article sup a{font-family:var(--font-mono); font-size:11px; padding:0 2px}
.article pre{background:var(--surface-2); border:1px solid var(--line); border-radius:8px; padding:12px 14px; overflow-x:auto; font-family:var(--font-mono); font-size:13px; line-height:1.6}
.article pre.mermaid{background:var(--surface); text-align:center}
.article code{font-family:var(--font-mono); font-size:.88em; background:var(--surface-2); padding:1px 5px; border-radius:4px}
.article pre code{background:none; padding:0}
.src-list{display:grid; gap:8px}
.src{display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center; padding:10px 14px; border:1px solid var(--line); border-radius:8px; color:var(--ink)}
.src:hover{border-color:var(--accent)}
.src .t{font-weight:600}
.src .h{font-size:12.5px; color:var(--faint); font-family:var(--font-mono)}
.src-type{font-size:12px; font-weight:600; padding:1px 7px; border-radius:5px; background:var(--surface-2); color:var(--muted); white-space:nowrap}
.term-row{display:flex; flex-wrap:wrap; gap:8px}
.term-chip{display:inline-flex; align-items:center; gap:8px; padding:4px 6px 4px 12px; border:1px solid var(--line); border-radius:999px; font-size:14px}
.detail-foot{display:flex; gap:8px; flex-wrap:wrap; margin-top:26px; padding-top:18px; border-top:1px solid var(--line)}

/* ---------- 学习（第二版布局） ---------- */
.seg{display:inline-flex; padding:3px; background:var(--surface-2); border-radius:8px; margin-bottom:18px}
.seg button{border:0; background:transparent; padding:5px 18px; border-radius:6px; cursor:pointer; color:var(--muted); font-size:14.5px; display:inline-flex; gap:6px; align-items:center}
.seg button.on{background:var(--surface); color:var(--accent); font-weight:600; box-shadow:var(--shadow)}
.search{display:flex; gap:8px; align-items:center; padding:6px 6px 6px 12px; border:1px solid var(--line); border-radius:var(--r); background:var(--surface); margin-bottom:8px}
.search:focus-within{border-color:var(--accent)}
.search svg{width:18px; height:18px; color:var(--faint); flex:none}
.search input{flex:1; min-width:0; border:0; outline:none; background:transparent; padding:5px 0}
.search-meta{font-size:13px; color:var(--faint); margin:0 2px 10px; display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap}
.qtags{display:flex; gap:6px; flex-wrap:wrap}
.qtags button{border:1px solid var(--line); background:var(--surface); border-radius:999px; padding:0 10px; font-size:12.5px; cursor:pointer; color:var(--muted)}
.qtags button:hover{border-color:var(--accent); color:var(--accent)}
.rows{display:grid}
.row{display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; padding:14px 16px; border-bottom:1px solid var(--line); color:var(--ink)}
.row:last-child{border-bottom:0}
.row b{font-weight:600; font-size:16px}
.row .s{font-size:13.5px; color:var(--muted)}
.row .d{font-size:14px; color:var(--muted); margin-top:2px}
a.row:hover b{color:var(--accent)}
.row-side{display:grid; justify-items:end; gap:4px}
.group{margin-bottom:22px}
.group h2{font-family:var(--font-body); font-size:13px; font-weight:600; color:var(--muted); letter-spacing:.06em; margin:0 2px 6px}
.add-box{display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:8px; padding:8px; margin-bottom:18px}
.add-box input{border:0; outline:none; padding:6px 8px; background:transparent; min-width:0}
.empty{padding:28px 16px; color:var(--muted); text-align:center; display:grid; gap:10px; justify-items:center}

/* ---------- 讲解详情（第一版） ---------- */
.card-layout{display:grid; grid-template-columns:220px minmax(0,1fr); gap:28px; align-items:start}
.card-toc{position:sticky; top:calc(env(safe-area-inset-top,0px) + 72px); font-size:13.5px; display:grid; gap:1px}
.card-toc a{color:var(--muted); padding:4px 10px; border-left:2px solid var(--line)}
.card-toc a:hover{color:var(--accent); border-left-color:var(--accent)}
.card-layout .article{padding:28px 34px}
.card-layout .article h1{font-size:30px}
.card-layout .article h2{font-size:21px; margin:30px 0 10px}
#readbar{position:fixed; left:0; top:env(safe-area-inset-top,0px); height:3px; background:var(--robin); z-index:40; width:0}
.tbl{overflow-x:auto; border:1px solid var(--line); border-radius:8px; margin:12px 0}
.tbl table{border-collapse:collapse; width:100%; font-size:14px}
.tbl th,.tbl td{padding:8px 12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top}
.tbl th{background:var(--surface-2); white-space:nowrap}
.tbl tr:last-child td{border-bottom:0}
.res{display:grid; gap:8px; margin:8px 0}
.res-level{font-size:12px; font-weight:700; letter-spacing:.06em; color:var(--muted); margin-top:8px}
.res-item{display:grid; grid-template-columns:auto minmax(0,1fr); gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:8px}
.res-type{font-size:12px; font-weight:600; padding:1px 7px; border-radius:5px; background:var(--surface-2); height:fit-content; white-space:nowrap}
.verified{color:var(--ok); font-size:12px}
.refs{font-size:13.5px}
.refs li{margin:3px 0; word-break:break-word}
.followups{display:grid; gap:6px}
.followups .fu{display:flex; justify-content:space-between; gap:10px; align-items:center; padding:8px 12px; border:1px dashed var(--line); border-radius:8px}
.deeper{display:flex; gap:8px; flex-wrap:wrap; padding:14px; margin-top:24px; background:var(--surface-2); border-radius:8px; align-items:center}
.quiz{display:grid; gap:12px}
.qcard{border:1px solid var(--line); border-radius:var(--r); padding:16px; background:var(--surface); display:grid; gap:10px}
.qtype{font-size:12px; font-weight:600; color:var(--muted)}
.opts{display:grid; gap:8px}
.opt{text-align:left; border:1px solid var(--line); border-radius:8px; padding:9px 14px; background:var(--surface); cursor:pointer}
.opt:hover{border-color:var(--accent)}
.opt.right{border-color:var(--ok); background:var(--ok-soft)}
.opt.wrong{border-color:var(--bad); background:var(--bad-soft)}
.qcard textarea, .rv textarea{width:100%; min-height:90px; border:1px solid var(--line); border-radius:8px; padding:9px 12px; background:var(--surface); resize:vertical; line-height:1.7}
.grade{border-radius:8px; padding:10px 12px; font-size:14px; display:grid; gap:4px}
.grade.good{background:var(--ok-soft)} .grade.mid{background:var(--warn-soft)} .grade.bad{background:var(--bad-soft)}

/* ---------- 复习（第二版布局） ---------- */
.rv{display:grid; gap:20px}
.rv-top{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap}
.rv-eggs{display:flex; gap:8px}
.rv-eggs svg{width:17px; height:22px; transition:transform .3s}
.rv-eggs svg.cur{transform:translateY(-4px)}
.q-text{font-family:var(--font-display); font-size:23px; font-weight:600; line-height:1.6}
.rv-foot{display:flex; justify-content:space-between; align-items:center; gap:12px}
.nest{display:grid; justify-items:center; gap:12px; text-align:center; padding:26px 0}
.nest svg{width:160px; height:90px}

/* ---------- 周报（第一版） ---------- */
.weekly{display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:20px; align-items:start}
.weekly .article{padding:26px 30px}
.weekly h3{font-size:17px; margin-top:18px}
.tiles{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px}
.tile{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:12px 14px}
.tile .v{font-family:var(--font-display); font-size:26px; line-height:1.2}
.tile .k{font-size:12.5px; color:var(--muted)}
.bars{display:grid; gap:8px; margin:10px 0}
.bar-row{display:grid; grid-template-columns:110px minmax(0,1fr) 64px; gap:10px; align-items:center; font-size:13px}
.bar-track{position:relative; height:16px}
.bar-track .last{position:absolute; left:0; top:10px; height:4px; border-radius:2px; background:var(--line)}
.bar-track .this{position:absolute; left:0; top:2px; height:8px; border-radius:2px; background:var(--accent)}
.legend{display:flex; gap:14px; font-size:12px; color:var(--muted)}
.legend i{display:inline-block; width:14px; height:6px; border-radius:2px; vertical-align:middle; margin-right:4px}
.week-list{display:grid; gap:4px}
.week-list a{padding:8px 12px; border-radius:8px; color:var(--ink); display:flex; justify-content:space-between}
.week-list a.on{background:var(--accent-soft); color:var(--accent); font-weight:600}
.trend{display:flex; flex-wrap:wrap; gap:6px}
.up{color:var(--ok)} .down{color:var(--bad)}

/* ---------- 系统（第一版） ---------- */
.sys-grid{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:18px}
.sys-grid .tile .v{font-size:24px}
.two{display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:18px; align-items:start}
.panel > h2{font-size:17px; padding:14px 16px 0}
.panel .tbl{border:0; border-top:1px solid var(--line); border-radius:0 0 var(--r) var(--r); margin:12px 0 0}
.state{display:inline-flex; align-items:center; gap:6px}
.state i{width:8px; height:8px; border-radius:50%; display:inline-block}
.i-ok{background:var(--ok)} .i-warn{background:var(--warn)} .i-bad{background:var(--bad)} .i-off{background:var(--line)}
.form{display:grid; gap:12px; padding:14px 16px 16px}
.form label{display:grid; gap:4px; font-size:14px}
.form input[type=number], .form input[type=time]{border:1px solid var(--line); border-radius:8px; padding:6px 10px; background:var(--surface); width:160px}
.form .hint2{font-size:12.5px; color:var(--muted)}
.toggle{display:inline-flex !important; grid-auto-flow:column; align-items:center; gap:6px; font-size:13.5px; color:var(--muted); cursor:pointer}
.toggle input{accent-color:var(--accent)}

/* ---------- 登录（第一版） ---------- */
.login{min-height:70vh; display:flex; align-items:center; justify-content:center}
.login .box{width:min(380px,100%); background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:30px 28px; display:grid; gap:14px; box-shadow:var(--shadow); text-align:center}
.login input{border:1px solid var(--line); border-radius:8px; padding:9px 12px; background:var(--surface)}
.login .err{font-size:13px; color:var(--bad); min-height:1.2em}

/* ---------- 浮层 ---------- */
#selBtn{position:fixed; z-index:45; box-shadow:var(--shadow)}
.tip{position:fixed; z-index:45; max-width:300px; background:var(--ink); color:var(--bg); border-radius:8px; padding:10px 12px; font-size:13px; box-shadow:var(--shadow); pointer-events:none}
.tip ul{margin:4px 0 0; padding-left:1.1em}
.modal-bg{position:fixed; inset:0; background:rgba(10,16,18,.45); z-index:50; display:flex; align-items:center; justify-content:center; padding:16px}
.modal{background:var(--surface); border-radius:14px; padding:20px; width:min(500px,100%); display:grid; gap:12px; box-shadow:var(--shadow)}
.modal h2{font-size:19px}
.modal textarea{width:100%; min-height:70px; border:1px solid var(--line); border-radius:8px; padding:8px 10px; background:var(--surface); resize:vertical}
.modal .ctx{font-size:13px; color:var(--muted); background:var(--surface-2); border-radius:8px; padding:8px 10px}
.modal .foot{display:flex; gap:8px; justify-content:space-between; align-items:center; flex-wrap:wrap}
#toast{position:fixed; left:50%; transform:translateX(-50%); bottom:calc(24px + env(safe-area-inset-bottom,0px)); z-index:60; display:flex; align-items:center; gap:8px; background:var(--ink); color:var(--bg); padding:8px 16px 8px 10px; border-radius:8px; font-size:14px; box-shadow:var(--shadow); max-width:calc(100% - 32px)}
#toast svg{width:24px; height:24px; flex:none}

@media (max-width: 980px){
  .card-layout{grid-template-columns:minmax(0,1fr)}
  .card-toc{display:none}
  .weekly{grid-template-columns:minmax(0,1fr)}
  .sys-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .two{grid-template-columns:minmax(0,1fr)}
}
@media (max-width: 720px){
  .date{display:none}
  .hello h1{font-size:27px}
  .tasks{grid-template-columns:minmax(0,1fr); gap:8px}
  .branch{display:none}
  .article, .card-layout .article, .weekly .article{padding:20px 18px}
  .article-head h1, .card-layout .article h1{font-size:24px}
  .add-box{grid-template-columns:minmax(0,1fr)}
  .src{grid-template-columns:minmax(0,1fr)}
  .bar-row{grid-template-columns:84px minmax(0,1fr) 56px}
  .q-text{font-size:20px}
}
@media (prefers-reduced-motion: reduce){ *{animation:none!important; transition:none!important} }
