/* ========================================
   phone-sport.css - 查手机运动页面样式
   角色视角的运动健康数据（步数 + 运动记录）
   配色沿用项目奶白色极简风
   ======================================== */

/* ===== 全屏容器 ===== */
.ps-screen {
  position: absolute;
  inset: 0;
  max-width: 100%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--color-bg, #f7f5f0);
  transform: translateX(100%);
  /* 关闭后彻底隐藏，避免在某些视口下从右侧露出 */
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s linear 0.32s;
  overflow: hidden;
  overflow-x: hidden;
  box-sizing: border-box;
  font-family: var(--font-family, -apple-system, sans-serif);
}
.ps-screen.is-active {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s;
}

/* ===== 列表视图 / 详情视图 ===== */
.ps-list-view,
.ps-detail-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--color-bg, #f7f5f0);
}
.ps-list-view {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ps-list-view.is-hidden { transform: translateX(-28%); }
.ps-detail-view {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}
.ps-detail-view.is-active { transform: translateX(0); }

/* ===== 顶部导航栏 ===== */
.ps-nav,
.ps-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 8px;
  flex-shrink: 0;
  background: var(--color-card, #fffdf8);
  border-bottom: 1px solid var(--color-border, #ece8e0);
}
.ps-nav__back,
.ps-detail-nav__back,
.ps-nav__action {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--color-text, #2c2a26);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}
.ps-nav__back svg,
.ps-detail-nav__back svg,
.ps-nav__action svg { width: 22px; height: 22px; }
.ps-nav__back:active,
.ps-detail-nav__back:active,
.ps-nav__action:active { background: var(--color-card-muted, #f0ece3); }
.ps-nav__title,
.ps-detail-nav__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text, #2c2a26);
}
.ps-nav__right,
.ps-detail-nav__right {
  min-width: 40px;
  display: flex;
  justify-content: flex-end;
}

/* ===== 角色身份提示条 ===== */
.ps-owner-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-shrink: 0;
  background: var(--color-card, #fffdf8);
  border-bottom: 1px solid var(--color-border, #ece8e0);
}
.ps-owner-bar__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-card-muted, #f0ece3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-secondary, #8a857c);
  flex-shrink: 0;
}
.ps-owner-bar__avatar img { width: 100%; height: 100%; object-fit: cover; }
.ps-owner-bar__info { display: flex; align-items: baseline; gap: 4px; }
.ps-owner-bar__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #2c2a26);
}
.ps-owner-bar__hint {
  font-size: 13px;
  color: var(--color-text-secondary, #8a857c);
}

/* ===== 列表主体（可滚动） ===== */
.ps-list-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

/* ===== 今日步数大卡片 ===== */
.ps-today {
  background: var(--color-card, #fffdf8);
  border: 1px solid var(--color-border, #ece8e0);
  border-radius: 20px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

/* 环形进度 */
.ps-today__ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 20px;
}
.ps-today__ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ps-today__ring-bg {
  fill: none;
  stroke: var(--color-card-muted, #f0ece3);
  stroke-width: 10;
}
.ps-today__ring-fg {
  fill: none;
  stroke: #d9a86c;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
.ps-today__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ps-today__steps {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-text, #2c2a26);
  line-height: 1;
}
.ps-today__steps-label {
  font-size: 13px;
  color: var(--color-text-secondary, #8a857c);
  margin-top: 4px;
}

/* 今日数据三列 */
.ps-today__stats {
  display: flex;
  width: 100%;
  border-top: 1px solid var(--color-border, #ece8e0);
  padding-top: 16px;
}
.ps-today__stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.ps-today__stat + .ps-today__stat {
  border-left: 1px solid var(--color-border, #ece8e0);
}
.ps-today__stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text, #2c2a26);
}
.ps-today__stat-label {
  font-size: 11px;
  color: var(--color-text-secondary, #8a857c);
}

/* 今日心情/状态 */
.ps-today__mood {
  margin-top: 16px;
  width: 100%;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary, #8a857c);
  background: var(--color-card-muted, #f0ece3);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
}
.ps-today__mood:empty { display: none; }

/* ===== 区块标题 ===== */
.ps-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary, #8a857c);
  margin: 24px 4px 12px;
}

/* ===== 运动记录列表 ===== */
.ps-records {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ps-record {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-card, #fffdf8);
  border: 1px solid var(--color-border, #ece8e0);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.ps-record:active {
  transform: scale(0.985);
  background: var(--color-card-muted, #f0ece3);
}
.ps-record__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.ps-record__icon svg { width: 24px; height: 24px; }

/* 运动类型配色 */
.ps-ic--c1 { background: linear-gradient(135deg, #e0b074, #d9a86c); }
.ps-ic--c2 { background: linear-gradient(135deg, #a8c4a2, #8fb389); }
.ps-ic--c3 { background: linear-gradient(135deg, #9fb8d4, #7fa0c4); }
.ps-ic--c4 { background: linear-gradient(135deg, #d4a0a8, #c48f9c); }
.ps-ic--c5 { background: linear-gradient(135deg, #c0a8d4, #a88fc4); }
.ps-ic--c6 { background: linear-gradient(135deg, #d4c09f, #c4b07f); }

.ps-record__body { flex: 1; min-width: 0; }
.ps-record__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ps-record__type {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #2c2a26);
}
.ps-record__time {
  font-size: 12px;
  color: var(--color-text-secondary, #8a857c);
  flex-shrink: 0;
}
.ps-record__sub {
  font-size: 13px;
  color: var(--color-text-secondary, #8a857c);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 加载 / 空状态 ===== */
.ps-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 50px 0;
}
.ps-loading.is-hidden { display: none; }
.ps-loading__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-card-muted, #f0ece3);
  border-top-color: #d9a86c;
  border-radius: 50%;
  animation: ps-spin 0.8s linear infinite;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }
.ps-loading__text {
  font-size: 14px;
  color: var(--color-text-secondary, #8a857c);
}
.ps-empty {
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 50px 0;
}
.ps-empty__icon {
  width: 48px;
  height: 48px;
  color: var(--color-text-secondary, #b5afa4);
}
.ps-empty__text {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text, #2c2a26);
}
.ps-empty__hint {
  font-size: 13px;
  color: var(--color-text-secondary, #8a857c);
}

/* ===== 详情视图 ===== */
.ps-detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 16px;
}

/* 详情头部 */
.ps-detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.ps-detail-head__icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.ps-detail-head__icon svg { width: 32px; height: 32px; }
.ps-detail-head__info { flex: 1; min-width: 0; }
.ps-detail-head__type {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text, #2c2a26);
  margin: 0 0 4px;
}
.ps-detail-head__meta {
  font-size: 13px;
  color: var(--color-text-secondary, #8a857c);
}

/* 数据网格 */
.ps-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.ps-detail-cell {
  background: var(--color-card, #fffdf8);
  border: 1px solid var(--color-border, #ece8e0);
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ps-detail-cell__val {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text, #2c2a26);
  line-height: 1.1;
}
.ps-detail-cell__label {
  font-size: 12px;
  color: var(--color-text-secondary, #8a857c);
}

/* 运动感受 */
.ps-detail-note-wrap {
  background: var(--color-card, #fffdf8);
  border: 1px solid var(--color-border, #ece8e0);
  border-radius: 14px;
  padding: 16px;
}
.ps-detail-note-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary, #8a857c);
  margin-bottom: 8px;
}
.ps-detail-note {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text, #2c2a26);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 详情底部只读提示 */
.ps-detail-footer {
  flex-shrink: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--color-card, #fffdf8);
  border-top: 1px solid var(--color-border, #ece8e0);
}
.ps-detail-footer__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-secondary, #8a857c);
}
.ps-detail-footer__hint svg { flex-shrink: 0; }

/* ===== Toast ===== */
.ps-toast {
  position: absolute;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(44, 42, 38, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}
.ps-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   底色白化覆盖（去除米色/灰色调）
   固定色值，避免项目 --color-* 变量带米色
   ======================================== */
.ps-screen,
.ps-list-view,
.ps-detail-view {
  background: #ffffff;
}
.ps-nav,
.ps-detail-nav,
.ps-owner-bar,
.ps-today,
.ps-record,
.ps-detail-cell,
.ps-detail-note-wrap,
.ps-detail-footer {
  background: #ffffff;
  border-color: #efefef;
}
.ps-nav,
.ps-detail-nav,
.ps-owner-bar {
  border-bottom-color: #efefef;
}
.ps-detail-footer {
  border-top-color: #efefef;
}
.ps-today__stats {
  border-top-color: #efefef;
}
.ps-today__stat + .ps-today__stat {
  border-left-color: #efefef;
}
.ps-today__ring-bg {
  stroke: #f0f0f0;
}
.ps-today__mood {
  background: #f6f6f6;
}
.ps-record:active {
  background: #f5f5f5;
}
.ps-nav__back:active,
.ps-detail-nav__back:active,
.ps-nav__action:active {
  background: #f0f0f0;
}
.ps-owner-bar__avatar {
  background: #f2f2f2;
}
.ps-loading__spinner {
  border-color: #f0f0f0;
  border-top-color: #d9a86c;
}
