:root {
  color-scheme: light;
  --paper: #fff8ec;
  --paper-deep: #f3ddb9;
  --ink: #312920;
  --muted: #766655;
  --line: rgba(61, 48, 34, 0.16);
  --accent: #d98232;
  --accent-2: #ee8d7f;
  --green: #638d59;
  --blue: #5d789d;
  --danger: #a84d3e;
  --card: rgba(255, 252, 245, 0.9);
  --glass: rgba(255, 255, 255, 0.52);
  --shadow: 0 24px 80px rgba(92, 65, 31, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(238, 141, 127, 0.22), transparent 30rem),
    radial-gradient(circle at 86% 12%, rgba(99, 141, 89, 0.18), transparent 30rem),
    linear-gradient(180deg, #fae6c6 0%, #fff9ef 46%, #f2d8b0 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

html,
body {
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(80, 60, 34, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 60, 34, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.fitness-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 22px 0 112px;
}

.hero-card, .paper-card, .panel, .exercise-card, .slot-machine, .modal-sheet {
  border: 2px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: clamp(20px, 3vw, 34px);
  background:
    linear-gradient(135deg, rgba(255, 252, 245, 0.96), rgba(255, 245, 226, 0.82)),
    radial-gradient(circle at 82% 18%, rgba(217, 130, 50, 0.22), transparent 16rem);
}

.hero-card::before {
  content: '轻\A 练';
  white-space: pre;
  position: absolute;
  right: clamp(12px, 3vw, 32px);
  top: clamp(16px, 4vw, 42px);
  width: clamp(72px, 12vw, 132px);
  height: clamp(72px, 12vw, 132px);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(217, 130, 50, 0.12);
  border: 1px dashed rgba(49, 41, 32, 0.18);
  color: rgba(49, 41, 32, 0.16);
  font-size: clamp(26px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.05;
  pointer-events: none;
}

.hero-card::after, .paper-card::after, .slot-machine::after {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(64, 54, 44, 0.16);
  border-radius: inherit;
  pointer-events: none;
}

.crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.crumbs a { text-decoration: none; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 14px;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.75;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  margin-top: 24px;
  padding: 7px 8px 7px 16px;
  border: 1px solid rgba(64, 54, 44, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 14px 36px rgba(75, 52, 24, 0.08);
}
.hero-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
.hero-search button, .primary-btn, .ghost-btn, .chip, .tiny-btn {
  border: 0;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.hero-search button, .primary-btn {
  border-radius: 999px;
  padding: 11px 18px;
  background: linear-gradient(135deg, #4a3829, #9a6430);
  color: #fff;
  box-shadow: 0 12px 22px rgba(74, 56, 41, 0.18);
}
.ghost-btn, .chip, .tiny-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}
button:hover, .primary-btn:hover, .ghost-btn:hover, .chip:hover, .tiny-btn:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }

.hero-note {
  position: relative;
  z-index: 1;
  padding: 22px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  box-shadow: 0 16px 44px rgba(68, 45, 18, 0.08);
}
.hero-note span { color: var(--muted); font-size: 13px; }
.hero-note strong { display: block; margin: 6px 0 8px; font-size: 20px; }
.hero-note p { margin: 0; color: var(--muted); line-height: 1.7; }

.status-bar {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
}
.status-bar.ready { color: #35613d; }
.status-bar.error { color: var(--danger); }

.app-stage { display: grid; gap: 18px; }
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}
.section-title h2 { margin: 0; font-size: clamp(24px, 4vw, 34px); }
.section-title p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.paper-card, .panel, .slot-machine {
  position: relative;
  border-radius: 30px;
  padding: clamp(18px, 2.4vw, 26px);
}
.panel { box-shadow: none; background: rgba(255, 255, 255, 0.48); }

.slot-machine {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,.68), rgba(245,223,190,.56)),
    var(--card);
}
.slot-display {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.slot-cell {
  min-height: 108px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px solid rgba(64,54,44,.22);
  border-radius: 24px;
  background: rgba(255,255,255,.7);
}
.slot-cell span { display: block; color: var(--muted); font-size: 13px; }
.slot-cell strong { display: block; margin-top: 8px; font-size: clamp(20px, 4vw, 30px); }

.quick-card {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  border-radius: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(255,255,255,.76), rgba(255,246,232,.62));
  box-shadow: 0 14px 36px rgba(75, 52, 24, 0.07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.quick-card:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 130, 50, 0.32);
  box-shadow: 0 20px 48px rgba(75, 52, 24, 0.12);
}
.quick-card b { font-size: 21px; }
.quick-card span { color: var(--muted); line-height: 1.5; }
.quick-card i { font-style: normal; font-size: 32px; }

.overview-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.metric {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255,255,255,.68);
  border: 1px solid var(--line);
}
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 30px; letter-spacing: -0.03em; }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(120px, 180px));
  gap: 10px;
  align-items: center;
}
.filters input, .filters select, .field select, .field input, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: 0;
  background: rgba(255,255,255,.66);
  color: var(--ink);
}
.field { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }

