/* ============================================
   Holiday 阅读花园 - 温暖手绘风样式
   ============================================ */

:root {
  /* 温暖配色 */
  --coral: #FF8C94;
  --coral-light: #FFC3C8;
  --coral-soft: #FFF0F1;
  --sky: #87CEEB;
  --sky-light: #C5E8F7;
  --sky-soft: #EDF7FC;
  --sun: #FFD93D;
  --sun-light: #FFF3B0;
  --sun-soft: #FFFBE6;
  --leaf: #6BCB77;
  --leaf-light: #A8E6CF;
  --leaf-soft: #E8F8EE;
  --lavender: #D5A8E3;
  --lavender-light: #F0E6F5;
  --sand: #FFF9F5;
  --cream: #FFFCF8;
  --white: #FFFFFF;
  --charcoal: #4A4A4A;
  --gray: #888888;
  --light-gray: #F5F5F5;
  --border: #E8E8E8;

  /* 手绘圆角 */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-full: 999px;

  /* 柔和阴影 */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-colored: 0 8px 32px rgba(255,140,148,0.15);

  /* 字体 */
  --font-main: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--sand);
  color: var(--charcoal);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   顶部导航
   ============================================ */
.site-header {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-light) 100%);
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.logo {
  font-size: 1.5em;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo-icon {
  font-size: 1.3em;
}

.user-badge {
  background: rgba(255,255,255,0.35);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.85em;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 主导航 */
.main-nav {
  max-width: 1200px;
  margin: 12px auto 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.nav-item {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
}

.nav-item:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

.nav-item.active {
  background: white;
  color: var(--coral);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 100px;
}

.page {
  display: none;
  animation: fadeInUp 0.2s ease;
}

.page.active {
  display: block;
}

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

/* ============================================
   卡片组件
   ============================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.85em;
  color: var(--gray);
  margin-top: -12px;
  margin-bottom: 16px;
}

/* ============================================
   统计卡片网格
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-card.coral::before { background: var(--coral); }
.stat-card.sky::before { background: var(--sky); }
.stat-card.sun::before { background: var(--sun); }
.stat-card.leaf::before { background: var(--leaf); }
.stat-card.lavender::before { background: var(--lavender); }

.stat-number {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.2;
}

.stat-card.coral .stat-number { color: var(--coral); }
.stat-card.sky .stat-number { color: var(--sky); }
.stat-card.sun .stat-number { color: #E6B800; }
.stat-card.leaf .stat-number { color: var(--leaf); }
.stat-card.lavender .stat-number { color: var(--lavender); }

.stat-label {
  font-size: 0.8em;
  color: var(--gray);
  margin-top: 4px;
}

/* ============================================
   按钮
   ============================================ */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-light) 100%);
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255,140,148,0.4);
}

.btn-secondary {
  background: var(--light-gray);
  color: var(--charcoal);
}

.btn-success {
  background: linear-gradient(135deg, var(--leaf) 0%, var(--leaf-light) 100%);
  color: white;
}

.btn-sky {
  background: linear-gradient(135deg, var(--sky) 0%, var(--sky-light) 100%);
  color: white;
}

.btn-sun {
  background: linear-gradient(135deg, var(--sun) 0%, var(--sun-light) 100%);
  color: var(--charcoal);
}

.btn-small {
  padding: 6px 14px;
  font-size: 0.8em;
}

.btn-large {
  padding: 14px 32px;
  font-size: 1.1em;
}

/* ============================================
   表单
   ============================================ */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9em;
  color: var(--charcoal);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1em;
  font-family: inherit;
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: var(--white);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============================================
   分类标签
   ============================================ */
.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.category-tag {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 2px solid transparent;
  background: var(--light-gray);
  color: var(--charcoal);
}

.category-tag:hover {
  transform: scale(1.05);
}

.category-tag.selected {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-soft);
}

