/* ==================== 阅读记录页面 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f7f4;
  min-height: 100vh;
  color: #333;
}

/* 顶部标题 */
.header {
  background: linear-gradient(135deg, #10b981 0%, #0d9488 100%);
  color: #fff;
  padding: 20px 20px 18px;
  text-align: center;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
  position: relative;
}
.header h1 { font-size: 22px; letter-spacing: 1px; }
.header p { font-size: 13px; opacity: 0.92; margin-top: 5px; }

.btn-back-topright {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 12px;
  transition: background 0.2s;
}
.btn-back-topright:hover { background: rgba(255,255,255,0.35); }

.page-body {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 今日进度 */
.today-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 16px;
}
.today-card__left { flex-shrink: 0; text-align: center; }
.today-card__label { font-size: 12px; color: #888; margin-bottom: 2px; }
.today-card__time { font-size: 22px; font-weight: 800; color: #0d9488; }
.today-card__right { flex: 1; }
.today-card__bar {
  height: 12px;
  background: #e8f3ee;
  border-radius: 8px;
  overflow: hidden;
}
.today-card__fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #10b981);
  border-radius: 8px;
  transition: width 0.5s;
}
.today-card__goal { font-size: 12px; color: #999; margin-top: 6px; }

/* 会话卡片 */
.session-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.05);
  text-align: center;
}
.session-start__icon { font-size: 52px; margin-bottom: 10px; }
.session-start__hint {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
  margin-bottom: 16px;
}
.session-start__hint .link { color: #0d9488; font-weight: 700; }
.btn-start {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  color: #fff;
  border: none;
  padding: 14px 40px;
  border-radius: 26px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(16, 185, 129, 0.45); }

/* 进行中 */
.session-timer {
  font-size: 42px;
  font-weight: 800;
  color: #0d9488;
  font-variant-numeric: tabular-nums;
}
.session-timer__sub { font-size: 13px; color: #aaa; margin-bottom: 12px; }
.session-progress {
  height: 12px;
  background: #e8f3ee;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}
.session-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #f59e0b);
  border-radius: 8px;
  transition: width 1s;
}
.session-done-banner {
  background: #fef3c7;
  color: #b45309;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.session-content { text-align: left; margin-bottom: 12px; }
.session-content__title { font-size: 13px; color: #888; margin-bottom: 8px; }
.session-content__list { display: flex; flex-direction: column; gap: 6px; }
.session-content__item {
  background: #f0f7f4;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: #444;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.session-content__item .b-name { font-weight: 700; color: #0d9488; }
.session-content__item .b-time { color: #999; flex-shrink: 0; }
.session-content__empty { font-size: 13px; color: #bbb; }
.session-manual { margin-bottom: 14px; }
.session-manual__input {
  width: 100%;
  border: 2px solid #e5f0eb;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
  font-family: inherit;
}
.session-manual__input:focus { border-color: #34d399; }
.btn-finish {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  padding: 13px 34px;
  border-radius: 26px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.3);
  transition: transform 0.15s;
}
.btn-finish:hover { transform: translateY(-2px); }

/* 本周统计 */
.week-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.05);
}
.week-card__title { font-size: 14px; font-weight: 700; color: #555; margin-bottom: 12px; }
.week-card__days { display: flex; gap: 6px; }
.week-day {
  flex: 1;
  background: #f4f8f6;
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.week-day--today { background: #d1fae5; }
.week-day__name { font-size: 12px; color: #888; margin-bottom: 4px; }
.week-day__name--today { color: #0d9488; font-weight: 700; }
.week-day__bar { height: 44px; border-radius: 6px; background: #e8f3ee; position: relative; overflow: hidden; }
.week-day__fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #34d399, #10b981);
  border-radius: 6px;
  transition: height 0.5s;
}
.week-day__min { font-size: 11px; color: #666; margin-top: 4px; font-weight: 600; }

/* 历史记录 */
.records-card {
  background: #fff;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.05);
}
.records-card__title { font-size: 14px; font-weight: 700; color: #555; margin-bottom: 12px; }
.records-card__list { display: flex; flex-direction: column; gap: 8px; }
.record-item {
  border: 2px solid #eef3f0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.record-item__head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.record-item__date { font-weight: 700; color: #444; }
.record-item__dur { color: #0d9488; font-weight: 800; }
.record-item__dur--done { color: #d97706; }
.record-item__books { color: #888; font-size: 12px; line-height: 1.6; }
.record-item__del {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  float: right;
}
.record-item__del:hover { color: #e74c3c; }
.records-empty { text-align: center; color: #bbb; font-size: 13px; padding: 12px 0; }

@media (max-width: 480px) {
  .session-timer { font-size: 34px; }
  .week-card__days { gap: 4px; }
  .btn-back-topright {
    position: static;
    transform: none;
    display: inline-block;
    margin-bottom: 8px;
  }
}

/* ==================== 视频录制 ==================== */
.video-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 4px 0 6px;
  cursor: pointer;
  user-select: none;
}
.video-opt input { display: none; }
.video-opt__switch {
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: #d5dbe7;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.video-opt__switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: left 0.2s;
}
.video-opt input:checked + .video-opt__switch { background: #ef4444; }
.video-opt input:checked + .video-opt__switch::after { left: 21px; }
.video-opt input:disabled + .video-opt__switch { opacity: 0.5; }
.video-opt__text { font-size: 14px; font-weight: 600; color: #444; }
.video-opt__note { font-size: 12px; color: #98a2b3; margin: 2px 0 10px; }

.session-video {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff5f5;
  border: 1px solid #ffd9d9;
}
.session-video--error { background: #fffaf0; border-color: #ffe3b3; }
.session-video__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.session-video__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c9ced9;
  flex-shrink: 0;
}
.session-video__dot.is-live {
  background: #ef4444;
  animation: lxRecBlink 1.2s infinite;
}
@keyframes lxRecBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.session-video__status { font-size: 14px; font-weight: 700; color: #b91c1c; }
.session-video--error .session-video__status { color: #b45309; }
.session-video__size { font-size: 12px; color: #9aa1ae; margin-left: auto; }
.session-video__preview {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 10px auto 0;
  border-radius: 12px;
  background: #1a1a1a;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.session-video__error { margin-top: 8px; font-size: 13px; color: #b45309; line-height: 1.6; }
.video-retry {
  margin-top: 8px;
  background: #fff;
  border: 1px solid #f0b46b;
  color: #b45309;
  border-radius: 12px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.video-retry:hover { background: #fff7ec; }
.session-video__hint { margin-top: 8px; font-size: 12px; color: #98a2b3; line-height: 1.6; }

.records-card__storage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #98a2b3;
  margin: -4px 0 10px;
}
.linkbtn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
}
.linkbtn:hover { text-decoration: underline; }

.record-item__video {
  margin-top: 8px;
  background: #fff5f5;
  border: 1px solid #ffd9d9;
  color: #b91c1c;
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.record-item__video:hover { background: #ffecec; }
.record-item__video.open { background: #ef4444; border-color: #ef4444; color: #fff; }
.record-item__videos { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.video-loading { font-size: 12px; color: #98a2b3; padding: 6px 2px; }
.video-seg {
  background: #fbfbfd;
  border: 1px solid #eef0f6;
  border-radius: 12px;
  padding: 8px 10px;
}
.video-seg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}
.video-seg__dl {
  background: #eef1ff;
  border: 1px solid #c9d2f5;
  color: #4a5cd4;
  border-radius: 10px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.video-seg__dl:hover { background: #dfe6ff; }
.video-seg__player { width: 100%; max-width: 420px; border-radius: 10px; background: #000; display: block; }
.video-seg__hint { font-size: 11px; color: #a6adbb; margin-top: 4px; }
