:root {
  --pink: #ff6b9d;
  --pink-soft: #ffe4f1;
  --purple: #c77dff;
  --purple-soft: #f0e6ff;
  --lavender: #e8d5ff;
  --green: #27ae60;
  --green-soft: #d5f5e3;
  --blue: #85c1e9;
  --blue-soft: #e8f4fd;
  --yellow: #f5b041;
  --yellow-soft: #fef9e7;
  --text: #4a3a5a;
  --text-light: #8a7a9a;
  --bg: #f8f0ff;
  --card: #ffffff;
  --border: #eadef5;
  --shadow: 0 4px 20px rgba(180, 140, 220, 0.12);
  --shadow-lg: 0 8px 32px rgba(180, 140, 220, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --topbar-h: 56px;
  --nav-h: 48px;
}

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

html, body {
  min-height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #fff5fb 0%, #f5e8ff 50%, #eef4ff 100%);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,157,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  left: -15%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199,125,255,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ===== 顶栏 ===== */
.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--pink), var(--purple), var(--blue)) 1;
  z-index: 50;
  flex-wrap: nowrap; /* 标题与右侧链接严格同一行 */
  min-height: 52px;
}
.logo-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.logo-btn:hover .logo-icon { transform: scale(1.12); }
.top-nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: min(52vw, 640px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.top-nav::-webkit-scrollbar { display: none; height: 0; }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 30px;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(255,107,157,0.3));
}

.logo-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(90deg, #ff6b9d, #c77dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.logo-sub {
  font-size: 0.7rem;
  color: var(--text-light);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

/* 常用网站：最右侧下拉列表，与标题同一行 */
.quick-links-wrap {
  position: relative;
}
.quick-links-btn {
  border: 1.5px solid var(--lavender);
  background: linear-gradient(135deg, #fff5fb, #f0e6ff);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.quick-links-btn:hover,
.quick-links-wrap.open .quick-links-btn {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255,107,157,0.25);
}
.ql-caret { font-size: 0.7rem; opacity: 0.85; }
.quick-links-wrap.open .ql-caret { transform: rotate(180deg); display: inline-block; }

.quick-links-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(100,60,140,0.18);
  border: 1px solid var(--border);
  z-index: 100;
}
.quick-links-wrap.open .quick-links-list {
  display: block;
}
.quick-links-list li { margin: 0; }
.quick-links-list a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.15s;
}
.quick-links-list a:hover {
  background: linear-gradient(90deg, #ffe4f1, #f0e6ff);
  color: var(--pink);
}

.sync-status {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
}
.sync-status.ok { color: var(--green); }
.sync-status.syncing { color: #8a7a9a; }
.sync-status.error { color: #e74c3c; }

/* ===== 主导航 ===== */
.nav-item {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.nav-item:hover {
  background: var(--pink-soft);
  transform: translateY(-1px);
}
.nav-item.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  box-shadow: 0 4px 14px rgba(255,107,157,0.35);
  transform: translateY(-1px);
}

/* ===== 主内容 ===== */
.main-area {
  flex: 1;
  overflow: auto;
  padding: 14px 20px 20px;
}

/* Custom scrollbar */
.main-area::-webkit-scrollbar,
.file-tree::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.main-area::-webkit-scrollbar-track,
.file-tree::-webkit-scrollbar-track {
  background: transparent;
}
.main-area::-webkit-scrollbar-thumb,
.file-tree::-webkit-scrollbar-thumb {
  background: var(--lavender);
  border-radius: 3px;
}
.main-area::-webkit-scrollbar-thumb:hover,
.file-tree::-webkit-scrollbar-thumb:hover {
  background: var(--purple);
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

.hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--purple-soft);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--purple);
}

/* ===== 首页网格 ===== */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.dash-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(234,222,245,0.6);
  position: relative;
  overflow: hidden;
}

.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dash-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--lavender);
}

.dash-card:hover::before {
  opacity: 1;
}

.dash-card.wide { grid-column: 1 / -1; }

.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dash-head h2 { font-size: 1rem; }
.dash-link { font-size: 0.8rem; color: var(--pink); }
.date-tag { font-size: 0.85rem; color: var(--text-light); font-weight: 400; }

.dash-stat-row {
  display: flex;
  gap: 16px;
  justify-content: space-around;
  text-align: center;
}

.dash-stat-row .big {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--pink);
  text-shadow: 0 1px 2px rgba(255,107,157,0.15);
}

.dash-stat-row .label {
  font-size: 0.75rem;
  color: var(--text-light);
}

.mini-bar {
  height: 8px;
  background: var(--lavender);
  border-radius: 999px;
  margin-top: 12px;
  overflow: hidden;
}
.mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 999px;
  transition: width 0.5s;
}

/* ===== 日历 ===== */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.cal-day-name { font-size: 0.75rem; color: var(--text-light); padding: 4px 0; }
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #f8f4fc;
  transition: all 0.15s ease;
}
.cal-day.has-study {
  background: linear-gradient(135deg, #ffb6d5, #d4a5ff);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(255,107,157,0.2);
}
.cal-day.today {
  outline: 2.5px solid var(--pink);
  outline-offset: 1px;
  font-weight: 700;
  background: var(--pink-soft);
}
.cal-day.empty { background: transparent; }

/* ===== 视频布局 ===== */
.video-layout {
  display: flex;
  min-height: calc(100vh - 140px);
  gap: 12px;
}

.video-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(234,222,245,0.5);
}

.sidebar-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.folder-status {
  font-size: 0.75rem;
  color: var(--green);
  margin-top: 6px;
  word-break: break-all;
}

.tree-search {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.tree-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--lavender);
  border-radius: 999px;
  font-size: 0.85rem;
  outline: none;
}
.tree-search input:focus { border-color: var(--pink); }

.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  font-size: 0.85rem;
}

.tree-empty, .empty-hint {
  text-align: center;
  color: var(--text-light);
  padding: 24px 12px;
  font-size: 0.9rem;
}

.tree-folder, .tree-file {
  user-select: none;
}

.tree-folder-label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.tree-folder-label:hover { background: var(--pink-soft); }

.tree-children {
  padding-left: 14px;
  border-left: 1.5px solid var(--lavender);
  margin-left: 8px;
}

.tree-file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s ease;
}
.tree-file-item:hover {
  background: var(--purple-soft);
  transform: translateX(2px);
}
.tree-file-item.active {
  background: linear-gradient(135deg, var(--pink-soft), var(--purple-soft));
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(255,107,157,0.12);
}
.tree-file-item .prog-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  flex-shrink: 0;
}
.tree-file-item .prog-dot.partial { background: #f39c12; }
.tree-file-item .prog-dot.done { background: var(--green); }

.tree-toggle {
  width: 16px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-light);
}

.video-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: auto;
}

.player-zone {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(234,222,245,0.5);
}

