:root {
  --paper: #f7f1e4;
  --paper-deep: #efe2c9;
  --ink: #2b231d;
  --muted: #746a60;
  --line: #2b231d;
  --honey: #f2b84b;
  --honey-light: #ffd98a;
  --coral: #ef765f;
  --coral-soft: #ffe1d8;
  --blue: #6f8fb7;
  --blue-soft: #dae7f4;
  --sage: #7c9471;
  --sage-soft: #e2eadb;
  --plum: #8c6680;
  --plum-soft: #eadbe5;
  --shadow: 0 10px 30px rgba(74, 52, 27, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--paper); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 7% 4%, rgba(242, 184, 75, .16), transparent 23rem),
    linear-gradient(180deg, #fbf7ef 0%, var(--paper) 58%, #f3ead9 100%);
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  position: relative;
  z-index: 10;
}
.auth-card {
  width: min(100%, 430px);
  border: 1.7px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 253, 248, .97);
  padding: 24px;
  box-shadow: 7px 8px 0 var(--line);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin: -10px 0 18px; }
.auth-brand img { width: 84px; height: 72px; object-fit: contain; object-position: center bottom; }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { font-size: 1.22rem; letter-spacing: .08em; }
.auth-brand span { margin-top: 3px; color: var(--muted); font-size: .76rem; }
.auth-card h1 { font-size: clamp(1.8rem, 8vw, 2.45rem); }
.auth-intro { margin: 10px 0 20px; color: var(--muted); line-height: 1.6; font-size: .9rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.auth-tab { min-height: 44px; border: 1.5px solid var(--line); border-radius: 14px; background: #fffaf1; cursor: pointer; font-weight: 850; }
.auth-tab.is-active { background: var(--honey-light); box-shadow: 2px 3px 0 var(--line); }
.auth-form { display: grid; }
.auth-form label { margin: 11px 0 6px; font-size: .82rem; font-weight: 850; }
.auth-form label span { color: var(--muted); font-weight: 650; font-size: .72rem; }
.auth-form input, .auth-form select {
  width: 100%; height: 49px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fffdf8; padding: 0 13px; outline: none;
}
.auth-form input:focus, .auth-form select:focus { border-width: 2px; box-shadow: 0 0 0 3px rgba(242,184,75,.22); }
.auth-form .primary-button { width: 100%; margin-top: 20px; }
.auth-form :disabled { opacity: .64; cursor: wait; }
.local-entry { margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed rgba(43,35,29,.28); text-align: center; }
.local-entry > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .74rem; font-weight: 750; }
.local-entry-button { width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--honey-light); box-shadow: 2px 3px 0 var(--line); cursor: pointer; font-weight: 900; }
.local-entry p { margin: 9px 0 0; color: #8a5f19; font-size: .72rem; line-height: 1.5; }
.auth-error { min-height: 22px; margin: 12px 0 0; color: #a73325; font-size: .8rem; text-align: center; line-height: 1.45; }
.auth-note { margin: 8px 0 0; color: var(--muted); font-size: .72rem; text-align: center; }

.app-shell { width: min(100%, 1040px); margin: 0 auto; min-height: 100dvh; position: relative; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(18px, 4vw, 34px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 241, 228, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1.5px solid rgba(43, 35, 29, .12);
}

.wordmark, .avatar-button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.wordmark { text-align: left; display: flex; flex-direction: column; gap: 2px; }
.wordmark { order: 1; }
.avatar-button { order: 3; }
.wordmark-main { font-size: 1.25rem; font-weight: 900; letter-spacing: .08em; }
.wordmark-sub { font-size: .72rem; color: var(--muted); }

.avatar-button { display: flex; align-items: center; gap: 8px; }
.avatar-dot {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--honey); border: 1.5px solid var(--line); font-weight: 900;
  box-shadow: 2px 2px 0 var(--line);
}
.avatar-name { display: none; font-size: .9rem; font-weight: 700; }
.sync-badge { order: 2; margin-left: auto; margin-right: 8px; color: var(--muted); font-size: .68rem; white-space: nowrap; }
.sync-badge[data-tone="saving"] { color: #8a5f19; }
.sync-badge[data-tone="error"] { color: #a73325; }
.sync-badge[data-tone="local"] { color: #6b4c18; font-weight: 800; }

main { padding: 20px 18px 112px; }

.bottom-nav {
  position: fixed;
  left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 1040px);
  height: calc(76px + env(safe-area-inset-bottom));
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: rgba(255, 252, 246, .94);
  backdrop-filter: blur(15px);
  border-top: 1.5px solid rgba(43, 35, 29, .14);
  z-index: 30;
}

.nav-item {
  border: 0; border-radius: 17px; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); cursor: pointer; font-size: .76rem; font-weight: 700;
}
.nav-item.is-active { background: var(--honey-light); color: var(--ink); }
.nav-icon { font-size: 1.3rem; line-height: 1; }

.page { animation: page-in .26s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

.eyebrow { margin: 0 0 7px; font-size: .78rem; font-weight: 850; letter-spacing: .14em; color: #8a5f19; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.85rem, 7vw, 3rem); line-height: 1.12; letter-spacing: -.04em; }
h2 { margin: 0; font-size: 1.34rem; line-height: 1.3; }
h3 { margin: 0; font-size: 1rem; }

.hero {
  min-height: 240px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: end;
  overflow: hidden;
  border: 1.6px solid var(--line);
  border-radius: 28px;
  background: var(--honey-light);
  box-shadow: 5px 6px 0 var(--line);
  padding: 25px 0 0 24px;
}

.hero-copy { align-self: center; padding-bottom: 24px; position: relative; z-index: 2; }
.hero-copy p { margin: 12px 0 18px; color: #5e4f3f; line-height: 1.6; font-size: .94rem; }
.hero-mascot { width: 198px; max-width: none; margin-left: -48px; align-self: end; filter: drop-shadow(0 8px 9px rgba(71, 43, 13, .1)); }

.daily-plan {
  margin-top: 17px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  padding: 17px;
  box-shadow: 3px 4px 0 rgba(43, 35, 29, .2);
}
.daily-plan-summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.daily-plan-summary .eyebrow { margin-bottom: 3px; }
.daily-number { display: flex; align-items: baseline; gap: 4px; }
.daily-number strong { font-size: 2rem; line-height: 1; }
.daily-number span { color: var(--muted); font-size: .85rem; }
.daily-subjects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 15px; }
.daily-subject-pill { min-height: 54px; border-radius: 14px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: .68rem; line-height: 1.25; }
.daily-subject-pill b { font-size: 1.05rem; }
.daily-note { margin: 12px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }

.mini-button, .primary-button, .ghost-button {
  border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 850;
  min-height: 44px; padding: 0 18px;
}
.mini-button, .primary-button { background: var(--ink); color: #fff9ed; box-shadow: 3px 3px 0 rgba(43, 35, 29, .2); }
.mini-button:disabled { opacity: .58; cursor: default; box-shadow: none; }
.ghost-button { background: transparent; }
.mini-button:active, .primary-button:active, .memory-button:active { transform: translate(1px, 1px); box-shadow: none; }

.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 30px 2px 14px; gap: 14px; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.count-badge { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: .75rem; font-weight: 800; background: #fffaf0; white-space: nowrap; }

.subject-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.subject-card {
  min-height: 142px; text-align: left; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 17px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 3px 4px 0 var(--line); transition: transform .18s ease;
}
.subject-card:hover { transform: translateY(-2px) rotate(-.35deg); }
.subject-card:nth-child(2n):hover { transform: translateY(-2px) rotate(.35deg); }
.subject-icon { font-size: 1.35rem; }
.subject-title { font-weight: 900; line-height: 1.25; }
.subject-meta { color: rgba(43, 35, 29, .66); font-size: .75rem; }
.tone-honey { background: #ffd781; }
.tone-blue { background: #d5e5f3; }
.tone-coral { background: #ffd9ce; }
.tone-sage { background: #dfe9d7; }
.tone-plum { background: #eadbe5; }
.tone-cream { background: #fff4d9; }

.streak-card {
  margin-top: 16px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 15px 17px; display: flex; gap: 13px; align-items: center; background: rgba(255,255,255,.42);
}
.streak-mark { font-size: 1.7rem; }
.streak-card strong { display: block; }
.streak-card span { font-size: .82rem; color: var(--muted); }

.back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.back-button { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: #fffaf1; font-size: 1.3rem; cursor: pointer; }
.back-row p { margin: 0; color: var(--muted); font-size: .82rem; }

.flashcard {
  border: 1.6px solid var(--line); border-radius: 28px; background: #fffdf8;
  min-height: 450px; padding: 22px; box-shadow: 5px 6px 0 var(--line); display: flex; flex-direction: column;
}
.question-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.type-pill, .source-pill { border-radius: 999px; padding: 6px 10px; font-size: .73rem; font-weight: 800; }
.type-pill { background: var(--coral-soft); }
.source-pill { background: var(--blue-soft); color: #3f5873; max-width: 62%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.question-title { font-size: clamp(1.55rem, 7vw, 2.35rem); line-height: 1.32; margin: 34px 0 14px; }
.question-tip { margin: 0; color: var(--muted); line-height: 1.65; font-size: .9rem; }
.reveal-zone { margin: auto 0 10px; text-align: center; padding-top: 28px; }
.reveal-button { width: 100%; min-height: 62px; border: 1.5px dashed var(--line); border-radius: 18px; background: #fff4d9; cursor: pointer; font-weight: 900; font-size: 1rem; }
.answer-box { display: none; margin-top: 24px; padding-top: 20px; border-top: 1.5px dashed rgba(43,35,29,.3); }
.answer-box.is-visible { display: block; animation: answer-in .28s ease both; }
@keyframes answer-in { from { opacity: 0; transform: translateY(7px); } }
.answer-box h3 { display: flex; align-items: center; gap: 8px; }
.answer-box p { line-height: 1.82; font-size: .96rem; margin: 13px 0 0; text-align: justify; }
.memory-prompt { margin: 24px 0 10px; font-size: .84rem; font-weight: 800; }
.memory-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.memory-button { min-height: 50px; border: 1.5px solid var(--line); border-radius: 15px; cursor: pointer; font-weight: 850; box-shadow: 2px 3px 0 var(--line); }
.memory-button.known { background: var(--sage-soft); }
.memory-button.fuzzy { background: var(--honey-light); }
.memory-button.forgot { background: var(--coral-soft); }
.card-progress { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.progress-track { height: 9px; border-radius: 999px; background: #e5dccb; overflow: hidden; flex: 1; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--honey); transition: width .35s ease; }
.card-progress span { font-size: .75rem; color: var(--muted); }

.library-hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px; }
.library-hero p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.stack-mark { font-size: 2.6rem; transform: rotate(4deg); }
.library-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.library-overview span { min-height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed rgba(43,35,29,.45); border-radius: 16px; background: rgba(255,255,255,.38); color: var(--muted); font-size: .72rem; }
.library-overview strong { color: var(--ink); font-size: 1rem; }
.archive-note { margin: 8px 2px 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.search-wrap { position: sticky; top: 87px; z-index: 12; margin: 20px 0 12px; }
.search-input { width: 100%; height: 52px; border: 1.5px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.95); padding: 0 17px; outline: none; box-shadow: 3px 3px 0 rgba(43,35,29,.16); }
.search-input:focus { border-width: 2px; }
.library-type-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 4px 0 16px; }
.library-type-tab { min-height: 62px; border: 1.5px solid var(--line); border-radius: 16px; background: #fffaf1; padding: 7px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .79rem; font-weight: 900; }
.library-type-tab b { font-size: .66rem; color: var(--muted); font-weight: 750; }
.library-type-tab.is-active { background: var(--honey-light); box-shadow: 2px 3px 0 var(--line); transform: translateY(-1px); }
.library-type-tab.is-active b { color: var(--ink); }
.filter-label { margin: 0 2px 6px; color: var(--muted); font-size: .73rem; font-weight: 800; }
.filter-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.archive-toggle { border: 1.5px solid var(--line); border-radius: 999px; background: #fffaf1; min-height: 34px; padding: 0 12px; cursor: pointer; color: var(--ink); font-size: .72rem; font-weight: 850; }
.archive-toggle.is-active { background: var(--ink); color: #fff; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 1px 12px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { white-space: nowrap; border: 1.5px solid var(--line); border-radius: 999px; background: #fffaf1; min-height: 38px; padding: 0 14px; cursor: pointer; font-weight: 800; }
.filter-chip.is-active { background: var(--ink); color: #fff; }
.library-list { display: grid; gap: 12px; }
.material-card { border: 1.5px solid var(--line); border-radius: var(--radius); background: #fffdf8; padding: 18px; cursor: pointer; box-shadow: 2px 3px 0 rgba(43,35,29,.18); }
.material-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.material-card h3 { margin: 10px 0 8px; font-size: 1.08rem; }
.material-card p { margin: 0; color: var(--muted); line-height: 1.6; font-size: .86rem; }
.material-kind { font-size: .73rem; padding: 5px 9px; border-radius: 999px; background: var(--plum-soft); font-weight: 800; }
.material-kind.kind-案例库 { background: var(--coral-soft); }
.material-kind.kind-理论库 { background: var(--plum-soft); }
.material-kind.kind-数据库 { background: var(--blue-soft); }
.material-kind.kind-完整原文 { background: var(--honey-light); }
.material-topic { color: #8a5f19; font-size: .75rem; font-weight: 850; }
.material-detail { display: none; margin-top: 13px; border-top: 1px dashed rgba(43,35,29,.25); padding-top: 13px; color: var(--ink) !important; }
.material-card.is-open .material-detail { display: block; animation: answer-in .25s ease both; }
.material-source { color: var(--muted); font-size: .76rem; }
.load-more { width: 100%; min-height: 48px; margin-top: 16px; border: 1.5px dashed var(--line); border-radius: 16px; background: #fff4d9; cursor: pointer; font-weight: 900; }
.empty-state { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 30px 18px; text-align: center; color: var(--muted); }

.profile-header { display: grid; grid-template-columns: 1fr 102px; align-items: center; padding: 4px 2px 20px; }
.profile-header p { margin: 8px 0 0; color: var(--muted); }
.profile-mascot { width: 126px; margin-left: -24px; }
.dashboard-grid { display: grid; gap: 12px; }
.dashboard-card { border: 1.5px solid var(--line); border-radius: var(--radius); background: #fffdf8; padding: 18px; box-shadow: 2px 3px 0 rgba(43,35,29,.16); }
.countdown { background: var(--plum-soft); }
.countdown-number { font-size: 3.25rem; line-height: 1; font-weight: 950; letter-spacing: -.06em; margin: 11px 0 5px; }
.countdown p, .dashboard-card > p { color: var(--muted); margin: 6px 0 0; line-height: 1.5; font-size: .85rem; }
.progress-card { display: grid; grid-template-columns: 102px 1fr; align-items: center; gap: 18px; }
.progress-ring { width: 96px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; background: conic-gradient(var(--honey) var(--degree), #eadfcd 0); }
.progress-ring::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #fffdf8; }
.progress-ring strong { position: relative; z-index: 1; font-size: 1.25rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.stat { border-radius: 14px; padding: 9px 6px; text-align: center; font-size: .72rem; }
.stat strong { display: block; font-size: 1.1rem; }
.stat.known { background: var(--sage-soft); }
.stat.fuzzy { background: var(--honey-light); }
.stat.forgot { background: var(--coral-soft); }
.wrong-list { display: grid; gap: 8px; margin-top: 14px; }
.wrong-item { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 14px; padding: 11px 12px; text-align: left; cursor: pointer; }
.wrong-item.fuzzy { background: var(--honey-light); }
.wrong-item.forgot { background: var(--coral-soft); }
.wrong-item span:last-child { margin-left: auto; }
.diary textarea { width: 100%; min-height: 130px; resize: vertical; margin-top: 13px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 16px; background: #fffaf1; outline: none; line-height: 1.65; }
.diary-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.save-status { color: var(--muted); font-size: .75rem; }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 18px); background: var(--ink); color: white; padding: 11px 16px; border-radius: 999px; z-index: 60; opacity: 0; pointer-events: none; transition: .22s ease; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.account-dialog { width: min(92vw, 420px); border: 0; border-radius: 28px; padding: 0; background: transparent; }
.account-dialog::backdrop { background: rgba(43,35,29,.42); backdrop-filter: blur(5px); }
.dialog-card { position: relative; border: 1.7px solid var(--line); border-radius: 28px; background: var(--paper); padding: 24px; box-shadow: 6px 7px 0 var(--line); }
.dialog-close { position: absolute; right: 14px; top: 12px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 1.7rem; cursor: pointer; }
.dialog-mascot { display: block; width: 116px; margin: -22px auto -6px; }
.dialog-card h2 { text-align: center; margin-bottom: 19px; }
.dialog-card .eyebrow { text-align: center; }
.dialog-card label { display: block; font-size: .8rem; font-weight: 850; margin: 12px 0 7px; }
.dialog-card input, .dialog-card select { width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: 14px; background: #fffdf8; padding: 0 12px; }
.dialog-card .primary-button { width: 100%; margin-top: 18px; }
.backup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.backup-button { min-height: 44px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff6df; cursor: pointer; font-size: .78rem; font-weight: 850; }
.logout-button { width: 100%; min-height: 44px; margin-top: 10px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; font-weight: 850; }
.dialog-note { font-size: .73rem; color: var(--muted); line-height: 1.55; text-align: center; }

.backup-card { background: #fff8e8; }
.backup-card h2 { margin-bottom: 5px; }
.backup-card > p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.backup-status { display: flex; align-items: center; gap: 9px; margin: 15px 0; padding: 12px; border: 1.5px dashed rgba(43,35,29,.4); border-radius: 15px; background: rgba(255,255,255,.52); font-size: .8rem; line-height: 1.5; }
.backup-status-mark { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: var(--honey-light); border: 1px solid var(--line); font-weight: 900; }
.backup-card .backup-actions { margin-top: 0; }

@media (min-width: 720px) {
  .avatar-name { display: inline; }
  main { padding: 32px 28px 120px; }
  .hero { grid-template-columns: 1fr 250px; min-height: 300px; padding-left: 36px; }
  .hero-mascot { width: 292px; margin-left: -50px; }
  .subject-grid { grid-template-columns: repeat(3, 1fr); }
  .subject-card { min-height: 165px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-card.diary, .dashboard-card.wrongbook { grid-column: span 2; }
  .library-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 410px) {
  .sync-badge { max-width: 70px; overflow: hidden; text-overflow: ellipsis; }
  .auth-card { padding: 21px 18px; }
}

@media (min-width: 1080px) {
  body { padding: 20px 0; }
  .app-shell { min-height: calc(100dvh - 40px); border: 1.5px solid rgba(43,35,29,.2); border-radius: 32px; overflow: hidden; background: rgba(247,241,228,.78); box-shadow: var(--shadow); }
  .bottom-nav { bottom: 20px; width: 440px; border: 1.5px solid var(--line); border-radius: 24px; height: 70px; padding: 8px; box-shadow: 4px 5px 0 var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
