/* ===== 设计变量 ===== */
:root {
  --green: #00B894;
  --green-light: #E8F5F1;
  --green-mid: #00A882;
  --black: #0D0D0D;
  --gray-1: #1A1A1A;
  --gray-2: #555555;
  --gray-3: #999999;
  --gray-4: #CCCCCC;
  --gray-5: #F2F2F2;
  --white: #FFFFFF;
  --bg: #F7F7F7;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-strong: 0 4px 24px rgba(0,0,0,0.12);

  /* 运动类型色彩 */
  --type-aerobic: #00B894;
  --type-aerobic-light: #E8F5F1;
  --type-strength: #E17055;
  --type-strength-light: #FDF0ED;
  --type-stretch: #6C5CE7;
  --type-stretch-light: #F0EEFF;
}

/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Noto Sans SC', 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--black);
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input { font-family: inherit; border: none; outline: none; background: none; }

/* ===== 应用容器 ===== */
#app {
  position: relative;
  width: 100%;
  height: 100vh;
  max-width: 390px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

/* ===== 页面 ===== */
.page {
  position: absolute;
  inset: 0;
  bottom: 64px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.page-inner {
  padding: 0 24px 32px;
  min-height: 100%;
}

/* ===== 今天页 ===== */
.today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 56px;
  padding-bottom: 16px;
}

.welcome-greeting {
  font-size: 13px;
  color: var(--gray-3);
  margin-bottom: 2px;
}

.welcome-name {
  font-size: 24px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.02em;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-5);
  color: var(--gray-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.avatar-btn:active { transform: scale(0.92); }

/* 日期导航 */
.date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
}

.date-arrow {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-3);
  border-radius: 8px;
  transition: background 0.15s;
}

.date-arrow:active {
  background: var(--gray-5);
}

.date-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--black);
}

.date-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
  background: var(--green-light);
  padding: 2px 8px;
  border-radius: 6px;
}

.date-tag.other {
  color: var(--gray-3);
  background: var(--gray-5);
}

/* 圆环 Swiper 卡片 */
.ring-swiper {
  width: 100%;
  margin: 8px 0 20px;
  overflow: visible;
}

.ring-swiper .swiper-wrapper {
  align-items: center;
}

/* Swiper cards effect 容器需要固定高度 */
.ring-swiper.swiper-cards {
  overflow: visible;
}

.ring-swiper .swiper-slide {
  border-radius: 20px;
  overflow: hidden;
}

.ring-slide {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  width: 340px;
  max-width: calc(100vw - 50px);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  border: 1.5px solid transparent;
}

.ring-slide.swiper-slide-active {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border-color: var(--green-light);
}

/* 非活跃卡片稍微变暗 */
.ring-slide:not(.swiper-slide-active) {
  filter: brightness(0.96);
}

.ring-card-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 22px;
}

/* 当前卡片内：大圆环 */
.rc-ring {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.rc-ring .ring-svg {
  width: 100%;
  height: 100%;
}

.rc-ring .ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rc-ring .ring-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.03em;
  line-height: 1;
}

.rc-ring .ring-total {
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-3);
}

.rc-ring .ring-label {
  font-size: 11px;
  color: var(--gray-3);
  margin-top: 2px;
}

/* 后方卡片内：小圆环 */
.rc-ring-mini {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.rc-ring-svg {
  width: 100%;
  height: 100%;
}

.rc-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
}

.rc-ring-total {
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-3);
}

.rc-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rc-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-2);
}

.rc-status {
  font-size: 12px;
  color: var(--gray-3);
}

/* 进度环区域（仅进度环数值用） */
.ring-info-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.ring-info-sub {
  font-size: 13px;
  color: var(--gray-3);
}

/* 任务列表 */
.task-list {
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.task-row.tappable {
  cursor: pointer;
}

.task-row.tappable:active {
  transform: scale(0.98);
}

/* 类型图标徽章 */
.task-type-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.task-type-badge.aerobic {
  background: var(--type-aerobic-light);
  color: var(--type-aerobic);
}

.task-type-badge.strength {
  background: var(--type-strength-light);
  color: var(--type-strength);
}

.task-type-badge.stretch {
  background: var(--type-stretch-light);
  color: var(--type-stretch);
}

.task-row.done .task-type-badge {
  opacity: 0.45;
}

.task-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.task-row-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-1);
}