.player-placeholder {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-light);
  background: linear-gradient(160deg, #fdfbff, var(--purple-soft));
}
.ph-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(180,140,220,0.2));
}
.ph-hint { font-size: 0.8rem; margin-top: 6px; }

.player-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.player-title-bar h3 {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#video-player {
  width: 100%;
  max-height: 45vh;
  background: #000;
  display: block;
}

.player-meta {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.course-cards-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  flex: 1;
  min-height: 0;
  border: 1px solid rgba(234,222,245,0.5);
}

.section-title {
  font-size: 1rem;
  margin-bottom: 12px;
}

.course-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.course-card {
  background: linear-gradient(145deg, #fff, var(--pink-soft));
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(180,140,220,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(180,140,220,0.15);
}

.course-card h4 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-card .c-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.course-card .c-bar {
  height: 10px;
  background: var(--lavender);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.course-card .c-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 999px;
  transition: width 0.4s;
}

.course-card .c-pct {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pink);
  text-align: right;
}

/* ===== 编辑页通用布局 ===== */
.editor-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.editor-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  min-width: 280px;
  flex: 1;
  border: 1px solid rgba(234,222,245,0.5);
}

.editor-panel.grow { flex: 2; min-width: 320px; }

.editor-panel h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== 表单 / 按钮 ===== */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--lavender);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fdfbff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255,107,157,0.1);
  background: #fff;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn.primary {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  box-shadow: 0 4px 12px rgba(255,107,157,0.3);
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255,107,157,0.4);
}
.btn.secondary { background: var(--lavender); color: var(--text); }
.btn.secondary:hover { background: var(--purple-soft); transform: translateY(-1px); }
.btn.success {
  background: linear-gradient(135deg, #7dcea0, #52be80);
  color: white;
  box-shadow: 0 4px 12px rgba(82,190,128,0.3);
}
.btn.success:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(82,190,128,0.4); }
.btn.small { padding: 6px 12px; font-size: 0.8rem; }
.btn.danger { background: #ffb3b3; color: #c0392b; }
.btn.full { width: 100%; }

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filter-bar select {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  border: 1.5px solid var(--lavender);
  border-radius: 999px;
  font-size: 0.9rem;
  outline: none;
}

/* ===== 单词 / 错题 / 成绩 / 科目 ===== */
.vocab-add {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.vocab-add input {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border: 1.5px solid var(--lavender);
  border-radius: 999px;
  font-size: 0.95rem;
  outline: none;
}
.vocab-add input:focus { border-color: var(--pink); }

.vocab-list { display: flex; flex-direction: column; gap: 8px; }
.vocab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--purple-soft);
  border-radius: 10px;
}
.vocab-item.done { background: var(--green-soft); opacity: 0.9; }
.vocab-word { font-weight: 700; min-width: 80px; }
.vocab-meaning { flex: 1; color: var(--text-light); }
.vocab-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--purple);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.vocab-item.done .vocab-check {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8f4fc, #fff);
  border-radius: 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}
.history-item:hover { transform: translateX(2px); }

.wrong-list { display: flex; flex-direction: column; gap: 12px; }
.wrong-item {
  padding: 16px;
  background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
  border-radius: 12px;
  border-left: 4px solid var(--pink);
  box-shadow: 0 2px 8px rgba(231,76,60,0.06);
  transition: transform 0.2s ease;
}
.wrong-item:hover { transform: translateX(2px); }
.wrong-item.mastered {
  background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
  border-left-color: var(--green);
  opacity: 0.9;
}
.wrong-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.wrong-subject {
  font-size: 0.8rem;
  background: var(--pink);
  color: white;
  padding: 2px 10px;
  border-radius: 999px;
}
.wrong-date { font-size: 0.8rem; color: var(--text-light); }
.wrong-content { font-size: 0.95rem; margin-bottom: 4px; }
.wrong-answer {
  font-size: 0.85rem;
  color: var(--green);
  background: #e8f8f0;
  padding: 6px 10px;
  border-radius: 8px;
  margin-top: 6px;
}
.wrong-actions { display: flex; gap: 8px; margin-top: 10px; }

.grade-list { display: flex; flex-direction: column; gap: 10px; }
.grade-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff5fb, #f5eeff);
  border-radius: 12px;
  border-left: 4px solid var(--pink);
  box-shadow: 0 2px 8px rgba(180,140,220,0.08);
  transition: transform 0.2s ease;
}
.grade-item:hover { transform: translateX(2px); }
.grade-score {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--pink);
  min-width: 52px;
  text-align: center;
}
.grade-score.high { color: var(--green); }
.grade-score.mid { color: #e67e22; }
.grade-score.low { color: #e74c3c; }
.grade-info { flex: 1; min-width: 0; }
.grade-subject-tag {
  font-size: 0.8rem;
  background: var(--purple);
  color: white;
  padding: 2px 10px;
  border-radius: 999px;
  margin-right: 6px;
}
.grade-date { font-size: 0.85rem; color: var(--text-light); }
.grade-note { font-size: 0.85rem; margin-top: 2px; }

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.subject-card {
  background: linear-gradient(145deg, #fff, var(--pink-soft));
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(180,140,220,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(234,222,245,0.5);
}
.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(180,140,220,0.18);
}
.subject-card .emoji {
  font-size: 2rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}
.subject-card .name { font-weight: 600; margin-bottom: 8px; }
.progress-bar {
  height: 8px;
  background: var(--lavender);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 999px;
  transition: width 0.5s;
}
.subject-card .time { font-size: 0.8rem; color: var(--text-light); }

/* ===== 弹窗 ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(70, 50, 90, 0.4);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
.modal-content {
  background: white;
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  border: 1px solid var(--border);
}
.modal-content h3 { margin-bottom: 16px; text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .video-layout { flex-direction: column; height: auto; }
  .video-sidebar { width: 100%; max-height: 280px; }
  
  .topbar { flex-wrap: nowrap; padding: 8px 12px; gap: 6px; }
  .logo-sub { display: none; }
}

@media (max-width: 600px) {
  .home-grid { grid-template-columns: 1fr; }
  .today-stats { grid-template-columns: repeat(2, 1fr); }
  .editor-layout { flex-direction: column; }
  .quick-links-wrap { /* keep */ }
}

/* ===== 成绩曲线：宽图、一屏高度 ===== */
.grade-chart-panel {
  width: 100%;
  padding: 14px 18px 10px;
}
.grade-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.grade-chart-head h2 { margin-bottom: 0; }
.grade-chart-filter {
  margin-bottom: 0;
  min-width: 180px;
}
.grade-chart-wrap {
  position: relative;
  width: 100%;
  height: min(42vh, 380px);
  min-height: 220px;
}
.grade-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}


