/* ====== 运动页 (exercises) ====== */

.exercise-section {
  max-width: 100%;
}

.exercise-section .section-head {
  margin-bottom: 18px;
}

/* --- 统计卡片 --- */
.ex-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.ex-stat {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  min-width: 0;
}

.ex-stat-num {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  overflow-wrap: break-word;
}

.ex-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

/* --- 类型卡片 --- */
.ex-type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.ex-type-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.ex-type-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.ex-type-dot,
.ex-item-type-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ex-type-nums {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 6px;
}

.ex-type-count {
  font-size: 13px;
  color: var(--text-soft);
}

.ex-type-km {
  font-size: 14px;
  font-weight: 600;
  color: var(--type-color, var(--accent));
}

/* --- 内容块 --- */
.ex-block {
  margin-bottom: 26px;
}

.ex-block-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

/* --- 运动日历热力图 --- */
.ex-heat {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 13px);
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 0;
}

.ex-heat .h-cell {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  font-size: 0;
}

.ex-heat .l0 { background: var(--line-soft); }
.ex-heat .l1 { background: #bde6c6; }
.ex-heat .l2 { background: #7fd493; }
.ex-heat .l3 { background: #45b45f; }
.ex-heat .l4 { background: #1f8f3b; }

body.theme-dark .ex-heat .l0 { background: #232118; }
body.theme-dark .ex-heat .l1 { background: #155b35; }
body.theme-dark .ex-heat .l2 { background: #20874a; }
body.theme-dark .ex-heat .l3 { background: #2aab58; }
body.theme-dark .ex-heat .l4 { background: #3dd06e; }

.ex-heat-legend {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-mute);
}

.ex-heat-legend .h-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  font-size: 0;
}

.ex-heat-tip {
  margin-left: 8px;
  font-size: 10px;
  opacity: 0.75;
}

/* --- 轨迹地图 --- */
.ex-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-soft);
}

.ex-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ex-legend-line {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.ex-map {
  width: 100%;
  height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-soft);
  z-index: 0;
}

.ex-map .leaflet-container {
  background: var(--bg-soft);
}

/* 地图提示框深色适配 */
.ex-map .leaflet-tooltip {
  font-size: 12px;
  border-radius: 4px;
}

/* --- 运动列表 --- */
.ex-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ex-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px dashed var(--line-soft);
  min-width: 0;
}

.ex-item:last-child {
  border-bottom: none;
}

.ex-item-date {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 52px;
  padding-right: 16px;
  border-right: 1px solid var(--line-soft);
}

.ex-item-day {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--type-color, var(--accent));
  line-height: 1.1;
}

.ex-item-mon {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

.ex-item-main {
  flex: 1;
  min-width: 0;
}

.ex-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex-wrap: wrap;
}

.ex-item-time {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 400;
  font-family: var(--mono);
}

.ex-item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-mute);
  flex-wrap: wrap;
}

.ex-item-sub .dot {
  opacity: 0.5;
}

/* --- 底部 --- */
.ex-updated {
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-mute);
  text-align: right;
}

/* --- 移动端适配 --- */
@media (max-width: 640px) {
  .ex-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .ex-stat {
    padding: 12px 8px;
  }
  .ex-stat-num {
    font-size: 19px;
  }
  .ex-stat-label {
    font-size: 11px;
  }
  .ex-type-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .ex-map {
    height: 340px;
  }
  .ex-item {
    gap: 12px;
    padding: 12px 14px;
  }
  .ex-item-date {
    width: 44px;
    padding-right: 12px;
  }
  .ex-item-day {
    font-size: 18px;
  }
}
