﻿:root {
  color-scheme: light;
  --bg: #eef2ed;
  --panel: #ffffff;
  --ink: #18231f;
  --muted: #66736d;
  --line: #d9e1dc;
  --teal: #117b73;
  --teal-dark: #0d5f59;
  --amber: #c9821f;
  --blue: #416b9c;
  --soft: #f7f9f6;
  --shadow: 0 22px 70px rgba(21, 36, 31, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(125deg, rgba(17, 123, 115, 0.12), rgba(201, 130, 31, 0.08) 42%, rgba(65, 107, 156, 0.12)),
    var(--bg);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 48px);
}

.input-panel, .output-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(217, 225, 220, 0.9);
  box-shadow: var(--shadow);
}

.input-panel {
  border-radius: 8px;
  padding: 22px;
  align-self: start;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.output-panel {
  border-radius: 8px;
  padding: 24px;
  min-width: 0;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 255, 255, 0.88) 44% 56%, transparent 56%),
    linear-gradient(0deg, transparent 38%, rgba(255, 255, 255, 0.88) 38% 62%, transparent 62%),
    linear-gradient(135deg, var(--teal), var(--amber));
  flex: 0 0 auto;
}

h1, h2, h3, p { margin: 0; }

h1 { font-size: 1.35rem; line-height: 1.15; }

.brand p, .hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.form { display: grid; gap: 16px; }

.section-title {
  color: var(--teal-dark);
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
}

.grid, .lift-grid { display: grid; gap: 12px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lift-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lift-grid.detailed { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.lift-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lift-card legend {
  padding: 0 6px;
  color: var(--teal-dark);
  font-size: 0.86rem;
  font-weight: 900;
}

.lift-card label { font-size: 0.78rem; }

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #34413c;
  font-size: 0.88rem;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(17, 123, 115, 0.12);
}

.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}
button:active { transform: translateY(1px); }

.primary {
  background: var(--teal);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
}
.primary:hover { background: var(--teal-dark); }

.ghost, .tab {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 700;
}
.ghost:hover, .tab:hover { border-color: #b9c7c0; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.eyebrow {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.35rem);
  line-height: 1.08;
  margin-top: 4px;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
  display: grid;
  align-content: space-between;
}
.metric span { color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.metric strong { font-size: 1.5rem; }

.visual-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.visual-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  min-width: 0;
}

.block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

h3 { font-size: 1rem; }
.block-header span {
  border-radius: 999px;
  background: #edf5f3;
  color: var(--teal-dark);
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 900;
}

canvas { display: block; width: 100%; height: 220px; }

.macro-bars { display: grid; gap: 13px; margin-top: 18px; }
.macro { display: grid; gap: 7px; }
.macro-label {
  display: flex;
  justify-content: space-between;
  color: #34413c;
  font-size: 0.86rem;
  font-weight: 800;
}
.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e9eeeb;
  overflow: hidden;
}
.bar-fill { height: 100%; border-radius: inherit; }

.program-summary { margin-top: 14px; }
.output-group.compact {
  background: linear-gradient(135deg, rgba(17, 123, 115, 0.08), rgba(201, 130, 31, 0.08)), #fff;
}
.source-note {
  margin-top: 6px;
  color: var(--muted) !important;
  font-size: 0.86rem;
}


.program-catalog {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.program-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 7px;
  min-height: 128px;
}

.program-card.active {
  border-color: var(--teal);
  background: #f3fbf8;
}

.program-card strong {
  color: var(--teal-dark);
  font-size: 0.92rem;
}

.program-card p {
  color: #34413c;
  font-size: 0.8rem;
  line-height: 1.45;
}

.program-card span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.source-note a {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.source-note a:hover { text-decoration: underline; }
.tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  overflow-x: auto;
}
.tab { min-height: 38px; white-space: nowrap; }
.tab.active { color: #fff; background: #22332d; border-color: #22332d; }
.tab-panel { display: none; padding-top: 16px; }
.tab-panel.active { display: block; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
  background: #fff;
}

th, td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #52605a;
}
td { line-height: 1.5; }
tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; }


.week-plan {
  display: grid;
  gap: 14px;
}

.week-toolbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.week-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 900;
  white-space: nowrap;
}

.week-chip.active {
  border-color: #22332d;
  background: #22332d;
  color: #fff;
}

.week-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px 16px;
}

.week-summary div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.week-summary span {
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.week-summary strong {
  font-size: 1.15rem;
}

.week-summary p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}


.interval-advice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 5px;
}

.interval-advice strong {
  font-size: 0.9rem;
}

.interval-advice p {
  color: #43504b;
  font-size: 0.9rem;
  line-height: 1.55;
}
.day-list {
  display: grid;
  gap: 12px;
}

