:root {
  --paper: #fefae0;
  --surface: #fffdf1;
  --ink: #2f3a27;
  --muted: #65705b;
  --line: rgba(47, 58, 39, .18);
  --yellow: #f7d84a;
  --yellow-soft: #fff4bd;
  --green: #a8bf75;
  --green-soft: #e9f0d1;
  --peach: #f2a074;
  --blue: #8fb6c8;
  --rose: #df9aa6;
  --danger: #af5c58;
  --radius: 8px;
  --title: "Noto Serif SC", "Songti SC", "STSong", serif;
  --body: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --hand: "Comic Sans MS", cursive;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(247,216,74,.86); outline-offset: 2px; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 7px; background: #fffef8; color: var(--ink); padding: 10px 12px; }
textarea { min-height: 116px; resize: vertical; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 8px; font: 900 clamp(30px,4.2vw,50px)/1.07 var(--title); letter-spacing: 0; }
h2 { margin-bottom: 4px; font: 900 21px/1.22 var(--title); }
h3 { margin-bottom: 3px; font: 900 16px/1.25 var(--title); }
small, .basis { color: var(--muted); font-size: 12px; }
.app-shell { width: min(1440px,100%); margin: 0 auto; padding: 18px 24px 40px; }
.topbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--yellow); font: 900 20px/1 var(--title); }
.brand-avatar { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--yellow-soft); object-fit: cover; object-position: center 18%; }
.brand strong { display: block; font: 900 22px/1.12 var(--title); }
.brand small { display: block; margin-top: 3px; }
.top-actions,.head-actions,.dialog-actions,.backup-row { display: flex; align-items: center; gap: 9px; }
.ai-status { min-height: 32px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 800; }
.ai-status.ready { background: var(--green-soft); border-color: rgba(168,191,117,.95); color: var(--ink); }
.app-layout { display: grid; grid-template-columns: 194px minmax(0,1fr); gap: 28px; padding-top: 22px; }
.sidebar { position: sticky; top: 16px; height: fit-content; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { min-height: 46px; display: flex; align-items: center; gap: 11px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; text-align: left; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: var(--yellow-soft); color: var(--ink); }
.nav-item.active { background: var(--green-soft); color: var(--ink); }
.local-note { display: flex; gap: 7px; margin: 28px 0 0; padding: 13px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: 12px; }
.local-note svg { width: 17px; flex: 0 0 auto; }
.view { display: none; }
.view.active { display: block; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 8px 0 22px; }
.page-head p { margin-bottom: 0; color: var(--muted); }
.eyebrow,.scribble { display: inline-block; color: var(--peach); font: 700 18px/1 var(--hand); }
.date-chip,.label { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 800; }
.button,.icon-button,.link-button { border: 1px solid var(--line); cursor: pointer; font-weight: 800; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: 7px; background: var(--surface); }
.button svg,.icon-button svg { width: 18px; height: 18px; }
.button.primary { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.button.secondary { background: var(--green-soft); }
.button.quiet { background: transparent; }
.button:hover,.icon-button:hover { background: var(--yellow-soft); }
.button.primary:hover { background: #44513a; }
.button.wide { width: 100%; }
.icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--surface); }
.link-button { border: 0; padding: 5px 0; background: transparent; color: var(--ink); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.panel-head p { margin: 5px 0 0; }
.dashboard-grid,.nutrition-grid,.english-grid,.review-grid,.split-grid { display: grid; gap: 18px; }
.dashboard-grid { grid-template-columns: minmax(0,1.45fr) minmax(300px,.85fr); }
.plan-panel { min-height: 296px; position: relative; overflow: hidden; background: var(--green-soft); }
.plan-panel::after { content: "today"; position: absolute; right: 16px; bottom: -28px; color: rgba(47,58,39,.07); font: 900 96px/1 Georgia,serif; pointer-events: none; }
.plan-panel .basis { position: relative; z-index: 1; margin: 7px 0 13px; }
.guide-panel { min-height: 296px; display: grid; grid-template-columns: minmax(145px,.7fr) minmax(170px,1fr); align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--yellow-soft); }
.guide-panel img { width: 100%; height: 270px; object-fit: contain; object-position: bottom; mix-blend-mode: multiply; }
.guide-panel div { padding: 18px 16px 18px 0; }
.guide-panel p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.task-list { position: relative; z-index: 1; display: grid; gap: 9px; }
.task { min-height: 55px; display: grid; grid-template-columns: 29px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 8px 9px; border: 1px solid rgba(47,58,39,.16); border-radius: 7px; background: rgba(255,253,241,.76); }
.task.done { opacity: .63; }
.task-check { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: var(--surface); cursor: pointer; }
.task.done .task-check { background: var(--ink); color: var(--surface); }
.task-check svg { width: 16px; }
.task strong,.record-title { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.task small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task time { color: var(--muted); font-size: 12px; font-weight: 800; }
.quick-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.quick-card { min-height: 105px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; }
.quick-card:hover { background: var(--yellow-soft); transform: translateY(-1px); }
.quick-card svg { width: 22px; color: var(--peach); }
.quick-card span { font-weight: 900; }
.quick-card small { line-height: 1.35; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.metric { min-height: 172px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 800; }
.metric-top svg { width: 18px; height: 18px; }
.metric-value { margin: 13px 0 3px; font: 900 35px/1 var(--title); }
.metric-value small { font: 400 13px var(--body); }
.metric p { margin: 0; color: var(--muted); font-size: 13px; }
.progress { height: 8px; margin-top: 20px; overflow: hidden; border-radius: 999px; background: rgba(47,58,39,.1); }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.split-grid { grid-template-columns: minmax(0,1.25fr) minmax(290px,.75fr); }
.record-list { display: grid; }
.record { min-height: 61px; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.record:first-child { border-top: 0; }
.record-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow-soft); }
.record-icon svg { width: 16px; }
.record-meta { color: var(--muted); font-size: 12px; }
.record-value { color: var(--muted); font-size: 12px; font-weight: 800; }
.media-button { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--yellow-soft); cursor: pointer; font-size: 12px; font-weight: 800; }
.insight-panel { min-height: 180px; padding: 19px; border: 1px dashed rgba(47,58,39,.3); border-radius: var(--radius); background: rgba(255,244,189,.54); }
.insight-panel p { margin: 10px 0 12px; line-height: 1.68; }
.nutrition-grid { grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); }
.stack { display: grid; gap: 18px; align-content: start; }
.calorie-summary { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.big-number { margin: 6px 0; font: 900 43px/1 var(--title); }
.calorie-summary p { margin: 0; color: var(--muted); }
.section-rule { height: 1px; margin: 20px 0; background: var(--line); }
.food-list { display: grid; }
.food-row { min-height: 61px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.food-row:first-child { border-top: 0; }
.food-thumb { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 6px; object-fit: cover; background: var(--yellow-soft); }
.food-name { overflow: hidden; font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.food-meta { color: var(--muted); font-size: 12px; }
.remove-button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--yellow-soft); cursor: pointer; }
.remove-button svg { width: 16px; }
.weight-line { display: flex; align-items: baseline; gap: 7px; }
.weight-line strong { font: 900 37px/1 var(--title); }
.weight-chart { width: 100%; height: 116px; margin-top: 16px; }
.weight-chart .line { fill: none; stroke: var(--peach); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.weight-chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.activity-list { display: grid; gap: 9px; margin-top: 12px; }
.activity-item { display: flex; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 13px; }
.english-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.summary-strip { min-height: 94px; padding: 14px; border-top: 3px solid var(--ink); background: rgba(255,253,241,.68); }
.summary-strip strong { display: block; margin-top: 11px; font: 900 24px/1 var(--title); }
.english-grid { grid-template-columns: minmax(0,1.25fr) minmax(290px,.75fr); }
.project-list,.suggestion-list,.material-library { display: grid; gap: 12px; }
.project { padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,253,241,.68); }
.project-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.project p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.stage-list { display: grid; gap: 7px; margin-top: 14px; }
.stage { min-height: 43px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.stage.active { background: var(--yellow-soft); }
.stage.done { opacity: .58; }
.stage-index { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); font-size: 12px; font-weight: 900; }
.stage button { min-height: 30px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--green-soft); cursor: pointer; font-size: 12px; font-weight: 800; }
.suggestion { padding: 13px 0; border-top: 1px solid var(--line); }
.suggestion:first-child { margin-top: 16px; }
.suggestion p { margin: 5px 0; font-size: 14px; font-weight: 800; }
.material-card { display: grid; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); }
.material-card:first-child { margin-top: 16px; }
.material-card h3 { margin: 4px 0; }
.material-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.material-card .button { justify-self: start; }
.idea-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.search { min-height: 44px; flex: 1; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.search svg { width: 18px; color: var(--muted); }
.search input { min-height: 40px; padding: 0; border: 0; background: transparent; }
.filter-tabs,.segmented { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-tabs button,.segmented button { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 800; font-size: 13px; }
.filter-tabs button.active,.segmented button.active { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.idea-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.idea { min-height: 148px; display: flex; flex-direction: column; align-items: start; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.idea p { margin: 10px 0 auto; white-space: pre-wrap; }
.idea-foot { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 12px; }
.review-grid { grid-template-columns: minmax(0,1.2fr) minmax(290px,.8fr); }
.timeline { display: grid; }
.timeline-item { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline-item time { color: var(--muted); font-size: 12px; font-weight: 800; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.review-note { margin: 12px 0 20px; color: var(--muted); line-height: 1.75; }
dialog { width: min(580px,calc(100% - 28px)); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgba(47,58,39,.24); }
dialog::backdrop { background: rgba(47,58,39,.3); }
.dialog-content { padding: 22px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-head h2 { margin: 4px 0 0; }
.dialog-actions { justify-content: flex-end; margin-top: 22px; }
.study-dialog { max-height: min(760px,calc(100vh - 28px)); overflow: auto; }
.study-meta,.study-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.study-meta { margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 800; }
.study-actions { margin-bottom: 16px; }
.study-text { padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--yellow-soft); font: 500 17px/1.78 Georgia,serif; color: var(--ink); }
.study-details { margin-top: 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.study-details summary { cursor: pointer; font-weight: 900; }
.study-details p { margin: 10px 0 0; color: var(--muted); }
.phrase-list { margin: 16px 0; }
.phrase-list h3 { margin-bottom: 9px; }
.phrase-list div { display: grid; grid-template-columns: minmax(0,1fr) minmax(100px,.7fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.phrase-list span { color: var(--muted); }
.practice-note { margin: 16px 0; padding: 14px; border-left: 4px solid var(--yellow); background: var(--green-soft); }
.practice-note p { margin: 8px 0 0; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid label,.capture-fields label { display: grid; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 800; }
.backup-row { flex-wrap: wrap; margin-top: 20px; }
.capture-stack { display: grid; gap: 14px; }
.capture-tabs { display: flex; gap: 8px; margin-bottom: 17px; }
.capture-tab { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 800; }
.capture-tab.active { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.inline-actions,.media-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.field-note { color: var(--muted); font-size: 12px; }
.media-preview { display: none; width: 110px; height: 82px; object-fit: cover; border: 1px solid var(--line); border-radius: 7px; }
.media-preview.show { display: block; }
.audio-preview { width: 100%; margin-top: 4px; }
.estimate-result { padding: 10px 12px; border-left: 4px solid var(--yellow); background: var(--yellow-soft); color: var(--muted); font-size: 13px; }
.empty { padding: 22px 0; color: var(--muted); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 10; max-width: min(480px,calc(100% - 28px)); padding: 12px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); color: var(--surface); box-shadow: 0 8px 30px rgba(0,0,0,.2); font-weight: 800; opacity: 0; transform: translate(-50%,90px); transition: .2s ease-out; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
@media (max-width: 1050px) { .dashboard-grid,.nutrition-grid,.english-grid,.review-grid,.split-grid { grid-template-columns: 1fr; } .metric-grid { grid-template-columns: repeat(4,minmax(170px,1fr)); overflow-x: auto; padding-bottom: 4px; } }
@media (max-width: 760px) { .app-shell { padding: 13px 14px 28px; } .topbar { min-height: 56px; } .brand small,.ai-status,.top-actions .button span { display:none; } .app-layout { grid-template-columns: 1fr; gap: 16px; padding-top: 13px; } .sidebar { position: sticky; top: 0; z-index: 5; width: calc(100% + 28px); margin-left: -14px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: rgba(254,250,224,.94); backdrop-filter: blur(12px); overflow-x: auto; } .sidebar nav { width: max-content; display: flex; } .nav-item { min-height: 40px; padding: 0 10px; font-size: 13px; } .local-note { display:none; } .page-head { align-items:start; margin-top: 5px; } .date-chip { display:none; } .head-actions { flex-wrap: wrap; justify-content: flex-end; } h1 { font-size: 32px; } .guide-panel { min-height: 202px; grid-template-columns: 145px 1fr; } .guide-panel img { height: 200px; } .guide-panel div { padding: 14px 14px 14px 0; } .guide-panel h2 { font-size: 18px; } .quick-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; } .quick-card { min-height: 94px; } .metric-grid { gap: 10px; } .metric { min-width: 170px; } .english-summary { grid-template-columns: 1fr; } .idea-tools { align-items: stretch; flex-direction: column; } .idea-list { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } .food-row { grid-template-columns: 42px minmax(0,1fr) auto auto; } .food-thumb { width: 38px; height: 38px; } .phrase-list div { grid-template-columns: 1fr; gap: 3px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }
