:root {
  --bg: #f7f3e9;
  --surface: #fffdf8;
  --surface-2: #f3f8f4;
  --mint: #cfe8df;
  --mint-strong: #6f9e8f;
  --pink: #f4dfe2;
  --ink: #25302d;
  --muted: #6f7975;
  --line: #e7e1d5;
  --danger: #9f5d62;
  --shadow: 0 10px 30px rgba(46, 60, 55, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 18px; border-right: 1px solid var(--line); background: rgba(255,253,248,.8); backdrop-filter: blur(18px); display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 24px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--mint), var(--pink)); font-weight: 800; letter-spacing: .04em; }
.brand-title { font-size: 18px; font-weight: 800; }.brand-subtitle { font-size: 12px; color: var(--muted); margin-top: 1px; }
.side-nav { display: grid; gap: 7px; }
.nav-button { border: 0; background: transparent; color: var(--muted); padding: 12px 14px; border-radius: 14px; display: flex; align-items: center; gap: 10px; text-align: left; }
.nav-button.active { background: var(--surface-2); color: var(--ink); font-weight: 700; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--muted); line-height: 1.5; padding: 12px 8px; }
.main-content { min-width: 0; padding: 24px clamp(20px, 4vw, 54px) 38px; }
.topbar { max-width: 1100px; margin: 0 auto 22px; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
h1 { margin: 5px 0 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.035em; }
.icon-button { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 22px; }
.view-root { max-width: 1100px; margin: 0 auto; }
.hero-card, .panel, .lesson-card, .stat-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); }
.hero-card { padding: clamp(22px, 4vw, 34px); background: linear-gradient(135deg, rgba(207,232,223,.72), rgba(255,253,248,.95) 55%, rgba(244,223,226,.5)); }
.hero-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.65); border: 1px solid rgba(255,255,255,.7); font-size: 12px; color: var(--muted); }
.hero-title { margin: 16px 0 10px; font-size: clamp(28px, 5vw, 46px); letter-spacing: -.04em; max-width: 760px; }
.hero-copy { max-width: 760px; color: var(--muted); line-height: 1.75; margin: 0 0 20px; }
.progress-wrap { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 24px; }
.progress-track { height: 9px; border-radius: 999px; background: rgba(255,255,255,.75); overflow: hidden; }
.progress-fill { height: 100%; background: var(--mint-strong); border-radius: inherit; }
.primary-button, .secondary-button, .danger-button { border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 750; }
.primary-button { background: var(--ink); color: white; }.secondary-button { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }.danger-button { background: #fff2f2; color: var(--danger); border: 1px solid #efd5d7; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(260px,.65fr); gap: 18px; margin-top: 18px; }
.panel { padding: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.small-muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.lesson-list { display: grid; gap: 10px; }
.lesson-row { width: 100%; border: 1px solid var(--line); background: #fffefb; border-radius: 16px; padding: 14px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; align-items: center; text-align: left; }
.lesson-index { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--mint-strong); font-weight: 800; }
.lesson-row-title { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.lesson-row-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }.status-dot.done { background: var(--mint-strong); }.status-dot.favorite { box-shadow: 0 0 0 4px var(--pink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }.stat-card { padding: 16px; box-shadow: none; }.stat-number { font-size: 26px; font-weight: 850; }.stat-label { margin-top: 4px; color: var(--muted); font-size: 12px; }
.toolbar { display: grid; grid-template-columns: minmax(0,1fr) 170px; gap: 10px; margin-bottom: 16px; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 12px 14px; outline: none; }.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--mint-strong); box-shadow: 0 0 0 3px rgba(111,158,143,.13); }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; background: rgba(255,255,255,.45); }
.lesson-dialog { width: min(860px, calc(100vw - 24px)); max-height: min(92vh, 980px); padding: 0; border: 0; border-radius: 26px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(30,40,36,.22); }
.lesson-dialog::backdrop { background: rgba(30,40,36,.28); backdrop-filter: blur(5px); }
.dialog-sheet { display: flex; flex-direction: column; max-height: inherit; }.dialog-head { padding: 22px 22px 14px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }.dialog-head h2 { margin: 5px 0 0; font-size: clamp(24px, 4vw, 34px); line-height: 1.2; }
.lesson-body { padding: 22px; overflow: auto; line-height: 1.78; }.lesson-section { padding: 16px 0; border-bottom: 1px solid var(--line); }.lesson-section:last-child { border-bottom: 0; }.lesson-section h3 { margin: 0 0 8px; font-size: 17px; }.lesson-section p { margin: 0; color: #35403c; white-space: pre-line; }.reflection-box { margin-top: 14px; padding: 16px; background: var(--surface-2); border-radius: 16px; }.reflection-box label { display: block; font-weight: 750; margin-bottom: 8px; }
.dialog-actions { border-top: 1px solid var(--line); padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: flex-end; background: rgba(255,253,248,.95); }
.note-card { border: 1px solid var(--line); border-radius: 16px; padding: 15px; background: var(--surface); }.note-card + .note-card { margin-top: 10px; }.note-card h3 { margin: 0 0 6px; font-size: 15px; }.note-text { color: #3f4a46; white-space: pre-wrap; line-height: 1.6; }.note-meta { color: var(--muted); font-size: 12px; margin-top: 8px; }
.settings-group { display: grid; gap: 12px; }.setting-row { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 16px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }.setting-row strong { display: block; }.setting-row .small-muted { margin-top: 4px; }
.bottom-nav { display: none; }
.app-footer { max-width: 1100px; margin: 30px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 190px minmax(0,1fr); }
  .sidebar { padding: 18px 12px; }.main-content { padding: 20px 18px 34px; }
  .grid-2 { grid-template-columns: 1fr; }.stats { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 700px) {
  .app-shell { display: block; }.sidebar { display: none; }.main-content { padding: max(18px, env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { margin-bottom: 16px; }.grid-2 { gap: 12px; }.hero-card { border-radius: 20px; }.hero-top { display: block; }.stats { gap: 8px; }.stat-card { padding: 13px 10px; }.stat-number { font-size: 22px; }
  .toolbar { grid-template-columns: 1fr; }.lesson-row { grid-template-columns: auto minmax(0,1fr) auto; padding: 12px; }.lesson-index { width: 38px; height: 38px; }.lesson-row-title { white-space: normal; line-height: 1.35; }
  .bottom-nav { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,1fr); background: rgba(255,253,248,.92); backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 20px; padding: 7px; z-index: 10; box-shadow: var(--shadow); }
  .bottom-nav .nav-button { padding: 8px 4px; gap: 3px; flex-direction: column; justify-content: center; font-size: 10px; border-radius: 14px; }.bottom-nav .nav-icon { font-size: 18px; }
  .lesson-dialog { width: 100vw; max-height: 96vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }.dialog-actions { position: sticky; bottom: 0; }.dialog-actions button { flex: 1; }
}
@media (prefers-reduced-motion: no-preference) { .hero-card, .panel, .lesson-row { transition: transform .15s ease, box-shadow .15s ease; }.lesson-row:hover { transform: translateY(-1px); } }