.day-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.day-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.day-header h4 {
  margin: 0;
  font-size: 1rem;
}

.day-header span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}


.day-header div {
  display: grid;
  gap: 3px;
}

.day-header div > span {
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}


.training-feedback {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.training-feedback label {
  font-size: 0.78rem;
}

.training-feedback select {
  min-height: 38px;
  padding: 7px 10px;
}

.training-feedback p {
  color: #43504b;
  font-size: 0.88rem;
  line-height: 1.55;
}

.day-block[data-feedback-status="lowEnergy"] .training-feedback,
.day-block[data-feedback-status="missedLoad"] .training-feedback {
  background: #fff9ef;
}

.day-block[data-feedback-status="skipped"] .training-feedback {
  background: #f4f6f8;
}

.day-block[data-feedback-status="tooEasy"] .training-feedback {
  background: #f3fbf8;
}
.exercise-table-wrap {
  overflow-x: auto;
}

.exercise-table {
  min-width: 980px;
  table-layout: fixed;
}

.exercise-table th {
  text-transform: none;
  letter-spacing: 0;
}

.exercise-table th:nth-child(1),
.exercise-table td:nth-child(1) { width: 14%; }

.exercise-table th:nth-child(2),
.exercise-table td:nth-child(2) { width: 13%; }

.exercise-table th:nth-child(3),
.exercise-table td:nth-child(3),
.exercise-table th:nth-child(4),
.exercise-table td:nth-child(4),
.exercise-table th:nth-child(5),
.exercise-table td:nth-child(5) { width: 10%; }

.exercise-table th:nth-child(6),
.exercise-table td:nth-child(6) { width: 28%; }

.exercise-table th:nth-child(7),
.exercise-table td:nth-child(7) { width: 15%; }

.exercise-table td {
  color: #34413c;
  font-size: 0.92rem;
}

.exercise-table td strong {
  color: var(--ink);
}
.exercise-list {
  display: grid;
}

.exercise-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.05fr) minmax(100px, 0.55fr) minmax(280px, 1.45fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.exercise-row:last-child { border-bottom: 0; }

.exercise-main {
  display: grid;
  gap: 5px;
}

.exercise-main strong {
  font-size: 1rem;
}

.exercise-main span,
.exercise-load {
  color: #34413c;
  font-weight: 800;
}

.exercise-intensity {
  color: #34413c;
  line-height: 1.55;
}

.exercise-row p {
  grid-column: 1 / -1;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}
.rich-output { display: grid; gap: 14px; }
.output-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
.output-group h4 { margin: 0 0 8px; font-size: 0.98rem; }
.output-group p, .output-group li { color: #43504b; line-height: 1.65; }
.output-group ul { margin: 8px 0 0; padding-left: 18px; }
.output-group strong {
  color: var(--ink);
}

.output-group .source-note {
  display: block;
}
.agent-waiting {
  display: grid;
  gap: 12px;
}

.agent-progress-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.agent-progress-title h4 { margin: 0; }

.agent-progress-title span {
  border-radius: 999px;
  background: #edf5f3;
  color: var(--teal-dark);
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.agent-progress {
  height: 12px;
  border-radius: 999px;
  background: #e9eeeb;
  overflow: hidden;
}

.agent-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 500ms ease;
}

.agent-progress-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .input-panel { position: static; max-height: none; }
}

@media (max-width: 760px) {
  .shell { padding: 12px; }
  .workspace { min-height: auto; }
  .input-panel, .output-panel { padding: 16px; }
  .two, .lift-grid, .lift-grid.detailed, .metrics, .visual-row { grid-template-columns: 1fr; }
  .lift-card { grid-template-columns: 1fr; }
  .topbar { align-items: center; }
  .week-summary { align-items: start; flex-direction: column; }
  .week-summary div { align-items: start; flex-direction: column; gap: 3px; }
  .exercise-row { grid-template-columns: 1fr; gap: 8px; }
  .exercise-row p { margin-top: 0; }
  .agent-progress-meta { grid-template-columns: 1fr; }
  .program-catalog { grid-template-columns: 1fr; }
  .training-feedback { grid-template-columns: 1fr; }
  h2 { font-size: 1.45rem; }
}


.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 35, 31, 0.46);
}

.modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.inline-check input {
  width: auto;
}

.settings-status {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  padding: 10px 12px;
  line-height: 1.45;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.provider-badge {
  border-radius: 999px;
  background: #edf5f3;
  color: var(--teal-dark);
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 900;
}

.provider-badge[data-provider="deepseek"] {
  background: #edf2fa;
  color: var(--blue);
}

.provider-badge[data-provider="openai"] {
  background: #f8f1e5;
  color: var(--amber);
}