/* ===== 首页：打卡条 + 分组卡片 ===== */
.home-compact {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.checkin-bar .checkin-flame { font-size: 1.4rem; }
.checkin-bar .checkin-sub { flex: 0 0 auto; }
.checkin-bar .checkin-badges { flex: 1 1 auto; justify-content: flex-end; margin-top: 0; }
.checkin-bar .btn { flex: 0 0 auto; }

.home-section { display: flex; flex-direction: column; gap: 10px; }
.home-sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.95rem; font-weight: 700; color: var(--purple);
}
.home-sec-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--lavender), rgba(232,213,255,0));
}
.home-grid { display: grid; gap: 12px; }
.home-grid > .dash-card { display: flex; flex-direction: column; }
.home-grid .home-mini-chart { margin-top: auto; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1180px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cols-4 { grid-template-columns: 1fr; }
  .checkin-bar { flex-wrap: wrap; }
  .checkin-bar .checkin-badges { order: 3; flex-basis: 100%; justify-content: flex-start; }
}

.dash-card.compact {
  padding: 12px 14px;
}
.dash-card.compact .dash-head {
  margin-bottom: 8px;
}
.dash-card.compact .dash-head h2 {
  font-size: 0.92rem;
}
.dash-card.compact .dash-stat-row .big {
  font-size: 1.25rem;
}
.dash-card.compact .dash-stat-row .label {
  font-size: 0.7rem;
}
.dash-card.compact .mini-bar {
  margin-top: 8px;
  height: 6px;
}

.home-mini-chart {
  position: relative;
  width: 100%;
  height: 72px;
}
.home-mini-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

.calendar.compact-cal {
  gap: 3px;
}
.calendar.compact-cal .cal-day-name {
  font-size: 0.7rem;
  padding: 2px 0;
}
.calendar.compact-cal .cal-day {
  font-size: 0.72rem;
  border-radius: 6px;
  aspect-ratio: 2;
  min-width: 0;
  min-height: 0;
  padding: 1px 0;
}

/* 三大天空：与其余卡片同一套浅色粉色系 */
.sky-mini-card {
  background: linear-gradient(150deg, #fff 0%, var(--pink-soft) 100%);
  border-color: var(--border);
}
.sky-mini-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--sky-accent), rgba(255,255,255,0));
}
.sky-mini-card .dash-stat-row .big { color: var(--sky-accent); }
.sky-mini-card .dash-stat-row .big.know { color: var(--purple); }
.sky-mini-card .sky-mini-note {
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 6px;
}
.accent-poet { --sky-accent: #b06ae0; }
.accent-hist { --sky-accent: #ff6b9d; }
.accent-book { --sky-accent: #e58fb8; }



/* 某日日记顶部的提示条 */
.daily-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 16px;
  border-left: 4px solid var(--pink);
  position: relative;
}


/* ===== 视频页：更高播放器 · 更矮课程卡片 · 双进度条 ===== */
.video-main {
  gap: 8px;
}
#video-player {
  max-height: 58vh;
  min-height: 280px;
}
.course-cards-section {
  padding: 8px 12px;
}
.course-cards {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.course-card {
  padding: 8px 10px;
}
.course-card h4 {
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.course-card .c-stats {
  font-size: 0.72rem;
  margin-bottom: 4px;
}
.course-card .c-bar {
  height: 6px;
  margin-bottom: 3px;
}
.course-card .c-bar.bar-play .c-fill {
  background: linear-gradient(90deg, #85c1e9, #5dade2);
}
.course-card .c-bar.bar-watched .c-fill {
  background: linear-gradient(90deg, var(--pink), var(--purple));
}
.course-card .c-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-light);
  margin-bottom: 1px;
}
.course-card .c-pct {
  font-size: 0.75rem;
  margin-top: 2px;
}

@media (max-width: 1000px) {
  .top-nav { margin-left: 0; width: 100%; }
}

/* 首页最近视频播放器 */
.home-recent-player {
  margin-top: 6px;
}
.home-recent-title {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#home-recent-video {
  width: 100%;
  max-height: 100px;
  border-radius: 8px;
  background: #111;
  display: block;
}

/* 课程表 */
.sch-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(180,140,220,0.08);
}
.sch-table th, .sch-table td {
  border: 1px solid var(--border);
  padding: 6px;
  text-align: center;
}
.sch-table th {
  background: linear-gradient(135deg, var(--purple-soft), var(--pink-soft));
  font-weight: 600;
  color: var(--text);
}
.sch-table.mini { font-size: 0.65rem; }
.sch-table.mini th, .sch-table.mini td { padding: 3px 2px; }
.sch-table.mini td.has {
  background: linear-gradient(135deg, #ffe4f1, #f0e6ff);
  font-weight: 600;
  color: var(--pink);
  border-radius: 4px;
}
.sch-table select {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 0.8rem;
  padding: 4px 2px;
}
.mini-schedule { overflow: auto; max-height: 100%; }

/* 甘特图 */
.gantt-mini, .gantt-full-inner { font-size: 0.75rem; }
.gantt-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.gantt-name {
  width: 72px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.gantt-name small {
  display: block;
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.7rem;
}
.gantt-track {
  display: flex;
  flex: 1;
  gap: 1px;
  height: 14px;
}
.gantt-cell {
  flex: 1;
  background: #f0eaf8;
  border-radius: 2px;
  min-width: 4px;
}
.gantt-cell.on {
  background: linear-gradient(90deg, #ff6b9d, #c77dff);
}
.gantt-cell.today {
  outline: 1px solid #ff6b9d;
}
.gantt-head {
  display: flex;
  margin-left: 78px;
  gap: 1px;
  margin-bottom: 4px;
}
.gantt-day-label {
  flex: 1;
  font-size: 0.6rem;
  color: var(--text-light);
  text-align: center;
  min-width: 4px;
}
.gantt-full { overflow-x: auto; margin: 12px 0; }
.plan-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.plan-form input, .plan-form select {
  padding: 8px 12px;
  border: 1.5px solid var(--lavender);
  border-radius: 10px;
  font-size: 0.9rem;
}
.plan-list { display: flex; flex-direction: column; gap: 8px; }
.plan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8f4fc, #fff);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.plan-item:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(180,140,220,0.1);
}
.plan-dates { font-size: 0.8rem; color: var(--text-light); }

/* 视频播放器更高 */
#video-player {
  max-height: 68vh !important;
  min-height: 360px !important;
}

.schedule-editor {
  overflow-x: auto;
}
.sch-table select {
  min-width: 72px;
  cursor: pointer;
}
.sch-table select:focus {
  outline: 2px solid var(--pink);
  border-radius: 4px;
}
.sch-table th {
  background: #f5eefc;
  font-weight: 600;
  white-space: nowrap;
}

/* 首页课程表更高更清晰 */
.home-charts-row > .dash-card:first-child {
  min-height: 220px;
}
.mini-schedule {
  overflow: auto;
  flex: 1;
  min-height: 160px;
}
.sch-table.mini {
  font-size: 0.72rem;
  height: 100%;
}
.sch-table.mini th, .sch-table.mini td {
  padding: 5px 3px;
  height: 22px;
}
.sch-table.mini td.has {
  border-radius: 4px;
}

/* 计划详情 */
.detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.detail-top h2 { margin: 0; flex: 1; }
.plan-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.plan-detail-card {
  background: linear-gradient(160deg, #fdfbff, #f8f4fc);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  box-shadow: 0 2px 8px rgba(180,140,220,0.06);
  transition: box-shadow 0.2s ease;
}
.plan-detail-card:hover {
  box-shadow: 0 4px 14px rgba(180,140,220,0.12);
}
.plan-detail-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.plan-detail-card textarea {
  flex: 1;
  width: 100%;
  min-height: 120px;
  border: 1.5px solid var(--lavender);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.9rem;
  resize: vertical;
  font-family: inherit;
}
.attach-row {
  margin-top: 10px;
}
.attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.attach-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.attach-open {
  flex: 1;
  text-align: left;
  border: none;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text);
  border: 1px solid var(--border);
}
.attach-open:hover { border-color: var(--pink); color: var(--pink); }
.attach-empty {
  font-size: 0.75rem;
  color: var(--text-light);
}
.plan-hint {
  font-size: 0.72rem;
  color: var(--pink);
  margin-top: 2px;
}
.plan-item-title:hover {
  color: var(--pink);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .plan-detail-grid { grid-template-columns: 1fr; }
}

/* 月历增强 */
.cal-entry-card {
  min-height: 160px;
  display: flex;
  flex-direction: column;
}
.cal-entry-card .calendar {
  flex: 1;
  overflow: hidden;
  max-height: 200px;
}
.cal-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 0.68rem;
  color: var(--text-light);
}
.cal-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 3px;
  vertical-align: middle;
}
.cal-legend .dot.holiday { background: #e74c3c; }
.cal-legend .dot.important { background: #f5b041; }
.cal-legend .dot.study { background: var(--pink); }
.cal-day {
  cursor: pointer;
  position: relative;
}
.cal-day:hover:not(.empty) {
  transform: scale(1.08);
  background: var(--pink-soft);
}
.cal-day.holiday {
  color: #c0392b;
  font-weight: 700;
  background: #fdecea;
}
.cal-day.important {
  box-shadow: inset 0 -3px 0 #f5b041;
}
.cal-day.has-note::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c77dff;
}
.cal-day.has-study {
  background: #ffe4f1;
}
#day-content {
  width: 100%;
  border: 1.5px solid var(--lavender);
  border-radius: 10px;
  padding: 10px;
  font-family: inherit;
  font-size: 0.95rem;
}

