:root {
  color-scheme: light;
  --ink: #202d25;
  --subtle: #59665c;
  --green: #31533a;
  --forest: #1e3528;
  --lime: #dcf0b7;
  --canvas: #f6f7f2;
  --surface: #fff;
  --line: #e3e8de;
  --mint: #edf3e6;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #6b8d44; outline-offset: 3px; }
svg { display: block; flex: none; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 18px; line-height: 1.45; }
[hidden] { display: none !important; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 33px 19px 20px; color: #edf5e8; background: var(--forest);
}
.brand { display: flex; gap: 12px; align-items: center; text-align: left; background: none; border: 0; padding: 0 7px; color: inherit; }
.brand strong { display: block; font-size: 24px; line-height: 1.14; letter-spacing: .08em; }
.brand small { display: block; color: #b6c6b8; font-size: 11px; margin-top: 5px; letter-spacing: .04em; white-space: nowrap; }
.nav { display: grid; gap: 7px; margin-top: 46px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: #c8d6c9; text-align: left;
}
.nav-item:hover { background: #ffffff12; color: white; }
.nav-item.active { background: var(--lime); color: #1e3528; font-weight: 700; }
.sidebar-bottom { margin-top: auto; }
.local-label {
  display: flex; align-items: center; gap: 8px; margin: 16px 5px 0;
  padding: 17px 10px 2px; border-top: 1px solid #4c6253; color: #b6c6b8; font-size: 11px;
}
.local-label i { width: 6px; height: 6px; border-radius: 50%; background: #b5d790; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 69px; padding: 0 34px; background: #fbfcf9; border-bottom: 1px solid var(--line);
}
.breadcrumb, .top-actions, .today-date { display: flex; align-items: center; gap: 10px; }
.breadcrumb { color: var(--subtle); font-size: 13px; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.breadcrumb img { display: none; }
.today-date { color: var(--subtle); white-space: nowrap; font-size: 13px; }
.icon-btn {
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--green); background: var(--surface);
  width: 36px; height: 36px; border-radius: 10px; padding: 0;
}
.icon-btn:hover, .secondary:hover { background: var(--mint); }
.top-settings { border-radius: 50%; background: #edf3e9; border-color: #e4ebdf; margin-left: 7px; }
.content { max-width: 1400px; margin: auto; padding: 25px 34px 30px; }
.content:focus { outline: none; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 232px;
  display: flex; align-items: center; padding: 29px 35px; border-radius: 19px; color: #fff;
  background: #284333;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 0 32%; z-index: -2;
  background: url('./assets/after-work.jpg') center 56% / cover no-repeat;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #284333 31%, #284333 37%, #284333a8 53%, #102f2300 76%);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px; color: #e4f1d7; font-size: 12px; font-weight: 600;
  border: 1px solid #d9f0c347; background: #f1ffde16; border-radius: 100px; padding: 4px 10px;
}
.hero h1 { margin-top: 10px; font-size: clamp(28px, 3.1vw, 46px); font-weight: 730; letter-spacing: -.035em; line-height: 1.24; }
.hero p { color: #e0ebdf; margin-top: 8px; font-size: 14px; }
.hero-progress { display: flex; align-items: center; gap: 12px; margin-top: 24px; color: #e0ebdf; font-size: 12px; }
.hero-progress strong { color: #f0f9e8; font-variant-numeric: tabular-nums; }
.progress-track { width: clamp(74px, 16vw, 185px); height: 6px; border-radius: 20px; background: #e4f4d63e; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--lime); border-radius: inherit; }
.week-strip, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.week-strip { margin-top: 19px; padding: 14px 19px 15px; }
.week-top, .week-title, .week-actions { display: flex; align-items: center; }
.week-top { justify-content: space-between; gap: 6px; margin-bottom: 11px; }
.week-title { gap: 11px; }
.week-title h2 { white-space: nowrap; }
.week-title span { color: var(--subtle); font-size: 12px; }
.week-actions { gap: 6px; }
.square { width: 31px; height: 31px; border-radius: 8px; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day {
  display: grid; justify-items: center; align-content: center; gap: 0; min-height: 62px;
  background: #f7f9f5; border: 1px solid #edf0ea; border-radius: 9px; padding: 4px 1px;
}
.day span { font-size: 11px; color: var(--subtle); }
.day strong { font-size: 19px; font-weight: 670; font-variant-numeric: tabular-nums; line-height: 1.4; }
.day i { width: 4px; height: 4px; margin-top: 1px; border-radius: 50%; }
.day i.marked { background: #669052; }
.day:hover, .day.selected { background: #e8f3d9; border-color: #cdddba; }
.day.selected strong, .day.selected span { color: #2b4d32; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.26fr) minmax(0, 1fr); gap: 17px; margin-top: 19px; align-items: start; }
.overview-grid { align-items: stretch; }
.overview-grid .workout-card { display: flex; flex-direction: column; }
.overview-grid .workout-preview { flex: 1; }
.card { padding: 18px 18px 16px; }
.section-heading { display: flex; align-items: center; gap: 11px; min-width: 0; }
.section-heading > div:nth-child(2) { min-width: 0; }
.section-heading p { color: var(--subtle); font-size: 12px; margin-top: 1px; }
.section-symbol, .meal-symbol, .tip-symbol { flex: none; display: grid; place-items: center; border-radius: 11px; width: 41px; height: 41px; }
.green { background: #e9f2e4; color: #36603d; }
.amber { background: #f5eedb; color: #855b24; }
.blue { background: #e9eef6; color: #405c83; }
.text-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px; padding: 5px 0; border: 0;
  background: transparent; white-space: nowrap; font-size: 12px; color: #365f3d; font-weight: 650;
}
.text-btn:hover { color: #203e28; text-decoration: underline; }
.heading-link { margin-left: auto; }
.today-btn { padding-inline: 4px; }
.meal-list { margin-top: 11px; }
.meal-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; }
.meal-row + .meal-row { border-top: 1px solid #edf0ea; }
.meal-row:last-child { padding-bottom: 1px; }
.meal-symbol { width: 39px; height: 39px; border-radius: 9px; }
.meal-name {
  display: grid; gap: 1px; flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; text-align: left;
}
.meal-name:hover strong { color: #386540; text-decoration: underline; }
.meal-meta, .meal-ingredients { color: var(--subtle); font-size: 11px; overflow-wrap: anywhere; }
.meal-meta span { margin-inline: 2px; }
.meal-name strong { font-size: 14px; line-height: 1.35; }
.meal-method { font-size: 12px; margin-top: 4px; color: var(--subtle); }
.meal-check {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; margin-left: auto; padding: 0;
  border-radius: 50%; border: 1px solid #dce5d9; background: transparent; color: #7c8b7f;
}
.meal-check:hover { background: #edf5e8; color: var(--green); }
.meal-check.checked { background: #3c6543; border-color: #3c6543; color: white; }
.workout-preview {
  position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 108px;
  margin-top: 14px; padding: 13px 14px; border-radius: 10px; background: #eaf2df;
}
.workout-graphic {
  position: absolute; right: -6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 138px; height: 138px; border-radius: 50%; background: #dceacc; color: #74915e; z-index: -1;
}
.workout-graphic svg { transform: rotate(-17deg); stroke-width: 1; }
.workout-badge { color: #38573a; font-size: 11px; font-weight: 650; background: #f7faef; border-radius: 5px; padding: 3px 6px; }
.workout-copy h3 { font-size: 18px; margin-top: 4px; }
.workout-meta { display: flex; align-items: center; gap: 5px; color: #415645; font-size: 12px; margin-top: 4px; }
.workout-meta i { width: 3px; height: 3px; background: #647965; border-radius: 50%; margin: 0 2px; }
.workout-actions { display: flex; gap: 8px; margin-top: 12px; }
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px;
  min-height: 39px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; font-weight: 650;
}
.primary { background: #315a3b; color: #fff; }
.primary:hover { background: #24482e; }
.secondary { border-color: #dce5d8; background: #fafbf8; color: #31553a; }
.workout-actions .primary { flex: 1; }
.tip-card {
  display: flex; align-items: center; gap: 12px; margin-top: 17px;
  border: 1px solid #dfe8d8; border-radius: 13px; background: #eff3e9; padding: 12px 15px;
}
.tip-symbol { width: 36px; height: 36px; background: #e2ecd8; color: #456748; }
.tip-card h2 { font-size: 13px; }
.tip-card p { font-size: 12px; color: var(--subtle); margin-top: 2px; }
.tip-card .text-btn { margin-left: auto; }
.page-heading h1 { font-size: clamp(27px, 3.4vw, 39px); letter-spacing: -.04em; line-height: 1.27; }
.page-heading p { color: var(--subtle); margin-top: 7px; }
.guide-card .text-btn { margin-top: 8px; }
.plate-layout { display: flex; gap: 20px; align-items: center; margin-top: 16px; }
.plate { width: 109px; height: 109px; flex: none; border-radius: 50%; border: 4px solid #f3f5ef; background: conic-gradient(#a7bd85 0 38%, #eac88a 38% 76%, #e8aea0 76%); }
.plate-legend { display: grid; gap: 9px; }
.plate-legend span { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.plate-legend i { width: 9px; height: 9px; border-radius: 50%; background: #a7bd85; }
.plate-legend span:nth-child(2) i { background: #eac88a; }
.plate-legend span:nth-child(3) i { background: #e8aea0; }
.guide-list { padding-left: 1.4rem; margin: 15px 0 0; color: var(--subtle); font-size: 13px; }
.guide-list li + li { margin-top: 6px; }
.guide-note, .steps-intro { font-size: 12px; color: var(--subtle); margin-top: 12px; }
.steps { list-style: none; counter-reset: step; margin: 12px 0; padding: 0; }
.steps li { display: grid; gap: 1px; position: relative; padding: 8px 0 8px 34px; border-bottom: 1px solid var(--line); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; top: 8px; left: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: var(--green); background: var(--mint); font-size: 12px; }
.movement-row { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.movement-row > div { display: grid; gap: 1px; }
.movement-row > div span { color: var(--subtle); font-size: 12px; }
.movement-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 4px;
  min-height: 31px; padding: 4px 7px; border: 1px solid #d9e6d3; border-radius: 7px;
  background: #f1f6ec; color: var(--green); font-size: 11px; font-weight: 650; white-space: nowrap;
}
.movement-toggle:hover, .movement-toggle[aria-expanded="true"] { background: #e5efdc; }
.movement-player { margin: 8px 0 1px; min-width: 0; overflow: hidden; border-radius: 9px; background: #f1f5ee; }
.movement-player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #20382a; }
.movement-player figcaption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; padding: 7px 9px; color: var(--subtle); font-size: 11px; }
.movement-player a { display: inline-flex; align-items: center; gap: 3px; color: var(--green); }
.movement-error { padding: 8px 9px 2px; color: var(--subtle); font-size: 12px; }
.schedule { display: grid; gap: 4px; margin-top: 14px; }
.schedule-row, .weight-row {
  display: grid; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; text-align: left;
  padding: 9px 7px; border: 0; border-radius: 6px; background: transparent; font-size: 12px;
}
.schedule-row span, .weight-row span { color: var(--subtle); }
.schedule-row:hover, .schedule-active, .weight-row:hover { background: var(--mint); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; margin-top: 19px; }
.stat { display: flex; align-items: center; gap: 12px; }
.stat span { color: var(--subtle); font-size: 12px; }
.stat strong, .weight-value strong { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat small { color: var(--subtle); }
.bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 151px; padding: 15px 4px 0; }
.bar-item { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 4px; justify-items: center; font-size: 11px; color: var(--subtle); }
.bar-well { display: flex; align-items: end; width: min(75%, 42px); background: #f0f3ee; border-radius: 6px; overflow: hidden; }
.bar-well i { width: 100%; background: #819e70; border-radius: 6px; }
.weight-value { margin: 17px 0 8px; }
.weight-value span { margin-left: 8px; color: var(--subtle); font-size: 12px; }
.weight-history { display: grid; }
.weight-row { grid-template-columns: 1fr auto auto; }
.empty-weight { display: grid; justify-items: center; text-align: center; gap: 5px; color: var(--subtle); padding: 21px 5px 16px; }
.empty-weight svg { color: #6f8e68; margin-bottom: 4px; }
.empty-weight strong { color: var(--ink); font-size: 13px; }
.empty-weight span { font-size: 12px; }
.mobile-nav { display: none; }
dialog {
  width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 28px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: 17px; padding: 20px; color: var(--ink); background: #fff;
  box-shadow: 0 20px 60px #182f2b35;
}
dialog::backdrop { background: #16241bae; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dialog-top h2 { font-size: 20px; }
.dialog-intro { color: var(--subtle); font-size: 13px; }
.meal-detail { border-radius: 10px; padding: 13px 15px; }
.meal-detail span { font-size: 12px; }
.meal-detail h3 { font-size: 18px; margin: 3px 0 4px; }
.meal-detail p { font-size: 13px; margin-top: 5px; }
.dialog-section-title { margin: 15px 0 6px; font-size: 14px; }
.meal-choices, .source-list { display: grid; gap: 5px; }
.source-list { margin-top: 13px; }
.choice {
  display: flex; gap: 9px; align-items: center; text-align: left; width: 100%; padding: 8px 10px; font-size: 13px;
  border: 1px solid var(--line); background: #fcfdfb; color: var(--ink); border-radius: 8px; text-decoration: none;
}
.choice:hover, .choice-current { background: #eef5e7; border-color: #d3e3cc; }
.choice > :last-child { margin-left: auto; color: var(--subtle); }
.choice-dot { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid #bdccba; border-radius: 50%; color: var(--green); }
form { display: grid; gap: 6px; margin-top: 14px; }
form label { font-size: 13px; font-weight: 650; }
form label span { font-weight: 400; color: var(--subtle); }
input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cfdcc9; color: var(--ink); background: #fcfdfb; border-radius: 8px; }
.form-primary { width: 100%; margin-top: 8px; }
.delete-record { color: #a44035; justify-self: center; }
.settings-sources { margin-top: 10px; }
.timer {
  border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); padding: 9px 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.timer span { display: block; font-size: 12px; color: var(--subtle); }
.timer strong { font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1; }
.toast {
  position: fixed; z-index: 4; bottom: 22px; left: 50%; transform: translateX(-50%);
  min-width: 120px; max-width: calc(100vw - 24px); background: var(--forest); color: white; text-align: center;
  padding: 9px 14px; border-radius: 9px; box-shadow: 0 8px 20px #192d2440; pointer-events: none;
}
@media (min-width: 1530px) { .topbar { padding-inline: max(34px, calc((100vw - 1564px) / 2)); } }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 192px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .topbar, .content { padding-inline: 22px; }
  .dashboard-grid { gap: 12px; }
  .workout-actions { flex-wrap: wrap; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 166px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; }
  .topbar, .content { padding-inline: 17px; }
  .section-heading p { font-size: 11px; }
  .card { padding: 13px; }
  .workout-graphic { opacity: .65; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 54px; gap: 6px; }
  .breadcrumb { gap: 6px; }
  .breadcrumb img { display: block; }
  .breadcrumb > span, .breadcrumb > svg { display: none; }
  .today-date { font-size: 11px; gap: 5px; }
  .top-settings { width: 31px; height: 31px; margin-left: 0; }
  .content { padding-top: 13px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .mobile-nav {
    position: fixed; bottom: 0; inset-inline: 0; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 3px; background: var(--forest); padding: 5px max(6px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }
  .mobile-nav .nav-item { flex-direction: column; gap: 3px; justify-content: center; padding: 4px 1px; min-height: 48px; font-size: 10px; white-space: nowrap; }
  .mobile-nav .nav-item.active { background: #3c5743; color: var(--lime); }
  .hero { min-height: 198px; padding: 18px; border-radius: 12px; }
  .hero h1 { font-size: clamp(24px, 5.2vw, 36px); }
  .hero p { font-size: 12px; }
  .hero::before { inset-inline-start: 24%; background-position: 68% 55%; }
  .hero::after { background: linear-gradient(90deg, #284333 18%, #284333dc 52%, #22382746 100%); }
  .hero-progress { margin-top: 16px; }
  .toast { bottom: calc(66px + env(safe-area-inset-bottom)); }
}
@media (max-width: 590px) {
  .topbar, .content { padding-inline: 12px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .week-strip { margin-top: 12px; padding: 10px 9px; }
  .week-days { gap: 4px; }
  .week-title { gap: 6px; }
  .week-title h2 { font-size: 15px; }
  .week-title span { font-size: 10px; }
  .day { min-height: 55px; border-radius: 7px; }
  .day strong { font-size: 17px; }
  .tip-card { align-items: start; padding: 10px; gap: 7px; }
  .tip-symbol { width: 31px; height: 31px; }
  .tip-card .text-btn { white-space: normal; text-align: right; }
  .stats { gap: 6px; }
  .stat { padding: 9px 6px; gap: 5px; }
  .stat strong { font-size: 20px; }
  .stat .section-symbol { width: 28px; height: 28px; border-radius: 7px; }
  .stat .section-symbol svg { width: 15px; height: 15px; }
  .stat span, .stat small { font-size: 10px; }
  .workout-graphic { opacity: 1; }
}
.profile-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; color: #31553a;
  border-radius: 8px; border: 1px solid #dbe6d4; background: #eff5e9; white-space: nowrap; font-size: 12px; font-weight: 650;
}
.profile-btn:hover { background: #e4efd9; }
.personal-summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; margin-top: 15px;
  padding: 11px 16px; border: 1px solid #dce6d7; border-radius: 12px; background: #f0f5eb;
}
.personal-summary .section-symbol { width: 38px; height: 38px; margin-right: -10px; }
.personal-summary span { display: block; color: var(--subtle); font-size: 11px; }
.personal-summary strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.personal-summary small, .personal-note { color: var(--subtle); font-size: 12px; }
.personal-summary .text-btn { margin-left: auto; }
.meal-energy { margin-top: 4px; font-size: 11px; font-weight: 650; color: #3a643f; }
.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.profile-fields > div { display: grid; min-width: 0; gap: 4px; }
.full-field { grid-column: 1 / -1; }
.profile-fields select {
  width: 100%; min-height: 40px; padding: 8px; border: 1px solid #cfdcc9; border-radius: 8px;
  background: #fcfdfb; color: var(--ink); font: inherit;
}
.profile-fields select:focus-visible { outline: 2px solid #6b8d44; outline-offset: 3px; }
.delete-profile { display: flex; margin: 11px auto 0; color: #a44035; }
@media (max-width: 590px) {
  .profile-btn { padding: 5px 7px; font-size: 11px; }
  .profile-btn svg { display: none; }
  .top-actions { gap: 5px; }
  .personal-summary { gap: 7px 14px; padding: 9px 11px; }
  .personal-summary .section-symbol { display: none; }
  .personal-summary small { font-size: 10px; }
  .personal-summary strong { font-size: 13px; }
}
@media (max-width: 350px) {
  .today-date { display: none; }
  .profile-fields label { font-size: 12px; }
}