/* 中文分类色 */
.tag-literature { background: var(--misty-rose, #FFE4E1); color: var(--medium-violet, #C71585); }
.tag-science { background: #E0F4FF; color: #0066CC; }
.tag-art { background: #FFF0F5; color: #FF69B4; }
.tag-history { background: #FFF8DC; color: var(--dark-goldenrod, #B8860B); }
.tag-geography { background: #E8F5E9; color: var(--green-dark, #2E7D32); }
.tag-philosophy { background: #F3E5F5; color: var(--purple-dark, #7B1FA2); }
.tag-biography { background: #ECEFF1; color: var(--blue-gray, #455A64); }
.tag-picturebook { background: #FFE0B2; color: var(--deep-orange, #E65100); }
.tag-other { background: #FFF3E0; color: var(--deep-orange, #E65100); }

/* 英文分类色 */
.tag-story { background: #E3F2FD; color: var(--primary-blue-dark, #1565C0); }
.tag-phonics { background: #F3E5F5; color: var(--purple-dark, #7B1FA2); }
.tag-phonics-beginner { background: #E8F5E9; color: var(--green-dark, #2E7D32); }
.tag-phonics-intermediate { background: #FFF8DC; color: var(--dark-goldenrod, #B8860B); }
.tag-phonics-advanced { background: var(--misty-rose, #FFE4E1); color: var(--medium-violet, #C71585); }
.tag-listening { background: #EDE7F6; color: #5E35B1; }
.tag-no-reading { background: #f0f0f0; color: #888; }
.tag-english-other { background: #ECEFF1; color: var(--blue-gray, #455A64); }

/* ============================================
   记录项
   ============================================ */
.record-item {
  background: var(--light-gray);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.record-item:hover {
  background: #EBEBEB;
  transform: translateX(4px);
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.record-date {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--coral);
}

.record-stats {
  display: flex;
  gap: 8px;
}

.record-stat {
  background: var(--coral-soft);
  color: var(--coral);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8em;
  font-weight: 600;
}

.record-books {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.record-book-tag {
  background: var(--white);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8em;
  border: 1px solid var(--border);
}

/* ============================================
   进度条
   ============================================ */
.progress-container {
  margin: 16px 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.9em;
}

.progress-bar {
  height: 12px;
  background: var(--light-gray);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ============================================
   图表
   ============================================ */
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 220px;
  padding: 20px 0;
  gap: 8px;
}

.bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 30px;
}

.bar-value {
  font-size: 0.75em;
  margin-bottom: 4px;
  color: var(--coral);
  font-weight: 600;
}

.bar {
  width: 100%;
  max-width: 40px;
  border-radius: 8px 8px 0 0;
  transition: height 0.5s ease;
  position: relative;
}

.bar-label {
  font-size: 0.7em;
  margin-top: 6px;
  color: var(--gray);
  text-align: center;
}

/* ============================================
   成长树与等级
   ============================================ */
.level-card {
  background: linear-gradient(135deg, var(--leaf-soft) 0%, var(--sky-soft) 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
}

.level-emoji {
  font-size: 4em;
  margin-bottom: 8px;
}

.level-name {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 4px;
}

.level-desc {
  font-size: 0.9em;
  color: var(--gray);
  margin-bottom: 16px;
}

.level-progress {
  background: var(--white);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 8px;
}

.level-progress-bar {
  height: 16px;
  background: linear-gradient(90deg, var(--leaf), var(--sky));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.level-stats {
  font-size: 0.85em;
  color: var(--gray);
}

/* 徽章墙 */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
}

.badge-item {
  text-align: center;
  padding: 16px 8px;
  border-radius: var(--radius-md);
  background: var(--light-gray);
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0.5;
}

.badge-item.earned {
  opacity: 1;
  background: var(--sun-soft);
  box-shadow: var(--shadow-sm);
}

.badge-item.earned:hover {
  transform: scale(1.05);
}

.badge-emoji {
  font-size: 2.5em;
  margin-bottom: 8px;
}

.badge-name {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--charcoal);
}

.badge-desc {
  font-size: 0.7em;
  color: var(--gray);
  margin-top: 4px;
}

/* ============================================
   识字卡片
   ============================================ */
.character-card-stage {
  perspective: 1000px;
  width: 280px;
  height: 380px;
  margin: 0 auto 24px;
}

.character-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  cursor: pointer;
}

.character-card-inner.flipped {
  transform: rotateY(180deg);
}

.character-card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.character-card-front {
  background: linear-gradient(135deg, var(--coral-soft) 0%, var(--white) 100%);
  border: 3px solid var(--coral-light);
}

.character-card-back {
  background: linear-gradient(135deg, var(--sky-soft) 0%, var(--white) 100%);
  border: 3px solid var(--sky-light);
  transform: rotateY(180deg);
}

.character-hanzi {
  font-size: 6em;
  font-weight: 700;
  color: var(--coral);
  line-height: 1;
}

.character-emoji {
  font-size: 3em;
  margin-top: 16px;
}

.character-pinyin {
  font-size: 1.5em;
  color: var(--sky);
  font-weight: 600;
  margin-bottom: 8px;
}

.character-meaning {
  font-size: 1em;
  color: var(--charcoal);
  text-align: center;
  margin-bottom: 12px;
}

.character-example {
  font-size: 0.9em;
  color: var(--gray);
  text-align: center;
  background: var(--light-gray);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* ============================================
   留言板
   ============================================ */
.message-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.message-item:hover {
  box-shadow: var(--shadow-md);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.message-author {
  font-weight: 600;
  color: var(--coral);
  display: flex;
  align-items: center;
  gap: 6px;
}

.message-time {
  font-size: 0.75em;
  color: var(--gray);
}

.message-content {
  color: var(--charcoal);
  line-height: 1.6;
}

.message-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.message-action {
  font-size: 0.8em;
  color: var(--gray);
  cursor: pointer;
  transition: color 0.3s;
  background: none;
  border: none;
  font-family: inherit;
}

.message-action:hover {
  color: var(--coral);
}

/* ============================================
   日历
   ============================================ */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-top: 2px;
}

.calendar-header {
  text-align: center;
  font-weight: 600;
  font-size: 0.58em;
  color: var(--gray);
  padding: 3px 1px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--light-gray);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 0.46em;
  position: relative;
  padding: 1px;
}

.calendar-day:hover {
  background: var(--coral-soft);
}

.calendar-day.has-record {
  background: var(--leaf);
  color: white;
}

.calendar-day.has-record-zero {
  background: #d5d5d5;
  color: #888;
}

.calendar-day.has-listening {
  background: #EDE7F6;
  color: #5E35B1;
}

.calendar-day.has-mixed {
  background: linear-gradient(135deg, #E8F5E9 0%, #EDE7F6 100%);
  color: #4A4A4A;
}

.calendar-day .day-minutes.listening {
  color: #7C4DFF;
  opacity: 1;
}

.calendar-day .day-minutes.reading {
  color: #4CAF50;
  opacity: 1;
}

.calendar-day .day-minutes.zero {
  color: #999;
  opacity: 0.7;
}

.calendar-day.today {
  border: 2px solid var(--coral);
  font-weight: 700;
}

.calendar-day .day-number {
  font-size: 0.75em;
}

.calendar-day .day-minutes {
  font-size: 0.48em;
  opacity: 0.9;
}

/* ============================================
   日期详情弹窗
   ============================================ */
.day-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.day-detail-modal.active {
  opacity: 1;
  visibility: visible;
}

.day-detail-content {
  background: var(--cream);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.day-detail-modal.active .day-detail-content {
  transform: scale(1);
}

.day-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-light) 100%);
  color: white;
}

.day-detail-header h3 {
  font-size: 1.1em;
  font-weight: 600;
  margin: 0;
}

.day-detail-close {
  background: rgba(255,255,255,0.3);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.day-detail-close:hover {
  background: rgba(255,255,255,0.5);
}

.day-detail-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(80vh - 64px);
}

.day-detail-record {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--sky);
}

.day-detail-record:last-child {
  margin-bottom: 0;
}

.day-detail-record-header {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.day-detail-lang {
  font-size: 0.8em;
  background: var(--sky-soft);
  color: var(--charcoal);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.day-detail-cat {
  font-size: 0.85em;
  color: var(--coral);
  font-weight: 500;
}

.day-detail-books {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.day-detail-book {
  background: var(--coral-soft);
  color: var(--charcoal);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85em;
}

/* 带封面的书籍标签 */
.day-detail-book-with-cover {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85em;
}

.day-detail-book-cover-small {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.day-detail-book-name {
  color: var(--charcoal);
  font-weight: 500;
}

.day-detail-stats {
  display: flex;
  gap: 12px;
  font-size: 0.85em;
  color: var(--gray);
  margin-bottom: 6px;
}

.day-detail-note {
  font-size: 0.9em;
  color: var(--charcoal);
  background: var(--sun-soft);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  line-height: 1.5;
}

.day-detail-summary {
  background: linear-gradient(135deg, var(--leaf-soft) 0%, var(--sky-soft) 100%);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
}

.day-detail-summary-title {
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 10px;
  font-size: 0.95em;
}

.day-detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.day-detail-summary-item {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.day-detail-summary-num {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--coral);
}

.day-detail-summary-label {
  font-size: 0.8em;
  color: var(--gray);
  margin-top: 2px;
}

/* 语言分组标题 */
.day-detail-lang-section {
  margin-bottom: 16px;
}

.day-detail-lang-title {
  font-size: 1em;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.day-detail-lang-section:nth-child(1) .day-detail-lang-title {
  background: linear-gradient(135deg, var(--coral-soft) 0%, var(--misty-rose, #FFE4E1) 100%);
  color: var(--coral);
}

.day-detail-lang-section:nth-child(2) .day-detail-lang-title {
  background: linear-gradient(135deg, var(--sky-soft) 0%, #E6F3FF 100%);
  color: var(--primary-blue-dark, #1565C0);
}

/* 中英文分类统计 */
.day-detail-lang-breakdown {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.day-detail-lang-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: var(--charcoal);
}

.day-detail-lang-flag {
  font-size: 1.2em;
}

/* ============================================
   书籍详情弹窗
   ============================================ */
.book-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.book-detail-modal.active {
  opacity: 1;
  visibility: visible;
}

.book-detail-content {
  background: var(--cream);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.book-detail-modal.active .book-detail-content {
  transform: scale(1);
}

.book-detail-header {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 0;
}

.book-detail-close {
  background: rgba(0,0,0,0.1);
  border: none;
  color: var(--gray);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s;
}

.book-detail-close:hover {
  background: var(--coral);
  color: white;
}

.book-detail-body {
  padding: 0 20px 20px;
  overflow-y: auto;
  max-height: calc(85vh - 50px);
}

.book-detail-top {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.book-detail-cover {
  width: 120px;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--light-gray);
  box-shadow: var(--shadow-md);
}

.book-detail-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-detail-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
}

.book-detail-info {
  flex: 1;
  min-width: 0;
}

.book-detail-title {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 8px;
  line-height: 1.3;
}

.book-detail-cat {
  font-size: 0.9em;
  color: var(--coral);
  font-weight: 500;
  margin-bottom: 6px;
}

.book-detail-author,
.book-detail-publisher,
.book-detail-age,
.book-detail-pages,
.book-detail-difficulty {
  font-size: 0.85em;
  color: var(--gray);
  margin-bottom: 4px;
}

.book-detail-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.book-detail-section-title {
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
  font-size: 0.95em;
}

.book-detail-description,
.book-detail-note {
  font-size: 0.9em;
  color: var(--charcoal);
  line-height: 1.6;
  background: var(--white);
  padding: 12px;
  border-radius: var(--radius-sm);
}

.book-difficulty {
  display: inline-block;
  background: var(--sky-soft);
  color: var(--primary-blue-dark, #1565C0);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75em;
  margin-top: 4px;
}

/* ============================================
   阅读统计页面
   ============================================ */

/* 顶部筛选条 */
.stats-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--border);
}

.stats-top-title {
  font-size: 1.15em;
  font-weight: 700;
  color: var(--charcoal);
}

.stats-top-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stats-top-filter {
  font-size: 0.85em;
  color: var(--primary-blue, #2979FF);
  cursor: pointer;
}

/* 时间段选择器 */
.stats-period-picker {
  background: white;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.stats-period-options {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.stats-period-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  cursor: pointer;
  font-size: 0.85em;
  color: var(--gray);
  font-family: inherit;
}

.stats-period-btn.active {
  background: var(--primary-blue, #2979FF);
  color: white;
  border-color: var(--primary-blue, #2979FF);
}

.stats-period-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.stats-period-arrow {
  background: none;
  border: none;
  font-size: 1em;
  cursor: pointer;
  color: var(--gray);
  padding: 4px 8px;
}

.stats-period-current {
  font-size: 1em;
  font-weight: 600;
  color: var(--charcoal);
  min-width: 120px;
  text-align: center;
}

/* 时间线月份块 */
.stats-month-block {
  padding: 0 16px;
  margin-top: 8px;
}

.stats-month-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 8px;
  position: relative;
}

.stats-month-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-blue, #2979FF);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.stats-month-name {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--charcoal);
}

/* 统计摘要 */
.stats-summary {
  background: #F5F7FA;
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0 16px 20px;
}

.stats-summary-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 12px;
}

.stats-summary-num {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--charcoal);
}

.stats-summary-unit {
  font-size: 0.85em;
  color: var(--gray);
  margin-left: 2px;
}

.stats-summary-label {
  font-size: 0.8em;
  color: var(--gray);
}

.stats-lang-detail {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #E0E0E0;
}

.stats-lang-item {
  text-align: center;
}

.stats-lang-label {
  font-size: 0.8em;
  color: #FF8A65;
  margin-bottom: 4px;
}

.stats-lang-label.en {
  color: #4FC3F7;
}

.stats-lang-nums {
  font-size: 0.8em;
  color: var(--gray);
}

/* 封面网格 */
.stats-month-books {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 0 16px 20px;
}

.stats-cover-item {
  position: relative;
  cursor: pointer;
}

.stats-cover-img {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 8px;
  object-fit: cover;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stats-cover-name {
  font-size: 0.7em;
  color: var(--charcoal);
  margin-top: 4px;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.stats-cover-day {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--primary-blue, #2979FF);
  color: white;
  font-size: 0.65em;
  padding: 2px 6px;
  border-radius: 10px;
}

/* 按日期分组的阅读书目 */
.stats-date-block {
  padding: 0 16px;
  margin-bottom: 16px;
}
.stats-date-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
  cursor: pointer;
  flex-wrap: wrap;
}
.stats-date-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral, #E8738A);
  flex-shrink: 0;
}
.stats-date-label {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--charcoal);
}
.stats-date-meta {
  font-size: 0.75em;
  color: var(--gray);
  margin-left: auto;
}
.stats-date-books {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0 8px 18px;
}
.stats-date-book-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
}
.stats-date-cover {
  width: 56px;
  height: 78px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  background: #f0f0f0;
}
.stats-date-cover-fallback {
  width: 56px;
  height: 78px;
  border-radius: 6px;
  background: var(--light-gray, #f5f6fa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6em;
}
.stats-date-book-name {
  font-size: 0.65em;
  color: var(--charcoal);
  text-align: center;
  margin-top: 4px;
  line-height: 1.3;
  max-width: 60px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stats-date-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 0 18px;
}
.stats-date-tag {
  font-size: 0.7em;
  background: #f0f4ff;
  color: #555;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ===== 封面编辑弹窗 ===== */
.cover-edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cover-edit-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 16px 30px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.cover-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cover-edit-header h4 {
  margin: 0;
  font-size: 1.1em;
  color: var(--charcoal);
}
.cover-edit-close {
  background: none;
  border: none;
  font-size: 1.3em;
  cursor: pointer;
  color: #999;
  padding: 4px 8px;
}
.cover-edit-preview {
  text-align: center;
  margin-bottom: 16px;
}
.cover-edit-preview img {
  width: 120px;
  height: 168px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.cover-edit-preview .placeholder {
  width: 120px;
  height: 168px;
  border-radius: 10px;
  background: #f5f6fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  border: 2px dashed #ddd;
}
.cover-edit-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.cover-edit-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s;
}
.cover-edit-btn:active { transform: scale(0.96); }
.cover-edit-btn.camera { background: #FFF0F3; color: #E8738A; }
.cover-edit-btn.upload { background: #E3F2FD; color: #1565C0; }
.cover-edit-info {
  margin-bottom: 12px;
}
.cover-edit-info label {
  display: block;
  font-size: 0.75em;
  font-weight: 600;
  color: #666;
  margin-bottom: 3px;
  margin-top: 8px;
}
.cover-edit-info input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9em;
  box-sizing: border-box;
}
.cover-edit-save-row {
  text-align: center;
  margin-top: 12px;
}
.btn-save-cover {
  background: var(--coral, #E8738A);
  color: #fff;
  border: none;
  padding: 10px 32px;
  border-radius: 24px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
}

/* 阅读旅程（保持不变） */
.stats-section-card {
  background: white;
  border-radius: var(--radius-lg);
  margin: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.stats-section-title {
  font-size: 1em;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.stats-journey-info {
  text-align: center;
  padding: 8px;
}

.stats-journey-start {
  font-size: 0.9em;
  color: var(--gray);
  margin-bottom: 8px;
}

.stats-journey-days {
  font-size: 2em;
  font-weight: 700;
  color: var(--coral);
}

.stats-journey-label {
  color: var(--gray);
  font-size: 0.85em;
}

.stats-journey-streak {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 32px;
}

.stats-journey-streak-item {
  text-align: center;
}

.stats-journey-streak-num {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--charcoal);
}

.stats-journey-streak-label {
  font-size: 0.75em;
  color: var(--gray);
  margin-top: 2px;
}

/* 加载完毕 */
.stats-load-done {
  text-align: center;
  color: var(--gray);
  font-size: 0.8em;
  padding: 16px;
}
/* ============================================
   书籍卡片
   ============================================ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.book-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
  border-left: 4px solid var(--coral);
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.book-cover {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--light-gray);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3em;
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-title {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-meta {
  font-size: 0.8em;
  color: var(--gray);
}

.book-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75em;
  font-weight: 600;
  margin-top: 8px;
}

.status-reading { background: var(--sky-soft); color: var(--sky); }
.status-completed { background: var(--leaf-soft); color: var(--leaf); }
.status-planned { background: var(--sun-soft); color: var(--dark-goldenrod, #B8860B); }

/* ============================================
   拍照识书
   ============================================ */
.camera-area {
  border: 3px dashed var(--coral-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  background: var(--coral-soft);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.camera-area:hover {
  border-color: var(--coral);
  background: var(--white);
}

.camera-icon {
  font-size: 3em;
  margin-bottom: 12px;
}

.camera-text {
  color: var(--gray);
  font-size: 0.9em;
}

/* 书籍详细信息折叠面板 */
.book-detail-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--sky-soft) 0%, var(--leaf-soft) 100%);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  color: var(--charcoal);
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 2px solid transparent;
}

.book-detail-toggle:hover {
  border-color: var(--sky);
}

/* 书籍条目（带封面预览） */
.book-entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--white);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border);
}

.book-entry-cover {
  width: 60px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5em;
}

.book-entry-info {
  flex: 1;
  min-width: 0;
}

.book-entry-name {
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 4px;
}

.book-entry-meta {
  font-size: 0.8em;
  color: var(--gray);
}

.book-entry-remove {
  background: var(--coral-soft);
  border: none;
  color: var(--coral);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-image {
  max-width: 200px;
  max-height: 280px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 12px auto;
  display: block;
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray);
}

.empty-state .emoji {
  font-size: 4em;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 1em;
}

/* ============================================
   模态框
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: var(--gray);
}

/* ============================================
   底部导航（移动端）
   ============================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  z-index: 1000;
  padding: 8px 0;
}

.mobile-nav-item {
  flex: 1;
  text-align: center;
  padding: 8px;
  color: var(--gray);
  text-decoration: none;
  font-size: 0.75em;
  transition: color 0.3s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

.mobile-nav-item .icon {
  font-size: 1.5em;
  display: block;
  margin-bottom: 2px;
}

.mobile-nav-item.active {
  color: var(--coral);
}

/* ============================================
   动画
   ============================================ */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.animate-bounce { animation: bounce 2s infinite; }
.animate-shake { animation: shake 0.5s ease; }
.animate-pulse { animation: pulse 2s infinite; }

/* ============================================
   庆祝动画
   ============================================ */
.celebration-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 3000;
  justify-content: center;
  align-items: center;
}

.celebration-overlay.active {
  display: flex;
}

.celebration-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  animation: modalIn 0.5s ease;
}

.celebration-emoji {
  font-size: 5em;
  margin-bottom: 16px;
}

.celebration-title {
  font-size: 1.5em;
  font-weight: 700;
  margin-bottom: 8px;
}

.celebration-text {
  color: var(--gray);
  margin-bottom: 24px;
}

/* 彩纸效果 */
.confetti-piece {
  position: absolute;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================
   响应式
   ============================================ */

/* ========== 首页两栏统计卡片 ========== */
.dash-split-card {
  padding: 12px 16px !important;
  border-radius: 16px !important;
}
.dash-split-row {
  display: flex;
  gap: 0;
}
.dash-split-col {
  flex: 1;
  padding: 6px 12px;
  text-align: center;
}
.dash-split-col:first-child {
  border-right: 1px solid #f0e6ff;
}
.dash-split-label {
  font-size: 0.68em;
  color: #888;
  margin-bottom: 8px;
  font-weight: 500;
}
.dash-split-metrics {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}
.dash-split-metric {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.dash-split-val {
  font-size: 1.9em;
  font-weight: 700;
  color: #333;
  line-height: 1;
}
.dash-split-col:first-child .dash-split-val {
  color: #e8738a;
}
.dash-split-col:last-child .dash-split-val {
  color: #5b8def;
}
.dash-split-unit {
  font-size: 0.6em;
  color: #999;
}
.dash-split-divider {
  width: 1px;
  height: 20px;
  background: #e8e8e8;
  margin: 0 6px;
}
.dash-split-bar {
  height: 5px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 3px;
}
.dash-split-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.today-fill {
  background: linear-gradient(90deg, #ffb3c1, #e8738a);
}
.total-fill {
  background: linear-gradient(90deg, #a8d0ff, #5b8def);
}
.dash-split-days {
  font-size: 0.64em;
  color: #999;
  margin-top: 6px;
}
.dash-split-days strong {
  color: #5b8def;
  font-size: 1.1em;
}

/* 听力统计行 */
.dash-listening-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e0d8f0;
}
.listen-label {
  color: #7C4DFF !important;
}
.dash-split-fill.listening-fill {
  background: linear-gradient(90deg, #7C4DFF, #B388FF) !important;
}

/* ========== 紧凑等级卡片（一行） ========== */
.level-card.compact {
  padding: 8px 14px !important;
  margin-bottom: 10px !important;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%) !important;
  border-radius: 12px !important;
}
.level-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.level-inline .level-emoji {
  font-size: 1.3em !important;
  margin-bottom: 0 !important;
}
.level-inline .level-name {
  font-size: 0.76em !important;
  font-weight: 600;
  color: #444;
  flex: 1;
}
.level-pct {
  font-size: 0.9em;
  font-weight: 700;
  color: #e8738a;
}
.level-arrow {
  font-size: 0.8em;
  color: #ccc;
}

/* ========== 日历导航条 ========== */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  padding: 0 2px;
}
.calendar-arrow {
  background: #f5f5f5;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.7em;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-arrow:active {
  background: #e8e8e8;
}
.calendar-month-label {
  font-size: 0.8em;
  font-weight: 600;
  color: #444;
}
@media (max-width: 768px) {
  .site-header {
    padding: 16px;
  }

  .logo {
    font-size: 1.2em;
  }

  .main-nav {
    gap: 4px;
  }

  .nav-item {
    padding: 6px 12px;
    font-size: 0.8em;
  }

  .main-content {
    padding: 16px 12px 80px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px 10px;
  }

  .stat-number {
    font-size: 1.4em;
  }

  .card {
    padding: 16px;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .character-card-stage {
    width: 240px;
    height: 340px;
  }

  .character-hanzi {
    font-size: 4em;
  }

  .mobile-nav {
    display: flex;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bar-chart {
    height: 160px;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   工具类
   ============================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--coral-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--coral);
}

/* ============================================
   家庭书房样式
   ============================================ */

/* 首页书房入口卡片 */
.study-card {
  background: linear-gradient(135deg, #FFF9F0 0%, #FFF5E6 100%);
  border: 2px solid #E8D5C4;
  position: relative;
  overflow: hidden;
}

.study-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(232, 197, 164, 0.3) 0%, transparent 70%);
  border-radius: 50%;
}

.study-preview {
  position: relative;
  z-index: 1;
}

.study-stats-row {
  display: flex;
  justify-content: space-around;
  margin: 12px 0 16px;
  gap: 10px;
}

.study-stat {
  text-align: center;
  flex: 1;
}

.study-stat-num {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--olive-brown, #8B6914);
  line-height: 1;
}

.study-stat-label {
  font-size: 0.68em;
  color: #A08060;
  margin-top: 3px;
}

.study-categories-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  justify-content: center;
}

.study-cat-tag {
  background: rgba(139, 105, 20, 0.08);
  border: 1px solid rgba(139, 105, 20, 0.15);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.8em;
  color: var(--olive-brown, #8B6914);
  white-space: nowrap;
}

.study-enter-hint {
  text-align: center;
  padding: 12px;
  background: rgba(139, 105, 20, 0.06);
  border-radius: var(--radius-md);
  color: #A08060;
  font-size: 0.9em;
  font-weight: 500;
}

/* 书房页面头部 */
.study-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
}

.study-badge {
  background: linear-gradient(135deg, var(--sand, #E8C5A4) 0%, var(--accent-warm, #D4A574) 100%);
  color: white;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85em;
  font-weight: 600;
}

.study-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9em;
  color: var(--warm-gray, #8B7355);
}

.study-summary .divider {
  color: #D4C4B0;
}

.study-summary strong {
  color: var(--olive-brown, #8B6914);
  font-size: 1.2em;
}

/* 搜索封面按钮 */
.study-search-covers-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
  border-radius: 10px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.study-search-covers-btn:hover {
  background: #C8E6C9;
}
.study-search-covers-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.study-add-book-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: #FF6B6B;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9em;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.study-add-book-btn:hover {
  background: #FF5252;
  transform: scale(1.02);
}

/* 分类标签 */
.study-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.study-tab {
  padding: 8px 16px;
  border: 2px solid var(--border);
  background: white;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
  font-family: inherit;
  color: var(--charcoal);
  white-space: nowrap;
}

.study-tab:hover {
  border-color: var(--accent-warm, #D4A574);
  background: #FFF9F0;
}

.study-tab.active {
  background: linear-gradient(135deg, var(--accent-warm, #D4A574) 0%, var(--sand, #E8C5A4) 100%);
  color: white;
  border-color: var(--accent-warm, #D4A574);
}

/* 🔥 年级筛选标签 */
.study-grade-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.study-grade-tab {
  padding: 6px 14px;
  border: 1.5px solid #e0e0e0;
  background: #fafafa;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.8em;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
  font-family: inherit;
  color: #666;
  white-space: nowrap;
}

.study-grade-tab:hover {
  border-color: #64B5F6;
  background: #E3F2FD;
  color: #1976D2;
}

.study-grade-tab.active {
  background: linear-gradient(135deg, #42A5F5 0%, #1E88E5 100%);
  color: white;
  border-color: #1E88E5;
}

/* 🔥 年级标签 */
.study-book-tag.grade-tag {
  background: #E3F2FD;
  color: #1976D2;
  border: 1px solid #90CAF9;
}

/* 🔥 主题标签 */
.study-book-tag.theme-tag {
  background: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFCC80;
}

/* 书房书籍网格 */
.study-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.study-book-card {
  display: flex;
  gap: 14px;
}

/* 书籍封面 */
.study-book-cover {
  width: 80px;
  height: 105px;
  min-width: 80px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.study-book-cover-char {
  font-size: 2em;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  line-height: 1;
}

.study-book-pages {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.65em;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}

.study-book-info {
  flex: 1;
  min-width: 0;
}

.study-book-difficulty {
  font-size: 0.8em;
  color: #D4A017;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 2px solid var(--border);
  transition: opacity 0.2s, transform 0.2s;
  position: relative;
}

.study-book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sand, #E8C5A4);
}

.study-book-card.read {
  border-left: 4px solid var(--leaf);
}

.study-book-card.unread {
  border-left: 4px solid var(--coral-light);
}

.study-book-title {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 6px;
  padding-right: 80px;
}

.study-book-author {
  font-size: 0.85em;
  color: var(--gray);
  margin-bottom: 10px;
}

.study-book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.study-book-tag {
  display: inline-block;
  background: var(--sand);
  border-radius: var(--radius-full);
  font-size: 0.75em;
  padding: 3px 10px;
  color: var(--warm-gray, #8B7355);
}

.study-book-tag.lang-en {
  background: var(--lavender-light);
  color: var(--lavender);
}

.study-book-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.study-status-badge {
  font-size: 0.8em;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.study-status-badge.read {
  background: var(--leaf-soft);
  color: var(--leaf);
}

.study-status-badge.unread {
  background: var(--coral-soft);
  color: var(--coral);
}

.study-toggle-btn {
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.75em;
  cursor: pointer;
  font-weight: 600;
  color: var(--gray);
  transition: opacity 0.2s, transform 0.2s;
  font-family: inherit;
}

.study-toggle-btn:hover {
  background: var(--coral);
  color: white;
  border-color: var(--coral);
}

/* 书房空状态 */
.study-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray);
}

.study-empty .emoji {
  font-size: 3em;
  margin-bottom: 12px;
}

/* 响应式 */
@media (max-width: 680px) {
  .study-stats-row {
    gap: 8px;
  }
  
  .study-stat-num {
    font-size: 1.3em;
  }
  
  .study-category-tabs {
    gap: 6px;
  }
  
  .study-tab {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  
  .study-books-grid {
    grid-template-columns: 1fr;
  }
  
  .study-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== 首页合并卡片（参照图2+图3） ===== */
.dash-combined-card { padding: 16px 12px !important; }
.dash-row-2col {
  display: flex;
  gap: 0;
}
.dash-metric-col {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  position: relative;
}
.dash-metric-col:first-child { border-right: 1px solid #f0e0e0; }
.dash-metric-icon { font-size: 1.1em; margin-bottom: 4px; }
.dash-metric-title { font-size: 0.8em; color: var(--gray); margin-bottom: 8px; font-weight: 600; }
.dash-metric-values { display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.dash-val { font-size: 1.8em; font-weight: 800; line-height: 1; }
.dash-val.pink { color: #E8738A; }
.dash-val.blue { color: #5DADE2; }
.dash-unit { font-size: 0.7em; color: var(--gray); margin-left: 2px; }
.dash-divider { color: #ddd; margin: 0 6px; font-size: 1.2em; }
.dash-accent-line { height: 3px; border-radius: 2px; margin-top: 10px; width: 60%; margin-left: auto; margin-right: auto; }
.dash-accent-line.pink-grad { background: linear-gradient(to right, #E8738A, transparent); }
.dash-accent-line.blue-grad { background: linear-gradient(to right, #5DADE2, transparent); }

/* ===== 等级紧凑条 ===== */
.level-compact-card { padding: 10px 16px !important; }
.level-compact-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.level-compact-emoji { font-size: 1.4em; }
.level-compact-name { font-weight: 700; font-size: 0.9em; color: var(--charcoal); }
.level-compact-progress { font-size: 0.8em; color: var(--coral); font-weight: 600; }
.level-compact-arrow { margin-left: auto; color: var(--gray); font-size: 1.2em; }

/* ===== 分类横向进度条（统计页）===== */
.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}
.cat-row:last-child { border-bottom: none; }
.cat-row:hover { background: #fafafa; }
.cat-row-left {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 90px;
  flex-shrink: 0;
}
.cat-row-emoji { font-size: 1.2em; }
.cat-row-name { font-size: 0.8em; font-weight: 600; color: var(--charcoal); }
.cat-row-bar-wrap {
  flex: 1;
  height: 18px;
  background: #f0f0f0;
  border-radius: 9px;
  overflow: hidden;
}
.cat-row-bar {
  height: 100%;
  border-radius: 9px;
  min-width: 4px;
  transition: width 0.5s ease;
}
.cat-row-val {
  width: 40px;
  text-align: right;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--charcoal);
  flex-shrink: 0;
}

/* ===== 本周柱状图（带横纵轴） ===== */
.dark-chart-area {
  background: #fff;
  border-radius: 12px;
  padding: 4px 0;
}
.dark-chart-body {
  display: flex;
  gap: 2px;
  align-items: stretch;
  min-height: 280px;
}
.dark-yaxis {
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 4px 28px 0;
  min-width: 28px;
  border-right: 1px solid #e0e0e0;
}
.dark-yaxis span {
  font-size: 0.7em;
  color: #888;
  line-height: 1;
}
.dark-bars {
  display: flex;
  align-items: stretch;
  flex: 1;
  gap: 8px;
  padding-bottom: 28px;
  border-bottom: 1px solid #e0e0e0;
  position: relative;
}
/* 底部横轴刻度线 */
.dark-bars::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 0;
}
.dark-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}
.dark-bar-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  width: 100%;
  position: relative;
}
.dark-bar {
  width: 80%;
  margin: 0 auto;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(to top, #7aa8f0, #b8d4ff);
  position: relative;
  min-height: 3px;
  transition: height 0.5s ease;
}
.dark-bar.today {
  background: linear-gradient(to top, #E8738A, #F5A0B0);
}
.dark-bar-val {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75em;
  font-weight: 700;
  color: #555;
  white-space: nowrap;
}
.dark-bar-date {
  font-size: 0.8em;
  color: #333;
  font-weight: 700;
  margin-top: 6px;
  line-height: 1;
}
.dark-bar-wd {
  font-size: 0.7em;
  color: #888;
  margin-top: 2px;
}
.dark-chart-summary {
  text-align: center;
  padding: 10px 0 4px;
  font-size: 0.85em;
  color: var(--charcoal);
}
.dark-chart-summary strong {
  color: var(--coral);
}

/* ===== 分类柱状图（图6风格） ===== */
/* ===== 分类横向进度条 ===== */
.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
}
.cat-row:last-child { border-bottom: none; }
.cat-row:hover { background: #fafafa; }
.cat-row-left {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 90px;
  flex-shrink: 0;
}
.cat-row-emoji { font-size: 1.2em; }
.cat-row-name { font-size: 0.8em; font-weight: 600; color: var(--charcoal); white-space: nowrap; }
.cat-row-bar-wrap {
  flex: 1;
  height: 18px;
  background: #f0f0f0;
  border-radius: 9px;
  overflow: hidden;
}
.cat-row-bar {
  height: 100%;
  border-radius: 9px;
  min-width: 4px;
  transition: width 0.5s ease;
}
.cat-row-val {
  width: 40px;
  text-align: right;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--charcoal);
  flex-shrink: 0;
}

/* ===== 日编辑面板 ===== */
.day-edit-panel {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.day-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}
.day-edit-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.day-edit-back {
  color: var(--coral, #E8738A);
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.day-edit-back:hover {
  background: var(--coral-soft, #FFF0F3);
}
.day-edit-header h3 {
  margin: 0;
  font-size: 1.05em;
  color: var(--charcoal, #333);
}
.day-edit-add-btn {
  background: var(--leaf, #4CAF50);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.day-edit-add-btn:hover {
  background: #43A047;
}
.day-edit-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.day-edit-record {
  background: var(--light-gray, #f5f6fa);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.day-edit-record-info {
  flex: 1;
  min-width: 200px;
}
.day-edit-record-lang {
  display: inline-block;
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 4px;
}
.day-edit-record-lang.cn { background: #E3F2FD; color: #1565C0; }
.day-edit-record-lang.en { background: #FFF3E0; color: #E65100; }
.day-edit-record-cat {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--charcoal, #333);
}
.day-edit-record-books {
  font-size: 0.8em;
  color: #666;
  margin-top: 2px;
}
.day-edit-record-stats {
  font-size: 0.78em;
  color: #888;
  margin-top: 2px;
}
.day-edit-record-actions {
  display: flex;
  gap: 6px;
}
.day-edit-edit-btn, .day-edit-del-btn {
  border: none;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.78em;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}
.day-edit-edit-btn {
  background: #E3F2FD;
  color: #1565C0;
}
.day-edit-edit-btn:hover {
  background: #BBDEFB;
}
.day-edit-del-btn {
  background: #FFEBEE;
  color: #C62828;
}
.day-edit-del-btn:hover {
  background: #FFCDD2;
}

/* 编辑表单弹层 */
.day-edit-form-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.day-edit-form {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
}
.day-edit-form h4 {
  margin: 0 0 16px 0;
  font-size: 1.05em;
  color: var(--charcoal, #333);
}
.day-edit-form .form-group {
  margin-bottom: 12px;
}
.day-edit-form label {
  display: block;
  font-size: 0.8em;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}
.day-edit-form select,
.day-edit-form input,
.day-edit-form textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9em;
  box-sizing: border-box;
  font-family: inherit;
  resize: vertical;
}
.day-edit-form .form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.day-edit-form .btn-cancel {
  background: #f5f5f5;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85em;
  cursor: pointer;
  color: #666;
}
.day-edit-form .btn-save {
  background: var(--coral, #E8738A);
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.85em;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
}

/* ========== 响应式优化补充 (Auto-added) ========== */

@media (max-width: 768px) {
  .site-header { padding: 12px 16px !important; }
  .header-top { flex-direction: column !important; gap: 8px !important; align-items: center !important; }
  .logo { font-size: 1.1em !important; }
  .main-nav {
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
    padding: 8px !important;
  }
  .nav-item {
    padding: 6px 12px !important;
    font-size: 0.85em !important;
    flex: 1 1 auto !important;
    min-width: 70px !important;
    text-align: center !important;
  }
  .main-content { padding: 16px 12px 75px !important; }
  .card {
    margin: 12px 0 !important;
    padding: 16px !important;
  }
  .dash-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .dash-stat-num { font-size: 2em !important; }
  .books-grid, .book-grid, #booksContainer {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .modal-content, .book-detail-modal .modal-content {
    width: 95% !important;
    max-height: 85vh !important;
    margin: 20px auto !important;
    padding: 20px !important;
  }
  .form-row { flex-direction: column !important; gap: 8px !important; }
  .form-group { width: 100% !important; }
  .user-badge { font-size: 0.8em !important; padding: 4px 10px !important; }
  .page-title { font-size: 1.3em !important; }
  .section-title { font-size: 1.1em !important; }
  .calendar-grid { grid-template-columns: repeat(7, 1fr) !important; gap: 1px !important; }
  .calendar-day { min-height: 32px !important; padding: 3px !important; font-size: 0.6em !important; }
  .message-form { flex-direction: column !important; }
  .message-input { width: 100% !important; margin-bottom: 8px !important; }
  .btn { padding: 10px 16px !important; font-size: 0.9em !important; }
  .category-bar-chart { height: 200px !important; }
  .book-cover, .book-cover-img { width: 80px !important; height: 110px !important; }
  .stats-cards, .stats-grid { grid-template-columns: 1fr !important; }
  .growth-tree { transform: scale(0.85) !important; transform-origin: top center !important; }
  .timeline-item { flex-direction: column !important; }
  .timeline-content { width: 100% !important; }
  .checkin-form { padding: 16px !important; }
  .char-level-btn { padding: 6px 12px !important; font-size: 0.8em !important; }
  .badge-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .book-details-panel { width: 100% !important; position: static !important; }
}

@media (max-width: 480px) {
  .logo { font-size: 1em !important; }
  .nav-item { font-size: 0.75em !important; padding: 5px 8px !important; min-width: 55px !important; }
  .dash-stats-row { grid-template-columns: repeat(2, 1fr) !important; }
  .books-grid, .book-grid, #booksContainer { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-stat-num { font-size: 1.6em !important; }
  .card { padding: 12px !important; }
  .modal-content { width: 98% !important; padding: 16px !important; }
  .page-title { font-size: 1.1em !important; }
  .book-title { font-size: 0.85em !important; }
  .stats-num { font-size: 1.5em !important; }
}

/* 小屏幕横屏优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .site-header { padding: 8px 12px !important; }
  .main-nav { flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  .modal-content { max-height: 90vh !important; }
  .dash-stats-row { grid-template-columns: repeat(4, 1fr) !important; }
}

/* 打印优化 */
@media print {
  .site-header, .main-nav, .btn, .modal, .celebration-overlay {
    display: none !important;
  }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: white !important; }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #e94560;
    --text-secondary: #f5f5f5;
    --border: #2d3748;
  }
}

/* ============================================
   家庭书房 v3 — 成长地图 + 书单
   ============================================ */

/* ---- 成长地图 ---- */
.growth-map { padding: 2px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.map-header { text-align: center; font-size: 0.75em; color: #666; margin-bottom: 6px; padding: 0 2px; }
.map-header strong { color: var(--coral); font-size: 1em; }
.map-island {
  padding: 4px 6px; margin-bottom: 0;
  display: flex; align-items: center; gap: 4px;
  background: #fafafa; border-radius: 8px;
}
.map-island-emoji { font-size: 1em; min-width: 0; text-align: center; flex-shrink: 0; }
.map-island-name { font-size: 0.65em; font-weight: 600; min-width: 0; color: #555; flex-shrink: 0; }
.map-island-bar {
  flex: 1; min-width: 0; height: 6px; background: #eee; border-radius: 3px; overflow: hidden;
}
.map-island-fill {
  height: 100%; background: linear-gradient(90deg, var(--leaf), var(--coral));
  border-radius: 3px; transition: width 0.5s ease;
}
.map-island-stats { font-size: 0.55em; color: #888; min-width: 0; text-align: right; white-space: nowrap; }
.map-legend { display: flex; justify-content: center; gap: 16px; margin-top: 8px; font-size: 0.75em; color: #999; }
.map-legend-item { display: flex; align-items: center; gap: 4px; }
.map-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.map-dot.read { background: var(--leaf); }
.map-dot.unread { background: #ddd; }

/* ---- 筛选栏 ---- */
.study-filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.study-filter-row .study-tab {
  padding: 5px 12px; border-radius: 20px; border: 1px solid #e0e0e0;
  background: #fff; font-size: 0.8em; cursor: pointer; transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.study-filter-row .study-tab.active {
  background: var(--leaf); color: #fff; border-color: var(--leaf); font-weight: 600;
}

/* ---- 统计栏 ---- */
.study-stats-mini {
  text-align: center; padding: 8px; font-size: 0.85em; color: #777;
  background: #f9f9f9; border-radius: 10px; margin: 6px 0;
}

/* ---- 书单卡片 ---- */
.study-book-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; background: #fff;
  border: 1px solid #f0f0f0; margin-bottom: 8px;
  cursor: pointer; transition: opacity 0.2s, transform 0.2s;
}
.study-book-card:hover { background: #fafafa; }
.study-book-card.read { background: #f0fff0; border-color: #c8e6c9; }
.study-book-cover {
  font-size: 2em; min-width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: #f5f5f5; border-radius: 10px;
}
.study-book-info { flex: 1; min-width: 0; }
.study-book-title { font-size: 0.95em; font-weight: 600; color: #333; margin-bottom: 3px; }
.study-book-meta { font-size: 0.75em; color: #999; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.study-book-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.study-book-tags .tag {
  font-size: 0.65em; padding: 2px 8px; border-radius: 10px;
  background: #f0f0f0; color: #888;
}
.study-book-read-date { font-size: 0.7em; color: var(--leaf); margin-top: 2px; }
.study-book-note { font-size: 0.68em; color: #B8860B; margin-top: 1px; font-style: italic; }

/* 阅读日记查看模式 */
.journal-view-date { font-size: 1em; color: var(--text-secondary); margin-bottom: 8px; }
.journal-view-rating { margin-bottom: 8px; }
.journal-view-note { margin-bottom: 4px; }

/* ---- 阅读日记弹窗 ---- */
.reading-journal-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.reading-journal-modal.active { opacity: 1; visibility: visible; }
.journal-card {
  background: #fff; border-radius: 20px; padding: 24px;
  width: 90%; max-width: 380px; position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.journal-close {
  position: absolute; top: 12px; right: 16px;
  font-size: 1.4em; cursor: pointer; color: #aaa;
}
.journal-book-title { font-size: 1.1em; font-weight: 600; margin-bottom: 16px; color: #333; }
.journal-field { margin-bottom: 14px; }
.journal-field label { display: block; font-size: 0.85em; color: #777; margin-bottom: 4px; }
.journal-field input, .journal-field textarea {
  width: 100%; padding: 10px; border: 1px solid #e0e0e0; border-radius: 10px;
  font-size: 0.9em; box-sizing: border-box;
}
.journal-field textarea { resize: vertical; }
.star-rating { display: flex; gap: 8px; }
.star-rating span { font-size: 1.8em; cursor: pointer; color: #ccc; transition: color 0.2s; }
.star-rating span:hover { color: #FFD93D; }
