:root {
  color-scheme: light;
  --ink: #1f2723;
  --muted: #69746f;
  --line: #d8ded5;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --mint: #a8d9c2;
  --coral: #ee9b85;
  --gold: #e3bc5f;
  --blue: #9fc5e8;
  --rose: #efb0bc;
  --shadow: 0 20px 50px rgba(31, 39, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(168, 217, 194, 0.24), transparent 34%),
    linear-gradient(315deg, rgba(238, 155, 133, 0.2), transparent 32%),
    var(--paper);
  color: var(--ink);
  font-family:
    "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  min-height: 0;
}

.hero-copy,
.workspace {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(216, 222, 213, 0.8);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #48745e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.hero-stats div {
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f3ec;
}

.hero-stats strong {
  display: block;
  font-size: 2rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.92rem;
}

.workspace {
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: #f5f1e9;
}

.tab-button,
.primary-action,
.secondary-action,
.icon-button {
  border: 0;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.tab-button {
  min-width: max-content;
  padding: 12px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
}

.panel {
  display: none;
  padding: clamp(18px, 4vw, 34px);
}

.panel.active {
  display: block;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(168, 217, 194, 0.45);
  border-color: #6aa985;
}

.date-field {
  width: min(220px, 100%);
}

.strength-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.move-card {
  display: grid;
  grid-template-columns: minmax(170px, 32%) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  min-height: 230px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.move-figure {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 10px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 58%, rgba(168, 217, 194, 0.22), transparent 68%),
    #f8f6f0;
}

.move-figure img {
  display: block;
  width: 100%;
  max-width: 240px;
  height: 150px;
  object-fit: contain;
}

.move-content {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.move-card h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 1.32rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

.move-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
}

.move-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.move-inputs label {
  gap: 10px;
  font-size: 1rem;
}

.session-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.feeling-field {
  grid-column: 1 / -2;
  align-self: stretch;
}

.strength-feeling {
  margin-top: 18px;
}

.primary-action {
  min-height: 50px;
  padding: 13px 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.primary-action:hover,
.icon-button:hover,
.tab-button:hover {
  transform: translateY(-1px);
}

.strength-grid + .primary-action {
  margin-top: 18px;
}

.strength-feeling + .trend-card {
  margin-top: 18px;
}

.trend-card + .primary-action {
  margin-top: 18px;
}

.trend-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.trend-header h3 {
  margin: 0;
  font-size: 1.26rem;
  line-height: 1.25;
}

.trend-header span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.trend-chart {
  min-height: 230px;
}

.trend-svg {
  display: block;
  width: 100%;
  height: auto;
}

.trend-grid-lines line {
  stroke: var(--line);
  stroke-width: 1;
}

.axis-label,
.trend-points text {
  fill: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.trend-area {
  fill: rgba(227, 188, 95, 0.18);
}

.trend-line {
  fill: none;
  stroke: #d39530;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-points circle {
  fill: #1f2723;
  stroke: #fff;
  stroke-width: 3;
}

.empty-chart,
.single-point-chart {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 0;
  border-radius: 8px;
  background: #f8f6f0;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.single-point-chart {
  gap: 6px;
}

.single-point-chart strong {
  color: var(--ink);
  font-size: 2.8rem;
  line-height: 1;
}

.calendar-tools {
  align-items: center;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.secondary-action {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.secondary-action:hover {
  transform: translateY(-1px);
  background: #f8f5ee;
}

.month-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #f2efe8;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  min-height: 116px;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.calendar-day:nth-child(7n + 1) {
  border-top-left-radius: 8px;
}

.calendar-day:hover {
  background: #fbf6ed;
}

.calendar-day.outside {
  color: #a5aba7;
  background: #f8f7f2;
}

.calendar-day.selected {
  outline: 3px solid rgba(238, 155, 133, 0.42);
  outline-offset: -3px;
}

.date-number {
  display: block;
  font-weight: 900;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #18362a;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(31, 39, 35, 0.1);
}

.type-icon.strength {
  background: var(--gold);
}

.type-icon.cardio {
  background: var(--coral);
  color: #4b1e16;
}

.type-icon.yoga {
  background: var(--blue);
  color: #17324a;
}

.type-icon.pilates {
  background: var(--rose);
  color: #4d1d2a;
}

.day-detail {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f5ee;
}

.day-detail h3 {
  margin: 0 0 12px;
}

.entry-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-list li {
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.entry-feeling {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  max-width: min(320px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 860px) {
  .strength-grid,
  .session-form {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .panel-header {
    align-items: start;
    flex-direction: column;
  }

  .session-form {
    align-items: stretch;
  }

  .feeling-field {
    grid-column: 1;
  }

  .trend-header {
    align-items: start;
    flex-direction: column;
  }

  .trend-header span {
    white-space: normal;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero-copy {
    padding: 24px;
  }

  .hero-stats,
  .move-card,
  .move-inputs {
    grid-template-columns: 1fr;
  }

  .move-card {
    gap: 18px;
    padding: 18px;
  }

  .move-card h3 {
    font-size: 1.18rem;
  }

  .move-figure img {
    height: 132px;
  }

  .calendar-day {
    min-height: 86px;
    padding: 7px;
  }

  .type-icon {
    width: 24px;
    height: 24px;
    font-size: 0.72rem;
  }
}
