:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #eef6f3;
  --text: #17201d;
  --muted: #64716b;
  --line: #dce4df;
  --primary: #0f766e;
  --primary-2: #0b5f59;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c2410c;
  --green: #15803d;
  --gray: #71717a;
  --shadow: 0 12px 32px rgba(20, 35, 30, 0.08);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 74px;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 34px);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

h1 {
  font-size: 22px;
  letter-spacing: 0;
}

h2 {
  font-size: 19px;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.view {
  margin: 0 auto;
  max-width: 1180px;
  padding: 18px clamp(14px, 4vw, 34px) 28px;
}

.tabbar {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  left: 0;
  position: fixed;
  right: 0;
  z-index: 6;
}

.tab-button {
  background: transparent;
  border: 0;
  color: var(--muted);
  min-height: 58px;
  padding: 8px 3px;
}

.tab-button.active {
  color: var(--primary);
  font-weight: 800;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.item-card,
.metric,
.calendar-cell,
.recommend-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 16px;
}

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

.metric {
  padding: 14px;
}

.metric .value {
  font-size: 27px;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 8px;
}

.metric .label {
  color: var(--muted);
  font-size: 12px;
}

.progress {
  background: #e5ece8;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress span {
  background: linear-gradient(90deg, var(--primary), #22a06b);
  display: block;
  height: 100%;
  min-width: 2px;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.mini-button,
.icon-button {
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 12px;
}

.primary-button {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--primary-2);
}

.secondary-button,
.ghost-button,
.mini-button {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}

.danger-button {
  background: #fff5f0;
  border: 1px solid #fed7c2;
  color: var(--red);
}

.mini-button {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 8px;
}

.icon-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  display: inline-flex;
  font-size: 22px;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.list {
  display: grid;
  gap: 10px;
}

.item-card {
  display: grid;
  gap: 9px;
  padding: 13px;
}

.row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.subtle {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  background: var(--surface-2);
  border-radius: 8px;
  color: #33514c;
  line-height: 1.55;
  padding: 10px;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 8px;
}

.badge.green {
  background: #e8f7ef;
  color: var(--green);
}

.badge.blue {
  background: #edf4ff;
  color: var(--blue);
}

.badge.amber {
  background: #fff7df;
  color: var(--amber);
}

.badge.red {
  background: #fff0eb;
  color: var(--red);
}

.badge.gray {
  background: #f1f1f3;
  color: var(--gray);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

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

textarea {
  resize: vertical;
}

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

.dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 560px;
  padding: 0;
  width: calc(100% - 28px);
}

.dialog::backdrop {
  background: rgba(15, 23, 20, 0.34);
}

.dialog-body {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.dialog-title,
.dialog-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.weekday-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 12px;
}

.weekday-field legend {
  color: var(--muted);
  font-size: 13px;
  padding: 0 5px;
}

.weekday-field label {
  align-items: center;
  color: var(--text);
  display: flex;
  flex-direction: row;
}

.weekday-field input {
  min-height: auto;
  width: auto;
}

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

.calendar-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

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

.calendar-cell.muted {
  opacity: 0.36;
}

.calendar-day {
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.event-dot {
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  margin-top: 4px;
  overflow: hidden;
  padding: 3px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-dot.onTime {
  background: var(--green);
}

.event-dot.late {
  background: var(--blue);
}

.event-dot.rescheduled {
  background: var(--gray);
}

.event-dot.noShow {
  background: var(--red);
}

.event-dot.coachCancel {
  background: #4b5563;
}

.event-dot.scheduled {
  background: var(--amber);
}

.week-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.week-row {
  display: grid;
  grid-template-columns: 88px 1fr;
}

.week-row + .week-row {
  border-top: 1px solid var(--line);
}

.week-date {
  background: #f0f5f2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 10px;
}

.week-events {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.recommend-row {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.recommend-score {
  align-items: center;
  display: flex;
  gap: 8px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.balance-log {
  border-left: 3px solid var(--primary);
  color: var(--muted);
  font-size: 12px;
  padding-left: 8px;
}

.ability-profile {
  align-items: center;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 180px 1fr;
  padding: 10px;
}

.ability-visual {
  align-items: center;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 30px;
}

.profile-tags span {
  background: #e8f7ef;
  border: 1px solid #cbeade;
  border-radius: 999px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  min-width: 72px;
  padding: 8px 10px;
  text-align: center;
}

.ability-radar {
  aspect-ratio: 1;
  display: block;
  height: 180px;
  width: 180px;
}

.ability-radar text {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.radar-ring {
  fill: none;
  stroke: #d9e4de;
  stroke-width: 1;
}

.radar-spoke {
  stroke: #e2e9e5;
  stroke-width: 1;
}

.radar-shape {
  fill: rgba(15, 118, 110, 0.24);
  stroke: var(--primary);
  stroke-linejoin: round;
  stroke-width: 2;
}

.radar-dots circle {
  fill: var(--primary);
  stroke: #ffffff;
  stroke-width: 1.5;
}

.ability-list {
  display: grid;
  gap: 7px;
  width: 100%;
}

.ability-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid #e7eee9;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 30px;
  padding: 6px 8px;
}

.ability-item span {
  color: var(--muted);
  font-size: 12px;
}

.ability-item strong {
  color: var(--primary);
  font-size: 14px;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
  }

  .grid.two,
  .grid.three,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .weekday-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-cell {
    min-height: 72px;
    padding: 5px;
  }

  .event-dot {
    font-size: 10px;
    padding: 2px 4px;
  }

  .ability-profile {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .ability-visual {
    width: 100%;
  }

  .ability-list {
    width: 100%;
  }

  .tab-button {
    font-size: 12px;
  }
}