.exercise-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.exercise-card {
  min-height: 196px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 26px;
  padding: 16px;
  box-shadow: none;
  background: rgba(255,255,255,.66);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.exercise-card:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 130, 50, 0.3);
  box-shadow: 0 16px 40px rgba(75, 52, 24, 0.09);
}
.exercise-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(223,147,67,.16), rgba(111,142,95,.12));
  border: 1px dashed rgba(64,54,44,.25);
}

.exercise-media.compact {
  height: 118px;
}

.exercise-media.large {
  height: min(360px, 52vh);
  margin: 16px 0;
  border-radius: 24px;
}

.workout-media {
  width: min(460px, 100%);
  margin: 16px auto 0;
}

.exercise-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.media-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 40px;
}
.exercise-card h3 { margin: 0; font-size: 18px; line-height: 1.38; letter-spacing: -0.01em; }
.exercise-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(223,147,67,.15);
  color: #76512b;
  font-size: 12px;
  font-weight: 750;
}
.card-actions { display: flex; gap: 8px; margin-top: 8px; }
.card-actions button { flex: 1; }
.favorite-on { color: #b65a4e; }

.plan-list { display: grid; gap: 12px; }
.plan-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.52);
}
.plan-item p { margin: 4px 0 0; color: var(--muted); line-height: 1.55; }

.timeline { display: grid; gap: 10px; }
.timeline-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.48);
  border: 1px solid var(--line);
}
.timeline-step b {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
}
.timeline-step p { margin: 4px 0 0; color: var(--muted); }

.workout-card { text-align: center; padding: 28px; }
.workout-count {
  width: min(240px, 66vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 18px auto;
  border-radius: 999px;
  border: 12px solid rgba(223,147,67,.24);
  background: rgba(255,255,255,.56);
}
.workout-count strong { font-size: clamp(54px, 16vw, 94px); }
.workout-count span { display: block; color: var(--muted); font-weight: 800; }

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 30;
  width: min(920px, calc(100% - 20px));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 247, 232, 0.92);
  box-shadow: 0 20px 55px rgba(64,54,44,.18);
  backdrop-filter: blur(12px);
}
.bottom-tabs a {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 54px;
  border-radius: 18px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 850;
}
.bottom-tabs a span { font-size: 12px; }
.bottom-tabs a.active { background: var(--ink); color: #fff; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 60;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  place-items: end center;
  padding: 18px;
  background: rgba(35, 28, 22, 0.38);
}
.modal.show { display: grid; }
.modal-sheet {
  width: min(780px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border-radius: 30px;
  padding: 22px;
  background: var(--paper);
}
.modal-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.modal-head h2 { margin-bottom: 6px; }
.step-list { padding-left: 22px; line-height: 1.8; color: var(--ink); }
.disclaimer { color: var(--danger); font-weight: 750; }

.empty {
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.42);
  color: var(--muted);
}

@media (max-width: 920px) {
  .hero-grid, .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .exercise-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-row { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .fitness-shell { width: calc(100% - 16px); max-width: 1180px; padding-top: 10px; }
  .hero-card::before { display: none; }
  .hero-card, .paper-card, .panel, .slot-machine { border-radius: 24px; padding: 16px; }
  .hero-search { display: grid; grid-template-columns: 22px minmax(0, 1fr) 54px; border-radius: 22px; align-items: center; gap: 6px; padding: 7px; }
  .hero-search span { padding-left: 6px; }
  .hero-search button { min-width: 52px; padding: 9px 12px; }
  .filters { grid-template-columns: 1fr; }
  .exercise-grid { grid-template-columns: 1fr; }
  .slot-display { grid-template-columns: 1fr; }
  .bottom-tabs { grid-template-columns: repeat(6, 1fr); border-radius: 20px; }
  .bottom-tabs a { min-height: 48px; font-size: 16px; }
  .bottom-tabs a span { display: none; }
  .plan-item { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
