﻿:root {
  --bg: #f4f7ef; --bg-deep: #eaf0e2; --surface: #fffdf8; --surface-2: #f8faf4; --surface-3: #eef3e8;
  --primary: #4f7d5c; --primary-dark: #315640; --primary-soft: #dce9da; --primary-mist: #eef5eb;
  --accent: #e6a24a; --accent-soft: #fbeed8; --danger: #c9675c; --danger-soft: #f9e6e2;
  --blue: #5f82a3; --blue-soft: #e6eef5; --text: #26352c; --text-2: #536358; --muted: #7d8b80;
  --line: #e3e8dc; --line-strong: #d3dbc9; --shadow-sm: 0 3px 12px rgba(49,86,64,.06);
  --shadow: 0 12px 34px rgba(49,86,64,.10); --shadow-lg: 0 24px 70px rgba(36,61,46,.22);
  --radius: 20px; --radius-sm: 14px; --nav-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px); --safe-top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(circle at 6% -4%, rgba(169,197,155,.22), transparent 30%), radial-gradient(circle at 98% 22%, rgba(230,162,74,.08), transparent 24%), var(--bg);
  color: var(--text); font-family: "PingFang SC","HarmonyOS Sans SC","Microsoft YaHei","Noto Sans SC",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: var(--primary); }
