:root {
  color-scheme: light;
  --ink: #172132;
  --slate: #526075;
  --night: #151e2c;
  --accent: #ff956f;
  --accent-deep: #a83c22;
  --paper: #f3f5f7;
  --line: #d9e0e8;
  --white: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
button, input, select { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid #bc4e35; outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 5; top: 12px; left: 12px; background: var(--white); padding: 8px 16px; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.brand-mark { width: 26px; height: 26px; display: grid; place-items: center; background: var(--accent); border-radius: 5px; }
.brand-mark::before { content: ""; width: 14px; height: 8px; border: solid var(--night); border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg) skew(-8deg,-8deg); }
.section { padding-top: 52px; scroll-margin-top: 16px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { font-size: clamp(1.7rem, 3.8vw, 2.2rem); line-height: 1.2; letter-spacing: -.025em; }
.section-heading p { color: var(--slate); margin-top: 6px; }
.week-select { display: flex; align-items: center; gap: 10px; flex: none; font-size: .875rem; font-weight: 650; }
.plan-settings { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.plan-settings input[type=date] { max-width: 100%; min-width: 0; min-height: 44px; padding: 5px 9px; border: 1px solid #aebaca; border-radius: 8px; background: white; }
.section-heading .plan-status { color: #376049; font-weight: 750; }
.plan-status:empty, .record-status:empty, #storage-status:empty { display: none; }
#storage-status { color: var(--accent-deep); }
select, input[type=search] { min-height: 44px; border: 1px solid #aebaca; border-radius: 8px; background: #fff; padding: 6px 12px; }
select { padding-right: 32px; appearance: none; background: linear-gradient(45deg, transparent 50%, var(--ink) 50%) calc(100% - 16px) 52% / 5px 5px no-repeat, linear-gradient(135deg, var(--ink) 50%, transparent 50%) calc(100% - 11px) 52% / 5px 5px no-repeat, #fff; }
.plan-layout { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(248px, 1fr); gap: 22px; align-items: start; }
.day-switch { display: grid; grid-template-columns: repeat(var(--day-count, 4), minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.day-button { min-width: 0; min-height: 64px; text-align: left; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.day-button:hover, .filter:hover { border-color: #8697ac; }
.day-button[aria-pressed=true] { border-color: #334155; background: var(--night); color: #fff; }
.day-button strong { display: block; font-size: .9375rem; }
.day-button span { display: block; color: var(--slate); font-size: .875rem; overflow-wrap: anywhere; }
.day-button[aria-pressed=true] span { color: #d6e0ee; }
.workout { background: #fff; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.workout-header { padding: 16px 20px; background: #e9eef4; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.workout-header h3 { font-size: 1.23rem; }
.workout-header p { color: var(--slate); font-size: .875rem; }
.workout-time { white-space: nowrap; font-size: .875rem; color: #344760; font-weight: 700; }
.workout-list { margin: 0; padding: 0; list-style: none; }
.workout-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 15px 6px 12px; }
.workout-row + .workout-row { border-top: 1px solid var(--line); }
.set-tracker { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.set-count { margin-inline-end: auto; color: var(--slate); font-size: .875rem; font-weight: 750; }
.set-goal-met .set-count { color: #285a3d; }
.set-add, .set-undo { min-width: 44px; min-height: 44px; padding: 5px 9px; border-radius: 8px; font-weight: 750; }
.set-add { background: #ffe4d9; border: 1px solid #d59179; color: #783622; }
.set-add:hover { background: #ffd5c5; }
.set-undo { background: white; border: 1px solid #b9c7d6; color: #40546e; font-size: .875rem; }
.exercise-record { grid-column: 2; margin-top: -4px; margin-bottom: 2px; min-width: 0; }
.exercise-record summary { width: fit-content; min-height: 44px; padding: 8px 0; color: var(--slate); cursor: pointer; font-size: .875rem; font-weight: 700; }
.exercise-record-fields { display: grid; grid-template-columns: minmax(0, .8fr) repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; padding: 10px; margin-bottom: 6px; background: #f1f5f9; border-radius: 8px; }
.exercise-record-field { display: grid; gap: 3px; font-weight: 700; font-size: .875rem; }
.exercise-record-field input, .session-note textarea { min-width: 0; min-height: 44px; padding: 6px 9px; border: 1px solid #aebaca; border-radius: 8px; background: #fff; font-size: 1rem; font-weight: 400; }
.exercise-record-hint { grid-column: 1 / -1; color: var(--slate); font-size: .875rem; }
.exercise-record-fields button, .session-note button { width: fit-content; min-height: 44px; border: 1px solid #d09a86; border-radius: 8px; padding: 5px 12px; background: #ffe9e0; color: #793321; font-weight: 750; }
.exercise-record-fields .record-status { grid-column: 2 / -1; }
.record-status, #session-note-status { align-self: center; color: #355643; font-size: .875rem; }
.history-by-date { margin-top: 23px; }
.history-by-date h3 { margin-bottom: 10px; }
.session-note { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 7px 10px; margin-top: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.session-note label, .session-note textarea { grid-column: 1 / -1; }
.session-note label { font-weight: 750; }
.session-note textarea { resize: vertical; }
.done-label { display: grid; place-items: center; min-height: 44px; cursor: pointer; }
.done-label input { width: 20px; height: 20px; margin: 0; accent-color: #98402d; cursor: pointer; }
.move-button { min-width: 0; padding: 8px 0; min-height: 59px; display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; }
.move-button:hover strong { color: var(--accent-deep); }
.move-button strong { display: block; }
.move-button small { display: block; color: var(--slate); font-size: .875rem; }
.move-button .detail-label { color: var(--accent-deep); font-size: .875rem; white-space: nowrap; font-weight: 700; }
.plan-aside h3 { margin-top: 5px; font-size: 1.14rem; }
.phase { padding: 21px 20px; background: #fceae4; border: 1px solid #f1cec2; border-radius: 13px; }
.phase-label { color: #8b3520; font-weight: 760; font-size: .875rem; }
.phase p + p, .phase h3 + p, .start-note p { margin-top: 6px; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; margin-top: 15px; font-size: .875rem; font-weight: 700; }
progress { display: block; width: 100%; height: 10px; margin-top: 7px; border: 0; border-radius: 20px; overflow: hidden; background: #dfbfb4; color: #a83c22; }
progress::-webkit-progress-bar { background: #dfbfb4; }
progress::-webkit-progress-value { background: #a83c22; border-radius: 20px; }
progress::-moz-progress-bar { background: #a83c22; }
.start-note { padding: 12px 4px 0; }
.start-note p { color: var(--slate); }
.start-note a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-deep); font-weight: 700; }
.library-section { margin-top: 6px; }
.search-label { width: min(100%, 270px); }
.search-label input { width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter { min-height: 44px; padding: 6px 14px; border-radius: 20px; border: 1px solid #bac6d4; background: #fff; font-size: .9375rem; white-space: nowrap; }
.filter[aria-pressed=true] { color: #fff; background: var(--night); border-color: var(--night); }
.library-controls { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 7px 14px; margin-bottom: 14px; }
.library-equipment { display: flex; align-items: center; gap: 8px; color: var(--slate); font-size: .875rem; font-weight: 700; }
.library-equipment select { min-width: 132px; max-width: 100%; }
.library-count { color: var(--slate); font-size: .875rem; font-variant-numeric: tabular-nums; }
#functional-trainer { scroll-margin-top: calc(var(--app-topbar-height) + var(--app-top-inset) + 10px); }
.trainer-filter { margin-inline-end: auto; font-weight: 750; color: var(--accent-deep); border-color: var(--accent-deep); }
.trainer-overview { margin: 0 0 14px; max-width: 44rem; }
.trainer-source a { display: inline-flex; min-height: 44px; align-items: center; color: var(--accent-deep); text-decoration: underline; }
.trainer-gallery { margin-block: 5px; }
.equipment-steps + .trainer-gallery { margin-top: 16px; }
.trainer-views {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.trainer-view-toggle {
  min-height: 44px;
  padding: 4px 3px;
  border: 1px solid #aebfd1;
  border-radius: 7px;
  background: var(--white);
  font-size: .875rem;
  font-weight: 700;
}
.trainer-view-toggle[aria-pressed="true"] { border-color: var(--night); background: var(--night); color: var(--white); }
.trainer-view .equipment-visual img { aspect-ratio: 4 / 3; }
.trainer-view-copy { color: var(--slate); margin-block: 6px; line-height: 1.5; }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.exercise-card { display: grid; width: 100%; text-align: left; appearance: none; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.exercise-card:hover { border-color: #8192a9; }
.exercise-card img { width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; background: #e4e6e7; }
.exercise-card-text { align-content: start; min-height: 118px; }
.catalog-card-label { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 8px 11px; border-bottom: 1px solid #e3e8ef; background: #edf2f7; color: #364861; font-size: .75rem; }
.catalog-card-label span:first-child { color: var(--accent-deep); font-weight: 750; }
.card-copy { padding: 11px 12px 12px; display: grid; gap: 2px; }
.card-copy span { color: var(--slate); font-size: .875rem; overflow-wrap: anywhere; }
.card-copy strong { line-height: 1.45; }
.catalog-setup { padding: 12px 14px; border: 1px solid #d8e2ee; border-radius: 10px; background: #f2f6fa; }
.dialog-body .catalog-setup h3 { margin-top: 0; }
.catalog-setup li + li { margin-top: 5px; }
.catalog-attribution { margin-top: 17px; color: var(--slate); font-size: .875rem; }
.empty { grid-column: 1 / -1; padding: 24px; border: 1px solid var(--line); background: #fff; border-radius: 12px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.guide-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 16px 18px; }
.guide-card h3 { font-size: 1.12rem; }
.guide-card ul, .dialog-body ol, .dialog-body ul { margin: 7px 0 0; padding-inline-start: 1.25em; }
.guide-card li + li, .dialog-body li + li { margin-top: 5px; }
.guide-card li { color: #3b495d; }
.sources { padding-top: 18px; color: var(--slate); font-size: .875rem; }
.sources a { display: inline-flex; align-items: center; min-height: 44px; margin-right: 20px; color: #30445f; }
.swap-button { min-height: 44px; border: 1px solid #b7c4d3; background: #fff; border-radius: 8px; padding: 6px 13px; font-weight: 700; }
.dialog-body { padding: 17px 20px 25px; }
.dialog-body h2 { margin: 4px 0; font-size: 1.65rem; line-height: 1.25; overflow-wrap: anywhere; }
.dialog-body h3 { font-size: 1.1rem; margin-top: 19px; }
.equipment-guide { margin-top: 12px; border: 1px solid #bfcddd; border-radius: 10px; background: #f0f5fa; }
.equipment-guide summary { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 7px 11px; list-style: none; border-radius: 9px; cursor: pointer; }
.equipment-guide summary::-webkit-details-marker { display: none; }
.equipment-guide summary::after { content: "+"; flex: 0 0 24px; border: 1px solid #aebfd1; border-radius: 6px; background: white; color: #284064; text-align: center; line-height: 22px; }
.equipment-guide[open] summary::after { content: "−"; }
.form-gallery summary::after { margin-inline-start: auto; }
.form-gallery .equipment-visual img { aspect-ratio: var(--form-image-ratio); }
.form-gallery-subheading { margin: 16px 0 0; }
.equipment-step-count { margin-inline-start: auto; color: var(--slate); font-size: .875rem; white-space: nowrap; }
.equipment-guide-body { padding: 10px 12px 12px; border-top: 1px solid #cbd7e5; }
.equipment-recognition strong, .equipment-check strong { margin-inline-end: 4px; }
.equipment-visual { margin: 10px 0 8px; border: 1px solid #bdccda; border-radius: 8px; overflow: hidden; background: #f9fbfe; }
.equipment-image-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.equipment-image-button:focus-visible { outline-offset: -4px; }
.equipment-visual img { width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: contain; }
.equipment-visual figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 6px 8px; color: var(--slate); border-top: 1px solid #d5e0ec; font-size: .875rem; }
.equipment-image-hint { color: var(--accent-deep); font-weight: 720; white-space: nowrap; }
.equipment-preview {
  width: min(calc(100% - 20px), 1050px);
  max-width: calc(100% - 20px);
  max-height: calc(100dvh - 20px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--white);
}
.equipment-preview::backdrop { background: rgb(13 22 34 / 74%); }
.equipment-preview-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 10px 12px; }
.equipment-preview-heading h2 { margin: 0; font-size: 1rem; }
.equipment-preview-tools { display: flex; gap: 8px; }
.equipment-preview-tools button {
  min-height: 44px;
  padding: 4px 10px;
  border: 1px solid #aebfd1;
  border-radius: 7px;
  background: var(--white);
  font-weight: 700;
}
.equipment-preview-tools button[aria-pressed="true"] { border-color: var(--night); background: var(--night); color: var(--white); }
.equipment-preview-media { max-height: min(68dvh, 740px); overflow: auto; background: var(--paper); }
.equipment-preview-media img { display: block; width: 100%; height: auto; max-height: min(68dvh, 740px); object-fit: contain; }
.equipment-preview-media.is-zoomed img { width: 200%; max-width: none; max-height: none; }
.dialog-body .equipment-steps { margin-top: 9px; padding-inline-start: 1.6em; }
.dialog-body .equipment-steps li + li { margin-top: 8px; }
.equipment-steps li::marker { color: #973c26; font-weight: 800; }
.equipment-steps li > p { color: #35465b; }
.equipment-check { margin-top: 11px; padding: 8px 9px; border-radius: 6px; background: #fff1e8; color: #792f1d; }
.motion-breakdown { margin-top: 13px; }
.motion-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.motion-heading h3 { margin: 0; }
.motion-phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-bottom: 7px; }
.phase-button, .motion-control { min-height: 44px; padding: 5px 7px; border-radius: 7px; font-weight: 750; }
.phase-button { border: 1px solid #b2bfd0; background: #fff; color: #34475f; font-size: .875rem; }
.phase-button[aria-pressed=true] { border-color: var(--night); background: var(--night); color: #fff; }
.motion-control { padding-inline: 12px; border: 1px solid #b3644d; background: #ffe5db; color: #6e2c1b; }
.motion-control[aria-pressed=true] { background: var(--accent); color: #211d20; }
.motion-stage { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #e4e6e7; }
.motion-stage img, .motion-stage video { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: contain; }
.motion-speed { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 7px; color: var(--slate); font-size: .875rem; }
.motion-details { background: #fff; line-height: 1.45; }
.muscle-targets { padding: 8px 11px; color: #7a1624; background: #fae9ec; }
.muscle-targets strong { margin-right: 4px; }
.muscle-swatch { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: #a9182e; }
.motion-caption { min-height: 2.75rem; padding: 9px 11px; }
.motion-status { color: var(--accent-deep); font-weight: 700; }
.motion-status:empty { display: none; }
.movement-meta { font-size: .875rem; color: var(--slate); }
.prescription { margin-top: 13px; padding: 10px 12px; border: 1px solid #d5deea; border-radius: 10px; background: #f5f8fb; }
.prescription-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.prescription-heading h3 { margin: 0; }
.dose-week { font-size: .875rem; color: var(--slate); white-space: nowrap; }
.dose-line { display: grid; grid-template-columns: minmax(3em, auto) 1fr; gap: 6px; padding: 3px 0; }
.dose-line dt { color: var(--slate); }
.dose-line dd { font-weight: 750; }
.dose-line .movement-meta { font-weight: 400; }
.dose-reserve, .dose-advice { margin-top: 5px; color: #37475b; }
.dose-reserve, .assisting-muscles { font-size: .875rem; color: var(--slate); }
.assisting-muscles { margin-top: 4px; }
.swap-area { margin-top: 12px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: space-between; align-items: center; background: #eaf0f6; border-radius: 9px; }
.swap-button { text-align: left; color: #34475f; }
.apply-swap { min-height: 44px; padding: 6px 14px; margin-top: 10px; background: var(--accent); color: var(--ink); border: 1px solid #a4523c; border-radius: 8px; font-weight: 750; }
@media (max-width: 900px) {
  .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .section { padding-top: 33px; }
  .section-heading { flex-wrap: wrap; align-items: start; gap: 10px; margin-bottom: 14px; }
  .section-heading p { font-size: .9375rem; }
  .plan-layout { grid-template-columns: 1fr; gap: 14px; }
  .day-button { padding-inline: 7px; }
  .day-button strong, .day-button span { font-size: .875rem; }
  .workout-header { padding: 12px; }
  .workout-row { padding-right: 11px; padding-left: 4px; gap: 4px; }
  .phase { padding: 14px; }
  .search-label { width: 100%; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .guide-grid { grid-template-columns: 1fr; }
  .dialog-body { padding-inline: 12px; }
}
@media (max-width: 480px) {
  .exercise-record-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exercise-record-field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 360px) {
  .wrap { width: calc(100% - 24px); }
  .filters { gap: 6px; }
  .filter { padding-inline: 10px; }
}
