body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input { font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 44px; outline: none; }
.field input:focus { border-color: var(--accent); }
.form-error { margin: 0; color: var(--danger); font-size: 13px; min-height: 1em; }

#app { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.mtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 8px; }
.hello { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.synced { font-size: 12.5px; color: var(--muted); }
.announce { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-size: 13.5px; font-weight: 500; }
.mstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mstat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-sm); }
.mstat b { display: block; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mstat span { font-size: 12px; color: var(--muted); }
.mstat.warn b { color: var(--warn); }
.mstat.danger b { color: var(--danger); }
.mcourses { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.mcourses button { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcourses button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mlist { display: flex; flex-direction: column; gap: 18px; }
.ghead { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px 4px; }
.ghead h2 { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.ghead h2.danger { color: var(--danger); }
.ghead span { font-size: 12px; color: var(--muted); }
.gcard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.mrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.mrow + .mrow { border-top: 1px solid var(--border-soft); }
.check { width: 28px; height: 28px; flex: none; border-radius: 50%; cursor: pointer; border: 2px solid color-mix(in srgb, var(--cc) 55%, var(--border)); background: transparent; display: inline-flex; align-items: center; justify-content: center; color: transparent; padding: 0; }
.check[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.mbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mtitle { font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.mrow.done .mtitle { color: var(--muted); text-decoration: line-through; }
.mmeta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow-md); max-width: calc(100% - 32px); }

.locked-box { margin: 12px 0; padding: 16px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); display: flex; flex-direction: column; gap: 6px; }
.locked-box p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.mplan { margin-top: 4px; }
.prow { display: flex; gap: 12px; padding: 12px 14px; align-items: flex-start; border-bottom: 1px solid var(--border); }
.prow:last-child { border-bottom: 0; }
.pnum { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #fff; background: var(--cc, var(--accent)); }
.mremind { margin: 18px 0 0; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 13.5px; display: flex; flex-direction: column; gap: 10px; }
.mremind span { color: var(--muted); }
.mremind .mcourses { padding: 0; margin: 0; }

.reg-done { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.reg-done p { margin: 0; color: var(--ink-2); line-height: 1.6; }
.reg-done .btn { justify-content: center; min-height: 42px; }

/* ---------- 登录 / 注册 ---------- */
[hidden] { display: none !important; }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background:
  radial-gradient(900px 500px at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 20px 50px -20px rgba(40, 10, 70, .35), var(--shadow-sm); padding: 30px 28px 24px; display: flex; flex-direction: column; gap: 20px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-logo { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, #7A1FB8, #57068C); display: grid; place-items: center; box-shadow: 0 6px 16px -6px rgba(87, 6, 140, .6); flex: none; }
.auth-brand div { display: flex; flex-direction: column; gap: 2px; }
.auth-brand strong { font-size: 19px; letter-spacing: -.01em; }
.auth-brand span { font-size: 12.5px; color: var(--muted); }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--sunken); }
.tabs2 button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.tabs2 button:hover { color: var(--ink); }
.tabs2 button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form h1 { margin: 0 0 2px; font-size: 22px; letter-spacing: -.01em; }
.auth-form .reg-only { display: flex; flex-direction: column; gap: 10px; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.name-row .field { min-width: 0; }
.field input { width: 100%; box-sizing: border-box; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input::placeholder { color: var(--muted); opacity: .7; }
.tip { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.tip svg { flex: none; margin-top: 1px; }
.tip b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.tip.warn { background: var(--warn-soft); color: var(--warn); }
.tip.warn div { color: var(--ink-2); }
.tip.warn b { color: var(--warn); }
.field-hint { margin: -8px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 60px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--accent-text); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.pw-eye:hover { background: var(--accent-soft); }
.btn.big { min-height: 48px; font-size: 16px; border-radius: 12px; justify-content: center; margin-top: 2px; }
.switch-line { margin: 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.link { border: 0; background: none; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; padding: 2px 4px; }
.link:hover { text-decoration: underline; }
.form-error:empty { display: none; }
@media (max-width: 420px) { .auth-card { padding: 24px 18px 20px; border-radius: 18px; } .name-row { grid-template-columns: 1fr; } }
.tabs2 button[aria-selected="true"] { color: var(--accent-text); }

.auth-card { position: relative; }
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--sunken); }
.lang-switch button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.auth-card > .lang-switch { position: absolute; top: 18px; right: 18px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.auth-brand { padding-right: 96px; }