img { max-width: 100%; display: block; }
h1,h2,h3,h4,p { margin: 0; }
ul,ol { margin: 0; padding: 0; list-style: none; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 17px; height: 17px; } .icon.lg { width: 26px; height: 26px; }
:focus-visible { outline: 3px solid rgba(79,125,92,.35); outline-offset: 2px; }
#app-shell { width: 100%; max-width: 860px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px); position: relative; }
.app-header { position: sticky; top: 0; z-index: 30; padding: calc(10px + var(--safe-top)) 16px 10px; background: rgba(244,247,239,.88); border-bottom: 1px solid rgba(211,219,201,.7); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; border-radius: 13px; box-shadow: 0 6px 15px rgba(49,86,64,.18); flex: 0 0 auto; }
.brand h1 { font-size: 19px; line-height: 1.2; letter-spacing: .02em; font-weight: 800; color: var(--primary-dark); }
.brand p { margin-top: 3px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--primary-dark); background: rgba(255,253,248,.76); border: 1px solid rgba(211,219,201,.75); transition: transform .15s ease, background .15s ease; }
.icon-btn:active { transform: scale(.94); background: var(--primary-soft); }
.child-switch { margin-top: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; background: #e8eee2; border-radius: 15px; padding: 4px; }
.child-tab { min-height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-weight: 700; font-size: 14px; transition: background .18s, color .18s, box-shadow .18s; }
.child-tab.active { background: var(--surface); color: var(--primary-dark); box-shadow: 0 2px 8px rgba(49,86,64,.10); }
.child-avatar { width: 26px; height: 26px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 800; }
.child-avatar.sister { background: linear-gradient(135deg,#d88182,#c6656d); }
.child-avatar.brother { background: linear-gradient(135deg,#628ab0,#4f708e); }
#main-content { padding: 16px 16px 30px; }
.view { display: none; }
.view.active { display: block; animation: view-in .26s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.card { background: var(--surface); border: 1px solid rgba(227,232,220,.95); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.section { margin-top: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.section-heading h2 { font-size: 17px; line-height: 1.3; font-weight: 800; letter-spacing: .01em; }
.section-heading p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.text-btn { color: var(--primary); display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 700; padding: 5px 2px; }
.text-btn .icon { width: 15px; height: 15px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.hero-card { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg,#3f6c52 0%,#5f8b68 57%,#7fa276 100%); border-radius: 26px; padding: 23px 20px 20px; box-shadow: 0 18px 38px rgba(49,86,64,.22); }
.hero-card::before { content: ""; position: absolute; width: 190px; height: 190px; border-radius: 50%; right: -72px; top: -80px; background: rgba(255,255,255,.09); }
.hero-card::after { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%; right: 45px; bottom: -92px; border: 22px solid rgba(255,255,255,.06); }
.hero-eyebrow { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.hero-title { position: relative; z-index: 1; margin-top: 12px; font-size: 26px; line-height: 1.25; font-weight: 850; letter-spacing: .01em; }
.hero-desc { position: relative; z-index: 1; margin-top: 7px; color: rgba(255,255,255,.82); font-size: 13px; max-width: 29em; }
.hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 18px; }
.hero-stat { background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.11); border-radius: 14px; padding: 9px 10px; }
.hero-stat strong { display: block; font-size: 21px; line-height: 1.1; font-weight: 850; }
.hero-stat span { display: block; font-size: 10px; color: rgba(255,255,255,.7); margin-top: 3px; }
.hero-actions { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 15px; }
.hero-btn { min-height: 45px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; font-weight: 800; transition: transform .15s, filter .15s; }
.hero-btn:active { transform: scale(.97); }
.hero-btn.primary { background: #fff7e8; color: var(--primary-dark); }
.hero-btn.secondary { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 13px; }
.stat-card { padding: 13px 11px; border-radius: 17px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.stat-icon { width: 31px; height: 31px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.stat-icon .icon { width: 18px; height: 18px; }
.stat-icon.green { color: var(--primary); background: var(--primary-soft); }
.stat-icon.orange { color: #aa6d1f; background: var(--accent-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-card strong { display: block; margin-top: 8px; font-size: 24px; line-height: 1; font-weight: 850; }
.stat-card small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.quick-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px; }
.quick-card { position: relative; overflow: hidden; padding: 16px; min-height: 108px; text-align: left; border-radius: 19px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.quick-card:active { transform: scale(.98); }
.quick-card .quick-icon { width: 39px; height: 39px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.quick-card.camera .quick-icon { color: #a86723; background: var(--accent-soft); }
.quick-card.manual .quick-icon { color: var(--primary); background: var(--primary-soft); }
.quick-card strong { display: block; font-size: 15px; font-weight: 800; }
.quick-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.weak-list { display: grid; gap: 8px; }
.weak-item { padding: 12px 13px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 8px; }
.weak-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.weak-item-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.subject-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.weak-item-title strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weak-item-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.bar-track { height: 7px; border-radius: 999px; background: #edf0e8; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#d89b4d,#e5b76d); }
.bar-fill.urgent { background: linear-gradient(90deg,#c9675c,#dc8a78); }
.bar-fill.mastered { background: linear-gradient(90deg,#5d8b68,#8eac83); }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; border-radius: 999px; padding: 3px 8px; font-size: 10px; font-weight: 700; line-height: 1.5; }
.badge.mastered { color: #3e6d4b; background: #e3efe0; }
.badge.pending { color: #996122; background: #fbefdb; }
.badge.urgent { color: #a64f47; background: #f8e3df; }
.badge.weak { color: #996122; background: #fbefdb; }
.badge.subject { color: var(--primary-dark); background: var(--primary-mist); }
.badge.cause { color: #726144; background: #f4eee1; }
.badge.ai { color: #5a568f; background: #ecebf8; }
.badge.local { color: var(--muted); background: #eef0ea; }
.empty-state { text-align: center; padding: 28px 20px; border-radius: 20px; background: rgba(255,253,248,.74); border: 1px dashed var(--line-strong); }
.empty-emoji { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 21px; display: grid; place-items: center; background: var(--primary-mist); color: var(--primary); }
.empty-emoji .icon { width: 31px; height: 31px; }
.empty-state h3 { font-size: 16px; font-weight: 800; }
.empty-state p { color: var(--muted); font-size: 12px; margin-top: 5px; }
.empty-state .btn { margin-top: 15px; }
.recent-list { display: grid; gap: 8px; }
.recent-item { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); width: 100%; text-align: left; }
.recent-item:active { background: var(--surface-2); }
.recent-main { flex: 1; min-width: 0; }
.recent-main strong { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-main span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.recent-icon { width: 37px; height: 37px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; color: var(--primary); background: var(--primary-mist); }
.recent-icon .icon { width: 19px; height: 19px; }
.chevron { color: #aab5ac; display: grid; place-items: center; } .chevron .icon { width: 18px; height: 18px; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.view-head h2 { font-size: 24px; line-height: 1.2; font-weight: 850; letter-spacing: .01em; }
.view-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; border-radius: 13px; font-size: 13px; font-weight: 800; line-height: 1; border: 1px solid transparent; transition: transform .14s ease, background .14s ease; }
.btn:active { transform: scale(.97); } .btn .icon { width: 18px; height: 18px; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 7px 16px rgba(49,86,64,.18); }
.btn.primary:active { background: var(--primary-dark); }
.btn.secondary { background: var(--surface); color: var(--primary-dark); border-color: var(--line-strong); }
.btn.soft { background: var(--primary-mist); color: var(--primary-dark); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { color: var(--text-2); border-color: var(--line); background: transparent; }
.btn.wide { width: 100%; } .btn.lg { min-height: 48px; border-radius: 15px; font-size: 14px; } .btn.sm { min-height: 34px; padding: 0 11px; border-radius: 10px; font-size: 12px; }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.filter-panel { padding: 11px; display: grid; gap: 9px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search-box input { width: 100%; height: 41px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-3); padding: 0 12px 0 38px; font-size: 13px; outline: none; }
.search-box input:focus { border-color: rgba(79,125,92,.4); background: #fff; }
.chip-scroll { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 1px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip { min-height: 30px; padding: 0 11px; flex: 0 0 auto; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--text-2); border: 1px solid var(--line); background: var(--surface-2); }
.chip.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.chip .count { opacity: .7; font-size: 10px; }
.result-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 13px 1px 9px; color: var(--muted); font-size: 11px; }
.mistake-list { display: grid; gap: 9px; }
.mistake-card { position: relative; width: 100%; text-align: left; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: border-color .18s, transform .14s; }
.mistake-card:active { transform: scale(.99); }
.mistake-card.selected { border-color: rgba(79,125,92,.55); box-shadow: 0 0 0 2px rgba(79,125,92,.09), var(--shadow-sm); }
.mistake-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mistake-card-head .spacer { flex: 1; }
.mistake-date { color: var(--muted); font-size: 10px; white-space: nowrap; }
.mistake-body { display: flex; gap: 11px; margin-top: 10px; }
.mistake-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto; background: var(--surface-3); }
.mistake-text { flex: 1; min-width: 0; }
.mistake-text strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.52; font-weight: 650; color: var(--text); word-break: break-word; }
.mistake-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: 10px; }
.mistake-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #b7c0b5; }
.select-box { width: 23px; height: 23px; border-radius: 8px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; background: var(--surface); flex: 0 0 auto; }
.mistake-card.selected .select-box { color: #fff; background: var(--primary); border-color: var(--primary); }
.select-box .icon { width: 15px; height: 15px; stroke-width: 2.5; }
.analysis-hero { display: grid; grid-template-columns: 116px 1fr; align-items: center; gap: 18px; padding: 18px; }
.mastery-ring { --value: 0; width: 108px; height: 108px; border-radius: 50%; padding: 10px; background: conic-gradient(var(--primary) calc(var(--value) * 1%), #e8ede2 0); position: relative; }
.mastery-ring::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.mastery-ring-content { position: relative; z-index: 1; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.mastery-ring-content strong { font-size: 25px; line-height: 1; font-weight: 850; color: var(--primary-dark); }
.mastery-ring-content span { font-size: 10px; color: var(--muted); margin-top: 4px; }
.analysis-hero-copy h3 { font-size: 18px; font-weight: 800; }
.analysis-hero-copy p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.mini-stat { padding: 5px 9px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); font-size: 10px; font-weight: 700; }
.mini-stat b { color: var(--primary-dark); font-size: 12px; margin-right: 2px; }
.panel-card { padding: 16px; }
.cause-chart { display: grid; gap: 12px; margin-top: 14px; }
.cause-row { display: grid; grid-template-columns: 68px 1fr 32px; align-items: center; gap: 9px; }
.cause-row span { font-size: 12px; font-weight: 650; }
.cause-row strong { text-align: right; font-size: 11px; color: var(--muted); font-weight: 700; }
.cause-row .bar-track { height: 9px; }
.cause-row:nth-child(1) .bar-fill { background: linear-gradient(90deg,#d29a54,#e3b36e); }
.cause-row:nth-child(2) .bar-fill { background: linear-gradient(90deg,#678eaa,#89a8be); }
.cause-row:nth-child(3) .bar-fill { background: linear-gradient(90deg,#b36e67,#d38e83); }
.cause-row:nth-child(4) .bar-fill { background: linear-gradient(90deg,#8c7ca8,#aa9dbd); }
.knowledge-list { display: grid; gap: 9px; margin-top: 12px; }
.knowledge-row { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.knowledge-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.knowledge-name { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.knowledge-name .subject-dot { margin-top: 6px; }
.knowledge-name strong { display: block; font-size: 13px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-name small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.knowledge-row .bar-track { margin-top: 9px; height: 6px; }
.knowledge-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 10px; }
.paper-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; }
.paper-toolbar-actions { display: flex; gap: 6px; }
.selection-info { padding: 7px 11px; border-radius: 11px; background: var(--primary-mist); color: var(--primary-dark); font-size: 11px; font-weight: 750; }
.option-panel { padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: grid; gap: 12px; margin-top: 12px; }
.option-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.option-title .icon { color: var(--primary); width: 18px; height: 18px; }
.option-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.option-copy strong { display: block; font-size: 13px; font-weight: 700; }
.option-copy small { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 46px; height: 27px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #dfe5da; transition: background .18s; }
.switch span::after { content: ""; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.14); transition: transform .18s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(19px); }
.select-inline { height: 34px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 28px 0 10px; font-size: 12px; font-weight: 700; }
.paper-generate { margin-top: 12px; }
.paper-history { display: grid; gap: 8px; margin-top: 11px; }
.paper-history-item { padding: 13px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; gap: 11px; }
.paper-history-icon { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; color: var(--primary); background: var(--primary-mist); flex: 0 0 auto; }
.paper-history-icon .icon { width: 20px; height: 20px; }
.paper-history-main { flex: 1; min-width: 0; }
.paper-history-main strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-history-main span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.paper-history-actions { display: flex; gap: 3px; }
.bottom-nav { position: fixed; z-index: 40; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 860px; min-height: calc(var(--nav-height) + var(--safe-bottom)); padding: 6px 12px calc(6px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; background: rgba(255,253,248,.94); border-top: 1px solid rgba(211,219,201,.9); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.nav-item { min-height: 52px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #89968b; font-size: 10px; font-weight: 700; }
.nav-item .icon { width: 23px; height: 23px; }
.nav-item.active { color: var(--primary-dark); background: var(--primary-mist); }
.nav-item.active .icon { stroke-width: 2.1; }
.modal-root { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal-root[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(29,46,35,.48); backdrop-filter: blur(3px); animation: fade-in .18s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet { position: relative; width: 100%; max-width: 680px; max-height: 92dvh; background: var(--bg); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: sheet-up .28s cubic-bezier(.2,.8,.2,1) both; overflow: hidden; }
@keyframes sheet-up { from { transform: translateY(36px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px 12px; border-bottom: 1px solid rgba(227,232,220,.8); background: var(--surface); flex: 0 0 auto; }
.modal-title-wrap { min-width: 0; }
.modal-header h2 { font-size: 18px; line-height: 1.3; font-weight: 850; }
.modal-header p { color: var(--muted); font-size: 11px; margin-top: 2px; }
.modal-close { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center; flex: 0 0 auto; }
.modal-body { padding: 16px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-footer { padding: 10px 16px calc(12px + var(--safe-bottom)); border-top: 1px solid rgba(227,232,220,.85); background: var(--surface); display: flex; gap: 8px; flex: 0 0 auto; }
.modal-footer .btn { flex: 1; }
.form-section { display: grid; gap: 12px; margin-bottom: 16px; }
.form-card { padding: 15px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.form-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: 12px; font-weight: 750; color: var(--text-2); }
.form-label .required { color: var(--danger); }
.form-hint { color: var(--muted); font-size: 10px; line-height: 1.5; margin-top: 6px; }
.input,.textarea,.select { width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: 12px; padding: 10px 12px; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus,.textarea:focus,.select:focus { border-color: rgba(79,125,92,.55); box-shadow: 0 0 0 3px rgba(79,125,92,.09); }
.textarea { min-height: 94px; resize: vertical; line-height: 1.6; } .textarea.small-area { min-height: 66px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.subject-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.subject-option { min-height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text-2); }
.subject-option.active { border-color: rgba(79,125,92,.5); background: var(--primary-soft); color: var(--primary-dark); }
.inline-field { display: flex; gap: 7px; } .inline-field .input { flex: 1; min-width: 0; } .inline-field .btn { flex: 0 0 auto; }
.photo-zone { border: 1.5px dashed var(--line-strong); border-radius: 16px; background: var(--surface-2); min-height: 116px; padding: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; overflow: hidden; }
.photo-zone.has-image { padding: 0; border-style: solid; }
.photo-zone img { width: 100%; max-height: 300px; object-fit: contain; border-radius: 14px; background: #e9ece4; }
.photo-placeholder { color: var(--muted); font-size: 11px; }
.photo-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.photo-action { min-height: 35px; padding: 0 11px; border-radius: 10px; display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text-2); font-size: 11px; font-weight: 700; cursor: pointer; }
.photo-action .icon { width: 15px; height: 15px; } .photo-action input { display: none; }
.ocr-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.ocr-status { font-size: 10px; color: var(--muted); flex: 1; min-width: 0; }
.detail-hero { padding: 16px; border-radius: 19px; background: var(--surface); border: 1px solid var(--line); }
.detail-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .detail-top .spacer { flex: 1; }
.detail-title { margin-top: 12px; font-size: 20px; line-height: 1.45; font-weight: 800; word-break: break-word; }
.detail-image { margin-top: 12px; border-radius: 14px; border: 1px solid var(--line); max-height: 360px; object-fit: contain; background: #e9ece4; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.detail-section { margin-top: 11px; padding: 15px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.detail-section-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; margin-bottom: 10px; }
.detail-section-title .icon { width: 18px; height: 18px; color: var(--primary); }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.answer-box { padding: 11px; border-radius: 13px; min-width: 0; }
.answer-box.child { background: var(--danger-soft); } .answer-box.correct { background: var(--primary-mist); }
.answer-box span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.answer-box strong { display: block; margin-top: 5px; font-size: 15px; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.analysis-summary { padding: 12px; border-radius: 13px; background: var(--accent-soft); color: #76531f; font-size: 13px; line-height: 1.7; }
.analysis-text { font-size: 13px; line-height: 1.75; color: var(--text-2); white-space: pre-wrap; margin-top: 10px; }
.analysis-source { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.variant-list { display: grid; gap: 9px; }
.variant-item { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.variant-question { padding: 12px; font-size: 13px; line-height: 1.65; }
.variant-question b { color: var(--primary-dark); margin-right: 5px; }
.variant-item details { border-top: 1px dashed var(--line); }
.variant-item summary { padding: 8px 12px; color: var(--primary); font-size: 11px; font-weight: 700; cursor: pointer; list-style: none; }
.variant-item summary::-webkit-details-marker { display: none; }
.variant-answer { padding: 0 12px 11px; color: var(--text-2); font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.status-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 12px; background: var(--surface-3); }
.status-seg button { min-height: 36px; border-radius: 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.status-seg button.active { background: var(--surface); color: var(--primary-dark); box-shadow: 0 2px 7px rgba(49,86,64,.09); }
.detail-actions { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 12px; } .detail-actions .btn.wide-span { grid-column: 1 / -1; }
.settings-section { padding: 15px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.settings-section h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.settings-section h3 .icon { width: 19px; height: 19px; color: var(--primary); }
.settings-section > p { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 5px; }
.settings-list { display: grid; gap: 7px; margin-top: 11px; }
.subject-manage-row { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.subject-manage-row strong { flex: 1; font-size: 12px; } .subject-manage-row .count { color: var(--muted); font-size: 10px; }
.subject-manage-row .icon-btn { width: 32px; height: 32px; border-radius: 9px; } .subject-manage-row .icon-btn .icon { width: 16px; height: 16px; }
.manage-add { display: flex; gap: 7px; margin-top: 9px; } .manage-add .input { height: 39px; }
.settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; } .settings-actions .span-2 { grid-column: 1 / -1; }
.info-note { display: flex; gap: 9px; padding: 11px; border-radius: 12px; background: var(--blue-soft); color: #4b6377; font-size: 11px; line-height: 1.6; margin-top: 10px; }
.info-note .icon { color: var(--blue); width: 18px; height: 18px; margin-top: 1px; }
.warn-note { background: var(--accent-soft); color: #7c5b28; } .warn-note .icon { color: #b67b2c; }
.danger-zone { border-color: rgba(201,103,92,.3); background: #fffaf8; } .danger-zone h3 .icon { color: var(--danger); }
.install-box { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 14px; background: var(--primary-mist); margin-top: 10px; }
.install-box .icon { width: 25px; height: 25px; color: var(--primary); }
.install-box div { flex: 1; min-width: 0; } .install-box strong { display: block; font-size: 12px; } .install-box span { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.about-box { text-align: center; padding: 9px 2px 2px; color: var(--muted); font-size: 10px; line-height: 1.7; } .about-box strong { color: var(--text-2); }
.confirm-card { padding: 21px 18px; text-align: center; }
.confirm-icon { width: 52px; height: 52px; border-radius: 17px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--accent-soft); color: #ae752b; }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); } .confirm-icon .icon { width: 25px; height: 25px; }
.confirm-card h2 { font-size: 17px; font-weight: 850; }
.confirm-card p { color: var(--muted); font-size: 12px; line-height: 1.65; margin-top: 7px; }
.toast-root { position: fixed; left: 50%; bottom: calc(var(--nav-height) + var(--safe-bottom) + 18px); transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 7px; width: min(92vw,460px); pointer-events: none; }
.toast { padding: 10px 15px; border-radius: 12px; background: rgba(38,53,44,.94); color: #fff; font-size: 12px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: toast-in .2s ease both; text-align: center; }
.toast.success { background: rgba(55,101,73,.96); } .toast.error { background: rgba(164,75,67,.96); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.busy-root { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 24px; background: rgba(29,46,35,.5); backdrop-filter: blur(4px); }
.busy-root[hidden] { display: none; }
.busy-card { width: min(86vw,310px); padding: 24px 20px; border-radius: 21px; background: var(--surface); text-align: center; box-shadow: var(--shadow-lg); }
.busy-spinner { width: 37px; height: 37px; border-radius: 50%; margin: 0 auto 14px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.busy-card strong { display: block; font-size: 14px; } .busy-card p { color: var(--muted); font-size: 11px; margin-top: 5px; line-height: 1.5; }
.print-preview { display: grid; gap: 10px; }
.print-preview-head { padding: 15px; border-radius: 17px; background: linear-gradient(135deg,#f0f5ea,#e8efe2); border: 1px solid var(--line); }
.print-preview-head h3 { font-size: 17px; } .print-preview-head p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.question-preview { padding: 12px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; line-height: 1.65; }
.question-preview b { color: var(--primary-dark); }
.paper-meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; } .paper-meta-row .badge { font-size: 9px; }
@media (min-width: 700px) {
  #main-content { padding: 22px 26px 38px; }
  .app-header { padding-left: 26px; padding-right: 26px; }
  .brand h1 { font-size: 21px; } .brand p { font-size: 12px; }
  .child-switch { max-width: 360px; }
  .hero-card { padding: 28px 27px 24px; }
  .hero-title { font-size: 31px; max-width: 75%; } .hero-desc { max-width: 62%; }
  .hero-actions { max-width: 430px; }
  .quick-grid { grid-template-columns: repeat(2,1fr); }
  .modal-root { align-items: center; padding: 28px; }
  .modal-sheet { border-radius: 25px; max-height: 90vh; }
  .modal-footer { padding-bottom: 14px; }
  .form-row.three { grid-template-columns: 1fr 1fr 1fr; }
  .settings-actions { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 380px) {
  .hero-title { font-size: 23px; }
  .stat-grid { gap: 6px; } .stat-card { padding: 11px 8px; } .stat-card strong { font-size: 21px; } .stat-card small { font-size: 10px; }
  .quick-grid { grid-template-columns: 1fr 1fr; } .quick-card { padding: 13px; }
  .analysis-hero { grid-template-columns: 98px 1fr; padding: 15px; gap: 12px; } .mastery-ring { width: 92px; height: 92px; }
  .form-row,.form-row.three { grid-template-columns: 1fr; }
  .answer-grid { grid-template-columns: 1fr; }
  .detail-actions { grid-template-columns: 1fr; } .detail-actions .btn.wide-span { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
