:root {
  --primary: #4f7cff;
  --primary-light: #eef2ff;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #8a91a3;
  --danger: #e5484d;
  --danger-light: #fdecec;
  --warn: #f5a623;
  --warn-light: #fef4e3;
  --ok: #30a46c;
  --ok-light: #e7f6ef;
  --border: #e6e8ef;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(30, 40, 90, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 14px calc(30px + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }

/* ===== 顶栏 ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px 10px;
  background: var(--bg);
}
.app-header h1 { font-size: 20px; font-weight: 700; }
.app-header .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.admin-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  border-radius: 999px;
}

/* ===== 课程卡片 ===== */
.course-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.08s;
  position: relative;
}
.course-card:active { transform: scale(0.985); }
.course-card.today {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--primary-light), var(--card) 55%);
}
.course-card.inactive { opacity: 0.55; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-title { font-size: 17px; font-weight: 700; }
.today-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 3px 10px;
}
.card-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
}
.remaining-block .num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--primary);
}
.remaining-block .num.danger { color: var(--danger); }
.remaining-block .num.warn { color: var(--warn); }
.remaining-block .label { font-size: 12px; color: var(--muted); }
.card-meta { text-align: right; font-size: 12px; color: var(--muted); }
.card-meta div + div { margin-top: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.chip.danger { background: var(--danger-light); color: var(--danger); }
.chip.warn { background: var(--warn-light); color: #b57500; }
.chip.info { background: var(--primary-light); color: var(--primary); }
.chip.muted { background: #f0f1f5; color: var(--muted); }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 70px 20px;
}
.empty-state .icon { font-size: 44px; margin-bottom: 12px; }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, 0.45);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.center { align-items: center; padding: 16px; }
.modal-box {
  background: var(--card);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.18s ease-out;
}
.modal-overlay.center .modal-box {
  border-radius: 18px;
  max-height: 84vh;
  animation: none;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-close {
  border: none;
  background: #f0f1f5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
}
.modal-body {
  padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== 详情弹层内容 ===== */
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.stat-box .v { font-size: 20px; font-weight: 800; color: var(--primary); }
.stat-box .v.danger { color: var(--danger); }
.stat-box .v.warn { color: var(--warn); }
.stat-box .k { font-size: 11px; color: var(--muted); margin-top: 2px; }

.detail-section { margin-top: 14px; }
.detail-section h3 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.info-rows .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.info-rows .row .k { color: var(--muted); }

.record-list { list-style: none; }
.record-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.record-list .left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.record-list .date { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.record-list .note { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-list .amount { font-weight: 600; flex-shrink: 0; }
.tag {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.tag.attended { background: var(--ok-light); color: var(--ok); }
.tag.absent { background: var(--warn-light); color: #b57500; }

.list-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* ===== 打卡区 ===== */
.mark-area {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
}
.mark-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.mark-row input[type="date"], .mark-row input[type="text"] {
  flex: 1;
  min-width: 0;
}
.mark-buttons { display: flex; gap: 10px; }
.mark-buttons .btn { flex: 1; padding: 13px 8px; font-size: 16px; }

/* ===== 按钮 ===== */
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.12s;
  font-family: inherit;
}
.btn:active { opacity: 0.8; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--ok); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }

/* ===== 表单 ===== */
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.form-item { margin-bottom: 12px; }
.form-item label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ===== 后台专用 ===== */
.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  max-width: 640px;
  margin: 0 auto;
}
.tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 13px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-family: inherit;
}
.tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 10px;
}
.section-head h2 { font-size: 16px; font-weight: 700; }

.admin-list-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.admin-list-card .line1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-list-card .title { font-weight: 700; font-size: 15px; }
.admin-list-card .meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.admin-list-card .ops { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.form-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

.schedule-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.schedule-row select { width: 86px; flex-shrink: 0; }
.schedule-row input[type="time"] { flex: 1; min-width: 0; }
.schedule-row .btn-remove {
  flex-shrink: 0;
  border: none;
  background: var(--danger-light);
  color: var(--danger);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.banner {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.banner.warn { background: var(--warn-light); color: #8a5b00; }
.banner.danger { background: var(--danger-light); color: var(--danger); }
.banner.info { background: var(--primary-light); color: var(--primary); }

/* ===== 登录 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.login-card .icon { font-size: 40px; margin-bottom: 10px; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card p { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.login-card input { margin-bottom: 12px; text-align: center; }
.login-error { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 6px; }

/* ===== Toast ===== */
#toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(20, 25, 40, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 999;
  max-width: 86vw;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.show { opacity: 1; }
#toast.warn { background: rgba(180, 110, 0, 0.95); }
#toast.error { background: rgba(200, 50, 55, 0.95); }

.filter-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-row select, .filter-row input { flex: 1; min-width: 110px; }

/* ===== 秒秒学习首页（门户） ===== */
.home-body {
  background: linear-gradient(180deg, #dfe8ff 0%, var(--bg) 240px);
  min-height: 100vh;
}
.home-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 34px 16px calc(30px + env(safe-area-inset-bottom));
}
.home-header { text-align: center; margin-bottom: 26px; }
.home-logo { font-size: 46px; line-height: 1; margin-bottom: 8px; }
.home-header h1 { font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.home-header p { font-size: 13px; color: var(--muted); margin-top: 4px; }

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.module-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.08s;
}
.module-card:active { transform: scale(0.985); }
.module-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.module-info { min-width: 0; }
.module-name { font-size: 16px; font-weight: 700; }
.module-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.module-arrow { margin-left: auto; color: var(--muted); font-size: 24px; flex-shrink: 0; }

/* ===== 模块占位页 ===== */
.placeholder-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.placeholder-card {
  text-align: center;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 28px;
  max-width: 360px;
  width: 100%;
}

/* ===== 阅读模块：书架 ===== */
.status-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 14px;
  background: var(--bg);
}
.status-tabs button {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.status-tabs button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.status-tabs .cnt {
  display: inline-block;
  min-width: 18px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  padding: 0 5px;
  margin-left: 2px;
}
.status-tabs button.active .cnt { background: rgba(255, 255, 255, 0.3); }

.shelf-container { padding-bottom: 110px; }
.shelf { margin-bottom: 6px; }
.shelf-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: end;
  padding: 10px 8px 6px;
}
.shelf-board {
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(180deg, #c69263 0%, #a06f3f 45%, #7c5227 100%);
  box-shadow: 0 4px 8px rgba(90, 55, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  margin: 0 2px 14px;
}

.book-cell { cursor: pointer; text-align: center; }
.book-cell:active { transform: scale(0.97); }
.book-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 6px 10px 10px 6px;
  overflow: visible;
  box-shadow: 0 3px 8px rgba(30, 40, 90, 0.18);
  transition: transform 0.1s;
}
.cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px 10px 10px 6px;
  display: block;
  border-left: 4px solid rgba(0, 0, 0, 0.18);
}
.cover-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 6px;
}
.cover-ph-title {
  writing-mode: vertical-rl;
  font-weight: 700;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  max-height: 78%;
  overflow: hidden;
  letter-spacing: 2px;
}
.cover-ph-author {
  position: absolute;
  bottom: 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-name {
  font-size: 12px;
  margin-top: 6px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
}

/* 读完点亮 */
.book-cover.finished-glow .cover-img {
  box-shadow: 0 0 0 2px #ffd76e, 0 0 16px 3px rgba(255, 200, 60, 0.55);
}
.finish-star {
  position: absolute;
  top: -7px;
  right: -5px;
  font-size: 17px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.finish-star.big { font-size: 26px; top: -10px; right: -8px; }

/* 在读进度角标 */
.corner-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  box-shadow: 0 2px 5px rgba(30, 40, 90, 0.3);
}
.corner-badge.reading-badge { background: var(--ok); }

/* 想读半透明 */
.book-cover.want-dim .cover-img { opacity: 0.55; filter: saturate(0.6); }

/* ===== 阅读模块：悬浮添加按钮 ===== */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #ff8a5c, #ff5e7e);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  padding: 14px 22px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(255, 94, 126, 0.45);
}
.fab:active { transform: scale(0.96); }

/* ===== 阅读模块：分段选择器 / 标签输入 ===== */
.seg-toggle {
  display: flex;
  background: #eef0f5;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.seg-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.seg-toggle button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(30, 40, 90, 0.12);
}

.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}
.tag-input-wrap input {
  flex: 1;
  min-width: 110px;
  border: none;
  padding: 4px;
}
.tag-input-wrap input:focus { border: none; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
}
.tag-chip b { cursor: pointer; font-weight: 700; }

/* 封面上传预览 */
.cover-edit-area { text-align: center; margin-bottom: 16px; }
.cover-preview-empty, .cover-preview-img {
  width: 110px;
  height: 147px;
  margin: 0 auto;
  border-radius: 8px 12px 12px 8px;
  cursor: pointer;
  overflow: hidden;
}
.cover-preview-empty {
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  background: var(--bg);
}
.cover-preview-empty span { font-size: 26px; }
.cover-preview-img { box-shadow: var(--shadow); }
.cover-preview-img img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 阅读模块：成长纪念卡 ===== */
.memorial-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
}
.memorial-card.golden {
  background: linear-gradient(180deg, #fff8e6 0%, var(--card) 45%);
  box-shadow: 0 2px 14px rgba(255, 190, 60, 0.25);
}
.mc-top { display: flex; gap: 16px; align-items: flex-start; }
.mc-cover { width: 110px; flex-shrink: 0; position: relative; }
.mc-cover .cover-img { box-shadow: 0 4px 12px rgba(30, 40, 90, 0.22); }
.mc-info { min-width: 0; flex: 1; }
.mc-info h2 { font-size: 19px; font-weight: 800; line-height: 1.35; word-break: break-all; }
.mc-author { font-size: 13px; color: var(--muted); margin-top: 5px; }
.mc-status { margin-top: 8px; }
.chip.ok { background: var(--ok-light); color: var(--ok); }

/* 时间轴 */
.timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 18px;
  padding: 14px 6px;
  background: var(--bg);
  border-radius: 12px;
  overflow-x: auto;
}
.tl-item { text-align: center; flex-shrink: 0; min-width: 62px; }
.tl-dot { font-size: 20px; }
.tl-label { font-size: 11px; color: var(--muted); margin-top: 3px; }
.tl-value { font-size: 13px; font-weight: 700; margin-top: 2px; }
.tl-arrow { color: var(--muted); font-size: 13px; padding: 6px 2px 0; flex-shrink: 0; }

/* 操作区 */
.action-area { margin-top: 14px; }
.progress-wrap { margin-bottom: 12px; }
.progress-bar {
  height: 10px;
  background: #eef0f5;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7ea6ff);
  border-radius: 999px;
  transition: width 0.3s;
}
.progress-text { font-size: 12px; color: var(--muted); margin-top: 5px; text-align: center; }
.action-buttons { display: flex; gap: 10px; }
.action-buttons .btn { flex: 1; padding: 13px 8px; font-size: 15px; }

.finished-banner {
  margin-top: 14px;
  background: linear-gradient(135deg, #ffe9b8, #ffd76e);
  color: #7a5200;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  border-radius: 12px;
  padding: 13px 10px;
}

/* 评分星星 */
.stars { display: flex; gap: 8px; margin-top: 4px; }
.stars .star {
  font-size: 30px;
  color: #dcdfe8;
  cursor: pointer;
  transition: transform 0.08s;
  line-height: 1;
}
.stars .star:active { transform: scale(1.2); }
.stars .star.on { color: #ffc531; text-shadow: 0 1px 4px rgba(255, 190, 40, 0.5); }

textarea { resize: vertical; min-height: 60px; }

/* ===== 阅读模块：统计成就页 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.stat-grid .stat-box { padding: 12px 4px; }
.stat-grid .stat-box .v { font-size: 17px; }
.stat-grid .stat-box .k { font-size: 10.5px; }

.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.badge-card {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 8px;
  text-align: center;
  filter: grayscale(0.85);
  opacity: 0.75;
}
.badge-card.earned {
  filter: none;
  opacity: 1;
  background: linear-gradient(180deg, #fff8e6, var(--card) 60%);
  box-shadow: 0 2px 10px rgba(255, 190, 60, 0.3);
}
.badge-icon { font-size: 26px; }
.badge-name { font-size: 12.5px; font-weight: 700; margin-top: 5px; }
.badge-desc { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.badge-earned-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #b57500;
  background: #ffe9b8;
  border-radius: 999px;
  padding: 1px 8px;
}
.badge-progress {
  height: 5px;
  background: #eef0f5;
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.badge-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}
.badge-progress-text { font-size: 10px; color: var(--muted); margin-top: 3px; }

.recent-list li { cursor: pointer; }
.recent-cover {
  width: 26px;
  height: 34px;
  border-radius: 3px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-size: 15px;
  flex-shrink: 0;
}
.recent-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 返回门户按钮 ===== */
.back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--primary);
  font-size: 18px;
  text-decoration: none;
  flex-shrink: 0;
}

/* ===== 跳绳音乐页 ===== */
.music-section { margin-bottom: 22px; }
.music-section h2 {
  font-size: 16px;
  font-weight: 700;
  border-left: 4px solid var(--ok);
  padding-left: 10px;
  margin-bottom: 10px;
}
.music-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.music-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 15px;
}
.music-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 9px;
}
.music-card audio {
  width: 100%;
  height: 40px;
  display: block;
}