.task-row.done .task-row-name {
  color: var(--gray-4);
  text-decoration: line-through;
}

.task-row-sub {
  font-size: 12px;
  color: var(--gray-3);
}

.task-row.done .task-row-sub {
  color: var(--gray-4);
}

.task-check-icon {
  flex-shrink: 0;
}

.task-check-icon.done {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.task-check-icon.pending {
  width: 18px;
  height: 18px;
  color: var(--gray-4);
}

.task-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-4);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.15s;
}

.task-action-btn:active {
  background: var(--gray-5);
}

/* 任务操作菜单 */
.task-menu {
  position: absolute;
  right: 24px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-strong);
  padding: 6px;
  z-index: 50;
  min-width: 100px;
}

.task-menu.hidden { display: none; }

.task-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--gray-1);
  border-radius: 6px;
  transition: background 0.15s;
}

.task-menu-item:active { background: var(--gray-5); }

.task-menu-item.danger { color: #E74C3C; }

/* AI 提示条 */
.ai-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--green-light);
  font-size: 13px;
  color: var(--gray-2);
  line-height: 1.5;
}

.ai-hint i {
  color: var(--green);
  margin-top: 1px;
  flex-shrink: 0;
}

/* ===== 计划页 ===== */
.plan-page-inner {
  padding: 0 0 100px;
  position: relative;
}

.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 56px 24px 16px;
}

.plan-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.02em;
}

/* 周/月 tab */
.plan-view-tabs {
  display: flex;
  background: var(--gray-5);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.plan-view-tab {
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-view-tab.active {
  background: var(--white);
  color: var(--black);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* 周/月视图区 */
.pv-week, .pv-month { }
.pv-week.hidden, .pv-month.hidden { display: none; }

/* 周/月导航 */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  margin-bottom: 16px;
}

.week-nav-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-2);
}

.week-nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-3);
  border-radius: 8px;
  transition: background 0.15s;
}

.week-nav-btn:active { background: var(--gray-5); }

/* 7格日期选择器 */
.week-days {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.week-days::-webkit-scrollbar { display: none; }

.week-day-cell {
  flex: 1;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.week-day-cell:active { background: var(--gray-5); }

.week-day-cell.selected {
  background: var(--black);
}

.week-day-cell.today:not(.selected) {
  background: var(--green-light);
}

.week-day-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-3);
  text-transform: uppercase;
}

.week-day-cell.selected .week-day-name {
  color: rgba(255,255,255,0.7);
}

.week-day-cell.today:not(.selected) .week-day-name {
  color: var(--green);
}

.week-day-num {
  font-size: 16px;
  font-weight: 600;
  color: var(--black);
  line-height: 1;
}

.week-day-cell.selected .week-day-num {
  color: var(--white);
}

.week-day-cell.today:not(.selected) .week-day-num {
  color: var(--green);
}

/* 训练类型小点 */
.week-day-dots {
  display: flex;
  gap: 2px;
  height: 5px;
  align-items: center;
  justify-content: center;
}

.week-day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.week-day-dot.aerobic { background: var(--type-aerobic); }
.week-day-dot.strength { background: var(--type-strength); }
.week-day-dot.stretch { background: var(--type-stretch); }

.week-day-cell.selected .week-day-dot {
  background: rgba(255,255,255,0.6);
}

/* 统计条 */
.week-stats {
  display: flex;
  gap: 10px;
  padding: 0 24px;
  margin-bottom: 20px;
}

.week-stat-item {
  flex: 1;
  background: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.week-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
  line-height: 1;
}

.week-stat-val.green { color: var(--green); }

.week-stat-label {
  font-size: 10px;
  color: var(--gray-3);
  margin-top: 4px;
}

/* 选中日标签 */
.plan-day-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-3);
  padding: 0 24px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* 训练项列表 */
.plan-items-list {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
}

.plan-item-row:active { transform: scale(0.98); }

.plan-type-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plan-type-badge.aerobic {
  background: var(--type-aerobic-light);
  color: var(--type-aerobic);
}

.plan-type-badge.strength {
  background: var(--type-strength-light);
  color: var(--type-strength);
}

.plan-type-badge.stretch {
  background: var(--type-stretch-light);
  color: var(--type-stretch);
}

.plan-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plan-item-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-1);
}

.plan-item-sub {
  font-size: 12px;
  color: var(--gray-3);
}