/* 日记模块化 */
.day-diary .detail-top { margin-bottom: 10px; }
.diary-modules {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.diary-mod {
  background: linear-gradient(160deg, #fdfbff, #f8f4fc);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  transition: box-shadow 0.2s ease;
}
.diary-mod:hover {
  box-shadow: 0 2px 10px rgba(180,140,220,0.08);
}
.diary-mod-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mod-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--text);
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1.5px solid var(--lavender);
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s ease;
}
.chip:hover {
  border-color: var(--pink);
  background: var(--pink-soft);
  transform: translateY(-1px);
}
.chip.active {
  background: linear-gradient(135deg, #ff6b9d, #c77dff);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(255,107,157,0.3);
}
.diary-mod input[type="text"],
.diary-mod textarea {
  width: 100%;
  border: 1.5px solid var(--lavender);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
}
.diary-mod textarea { resize: vertical; }

@media (max-width: 700px) {
  .diary-mod-row { grid-template-columns: 1fr; }
}

/* 背单词增强 */
.vocab-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.vocab-toolbar select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--lavender);
}
.lookup-result {
  background: linear-gradient(160deg, #f8f4fc, #fff);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 10px 0;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(180,140,220,0.08);
}
.lookup-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.lookup-word { font-size: 1.3rem; }
.lookup-phonetic { color: var(--text-light); font-size: 0.9rem; }
.lookup-defs {
  list-style: none;
  padding: 0;
  margin: 0;
}
.lookup-defs li {
  margin: 6px 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.lookup-defs em {
  color: var(--pink);
  font-style: normal;
  font-size: 0.75rem;
  margin-right: 4px;
}
.btn-speak {
  border: none;
  background: var(--purple-soft);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
}
.btn-speak:hover { background: linear-gradient(135deg,#ff6b9d,#c77dff); }
.btn-speak.big-speak {
  width: auto;
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 8px;
}
.vocab-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #fff, var(--purple-soft));
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(180,140,220,0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vocab-item:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(180,140,220,0.12);
}
.vocab-item.done {
  background: linear-gradient(135deg, #fff, var(--green-soft));
  opacity: 0.9;
}
.vocab-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.vocab-phonetic { color: var(--text-light); font-size: 0.85rem; }
.vocab-status-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.st-btn {
  border: 1.5px solid var(--lavender);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}
.st-btn.on, .st-btn:hover {
  background: linear-gradient(135deg,#ff6b9d,#c77dff);
  color: #fff;
  border-color: transparent;
}
.vocab-item.status-mastered { opacity: 0.75; border-color: #7dcea0; }
.vocab-item.status-known { border-color: #85c1e9; }
.vocab-item.status-practice { border-color: #f5b041; }

.vocab-flash {
  min-height: 220px;
  background: linear-gradient(160deg, #fff5fb, #f0e6ff);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: inset 0 2px 8px rgba(180,140,220,0.08);
}
.flash-card { text-align: center; }
.flash-word {
  font-size: 2rem;
  font-weight: 700;
  margin: 8px 0;
  cursor: pointer;
}
.flash-phonetic { color: var(--text-light); margin-bottom: 12px; }
.flash-q { font-size: 0.9rem; margin-bottom: 8px; color: var(--text-light); }
.flash-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.flash-opt {
  border: 1.5px solid var(--lavender);
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
}
.flash-opt:hover { border-color: var(--pink); }
.flash-opt.correct { background: #d5f5e3; border-color: #27ae60; }
.flash-opt.wrong { background: #fadbd8; border-color: #e74c3c; }
.flash-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.flash-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

/* 日记：一行点选 + 列表 */
.diary-top-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.diary-mod.compact {
  padding: 10px;
}
.diary-mod.compact .chip {
  padding: 4px 10px;
  font-size: 0.8rem;
}
.day-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.entry-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.entry-type {
  flex-shrink: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--lavender);
  background: #fff;
  font-size: 0.85rem;
  min-width: 110px;
}
.entry-text {
  flex: 1;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--lavender);
  font-size: 0.9rem;
}
.autosave-hint {
  font-size: 0.8rem;
  color: #27ae60;
  font-weight: 500;
}

/* 日历悬停弹窗 */
.cal-popup {
  position: fixed;
  z-index: 9999;
  min-width: 200px;
  max-width: 260px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(100,60,140,0.2);
  border: 1px solid var(--border);
  padding: 12px 14px;
  pointer-events: auto;
  font-size: 0.85rem;
  display: none;
}
.cal-popup-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--pink);
}
.cal-popup-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
  color: var(--text);
}
.cal-popup-empty {
  color: var(--text-light);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .diary-top-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .diary-top-row { grid-template-columns: 1fr; }
  .entry-row { flex-wrap: wrap; }
}

/* 日记内容：一排两个独立卡片 */
.day-entries-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.entry-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
  box-shadow: 0 2px 10px rgba(180,140,220,0.08);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.entry-card:focus-within {
  border-color: var(--pink);
  box-shadow: 0 4px 20px rgba(255,107,157,0.15);
  transform: translateY(-1px);
}
.entry-card:hover {
  box-shadow: 0 4px 14px rgba(180,140,220,0.12);
}
.entry-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.entry-card .entry-type {
  flex: 1;
  min-width: 0;
  border: none;
  background: #f5eefc;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.entry-card .entry-del {
  border: none;
  background: #fdecea;
  color: #c0392b;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.entry-card .entry-del:hover { background: #e74c3c; color: #fff; }
.entry-card .entry-text {
  flex: 1;
  width: 100%;
  border: none;
  background: transparent;
  resize: vertical;
  min-height: 72px;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 4px 2px;
  line-height: 1.45;
}
.entry-card.type-happy { border-top: 3px solid #f5b041; }
.entry-card.type-sentence { border-top: 3px solid #c77dff; }
.entry-card.type-knowledge { border-top: 3px solid #85c1e9; }
.entry-card.type-proud { border-top: 3px solid #58d68d; }
.entry-card.type-note { border-top: 3px solid #ff6b9d; }

@media (max-width: 700px) {
  .day-entries-grid { grid-template-columns: 1fr; }
}

.entry-card .entry-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.entry-card .entry-card-head {
  margin-bottom: 2px;
}

/* ===== 日记：美图和足迹 + 附件 ===== */
.photo-card { border-top: 3px solid #f7dc6f; }
.pc-btns { display: flex; gap: 6px; flex-shrink: 0; }
.entry-card-head .entry-attach { flex-shrink: 0; }
.day-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  min-height: 60px;
}
.dp-empty {
  color: var(--text-light);
  font-size: 0.82rem;
  padding: 16px 2px;
}
.dp-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #f6f1fb;
  cursor: pointer;
}
.dp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-thumb.sel { border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink-soft); }
.dp-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 0.62rem;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 0;
}
.dp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(30, 20, 45, 0.72);
  pointer-events: none;
}
.dp-lightbox img {
  max-width: 78vw;
  max-height: 76vh;
  border: 4px solid #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.dp-cap {
  color: #fff;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 14px;
  border-radius: 999px;
}
.day-photo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.dpm-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  color: var(--text-light);
}
.dpm-item input {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
}
.dpm-place { flex: 1 1 180px; min-width: 0; }
.dpm-place input { width: 100%; }
.dpm-item select {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.dp-cat {
  position: absolute;
  top: 0;
  left: 0;
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1;
  padding: 4px 5px;
  border-bottom-right-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}
.entry-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ef-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f5eefc;
  border-radius: 999px;
  padding: 2px 4px 2px 10px;
  font-size: 0.74rem;
}
.ef-name {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.ef-name:hover { color: var(--pink); text-decoration: underline; }
.ef-chip em { font-style: normal; font-size: 0.68rem; color: var(--text-light); }
.ef-del {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #c0392b;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.ef-del:hover { background: #e74c3c; color: #fff; }

/* 错题图片与 OCR */
.wrong-upload-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.wrong-img-wrap {
  margin-top: 8px;
  background: #faf7fd;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
#wrong-canvas {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  cursor: crosshair;
  border-radius: 8px;
  background: #111;
}
.wrong-ocr-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin: 8px 0 6px;
  text-align: center;
}
.wrong-ocr-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.ocr-status {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--pink);
  text-align: center;
  min-height: 1.2em;
}
.wrong-thumb {
  margin: 8px 0;
}
.wrong-thumb img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: #f8f4fc;
}

/* 错题：左侧更窄 */
.wrong-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 14px;
  align-items: start;
}
.wrong-add-panel {
  max-width: 280px;
}
.wrong-img-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.wrong-img-preview img {
  max-width: 100%;
  max-height: 100px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* 全屏图片编辑 */
.wrong-fs {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 10, 30, 0.92);
  display: flex;
  flex-direction: column;
  padding: 10px;
}
.wrong-fs-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  padding: 6px 8px 10px;
  font-weight: 600;
}
.wrong-fs-canvas-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  min-height: 0;
}
.wrong-fs-canvas-wrap canvas {
  max-width: 100%;
  cursor: crosshair;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.wrong-fs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  margin-top: 8px;
}
.wrong-fs-bar .ocr-status {
  color: #ffb6d5;
  min-width: 120px;
}

.wrong-filters {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.month-filter-label {
  font-size: 0.8rem;
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.month-filter-label input[type="month"] {
  border: 1.5px solid var(--lavender);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.wrong-answer-wrap { margin: 8px 0; }
.wrong-answer.hidden-ans { display: none; }
.wrong-answer {
  margin-top: 6px;
  padding: 8px 10px;
  background: #eafaf1;
  border-radius: 8px;
  font-size: 0.9rem;
}
.wrong-redo {
  display: flex;
  gap: 6px;
  margin: 8px 0;
  flex-wrap: wrap;
}
.wrong-redo .redo-input {
  flex: 1;
  min-width: 140px;
  border: 1.5px solid var(--lavender);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.88rem;
}
.redo-feedback {
  font-size: 0.88rem;
  margin-bottom: 6px;
  min-height: 1.2em;
  border-radius: 8px;
  padding: 6px 10px;
}
.redo-feedback.ok {
  background: #d5f5e3;
  color: #1e8449;
  font-weight: 600;
}
.redo-feedback.bad {
  background: #fdecea;
  color: #c0392b;
}
.redo-feedback.warn {
  background: #fef9e7;
  color: #b7950b;
}

@media (max-width: 800px) {
  .wrong-layout { grid-template-columns: 1fr; }
  .wrong-add-panel { max-width: none; }
}

.wrong-hover-layer {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(15, 8, 25, 0.88);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.wrong-hover-layer.show { display: flex; }
.wrong-hover-layer img {
  max-width: min(96vw, 1200px); max-height: 92vh;
  object-fit: contain; border-radius: 12px;
}

/* 错题本：一行一条 */
.wrong-item.row {
  padding: 8px 10px;
  transform: none;
}
.wrong-item.row:hover {
  transform: none;
  background: #fdf8ff;
}
.wrong-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}
.wrong-img-hover {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f0e6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  border: 1px solid var(--border);
}
.wrong-img-hover.empty {
  opacity: 0.4;
  cursor: default;
}
.wrong-row .wrong-subject {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pink-soft);
  color: var(--pink);
  font-weight: 600;
}
.wrong-row .wrong-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-light);
  min-width: 52px;
}
.wrong-content-one {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}
.wrong-row .redo-input {
  width: 110px;
  flex-shrink: 0;
  border: 1.5px solid var(--lavender);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.8rem;
}
.wrong-row .btn.small {
  padding: 4px 8px;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.wrong-item.row .wrong-answer {
  margin-top: 6px;
  margin-left: 40px;
}
.wrong-item.row .redo-feedback {
  margin-left: 40px;
}
@media (max-width: 900px) {
  .wrong-row { flex-wrap: wrap; }
  .wrong-content-one { width: 100%; white-space: normal; }
}
a.nav-item {
  display: inline-flex;
  align-items: center;
}

/* 首页错题可视化 */
.wrong-home-card .home-wrong-chart-wrap {
  height: 80px;
  margin: 6px 0 4px;
  position: relative;
  overflow: hidden;
}
.home-wrong-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.hw-bar-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hw-label {
  font-size: 0.72rem;
  color: var(--text-light);
}
.hw-label b {
  color: var(--pink);
  font-weight: 700;
}
.hw-track {
  height: 10px;
  background: #f0eaf6;
  border-radius: 999px;
  overflow: hidden;
}
.hw-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  min-width: 0;
}
.hw-fill.today {
  background: linear-gradient(90deg, #ff6b9d, #ff8fab);
  box-shadow: 0 0 8px rgba(255,107,157,0.35);
}
.hw-fill.month {
  background: linear-gradient(90deg, #c77dff, #85c1e9);
  box-shadow: 0 0 8px rgba(199,125,255,0.3);
}

/* 课程表：高亮第二天 */
.sch-table.mini th.day-hi {
  background: linear-gradient(135deg, #ff6b9d, #c77dff) !important;
  color: #fff !important;
  border-radius: 6px 6px 0 0;
  font-weight: 700;
}
.sch-table.mini td.col-hi {
  background: rgba(255, 107, 157, 0.18) !important;
  box-shadow: inset 0 0 0 1.5px rgba(255, 107, 157, 0.45);
}
.sch-table.mini td.col-hi.has {
  background: linear-gradient(135deg, #ffe4f1, #f0e6ff) !important;
  color: var(--pink);
  font-weight: 700;
}

/* 译林背单词 */
.yilin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.yilin-layout.with-list {
  grid-template-columns: 1fr 320px;
}
.yilin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.yilin-toolbar select {
  border: 1.5px solid var(--lavender);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.85rem;
}
.yilin-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
}
.yilin-stats-bar b { color: var(--pink); }
.yilin-card {
  min-height: 280px;
  background: linear-gradient(160deg, #fff5fb, #f0e6ff);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border);
}
.yl-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 8px; }
.yl-prompt {
  font-size: 2rem;
  font-weight: 700;
  margin: 10px 0;
  cursor: pointer;
}
.yl-prompt.zh { font-size: 1.35rem; font-weight: 600; }
.yl-phonetic { color: var(--text-light); margin-bottom: 12px; }
.yl-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 480px;
  margin: 12px auto 0;
}
.yl-choice {
  border: 1.5px solid var(--lavender);
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  font-size: 1.12rem;
  line-height: 1.45;
}
.yl-choice:hover { border-color: var(--pink); }
.yl-choice.correct { background: #d5f5e3; border-color: #27ae60; }
.yl-choice.wrong { background: #fadbd8; border-color: #e74c3c; }
.yl-input-row {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin: 16px auto 0;
}
.yl-input-row input {
  flex: 1;
  border: 1.5px solid var(--lavender);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
}
.yl-feedback {
  margin-top: 12px;
  min-height: 1.4em;
  font-weight: 600;
}
.yl-feedback.ok { color: #1e8449; }
.yl-feedback.bad { color: #c0392b; }
.yilin-nav, .yilin-mark {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.yilin-list {
  max-height: 65vh;
  overflow: auto;
}
.yl-list-row {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid #f3e8fa;
  font-size: 0.82rem;
  cursor: pointer;
}
.yl-list-row:hover { background: #fff5fb; }
.yl-tag {
  font-size: 0.7rem;
  background: #f5eefc;
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--text-light);
  flex-shrink: 0;
}
.yl-w { font-weight: 600; min-width: 70px; }
.yl-m { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6a5a7a; }

.yl-example {
  margin: 10px auto 14px;
  max-width: 520px;
  text-align: left;
  background: rgba(255,255,255,0.75);
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--lavender);
}
.yl-ex-en {
  font-size: 1.02rem;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.45;
}
.yl-ex-zh {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.4;
}
.yl-ex-loading {
  font-size: 0.85rem;
  color: var(--text-light);
}
.yl-input-row input {
  font-size: 1.1rem !important;
}

/* 手机课程表不被拉长 */
#home-schedule, .mini-schedule {
  overflow: auto;
  max-height: 220px;
  -webkit-overflow-scrolling: touch;
}
.sch-table.mini {
  width: 100%;
  table-layout: fixed;
  font-size: 0.62rem;
}
.sch-table.mini th,
.sch-table.mini td {
  padding: 2px 1px;
  height: auto;
  line-height: 1.2;
  word-break: break-all;
}
@media (max-width: 600px) {
  #home-schedule, .mini-schedule {
    max-height: 180px;
  }
  .sch-table.mini {
    font-size: 0.58rem;
  }
  .sch-table.mini th,
  .sch-table.mini td {
    padding: 1px;
  }
  /* 全屏错题框选：禁止页面滚动抢触摸 */
  .wrong-fs {
    touch-action: none;
  }
  .wrong-fs-canvas-wrap {
    touch-action: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  #wrong-canvas {
    touch-action: none;
    max-width: 100%;
  }
}

.vocab-level-mini, .vocab-level-box {
  margin-top: 8px;
}
.vocab-level-mini .vl-name, .vocab-level-box .vl-row {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.vocab-level-mini .vl-name b, .vocab-level-box b {
  color: var(--pink);
}
.vl-track {
  height: 8px;
  background: #f0eaf6;
  border-radius: 999px;
  overflow: hidden;
}
.vl-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff6b9d, #c77dff, #85c1e9);
  transition: width 0.4s ease;
}

/* 首页单词卡片：近3天待练 */
.home-vocab-recent {
  margin-top: 8px;
}
.home-vocab-recent .hvr-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
}
.home-vocab-recent .hvr-list {
  max-height: 92px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  scrollbar-width: thin;
}
.home-vocab-recent .hvr-word {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  background: var(--pink-soft);
  border-radius: 8px;
  padding: 3px 9px;
  white-space: nowrap;
}
}
.vl-tip {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
}

.checkin-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff5fb, #f0e6ff);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(180,120,200,0.08);
}
.checkin-bar.checked {
  background: linear-gradient(135deg, #e8f8ef, #e8f4ff);
}
.checkin-bar .btn { margin-left: auto; }
.checkin-flame {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(255,107,157,0.3));
}
.checkin-sub {
  font-size: 0.82rem;
  color: var(--text-light);
}
.checkin-sub b { color: var(--pink); }
#btn-checkin.done {
  background: #d5f5e3;
  color: #1e8449;
  box-shadow: none;
  cursor: default;
}

.vl-goal, .vl-tip {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
  line-height: 1.35;
}
.vl-cheer {
  margin-top: 8px;
  padding: 8px 10px;
  background: linear-gradient(135deg, #fff5fb, #f0e6ff);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
  border: 1px solid var(--border);
}
.vl-daily {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pink);
}
.vl-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe4f1, #e8d5ff);
  color: var(--pink);
  font-weight: 600;
  vertical-align: middle;
}

.checkin-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.ci-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffeaa7, #fdcbcb);
  color: #9a5b00;
  font-weight: 600;
}

.wrong-hover-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3001;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #c0392b;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  font-weight: 700;
}
.wrong-hover-close:hover {
  background: #e74c3c;
  color: #fff;
}
.wrong-hover-layer.show {
  pointer-events: auto;
}

.yl-dict-name {
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(90deg, #ff6b9d, #c77dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-right: 4px;
}
.yl-upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.yl-example {
  margin: 10px auto 12px;
  max-width: 520px;
  text-align: left;
  background: rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--lavender);
}
.yl-ex-en { font-size: 0.95rem; margin-bottom: 4px; line-height: 1.4; }
.yl-ex-zh { font-size: 0.85rem; color: var(--text-light); }

/* 背单词：状态同一行，主区域留给卡片 */
.yilin-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 6px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.ys-item b { color: var(--pink); }
.ys-goal { color: var(--text); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ys-cheer { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ys-daily input {
  width: 42px;
  border: 1px solid var(--lavender);
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 0.8rem;
  margin: 0 2px;
}
.yl-track-slim {
  height: 6px;
  margin-bottom: 10px;
}
.yl-ex-zh.hidden-trans {
  cursor: pointer;
  color: var(--pink);
  font-size: 0.85rem;
  text-decoration: underline dotted;
}
.yl-ex-zh-full {
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  margin-top: 4px;
}
.btn-speak-mini {
  border: none;
  background: #f0e6ff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 0.85rem;
  vertical-align: middle;
  margin-left: 4px;
}
.yilin-card { min-height: 320px; }
.yilin-main { flex: 1; }
.yilin-layout { min-height: calc(100vh - 120px); }

.rot-slider-lab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #fff;
}
.rot-slider-lab input[type="range"] {
  width: 100px;
  accent-color: #ff6b9d;
}
.wrong-fs-hint {
  color: rgba(255,255,255,0.75);
  font-size: 0.75rem;
  padding: 4px 12px 10px;
  margin: 0;
  text-align: center;
}
.wrong-fs-bar {
  flex-wrap: wrap;
  gap: 6px;
}

.day-sync-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .day-sync-row { grid-template-columns: 1fr; }
}
.day-sync-card {
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.day-sync-num {
  font-size: 0.9rem;
  margin: 4px 0 8px;
  color: var(--text-light);
}
.day-sync-num b {
  font-size: 1.3rem;
  color: var(--pink);
}
.day-sync-card textarea {
  width: 100%;
  border: 1.5px solid var(--lavender);
  border-radius: 10px;
  padding: 8px;
  font-size: 0.85rem;
  resize: vertical;
  font-family: inherit;
}

.py-content {
  font-size: 1.25rem;
  line-height: 1.9;
  margin: 16px 0;
  white-space: pre-wrap;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
}
.home-preview-snippet {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.4;
  max-height: 3.2em;
  overflow: hidden;
}
.home-preview-imgs {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.home-preview-imgs img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
}
.preview-img-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.preview-img-item {
  position: relative;
  width: 100px;
}
.preview-img-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.preview-img-item .btn {
  margin-top: 4px;
  width: 100%;
}
.day-sync-row {
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 900px) {
  .day-sync-row {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

/* 首页学习计划卡 */
.plan-card .mini-gantt {
  min-height: 120px;
}

/* ===== 首页读书卡片 ===== */
.home-book {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.home-book-cover {
  width: 52px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--purple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(180,140,220,0.2);
}
.home-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-book-cover .hb-ph {
  font-size: 1.6rem;
}
.home-book-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 甘特图下方成绩卡片：图表占80% ===== */
.grade-below-card {
  height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.grade-below-card .dash-head {
  flex: 0 0 auto;
  margin-bottom: 6px;
}
.grade-below-card .home-grade-below-wrap {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
.home-grade-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== 读书页面 ===== */
.reading-panel {
  padding: 12px;
}
.reading-layout {
  display: flex;
  gap: 12px;
  height: calc(100vh - 140px);
  min-height: 420px;
}
.bookshelf {
  flex: 0 0 20%;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 12px;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.bookshelf h2 {
  font-size: 1rem;
  margin-bottom: 2px;
}
.bs-counts {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.bs-counts b {
  color: var(--pink);
  font-size: 1.05rem;
}
.bs-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}
.bs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fdfbff;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.bs-item:hover {
  box-shadow: 0 2px 8px rgba(180,140,220,0.12);
}
.bs-item.active {
  border-color: var(--pink);
  background: var(--pink-soft);
}
.bs-cover {
  width: 34px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--purple-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.bs-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bs-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bs-title {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bs-status {
  align-self: flex-start;
  border: none;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.68rem;
  background: var(--purple-soft);
  color: var(--text);
  cursor: pointer;
}
.bs-status.st-reading { background: var(--pink-soft); color: var(--pink); }
.bs-status.st-read { background: #e8f8ef; color: #27ae60; }
.bs-status.st-toread { background: #fef9e7; color: #b7950b; }
.bs-status-row { display: flex; align-items: center; gap: 4px; }
.bs-empty { color: var(--text-light); font-size: 0.8rem; text-align: center; padding: 14px 4px; }
.bs-del {
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  flex-shrink: 0;
}
.bs-del:hover { color: #e74c3c; }

.reader {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fdfbff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.reader-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.reader-now {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.95rem;
}
.reader-body {
  flex: 1;
  min-height: 0;
  display: none;
  background: #fff;
  overflow: auto;
}
.reader:fullscreen {
  background: #fff;
}
.reader:fullscreen .reader-body {
  background: #fff;
}
@media (max-width: 700px) {
  .reading-layout {
    flex-direction: column;
    height: auto;
  }
  .bookshelf {
    flex: 0 0 auto;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 10px;
  }
  .bs-list {
    max-height: 180px;
  }
  .reader {
    min-height: 60vh;
  }
}

.poetry-layout {
  display: grid !important;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 800px) {
  .poetry-layout {
    grid-template-columns: 1fr;
  }
}
.poetry-list-panel {
  max-width: none !important;
  max-height: calc(100vh - 100px);
  overflow: auto;
}
.poetry-list-panel h2 {
  margin-bottom: 8px;
}
.poetry-card {
  min-height: 360px;
  text-align: center;
  padding: 24px 20px;
}
.py-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-light);
}
.py-meta span {
  background: #f5eefc;
  padding: 2px 10px;
  border-radius: 999px;
}
.py-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 8px 0 12px;
  color: var(--text);
}
.py-author-line {
  margin-bottom: 20px;
  font-size: 1.25rem;
  color: var(--text);
}
.py-dynasty {
  margin-right: 8px;
  color: var(--pink);
  font-weight: 600;
}
.py-author {
  font-weight: 600;
}
.py-content {
  font-size: 1.55rem !important;
  line-height: 2.1 !important;
  margin: 18px auto 20px !important;
  max-width: 36em;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif !important;
  color: #2c1810;
}
.py-meaning {
  margin: 16px auto 0;
  max-width: 40em;
  text-align: left;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-light);
  background: rgba(255,255,255,0.85);
  border: 1px dashed var(--lavender);
  border-radius: 12px;
  padding: 12px 16px;
}

.py-sec-label {
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.py-notes {
  margin: 14px auto 0;
  max-width: 40em;
  text-align: left;
  background: #fffaf5;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}
.py-notes ul { margin: 0; padding-left: 1.2em; }
.py-notes li { margin-bottom: 6px; }

.home-vocab-chart-wrap,
.home-poetry-chart-wrap {
  height: 80px;
  margin-top: 8px;
  overflow: hidden;
}
.home-poetry-bars {
  margin-top: 6px;
}

/* ===== 美图分类角标 ===== */
.dp-cat { pointer-events: none; }

/* ===== 荣誉墙（首页底部，纵向时间线） ===== */
.honor-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
  max-height: 340px;
  overflow-y: auto;
}
.ht-item { position: relative; padding-left: 30px; }
.ht-item:before {
  content: "";
  position: absolute;
  left: 10px;
  top: 4px;
  bottom: -14px;
  width: 2px;
  background: linear-gradient(to bottom, var(--yellow), var(--pink));
  opacity: 0.4;
}
.ht-item:last-child:before { bottom: auto; height: 20px; }
.ht-when { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; }
.ht-when b { font-weight: 700; color: var(--text); }
.ht-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.2;
}
.ht-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.ht-thumb {
  position: relative;
  width: 132px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--yellow-soft);
  background: #f6f1fb;
  cursor: zoom-in;
}
.ht-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ht-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 0.66rem;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 0;
}
.ht-empty { color: var(--text-light); font-size: 0.82rem; padding: 10px 2px; }

/* ===== 照片墙 ===== */
.pw-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-tab {
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.pw-tab.on { background: var(--pink-soft); border-color: var(--pink); color: var(--pink); }
.pw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.pw-tile {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f6f1fb;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.pw-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.pw-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 10px 8px;
  background: linear-gradient(to top, rgba(40, 25, 60, 0.78), rgba(40, 25, 60, 0));
  color: #fff;
  font-size: 0.74rem;
}
.pw-cap b { font-weight: 700; }
.pw-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== 导入照片：旋转后确认 ===== */
.prm-content { max-width: min(980px, 100%); }
.prm-count { font-size: 0.8rem; color: var(--text-light); font-weight: 600; margin-left: 8px; }
.prm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: 62vh;
  overflow-y: auto;
}
.prm-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffafc;
}
.prm-pic {
  position: relative;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3edf9;
}
.prm-pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .18s ease;
}
.prm-name {
  font-size: 0.74rem;
  color: var(--text-light);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prm-info {
  font-size: 0.74rem;
  color: var(--purple);
  font-weight: 600;
  text-align: center;
}
.prm-btns { display: flex; gap: 6px; justify-content: center; }
.prm-empty {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== 读书：服务器存储 + 阅读进度 ===== */
.bs-upload-status {
  font-size: 0.74rem;
  color: var(--text-light);
  line-height: 1.4;
  margin: 6px 2px 0;
  word-break: break-all;
}
.bs-upload-status.bad { color: #c0392b; }
.bs-meta {
  font-size: 0.72rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.bs-cloud { font-size: 0.75rem; }
.reader-toolbar { flex-wrap: wrap; }
.reader-prog {
  font-size: 0.78rem;
  color: var(--purple);
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}
.reader-pager { display: none; gap: 6px; }
.reader-body .pdf-page {
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 14px rgba(120, 90, 160, 0.18);
}
.home-book-main { flex: 1; min-width: 0; }
.home-book-sub {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 2px;
}
.day-reading-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 92px;
  overflow-y: auto;
}
.drl-item { font-size: 0.8rem; }
.drl-item b { color: var(--pink); }
.drl-empty { font-size: 0.75rem; color: var(--text-light); }

/* ===== 折叠屏 / 窄屏适配 ===== */
/* 折叠屏和手机浏览器的地址栏会吃掉可视高度，只用 100vh 容易把底部裁掉 */
.app-shell { min-height: 100vh; min-height: 100dvh; }

@media (max-width: 900px) {
  /* 顶栏：标题和右侧按钮占第一行；导航换到第二行、可横向滑动。
     折叠屏展开约 670px、折叠态外屏约 344px 时不再挤压标题、溢出屏幕 */
  .topbar { flex-wrap: wrap; row-gap: 6px; padding: 8px 12px 6px; align-items: center; }
  .topbar-left { flex: 1 1 0%; min-width: 0; }
  .logo-text { min-width: 0; }
  .logo-text h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-nav {
    order: 5;
    flex: 1 0 100%;
    width: 100%;
    max-width: none;
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav-item { padding: 7px 12px; font-size: 0.85rem; }
  .topbar-right { gap: 6px; }
  .main-area { padding: 12px 14px 16px; }
  .video-layout { min-height: 0; }
  /* 兜底：个别页面元素再宽，也不让整页被撑出横向滚动 */
  body { overflow-x: hidden; }
}

/* 折叠屏展开（宽 560~900、内屏高度偏矮）：三大天空与日记保持两列，
   避免全部堆成一列后被拉得很长、要来回滚动 */
@media (min-width: 560px) and (max-width: 900px) {
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
  .day-entries-grid { grid-template-columns: 1fr 1fr; }
}

/* 窄屏（折叠态外屏、分屏）：顶栏只留图标，去掉会被裁掉的文字 */
@media (max-width: 520px) {
  .topbar { padding: 6px 10px 4px; }
  .logo-icon { font-size: 24px; }
  .logo-text h1 { font-size: 1rem; max-width: 132px; }
  .topbar-right { gap: 4px; }
  .topbar-right .btn.small { padding: 6px 9px; }
  .topbar-right .lbl,
  .quick-links-btn .lbl,
  .quick-links-btn .ql-caret { display: none; }
  #sync-status { display: none; }
  .main-area { padding: 10px 10px 14px; }
  .home-grid { grid-template-columns: 1fr; }
  .day-entries-grid { grid-template-columns: 1fr; }
  .pw-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}
