:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #1b3026;
  background: #f3f5ee;
  --green: #1a3529;
  --lime: #d9f580;
  --muted: #596a5e;
  --border: #e1e7dc;
  --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #668f32; outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 6vw, 38px); letter-spacing: -.04em; }
h2 { font-size: 21px; }
small, .muted { color: var(--muted); }
small { line-height: 1.5; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; }
.brand small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .1em; }
.mark { width: 34px; height: 34px; border-radius: 50%; background: var(--lime); position: relative; overflow: hidden; flex: none; transform: rotate(-35deg); }
.mark::before, .mark::after { content: ""; position: absolute; width: 37px; height: 37px; border: 2px solid var(--green); border-radius: 50%; top: -3px; }
.mark::before { left: -29px; } .mark::after { right: -29px; }
.top { background: var(--green); color: white; padding-top: env(safe-area-inset-top); }
.top-inner, main, .nav-inner { max-width: 960px; margin: auto; padding-inline: clamp(16px, 5vw, 32px); }
.top-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.top small { color: #c3d3c6; }
.profile { text-align: right; font-size: 13px; }
main { padding-top: 26px; padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
.hero { background: var(--green); color: #fff; border-radius: 25px; padding: clamp(22px, 5vw, 40px); position: relative; overflow: hidden; isolation: isolate; }
.hero::after { content: ""; position: absolute; z-index: -1; width: 255px; height: 180px; right: -70px; top: 15px; border: 2px solid #8ba99455; border-radius: 5px; transform: rotate(-28deg); background: linear-gradient(90deg, transparent 49%, #8ba99455 49%, #8ba99455 50%, transparent 50%), linear-gradient(0deg, transparent 15%, #8ba99455 15%, #8ba99455 16%, transparent 16%, transparent 84%, #8ba99455 84%, #8ba99455 85%, transparent 85%); }
.eyebrow { color: #cce88a; letter-spacing: .12em; font-size: 12px; margin-bottom: 8px; }
.hero p:not(.eyebrow) { color: #dce7de; margin-top: 7px; }
.hero button { margin-top: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 13px 0 25px; }
.stat, .card, .filters { border: 1px solid var(--border); border-radius: 17px; background: var(--paper); }
.stat { text-align: left; color: var(--green); padding: 12px; }
.stat strong { display: block; font-size: 26px; line-height: 1.15; margin-bottom: 4px; }
.stat.active { background: #eef6d4; border-color: #c4d693; }
.card { padding: 14px 15px; }
.card + .card { margin-top: 8px; }
.section-title { margin: 22px 0 12px; }
.line, .section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.line > :first-child { min-width: 0; overflow-wrap: anywhere; }
.identity { display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; background: #eaf0df; border-radius: 13px; font-weight: 700; }
.badge { display: inline-block; font-size: 12px; padding: 5px 9px; border-radius: 20px; background: #eef3e7; white-space: nowrap; }
.badge.low { background: #fff0c7; color: #674602; }
.badge.empty { background: #fae8e1; color: #823c29; }
.btn { border: 1px solid transparent; border-radius: 11px; padding: 10px 14px; min-height: 44px; color: var(--green); font-weight: 700; background: #e8eee4; }
.btn.primary { background: var(--lime); }
.btn.subtle { background: white; border-color: var(--border); }
.btn.danger { color: #8b3329; }
.btn.full { width: 100%; }
.student { width: 100%; text-align: left; color: inherit; }
.student:hover, .stat:hover { border-color: #8ba06f; }
.filters { padding: 12px; margin-bottom: 10px; }
.filters summary { cursor: pointer; color: var(--muted); padding: 10px 2px 0; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.filters .grid { margin-top: 10px; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 650; min-width: 0; }
input, select, textarea { background: #f9faf6; color: inherit; border: 1px solid #d8e0d4; border-radius: 10px; min-height: 44px; width: 100%; min-width: 0; padding: 8px 10px; font-size: 16px; }
textarea { resize: vertical; min-height: 68px; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1; border-top: 1px solid var(--border); background: #fff; padding-bottom: env(safe-area-inset-bottom); }
.nav-inner { display: flex; padding-top: 6px; padding-bottom: 6px; }
.nav button { flex: 1; background: transparent; color: var(--muted); border: 0; min-height: 47px; padding: 5px; border-radius: 12px; }
.nav button[aria-current="page"] { color: var(--green); background: #eaf1de; font-weight: 750; }
.empty-state { padding: 25px 12px; text-align: center; color: var(--muted); border: 1px dashed #cbd6c8; border-radius: 14px; }
.stack { display: grid; gap: 12px; }
.detail { margin-top: 13px; }
.detail .hero { margin: 0; }
.detail-actions { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.history .card { margin-top: 7px; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; font-size: 14px; }
.login { max-width: 430px; padding: 22px; padding-top: max(8vh, env(safe-area-inset-top)); }
.login .hero { margin-bottom: 14px; }
.login form { padding: 20px; }
dialog { color: inherit; background: #fff; border: 0; border-radius: 22px; width: min(540px, calc(100% - 24px)); max-height: 88dvh; padding: 18px; }
dialog::backdrop { background: #12291ec0; }
dialog form { margin-top: 14px; }
dialog .choices { max-height: 42dvh; overflow: auto; padding: 2px 4px; }
.pick { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.pick input { width: 20px; min-height: auto; accent-color: #356647; }
.lesson-entry { border-bottom: 1px solid var(--border); padding-bottom: 7px; }
.error { color: #9b342a; font-size: 14px; }
.error:empty { display: none; }
#notice { position: fixed; bottom: calc(76px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); z-index: 2; padding: 10px 15px; border-radius: 12px; color: white; background: var(--green); }
#notice:empty { display: none; }
.loading { text-align: center; padding: 45px; }
@media (max-width: 365px) {
  .grid { grid-template-columns: 1fr; }
  .stat { padding: 9px; }
  .badge { padding-inline: 6px; }
}
[hidden] { display: none !important; }