.plan-item-menu-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-4);
  border-radius: 50%;
  transition: background 0.15s;
  flex-shrink: 0;
}

.plan-item-menu-btn:active { background: var(--gray-5); }

/* 空状态 */
.plan-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  color: var(--gray-4);
  font-size: 14px;
  text-align: center;
}

.plan-empty.hidden { display: none; }

.plan-empty-sub {
  font-size: 12px;
  color: var(--gray-4);
}

/* FAB */
.plan-fab {
  position: fixed;
  right: max(24px, calc(50vw - 390px/2 + 24px));
  bottom: 80px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: transform 0.15s, opacity 0.2s;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
}

.plan-fab.visible {
  opacity: 1;
  pointer-events: auto;
}

.plan-fab:active { transform: scale(0.92); }

/* 月历 */
.month-cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 24px;
  margin-bottom: 6px;
}

.month-cal-head span {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-4);
  text-align: center;
  padding: 4px 0;
}

.month-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0 24px;
  margin-bottom: 20px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.cal-cell:active { background: var(--gray-5); }

.cal-cell.empty { pointer-events: none; }

.cal-cell.selected { background: var(--black); }

.cal-cell.today:not(.selected) { background: var(--green-light); }

.cal-cell-num {
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
  line-height: 1;
}

.cal-cell.other-month .cal-cell-num { color: var(--gray-4); }

.cal-cell.selected .cal-cell-num { color: var(--white); }

.cal-cell.today:not(.selected) .cal-cell-num { color: var(--green); font-weight: 700; }

.cal-cell-dots {
  display: flex;
  gap: 2px;
  height: 4px;
}

.cal-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
}

.cal-dot.aerobic { background: var(--type-aerobic); }
.cal-dot.strength { background: var(--type-strength); }
.cal-dot.stretch { background: var(--type-stretch); }

.cal-cell.selected .cal-dot { background: rgba(255,255,255,0.6); }

/* 月历底部日详情 */
.month-day-detail {
  border-top: 1px solid var(--gray-5);
  padding-top: 16px;
}

/* ===== 创建计划弹层 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.2s;
}

.modal-overlay.hidden { display: none; }

.modal-sheet {
  width: 100%;
  max-width: 390px;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 16px 24px 32px;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--gray-4);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-3);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: block;
}

.form-input {
  width: 100%;
  font-size: 15px;
  color: var(--black);
  background: var(--gray-5);
  border-radius: 10px;
  padding: 12px 14px;
}

.form-input::placeholder { color: var(--gray-4); }

.type-picker {
  display: flex;
  gap: 8px;
}

.type-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  border-radius: 10px;
  background: var(--gray-5);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-2);
  cursor: pointer;
  transition: all 0.15s;
}

.type-option.active[data-type="aerobic"] {
  background: var(--type-aerobic-light);
  color: var(--type-aerobic);
}

.type-option.active[data-type="strength"] {
  background: var(--type-strength-light);
  color: var(--type-strength);
}

.type-option.active[data-type="stretch"] {
  background: var(--type-stretch-light);
  color: var(--type-stretch);
}

.type-option.active {
  font-weight: 600;
}

.type-option i {
  flex-shrink: 0;
}

.day-picker {
  display: flex;
  gap: 6px;
}

.day-chip {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gray-5);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-2);
  cursor: pointer;
  transition: all 0.15s;
}

.day-chip.active {
  background: var(--black);
  color: var(--white);
}

.modal-submit {
  width: 100%;
  padding: 14px;
  background: var(--green);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  margin-top: 8px;
  transition: transform 0.15s;
}

.modal-submit:active { transform: scale(0.98); }

.modal-cancel {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  color: var(--gray-3);
  margin-top: 4px;
}

/* AI 入口卡片（今天页底部） */
.ai-entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--green-light);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.ai-entry-card:active { transform: scale(0.98); }

.ai-entry-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-entry-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-entry-text { display: flex; flex-direction: column; gap: 2px; }

.ai-entry-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
}

.ai-entry-sub {
  font-size: 12px;
  color: var(--gray-3);
}

/* AI 遮罩 + 浮层 */
.ai-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
  transition: opacity 0.3s ease;
  max-width: 390px;
  margin: 0 auto;
}

.ai-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* AI 全屏浮层 - 从右向左滑入 */
.ai-overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  max-width: 390px;
  margin: 0 auto;
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
}

.ai-overlay.hidden {
  transform: translateX(100%);
  pointer-events: none;
  box-shadow: none;
}

.ai-overlay-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 24px;
  overflow: hidden;
}

.ai-overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 56px;
  padding-bottom: 24px;
  flex-shrink: 0;
}

.ai-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-5);
  color: var(--gray-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.ai-close-btn:active { background: var(--gray-4); }

.chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

.ai-input-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 max(16px, env(safe-area-inset-bottom));
  background: var(--bg);
  flex-shrink: 0;
}

/* ===== AI 页文字样式 ===== */
.ai-page-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.02em;
}

.ai-page-sub {
  font-size: 13px;
  color: var(--gray-3);
  margin-top: 4px;
}

.chat-bubble {
  max-width: 85%;
  padding: 13px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
}

.ai-bubble {
  background: var(--white);
  color: var(--gray-1);
  border-bottom-left-radius: 6px;
  box-shadow: var(--shadow);
  align-self: flex-start;
}

.user-bubble {
  background: var(--black);
  color: var(--white);
  border-bottom-right-radius: 6px;
  align-self: flex-end;
}

.quick-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.quick-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-2);
  background: var(--white);
  border: 1px solid var(--gray-5);
  padding: 8px 14px;
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
}

.quick-btn:active { background: var(--gray-5); }

.input-field {
  flex: 1;
  font-size: 14px;
  color: var(--black);
  background: var(--gray-5);
  border-radius: 20px;
  padding: 10px 16px;
}

.input-field::placeholder { color: var(--gray-4); }

.input-send {
  width: 36px;
  height: 36px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.input-send:active { transform: scale(0.92); }

/* ===== 数据页 ===== */
.data-page-inner {
  padding: 0 0 80px;
}

.data-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 56px 24px 16px;
}

.data-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--black);
  letter-spacing: -0.02em;
}

.data-period-tabs {
  display: flex;
  background: var(--gray-5);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.data-period-tab {
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.data-period-tab.active {
  background: var(--white);
  color: var(--black);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* 总运动天数 Hero */
.data-hero-main {
  margin: 0 24px 24px;
  background: var(--green);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.data-hero-main::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.data-hero-main::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.data-hero-main-num {
  font-size: 56px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.data-hero-main-label {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  position: relative;
  z-index: 1;
}

.data-hero-main-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

/* 通用区块 */
.data-section {
  margin-bottom: 24px;
  padding: 0 24px;
}

.data-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 12px;
}

/* 类型分布 */
.type-dist-wrap {
  background: var(--white);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
}

.type-dist-chart {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.type-dist-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  text-align: center;
  line-height: 1.3;
  pointer-events: none;
}

.type-dist-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-info { flex: 1; }

.legend-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-1);
}

.legend-pct {
  font-size: 11px;
  color: var(--gray-3);
  margin-top: 1px;
}

.legend-bar-bg {
  height: 3px;
  background: var(--gray-5);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.legend-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* 柱状图 */
.bar-chart-wrap {
  background: var(--white);
  border-radius: 14px 14px 0 0;
  padding: 16px 16px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  overflow: hidden;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--green-light);
  transition: height 0.5s ease;
  min-height: 3px;
  position: relative;
}

.bar-fill.current-week {
  background: var(--green);
}

.bar-val {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-3);
  margin-bottom: 4px;
}

.bar-val.current-week { color: var(--green); }

.bar-chart-x {
  background: var(--white);
  border-radius: 0 0 14px 14px;
  padding: 6px 16px 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  display: flex;
  gap: 6px;
  margin-bottom: 0;
}

.bar-x-label {
  flex: 1;
  font-size: 10px;
  color: var(--gray-4);
  text-align: center;
  font-weight: 500;
}

.bar-x-label.current-week { color: var(--green); font-weight: 600; }

/* ===== Tab 导航 ===== */
.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--white);
  border-top: 1px solid var(--gray-5);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 0;
}

.tab-icon-el {
  color: var(--gray-4);
  transition: color 0.15s;
}

.tab-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-4);
  transition: color 0.15s;
}

.tab-item.active .tab-icon-el,
.tab-item.active .tab-label {
  color: var(--black);
}

/* ===== 个人信息弹层 ===== */
.profile-avatar-area {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gray-5);
  color: var(--gray-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 日期切换过渡（内容区淡入） ===== */
.content-fade-in {
  animation: contentFadeIn 0.3s ease;
}

@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
