/* ============================================================
   学习笔记 App — 暗黑赛博朋克 / 叛逆中学生风格
   ============================================================ */

:root {
  --bg-primary: #0d0d0f;
  --bg-secondary: #16161a;
  --bg-card: #1e1e24;
  --bg-card-hover: #28282f;
  --bg-input: #23232a;
  --accent: #00e5ff;
  --accent2: #b14eff;
  --accent3: #ff3d71;
  --accent4: #00e676;
  --text-primary: #eaeaea;
  --text-secondary: #8888a0;
  --text-muted: #555568;
  --border: #2a2a35;
  --shadow: 0 4px 24px rgba(0, 0, 0, .5);
  --glow: 0 0 12px rgba(0, 229, 255, .45);
  --radius: 14px;
  --radius-sm: 8px;
  --nav-height: 64px;
  --header-height: 120px;
}

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

html, body {
  height: 100%;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

/* ---------- app shell ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  background: var(--bg-primary);
}

/* ---------- pages ---------- */
.pages {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease;
}
.page.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 2;
}

/* ---------- header ---------- */
.page-header {
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, var(--bg-secondary) 60%, transparent);
  position: relative;
  z-index: 5;
}
.page-header.no-sub { padding-bottom: 0; }
.header-content {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 44px;
}
.header-content h1 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
}
.header-content > button,
.header-content > div {
  flex-shrink: 0;
  z-index: 1;
}
.back-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--accent);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .2s, color .2s, border-color .2s;
}
.back-btn:hover, .back-btn:active {
  background: var(--accent);
  color: #000;
  box-shadow: var(--glow);
}
.header-content h1 {
    flex: 1;
    text-align: center;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .5px;
}
.accent {
  color: var(--accent);
  text-shadow: var(--glow);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-btn {
  background: none; border: none; cursor: pointer;
  font-size: 20px; line-height: 1;
  opacity: .7; transition: opacity .2s, transform .3s;
  padding: 4px;
}
.settings-btn:hover { opacity: 1; transform: rotate(60deg); }
.notification-dot {
  width: 8px; height: 8px;
  background: var(--accent3);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent3);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.avatar-small {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
}
.header-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}
.glow {
  color: var(--accent3);
  text-shadow: 0 0 8px rgba(255, 61, 113, .6);
  font-weight: 700;
}

/* ---------- page body ---------- */
.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  -webkit-overflow-scrolling: touch;
}
.chat-body { padding: 0 !important; display: flex; flex-direction: column; }
#page-chat .page-header { padding: 12px 0 10px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  height: var(--nav-height);
  display: flex;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  transition: color .2s, transform .2s;
  cursor: pointer;
  position: relative;
}
.nav-item .nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-item .nav-icon svg {
  width: 100%;
  height: 100%;
}
.nav-item .nav-label { font-size: 10px; font-weight: 500; }
.nav-item.active {
  color: var(--accent);
  transform: scale(1.08);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: var(--glow);
}

/* ============================================================
   主页
   ============================================================ */
.card-section { margin-bottom: 20px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-header h2 {
  font-size: 17px;
  font-weight: 700;
}
.more-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.card-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.card-scroll::-webkit-scrollbar { display: none; }

/* 主页卡片 */
.home-card {
  flex: 0 0 180px;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--border);
  transition: transform .2s, border-color .2s;
  cursor: pointer;
}
.home-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.home-card .card-thumb {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  position: relative;
}
.home-card .card-thumb .tag {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  color: #000;
}
.tag-math { background: var(--accent); }
.tag-physics { background: var(--accent2); color: #fff; }
.tag-chem { background: var(--accent3); color: #fff; }
.tag-code { background: var(--accent4); }
.tag-english { background: #ffab40; }
.home-card .card-body { padding: 10px; }
.home-card .card-body h4 { font-size: 13px; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.home-card .card-body p { font-size: 11px; color: var(--text-secondary); }

/* 主页计划 */
.plan-preview { display: flex; flex-direction: column; gap: 8px; }
.plan-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}
.plan-item.done { border-left-color: var(--accent4); opacity: .55; }
.plan-item .plan-check { font-size: 18px; }
.plan-item .plan-text { font-size: 13px; font-weight: 500; }
.plan-item .plan-time { margin-left: auto; font-size: 11px; color: var(--text-secondary); }

/* ============================================================
   视频笔记 — 卡片 / 列表切换
   ============================================================ */
.view-toggle { display: flex; gap: 4px; }
.toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 16px;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.toggle-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: var(--glow);
}
.edit-toggle-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
  flex-shrink: 0;
  margin-left: 8px;
}
.edit-toggle-btn:hover,
.edit-toggle-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: var(--glow);
}
.edit-toggle-btn svg {
  width: 18px; height: 18px;
}
.filter-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.filter-chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* 黄夫人高中物理 - 视频笔记页内单卡片（独立在系列卡片上方） */
.hwf-section {
  margin-bottom: 16px;
}
.hwf-course-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid rgba(255,255,255,.1);
}
.hwf-course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(102,126,234,.4);
}
.hwf-course-card .hwf-cc-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: rgba(255,255,255,.15);
  display: grid; place-items: center;
  font-size: 36px;
  flex-shrink: 0;
}
.hwf-course-card .hwf-cc-info {
  flex: 1;
}
.hwf-course-card .hwf-cc-info h3 {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
}
.hwf-course-card .hwf-cc-info p {
  font-size: 12px;
  color: rgba(255,255,255,.75);
}
.hwf-course-card .hwf-cc-arrow {
  font-size: 20px;
  color: rgba(255,255,255,.6);
  flex-shrink: 0;
}

/* 学科分类标题 */
.category-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
}
.category-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 黄夫人详情页 - 合集标题栏 */
.hwf-episode-header {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hwf-episode-header .hwf-ep-badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 900;
  color: #000;
}
.hwf-episode-header .hwf-ep-info h3 {
  font-size: 15px; font-weight: 700;
}
.hwf-episode-header .hwf-ep-info p {
  font-size: 12px; color: var(--text-secondary);
}

/* 黄夫人剧集列表 */
.hwf-episode-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hwf-episode-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.hwf-episode-item:hover { border-color: var(--accent); }
.hwf-episode-item .ep-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.hwf-episode-item .ep-info {
  flex: 1;
  min-width: 0; /* 允许收缩，防止长文件名把右侧 logo 挤出容器 */
}
.hwf-episode-item .ep-info h4 {
  font-size: 13px; font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.hwf-episode-item .ep-info .ep-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  gap: 10px;
}
.hwf-episode-item .ep-play,
.hwf-episode-item .ep-status {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--text-secondary);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
  flex-shrink: 0;
}
.hwf-episode-item .ep-play:hover,
.hwf-episode-item .ep-status:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.hwf-episode-item .ep-status.done {
  border-color: #4CAF50;
  color: #4CAF50;
  background: rgba(76, 175, 80, 0.15);
}
.hwf-episode-item .ep-status.done:hover {
  border-color: #66BB6A;
  color: #66BB6A;
}

/* 系列集合卡片（视频页统一使用） */
.video-series-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}
.video-series-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, border-color .2s;
  border: 1px solid var(--border);
  position: relative;
}
.video-series-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.video-series-card .vs-icon {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: relative;
}
.video-series-card .vs-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.video-series-card .vs-info h4 {
  font-size: 13px; font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.3;
}
.video-series-card .vs-info p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,229,255,.15);
  color: var(--accent);
  margin-right: 4px;
}

/* ---------- 视频卡片图片区域 ---------- */
.video-series-card .vs-thumb {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* ---------- 编辑模式 ---------- */
.card-edit-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  gap: 5px;
  z-index: 5;
}
.video-series-card.editing .card-edit-actions,
.video-series-list.edit-mode .video-series-card .card-edit-actions {
  display: flex;
}
.card-edit-btn,
.card-delete-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.card-edit-btn { background: rgba(0,229,255,.85); color: #000; }
.card-edit-btn:hover { transform: scale(1.15); }
.card-delete-btn { background: rgba(255,61,113,.85); color: #fff; }
.card-delete-btn:hover { transform: scale(1.15); }
.card-edit-btn svg,
.card-delete-btn svg { width: 14px; height: 14px; }
/* 添加卡片按钮 — 与卡片等大 */
.add-card-btn {
  display: none;
  min-height: 140px;
  border: 2px dashed var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.add-card-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.add-card-btn .add-icon {
  font-size: 36px;
  line-height: 1;
}

/* 编辑模式下显示添加按钮 */
.video-series-list.edit-mode .add-card-btn {
  display: flex;
}

/* 编辑模式下卡片不可点击跳转 */
.video-series-list.edit-mode .video-series-card {
  pointer-events: none;
}
.video-series-list.edit-mode .video-series-card .card-edit-actions,
.video-series-list.edit-mode .video-series-card .card-edit-actions *,
.video-series-list.edit-mode .add-card-btn {
  pointer-events: auto;
}

/* 编辑/添加弹窗 */
.edit-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 400;
  display: none;
}
.edit-modal-overlay.show { display: block; }
.edit-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 92%; max-width: 420px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  z-index: 401;
  display: none;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);
}
.edit-modal.show { display: block; }
.edit-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.edit-modal-header h3 { font-size: 16px; font-weight: 700; }
.edit-modal-close {
  width: 32px; height: 32px; border: none;
  background: var(--bg-card); color: var(--text-secondary);
  border-radius: 50%; font-size: 20px; cursor: pointer;
}
.edit-modal-body { padding: 20px; }
.edit-modal-body .form-group { margin-bottom: 16px; }
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 16px;
}

.edit-modal-body label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.edit-modal-body input[type="text"],
.edit-modal-body textarea,
.edit-modal-body select {
  width: 100%; padding: 10px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-primary);
  font-size: 16px; font-family: inherit;
  outline: none; transition: border-color .2s;
  box-sizing: border-box;
}
.edit-modal-body select { cursor: pointer; }
.edit-modal-body input:focus,
.edit-modal-body textarea:focus { border-color: var(--accent); }
.edit-modal-body textarea { min-height: 80px; resize: vertical; }
.edit-modal-body .img-preview {
  margin-top: 8px; width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius-sm); background-size: cover;
  background-position: center; border: 1px solid var(--border);
  display: none;
}
.edit-modal-body .img-preview.visible { display: block; }
.edit-modal-footer {
  display: flex; gap: 10px; padding: 0 0 20px;
}
.edit-modal-footer .btn {
  flex: 1; padding: 12px; border-radius: var(--radius-sm);
  border: none; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-cancel { background: var(--bg-card); color: var(--text-secondary); }
.btn-cancel:hover { background: var(--bg-card-hover); }
.btn-save { background: var(--accent); color: #000; }
.btn-save:hover { background: #00c8e0; }
.btn-danger { background: var(--accent3); color: #fff; }
.btn-danger:hover { background: #e0305f; }

/* 确认删除弹窗 */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 500; display: none;
}
.confirm-overlay.show { display: block; }
.confirm-dialog {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 88%; max-width: 360px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  z-index: 501; display: none;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);
  text-align: center;
}
.confirm-dialog.show { display: block; }
.confirm-dialog .confirm-body {
  padding: 24px 20px 16px;
}
.confirm-dialog .confirm-body h3 { font-size: 16px; margin-bottom: 8px; }
.confirm-dialog .confirm-body p { font-size: 13px; color: var(--text-secondary); }
.confirm-dialog .confirm-actions {
  display: flex; gap: 10px; padding: 0 0 20px;
}

/* ============================================================
   AI助手 - 聊天
   ============================================================ */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg {
  display: flex;
  gap: 8px;
  max-width: 92%;
  padding: 0;
}
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px;
  background: var(--bg-card);
  flex-shrink: 0;
}
.msg.user .msg-avatar { background: linear-gradient(135deg, var(--accent), var(--accent2)); font-size: 16px; color: #000; font-weight: 700; }
.msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.5;
}
.msg.bot .msg-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: linear-gradient(135deg, var(--accent), #0091ea);
  color: #000;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.msg-bubble p + p { margin-top: 6px; }

.chat-input-bar {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.input-row {
  display: flex;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
}
.attach-btn {
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.camera-close svg,
.camera-rotate-btn svg {
  stroke: var(--accent);
}

.attach-btn svg,
.camera-btn svg,
.send-btn svg {
  stroke: var(--accent);
}

.attach-btn:hover {
  border-color: var(--accent);
  background: var(--bg-input);
}
.attached-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  min-height: 0;
}
.attached-file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
}
.attached-file .remove-file {
  cursor: pointer;
  margin-left: 2px;
  opacity: 0.6;
}
.attached-file .remove-file:hover { opacity: 1; }
.input-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: border-color .2s;
}
.input-row input:focus { border-color: var(--accent); box-shadow: var(--glow); }
.input-row input::placeholder { color: var(--text-muted); }
.send-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.send-btn:hover {
  border-color: var(--accent);
  background: var(--bg-input);
}
.send-btn:active { transform: scale(.9); }

.record-start-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--accent3);
  background: var(--bg-card);
  color: var(--accent3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, border-color .2s;
  margin-right: 8px;
}
.record-start-btn:hover {
  background: var(--accent3);
  color: #fff;
  box-shadow: 0 0 12px rgba(255,61,113,.4);
}
.record-start-btn.recording {
  background: var(--accent3);
  color: #fff;
  animation: recPulse 1.5s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255,61,113,.4); }
  50% { box-shadow: 0 0 18px rgba(255,61,113,.8); }
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent4);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status-dot.online { background: var(--accent4); box-shadow: 0 0 6px var(--accent4); animation: pulse-green 2s infinite; }
.status-dot.offline { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
@keyframes pulse-green { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

/* ============================================================
   音频笔记 — 卡片式
   ============================================================ */
.audio-series-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}
.audio-series-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, border-color .2s;
  border: 1px solid var(--border);
  position: relative;
}
.audio-series-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent3);
}
.audio-series-card .as-thumb {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: relative;
}
.audio-series-card .as-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.audio-series-card .as-info h4 {
  font-size: 13px; font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.3;
}
.audio-series-card .as-info p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 音频卡片编辑/删除按钮 */
.audio-series-card.editing .as-edit-actions,
.audio-series-list.edit-mode .audio-series-card .as-edit-actions {
  display: flex;
}
.as-edit-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  gap: 5px;
  z-index: 5;
}
.as-edit-btn,
.as-delete-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.as-edit-btn { background: rgba(0,229,255,.85); color: #000; }
.as-edit-btn:hover { transform: scale(1.15); }
.as-delete-btn { background: rgba(255,61,113,.85); color: #fff; }
.as-delete-btn:hover { transform: scale(1.15); }
.as-edit-btn svg,
.as-delete-btn svg { width: 14px; height: 14px; }

/* 音频添加卡片按钮 */
.add-audio-card-btn {
  display: none;
  min-height: 140px;
  border: 2px dashed var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  transition: background .2s, color .2s, border-color .2s;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.add-audio-card-btn:hover {
  border-color: var(--accent3);
  color: var(--accent3);
}
.add-audio-card-btn .add-icon {
  font-size: 36px;
  line-height: 1;
}
.audio-series-list.edit-mode .add-audio-card-btn {
  display: flex;
}

/* 编辑模式下音频卡片不可点击 */
.audio-series-list.edit-mode .audio-series-card {
  pointer-events: none;
}
.audio-series-list.edit-mode .audio-series-card .as-edit-actions,
.audio-series-list.edit-mode .audio-series-card .as-edit-actions *,
.audio-series-list.edit-mode .add-audio-card-btn {
  pointer-events: auto;
}

/* 音频详情页 */
.audio-episode-header {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.audio-episode-header .ae-badge {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), var(--accent2));
  display: grid; place-items: center;
  font-size: 18px;
}
.audio-episode-header .ae-info h3 {
  font-size: 15px; font-weight: 700;
}
.audio-episode-header .ae-info p {
  font-size: 12px; color: var(--text-secondary);
}
.audio-episode-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.audio-episode-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.audio-episode-item:hover { border-color: var(--accent3); }
.audio-episode-item .ae-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.audio-episode-item .ae-info { flex: 1; }
.audio-episode-item .ae-info h4 {
  font-size: 13px; font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100vw - 120px);
}
.audio-episode-item .ae-info .ae-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  gap: 10px;
}
.audio-episode-item .ae-play {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid var(--accent3);
  background: transparent;
  color: var(--accent3);
  font-size: 12px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.audio-episode-item .ae-play:hover {
  background: var(--accent3);
  color: #000;
}

/* 录音面板 */
.record-fab {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent3), var(--accent2));
  font-size: 20px;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 0 12px rgba(255, 61, 113, .4);
  transition: transform .2s;
}
.record-fab:active { transform: scale(.9); }

.audio-row {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color .2s;
}
.audio-row:hover { border-color: var(--accent3); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255, 61, 113, 0.2); }
.audio-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent3), var(--accent2));
  display: grid; place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.audio-info { flex: 1; }
.audio-info h4 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.audio-info .meta { font-size: 11px; color: var(--text-secondary); display: flex; gap: 10px; }
.audio-play {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent3);
  background: transparent;
  color: var(--accent3);
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.audio-play:hover { background: var(--accent3); color: #000; }
.audio-row .fav-btn { cursor: pointer; font-size: 16px; }

/* 录音面板 */
.record-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 100;
  display: none;
  place-items: center;
}
.record-panel.show { display: grid; }
.record-panel-inner {
  text-align: center;
  padding: 40px;
}
.record-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 60px;
  margin-bottom: 20px;
}
.wave-bar {
  width: 4px;
  background: var(--accent3);
  border-radius: 2px;
  animation: waveAnim .6s ease-in-out infinite alternate;
}
.wave-bar:nth-child(1) { height: 20px; animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 35px; animation-delay: .1s; }
.wave-bar:nth-child(3) { height: 50px; animation-delay: .2s; }
.wave-bar:nth-child(4) { height: 30px; animation-delay: .3s; }
.wave-bar:nth-child(5) { height: 55px; animation-delay: .15s; }
.wave-bar:nth-child(6) { height: 40px; animation-delay: .25s; }
.wave-bar:nth-child(7) { height: 25px; animation-delay: .35s; }
.wave-bar:nth-child(8) { height: 45px; animation-delay: .05s; }
.wave-bar:nth-child(9) { height: 20px; animation-delay: .2s; }
@keyframes waveAnim {
  from { transform: scaleY(.4); }
  to { transform: scaleY(1); }
}
.record-time {
  font-size: 42px;
  font-weight: 900;
  color: var(--accent3);
  text-shadow: 0 0 20px rgba(255, 61, 113, .5);
  font-variant-numeric: tabular-nums;
}
.record-hint {
  margin: 8px 0 24px;
  font-size: 13px;
  color: var(--text-secondary);
}
.record-actions { display: flex; gap: 20px; justify-content: center; }
.rec-btn {
  padding: 12px 28px;
  border-radius: 24px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s;
}
.rec-btn:active { transform: scale(.92); }
.rec-btn.cancel { background: var(--bg-card); color: var(--text-secondary); }
.rec-btn.stop { background: var(--accent3); color: #fff; box-shadow: 0 0 16px rgba(255,61,113,.4); }

/* ============================================================
   我的
   ============================================================ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.profile-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-primary);
  display: grid; place-items: center;
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
}
.profile-info h2 { font-size: 20px; font-weight: 900; }
.profile-tag {
  font-size: 12px;
  color: rgba(255,255,255,.8);
  font-weight: 600;
}
.switch-account {
  margin-left: auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.profile-section {
  margin-bottom: 20px;
}
.profile-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* 学习成果栏 */
.achievement-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.achievement-num-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.achievement-num {
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
}
.achievement-num .achievement-total {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}
.achievement-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}
.achievement-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-input);
  overflow: hidden;
}
.achievement-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  width: 0;
  transition: width .4s ease;
}
.achievement-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  justify-content: center;
}
.achievement-cat-chip {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
}
.achievement-cat-chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}

/* 账号列表 */
.account-list { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.account-list::-webkit-scrollbar { display: none; }
.account-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.account-chip.current { border-color: var(--accent); box-shadow: var(--glow); }
.account-chip .mini-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  color: #000;
}
.account-chip span { font-size: 13px; font-weight: 600; }

/* 收藏 tab */
.fav-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.fav-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.fav-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }
.fav-content { display: flex; flex-direction: column; gap: 8px; }
.fav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
}
.fav-item .fav-icon { font-size: 20px; }
.fav-item .fav-title { font-size: 13px; font-weight: 600; }
.fav-item .fav-meta { font-size: 11px; color: var(--text-secondary); }
.fav-item .unfav { margin-left: auto; cursor: pointer; color: var(--text-muted); }

/* 学习计划列表 */
.plan-list { display: flex; flex-direction: column; gap: 8px; }
.plan-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.plan-row.done { border-left-color: var(--accent4); opacity: .6; }
.plan-row .plan-emoji { font-size: 20px; }
.plan-row .plan-detail { flex: 1; }
.plan-row .plan-detail h4 { font-size: 13px; font-weight: 700; }
.plan-row .plan-detail p { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.plan-row .plan-check { cursor: pointer; font-size: 18px; }

/* 设置 */
.settings-list { display: flex; flex-direction: column; gap: 4px; }
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
}
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--text-muted);
  border-radius: 24px;
  cursor: pointer;
  transition: .2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  display: none;
}
.modal-overlay.show { display: block; }
.modal {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%; max-width: 480px;
  background: var(--bg-secondary);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 201;
  transition: transform .3s ease;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.modal.show { transform: translateX(-50%) translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}
.modal-body { padding: 16px 20px; }

/* ---------- 媒体播放器 (视频/音频) ---------- */
.media-player {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  place-items: center;
}
.media-player.show { display: grid; }

.player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(10px);
}
.player-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  padding: 16px;
}
.player-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.player-header h3 {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
  flex-shrink: 0;
}
.player-close:hover {
  background: var(--accent3);
  color: #fff;
  border-color: var(--accent3);
}

/* 视频包装器 */
.video-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
/* 续播提示条 */
.resume-tip {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 20;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.resume-tip-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.video-wrapper video {
  width: 100%;
  display: block;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}

/* 音频播放器 — 上下半屏布局 */
.audio-player-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 0 20px;
  overflow: hidden;
}
.audio-player-top {
  flex: 0 0 auto;
  padding: 0;
}
.audio-player-bottom {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
  min-height: 0;
}
.audio-art {
  margin: 12px 0 8px;
}
.audio-disc {
  width: 100px; height: 100px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent2), var(--accent3), var(--accent));
  display: grid; place-items: center;
  animation: spin 4s linear infinite;
  box-shadow: 0 0 20px rgba(0,229,255,.3);
}
.audio-disc.paused { animation-play-state: paused; }
.disc-inner {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  display: grid; place-items: center;
  font-size: 22px;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.audio-progress {
  margin: 8px 0 4px;
  padding: 0 8px;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width .3s;
}
.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 4px 0 8px;
}
.audio-ctrl-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.audio-ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }
.audio-ctrl-btn.play-big {
  width: 52px; height: 52px;
  font-size: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  border: none;
  box-shadow: var(--glow);
}
.audio-ctrl-btn.play-big:hover { transform: scale(1.05); }

/* 播放器操作按钮 */
.player-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0 0 4px;
}
.player-action-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.player-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.player-action-btn.faved { border-color: var(--accent4); color: var(--accent4); }

/* 音频播放器 — 笔记文本框 */
.audio-notes {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 音频聊天框 */
.audio-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.audio-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.audio-chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.audio-chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}
.audio-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), #0091ea);
  color: #000;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.audio-chat-bar {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.audio-chat-bar input {
  flex: 1;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.audio-chat-bar input:focus { border-color: var(--accent); }
.ai-chat-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background .2s, color .2s, border-color .2s;
}
.ai-chat-btn svg { width: 16px; height: 16px; }
.ai-chat-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-input); }
#audio-chat-send {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  cursor: pointer;
  flex-shrink: 0;
  display: grid; place-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
#audio-chat-send svg { width: 16px; height: 16px; }
#audio-chat-send:hover { transform: scale(1.05); }

/* 音频播放器 — Tab 切换（覆盖式） */
.audio-notes-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.audio-tab {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  margin-right: -1px;
}
.audio-tab:last-child { margin-right: 0; }
.audio-tab:hover { color: var(--text-primary); }
.audio-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  border-bottom-color: var(--bg-card);
  z-index: 1;
}
/* tab 区域全屏展开开关 */
.tab-expand-btn {
  flex: 0 0 auto;
  width: 44px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.tab-expand-btn:hover { color: var(--accent); }
.tab-expand-btn.expanded {
  color: var(--accent);
  background: var(--bg-card);
}
/* 三角形箭头：半屏=空心朝上(展开)，全屏=实心朝下(收起) */
.expand-arrow { display: block; }
.expand-arrow.solid { display: none; }
.tab-expand-btn.expanded .expand-arrow.outline { display: none; }
.tab-expand-btn.expanded .expand-arrow.solid {
  display: block;
  transform: rotate(180deg);
}

.audio-notes {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.audio-notes textarea {
  flex: 1;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 0 0 12px 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  line-height: 1.6;
  resize: none;
  outline: none;
  -webkit-appearance: none;
}
.audio-notes textarea::placeholder {
  color: var(--text-muted);
}
.audio-notes textarea:focus {
  background: var(--bg-input);
}

/* 视频无文件时的占位提示 */
.video-placeholder {
  height: 200px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  font-size: 48px;
  color: rgba(255,255,255,.3);
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 13px; }

/* 滚动条美化 */
.page-body::-webkit-scrollbar, .chat-messages::-webkit-scrollbar { width: 6px; }
.page-body::-webkit-scrollbar-thumb, .chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ============================================================
   平板 / 桌面端响应式
   ============================================================ */

/* ---------- 平板 ≥ 600px ---------- */
@media (min-width: 600px) {
  .nav-item .nav-icon { font-size: 24px; }
  .nav-item .nav-label { font-size: 11px; }
  .page-header h1 {
    font-size: 36px;
  }
  .page-body {
    padding: 12px 24px 24px;
  }
  .home-card {
    flex: 0 0 220px;
  }
}

/* ---------- 桌面 ≥ 960px ---------- */
@media (min-width: 960px) {
  :root {
    --radius: 16px;
  }
  .nav-item .nav-icon { font-size: 36px; }
  .nav-item .nav-label { font-size: 12px; }
  .page-body {
    padding: 16px 32px 32px;
  }
  .header-content h1 {
    flex: 1;
    text-align: center;
    font-size: 30px;
  }

  /* 主页卡片变宽 */
  .home-card {
    flex: 0 0 260px;
  }

  

  /* 音频列表撑满宽度 */
  .audio-row {
    width: 100%;
    box-sizing: border-box;
  }

  /* 聊天气泡加大 */
  .msg {
    max-width: 70%;
  }
  .msg-bubble {
    font-size: 15px;
    padding: 14px 18px;
  }

  /* profile 卡片 */
  .profile-header {
    max-width: 600px;
  }
}

/* ---------- 超大桌面 ≥ 1280px ---------- */
@media (min-width: 1280px) {

  .page-body {
    padding: 20px 48px 32px;
  }
  .header-content h1 {
    flex: 1;
    text-align: center;
    font-size: 32px;
  }
  .home-card {
    flex: 0 0 280px;
  }

}

/* 设置弹窗 */
.settings-modal { max-width: 400px; }
.settings-section { margin-bottom: 24px; }
.settings-section h4 { font-size: 15px; margin-bottom: 12px; color: var(--text-primary); }

/* 主题选择网格 */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform .2s;
}
.theme-option:hover { transform: scale(1.05); }
.theme-option.active .theme-preview {
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.theme-preview {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  border: 2px solid var(--border);
  position: relative;
  overflow: hidden;
}
.theme-preview::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 20px;
}
.theme-preview::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 12px;
}
.theme-light {
  background: #f5f5f5;
}
.theme-light::before { background: #ffffff; }
.theme-light::after { background: #e0e0e0; }
.theme-dark {
  background: #1a1a1a;
}
.theme-dark::before { background: #2d2d2d; }
.theme-dark::after { background: #0d0d0d; }
.theme-cyber {
  background: linear-gradient(135deg, #0a0e17 0%, #1e1b4b 50%, #0a0e17 100%);
  position: relative;
  overflow: hidden;
}
.theme-cyber::before {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.2), rgba(139, 92, 246, 0.2));
  height: 20px;
}
.theme-cyber::after {
n.theme-glass {
  background: linear-gradient(165deg, #0f2027 0%, #203a43 40%, #2c5364 100%);
  position: relative;
}
.theme-glass::before {
  background: rgba(255,255,255,0.1);
  height: 20px;
}
.theme-glass::after {
  background: linear-gradient(135deg, rgba(7,193,96,0.3), rgba(6,173,86,0.3));
  height: 12px;
}
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.15), rgba(139, 92, 246, 0.15));
n.theme-glass {
  background: linear-gradient(165deg, #0f2027 0%, #203a43 40%, #2c5364 100%);
  position: relative;
}
.theme-glass::before {
  background: rgba(255,255,255,0.1);
  height: 20px;
}
.theme-glass::after {
  background: linear-gradient(135deg, rgba(7,193,96,0.3), rgba(6,173,86,0.3));
  height: 12px;
}
  height: 12px;
n.theme-glass {
  background: linear-gradient(165deg, #0f2027 0%, #203a43 40%, #2c5364 100%);
  position: relative;
}
.theme-glass::before {
  background: rgba(255,255,255,0.1);
  height: 20px;
}
.theme-glass::after {
  background: linear-gradient(135deg, rgba(7,193,96,0.3), rgba(6,173,86,0.3));
  height: 12px;
}
}
n.theme-glass {
  background: linear-gradient(165deg, #0f2027 0%, #203a43 40%, #2c5364 100%);
  position: relative;
}
.theme-glass::before {
  background: rgba(255,255,255,0.1);
  height: 20px;
}
.theme-glass::after {
  background: linear-gradient(135deg, rgba(7,193,96,0.3), rgba(6,173,86,0.3));
  height: 12px;
}
.theme-option span {
  font-size: 12px;
  color: var(--text-secondary);
}
.theme-option.active span {
  color: var(--accent);
  font-weight: 600;
}

/* 二维码容器 */
.qrcode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.qrcode-wrapper {
  width: 200px;
  height: 200px;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.qrcode-wrapper canvas {
  width: 100%;
  height: 100%;
}
.qrcode-placeholder {
  color: #999;
  font-size: 16px;
}
.qrcode-hint {
  font-size: 13px;
  color: var(--text-secondary);
}
.qrcode-url {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  text-align: center;
  max-width: 100%;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* 音频列表撑满屏幕 */
#page-audio {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100vw;
  max-width: 100vw;
}

#page-audio .page-body {
  padding: 16px 16px 0 16px;
  width: 100%;
}

/* 音频卡片网格 */
#page-audio .audio-series-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

#page-audio .audio-row {
  margin: 0 0 8px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 12px 16px;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

#page-audio .audio-row:hover {
  border-color: var(--accent3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 61, 113, 0.2);
}

/* 视频编辑模式样式 */
.edit-mode-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.edit-mode-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.edit-mode-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.edit-mode-btn svg {
  width: 18px;
  height: 18px;
}

/* 卡片编辑/删除图标 */
.card-edit-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 6px;
  z-index: 5;
}

.video-series-card.editing .card-edit-actions {
  display: flex;
}

.card-edit-btn,
.card-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.card-edit-btn {
  background: var(--accent);
  color: #000;
}

.card-edit-btn:hover {
  transform: scale(1.1);
}

.card-delete-btn {
  background: var(--accent3);
  color: #fff;
}

.card-delete-btn:hover {
  transform: scale(1.1);
}

.card-edit-btn svg,
.card-delete-btn svg {
  width: 14px;
  height: 14px;
}

/* 编辑弹窗样式 */
.video-edit-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  z-index: 1000;
  display: none;
}

.video-edit-modal.show {
  display: block;
}

.video-edit-modal .form-group {
  margin-bottom: 16px;
}

.video-edit-modal label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.video-edit-modal input,
.video-edit-modal textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 16px;
  box-sizing: border-box;
}

.video-edit-modal textarea {
  min-height: 80px;
  resize: vertical;
}

.video-edit-modal .btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.video-edit-modal .btn-primary:hover {
  background: var(--accent2);
}

/* Bot avatar SVG */
.msg.bot .msg-avatar svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* AI icon in header */
.ai-icon {
  width: 30px;
  height: 30px;
  vertical-align: middle;
  margin-right: 4px;
  display: inline-block;
}

/* Thinking indicator */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
}
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
}
.thinking-bubble {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 4px 0;
}
.thinking-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-radius: 18px;
}
.thinking-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c4dff;
  display: inline-block;
  position: relative; top: 2px;
  animation: dotPulse 1.4s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   音频合并功能样式
   ============================================================ */
.merge-toggle-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}
.merge-toggle-btn:hover { background: rgba(255,255,255,0.15); }
.merge-toggle-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  color: #8b5cf6;
}
.merge-action-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}
.merge-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.merge-action-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.audio-episode-item.selected {
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: #8b5cf6 !important;
}
.ae-checkbox {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

/* ============================================================
   音频合并功能样式
   ============================================================ */
.merge-toggle-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}
.merge-toggle-btn:hover { background: rgba(255,255,255,0.15); }
.merge-toggle-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  color: #8b5cf6;
}
.merge-action-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}
.merge-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.merge-action-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.audio-episode-item.selected {
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: #8b5cf6 !important;
}
.ae-checkbox {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

/* ============================================================
   音频合并功能样式
   ============================================================ */
.merge-toggle-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}
.merge-toggle-btn:hover { background: rgba(255,255,255,0.15); }
.merge-toggle-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  color: #8b5cf6;
}
.merge-action-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}
.merge-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.merge-action-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.audio-episode-item.selected {
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: #8b5cf6 !important;
}
.ae-checkbox {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

/* ============================================================
   音频合并功能样式
   ============================================================ */
.merge-toggle-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}
.merge-toggle-btn:hover { background: rgba(255,255,255,0.15); }
.merge-toggle-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  color: #8b5cf6;
}
.merge-action-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: white;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}
.merge-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.merge-action-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.audio-episode-item.selected {
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: #8b5cf6 !important;
}
.ae-checkbox {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

/* 音频删除按钮 */
.ae-delete {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.ae-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* 编辑模式按钮 */
.edit-mode-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}
.edit-mode-btn:hover { background: rgba(255,255,255,0.15); }
.edit-mode-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #3b82f6;
}

/* 合并音频对话框 */
.merge-title-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  background: var(--bg-secondary);
  color: var(--text);
  margin-top: 12px;
}
.merge-title-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* 音频笔记保存按钮 */
.audio-notes-container {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.audio-notes-container textarea {
  flex: 1;
  resize: none;
  padding: 12px;
  padding-bottom: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}
.audio-notes-save-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.audio-notes-save-btn:hover {
  background: var(--accent-hover, #5a4fcf);
  transform: translateY(-1px);
}
.audio-notes-save-btn:active {
  transform: translateY(0);
}

/* 保存按钮禁用状态 */
.audio-notes-save-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 16px;
  z-index: 10000;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success {
  background: rgba(34, 197, 94, 0.9);
}
.toast.error {
  background: rgba(239, 68, 68, 0.9);
}

/* 标题栏麦克风按钮 */
.page-header h1 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-header h1 .record-start-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  margin-left: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.page-header h1 .record-start-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.page-header h1 .record-start-btn svg {
  width: 18px;
  height: 18px;
}

/* 主页 header-right 靠右 */
#page-home .header-right {
  margin-left: auto;
}

/* AI笔记页信号灯靠右 */
#page-chat .chat-status {
  margin-left: auto;
}

/* 音频笔记标题栏布局调整 */
#page-audio .header-title-group {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}

#page-audio .header-title-group h1 {
  position: static !important;
  transform: none !important;
  margin: 0;
  white-space: nowrap;
}

#page-audio .edit-toggle-btn {
  margin-left: auto;
}

/* 音频播放器全屏 */
#audio-player .player-container {
  max-width: 100%;
  padding: 16px 0;
}

/* 收藏按钮样式 - 绝对定位靠右，不干扰播放按钮居中 */
.audio-controls {
  position: relative;
}
.audio-controls .fav-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  font-size: 22px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.audio-controls .fav-btn.faved {
  color: #ffd700;
}

.audio-controls .fav-btn:hover {
  transform: translateY(-50%) scale(1.1);
}

/* 播放器标题居中 */
.player-header {
  position: relative;
}
.player-header h3 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  max-width: calc(100% - 60px);
}

/* 音频集合详情页标题居中 */
#hwf-detail-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  max-width: calc(100% - 60px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 视频笔记标题栏布局调整 */
#page-video .header-title-group {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}

#page-video .header-title-group h1 {
  position: static !important;
  transform: none !important;
  margin: 0;
  white-space: nowrap;
}

#page-video .edit-toggle-btn {
  margin-left: auto;
}
/* 视频播放器底部 Tab 样式 */
.video-player-bottom {
  margin-top: 20px;
  border-top: 1px solid #e0e0e0;
  padding-top: 20px;
}

.video-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.video-tab-content {
  min-height: 200px;
}

.video-panel {
  display: none;
}

.video-panel.active {
  display: block;
}

#video-notes {
  border: none;
  width: 100%;
  min-height: 200px;
  padding: 12px 14px;
  border-radius: 0 0 12px 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.7;
  overflow-y: auto;
  box-sizing: border-box;
}

/* 视频笔记 Markdown 渲染样式 */
#video-notes h1, #video-notes h2, #video-notes h3, #video-notes h4 {
  margin: 14px 0 6px;
  color: #7c4dff;
  line-height: 1.4;
}
#video-notes h1 { font-size: 1.35em; }
#video-notes h2 { font-size: 1.2em; }
#video-notes h3 { font-size: 1.05em; }
#video-notes p { margin: 6px 0; }
#video-notes ul, #video-notes ol { margin: 6px 0; padding-left: 22px; }
#video-notes li { margin: 3px 0; }
#video-notes strong { color: #ff9800; font-weight: 600; }
#video-notes blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid #7c4dff;
  background: rgba(124,77,255,.08);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}
#video-notes code {
  background: rgba(124,77,255,.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .9em;
}
#video-notes pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 10px 14px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}
#video-notes pre code { background: none; padding: 0; color: inherit; }
#video-notes table { border-collapse: collapse; margin: 8px 0; width: 100%; }
#video-notes th, #video-notes td { border: 1px solid var(--border); padding: 5px 9px; font-size: .92em; }
#video-notes th { background: rgba(124,77,255,.12); }
#video-notes hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
#video-notes img { max-width: 100%; border-radius: 6px; }
#video-notes .math-block { text-align: center; margin: 10px 0; overflow-x: auto; }
#video-notes .math-inline { white-space: nowrap; }

/* ============================================================
   练习面板
   ============================================================ */
.quiz-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: 0 0 12px 12px;
}
.quiz-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.quiz-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.quiz-sub { font-size: 12px; color: var(--text-muted); }
.quiz-regenerate-btn {
  margin-left: auto;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
}
.quiz-regenerate-btn:hover { background: var(--bg-card-hover); }
.quiz-loading { padding: 20px 0; text-align: center; color: var(--text-muted); }
.quiz-content {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}
.quiz-item {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.quiz-q {
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 8px;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.quiz-q-num { font-weight: 700; color: var(--accent); }
.quiz-q-type {
  flex-shrink: 0;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: rgba(124,77,255,.15);
  color: #7c4dff;
  font-weight: 600;
}
.quiz-q-text { flex: 1; min-width: 0; overflow-wrap: break-word; }
.quiz-opts { display: flex; flex-direction: column; gap: 6px; }
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color .15s, background .15s;
}
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt:has(input:checked) {
  border-color: var(--accent);
  background: rgba(124,77,255,.08);
}
.quiz-opt input { accent-color: #7c4dff; }
.quiz-opt-key {
  font-weight: 700;
  color: var(--accent);
  min-width: 16px;
  text-align: center;
}
.quiz-submit-btn {
  margin-top: 12px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #0091ea);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}
.quiz-submit-btn:hover { opacity: .88; }
.quiz-error { color: var(--text-muted); font-size: 13px; text-align: center; padding: 16px 0; }
.quiz-retry-btn {
  margin-left: 8px;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
}
.quiz-result-dialog { max-width: 400px; }
.quiz-result-dialog .confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 16px 24px;
}
.quiz-result-dialog .confirm-actions .btn {
  flex: 0 1 105px;
  min-width: 88px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background .2s, color .2s, opacity .2s;
}
.quiz-result-dialog .confirm-actions .btn-cancel {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.quiz-result-dialog .confirm-actions .btn-cancel:hover { background: var(--bg-card-hover); }
.quiz-result-dialog .confirm-actions .btn-save {
  background: var(--accent);
  color: #000;
}
.quiz-result-dialog .confirm-actions .btn-save:hover { opacity: .88; }
.quiz-result-dialog .confirm-actions .btn-ai {
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
}
.quiz-result-dialog .confirm-actions .btn-ai:hover { opacity: .88; }

.quiz-result-score { padding: 8px 0 4px; }
.quiz-score-num {
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.quiz-score-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
}
.quiz-score-sub { font-size: 16px; color: var(--text-secondary); margin-top: 4px; }
.quiz-result-detail { padding: 8px 0 4px; }
.quiz-wrong-list {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255,60,90,.08);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.quiz-wrong-list.quiz-all-right {
  background: rgba(0,200,224,.08);
  color: #00c8e0;
}

#video-player {
  place-items: start stretch;
}

#video-player .player-container {
  width: 100%;
  max-width: 100%;
  padding: 0 !important;
  margin: 0;
  height: 100%;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

#video-player .player-header {
  width: 100%;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
}
#video-player .player-header h3 {
  position: static;
  left: auto;
  transform: none;
  flex: 1;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
#video-player .player-close {
  flex-shrink: 0;
  position: relative;
  z-index: 101;
  width: 30px;
  height: 30px;
  font-size: 16px;
}
#video-player .video-fav-btn {
  font-size: 26px;
  margin-top: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 101;
}

#video-player .player-header {
  position: relative;
}

#video-player .title-popup {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  min-height: 100%;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.5;
  word-break: break-all;
  display: none;
  z-index: 100;
  overflow: auto;
  box-sizing: border-box;
}

#video-player .title-popup.show {
  display: block;
}

#video-player .video-wrapper {
  flex-shrink: 0;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#video-player .video-wrapper video {
  width: 100%;
  max-width: 100%;
  max-height: 50vh;
  height: auto;
}

#video-player .audio-player-bottom {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 全屏展开：tab 区域占满整个屏幕，遮盖视频播放器 */
#video-player.tab-fullscreen .audio-player-bottom {
  position: fixed;
  inset: 0;
  z-index: 500;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--bg-primary);
}
#video-player.tab-fullscreen .audio-notes,
#video-player.tab-fullscreen .quiz-panel,
#video-player.tab-fullscreen .audio-chat {
  border-radius: 0;
}

/* 视频控制栏 */
.video-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.video-volume {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.video-volume svg {
  width: 20px;
  height: 20px;
}

.video-fav-btn {
  background: none;
  border: none;
  font-size: 36px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.video-fav-btn.active {
  color: #ffd700;
}

/* 视频播放器AI助手消息容器 - 减少左边距 */
#video-player .audio-chat-msgs {
  padding: 12px;
}

/* 视频播放器AI助手消息气泡 - 减少左边距 */
#video-player .audio-chat-msg.assistant {
  padding-left: 0;
}

/* ---------- 视频播放器音量控制 ---------- */
#vol-control {
  position: absolute;
  top: 8px;
  right: 54px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,0.75);
  border-radius: 20px;
  padding: 4px 10px;
  backdrop-filter: blur(8px);
}
#vol-control .vol-label {
  font-size: 18px;
  line-height: 1;
}
#vol-control .vol-val {
  color: #fff;
  font-size: 12px;
  min-width: 32px;
  text-align: right;
  font-weight: 600;
}
#vol-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
#vol-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
/* 手机端音量控件更大 */
@media (max-width: 768px) {
  #vol-control {
    top: 10px;
    right: 50px;
    padding: 6px 12px;
    border-radius: 22px;
  }
  #vol-control .vol-label {
    font-size: 20px;
  }
  #vol-control .vol-val {
    font-size: 16px;
    min-width: 38px;
  }
  #vol-slider {
    width: 60px !important;
    height: 6px;
  }
  #vol-slider::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }
}

/* 确认弹窗单按钮模式 */
.confirm-dialog.alert-mode .confirm-actions {
  justify-content: center;
  padding: 0 0 24px;
}
.confirm-dialog.alert-mode .confirm-actions .btn {
  min-width: 120px;
  padding: 12px 32px;
  font-size: 15px;
  border-radius: 8px;
}

/* Markdown 聊天内容 */
.msg.bot .msg-bubble h1, .msg.bot .msg-bubble h2, .msg.bot .msg-bubble h3 {
  margin: 8px 0 4px; font-size: 1em; color: #7c4dff;
}
.msg.bot .msg-bubble ul, .msg.bot .msg-bubble ol { margin: 4px 0; padding-left: 18px; }
.msg.bot .msg-bubble li { margin: 2px 0; }
.msg.bot .msg-bubble code {
  background: rgba(124,77,255,.12); padding: 1px 5px; border-radius: 4px; font-size: .9em;
}
.msg.bot .msg-bubble pre {
  background: #1e1e2e; color: #cdd6f4; padding: 10px 14px; border-radius: 8px; overflow-x: auto; margin: 6px 0;
}
.msg.bot .msg-bubble pre code { background: none; padding: 0; color: inherit; font-size: .85em; }
.msg.bot .msg-bubble strong { color: #ff9800; font-weight: 600; }
.msg.bot .msg-bubble p { margin: 4px 0; }
.msg.bot .msg-bubble table { border-collapse: collapse; margin: 6px 0; }
.msg.bot .msg-bubble th, .msg.bot .msg-bubble td { border: 1px solid rgba(255,255,255,.15); padding: 4px 8px; font-size: .9em; }
.msg.bot .msg-bubble th { background: rgba(124,77,255,.15); }

/* 音频/视频 AI 助手 Markdown */
.audio-chat-msg.bot h1, .audio-chat-msg.bot h2, .audio-chat-msg.bot h3,
.audio-chat-msg.assistant h1, .audio-chat-msg.assistant h2, .audio-chat-msg.assistant h3 {
  margin: 8px 0 4px; font-size: 1em; color: #7c4dff;
}
.audio-chat-msg.bot ul, .audio-chat-msg.bot ol,
.audio-chat-msg.assistant ul, .audio-chat-msg.assistant ol { margin: 4px 0; padding-left: 18px; }
.audio-chat-msg.bot li, .audio-chat-msg.assistant li { margin: 2px 0; }
.audio-chat-msg.bot code, .audio-chat-msg.assistant code {
  background: rgba(124,77,255,.12); padding: 1px 5px; border-radius: 4px; font-size: .9em;
}
.audio-chat-msg.bot pre, .audio-chat-msg.assistant pre {
  background: #1e1e2e; color: #cdd6f4; padding: 10px 14px; border-radius: 8px; overflow-x: auto; margin: 6px 0;
}
.audio-chat-msg.bot pre code, .audio-chat-msg.assistant pre code { background: none; padding: 0; color: inherit; }
.audio-chat-msg.bot strong, .audio-chat-msg.assistant strong { color: #ff9800; font-weight: 600; }
.audio-chat-msg.bot p, .audio-chat-msg.assistant p { margin: 4px 0; }

/* 思考中动画 */
.thinking-msg { opacity: 0.7; }
.thinking-dots { margin: 0; padding: 8px 12px; display: flex; gap: 3px; align-items: center; font-size: 16px; }
.thinking-dots span {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  position: relative; top: 2px;
  background: #7c4dff; animation: dot-bounce 1.2s infinite ease-in-out;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .3; }
  40% { transform: translateY(-6px); opacity: 1; }
}
/* ---------- 头像下拉菜单 ---------- */
.avatar-wrapper {
  position: relative;
  cursor: pointer;
}
.avatar-dropdown {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  z-index: 100;
  overflow: hidden;
}
.avatar-dropdown.show {
  display: block;
}
.dropdown-item {
  padding: 12px 16px;
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background .15s;
}
.dropdown-item:hover {
  background: var(--bg-card-hover);
}

/* ============================================================
   登录遮罩层
   ============================================================ */
#login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, #0f2027 0%, #203a43 40%, #2c5364 100%);
  z-index: 9999;
  padding: 20px;
}
#login-overlay.show { display: flex; }

.login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 40px 30px 28px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: loginIn .35s ease;
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-logo {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  background: linear-gradient(135deg, #07c160, #059de0);
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(7,193,96,0.35);
}
.login-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.login-sub {
  margin: 0 0 30px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}
.login-phone-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(7,193,96,0.3);
  transition: transform .15s, opacity .2s;
}
.login-phone-btn:hover { transform: translateY(-1px); opacity: .95; }
.login-phone-btn:active { transform: scale(.98); }
.login-phone-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.login-qr-btn {
  width: 100%;
  padding: 16px;
  margin-top: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(79,172,254,0.3);
  transition: transform .15s, opacity .2s;
}
.login-qr-btn:hover { transform: translateY(-1px); opacity: .95; }
.login-qr-btn:active { transform: scale(.98); }
.login-qr-btn:disabled { opacity: .6; }
.login-qr-area {
  margin-top: 14px;
  padding: 18px;
  background: #fff;
  border-radius: 14px;
  text-align: center;
}
.login-qr-box { display: inline-block; background: #fff; padding: 8px; border-radius: 8px; }
.login-qr-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}
.login-more {
  margin-top: 18px;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 6px;
  user-select: none;
}
.login-more:hover { color: rgba(255,255,255,0.7); }
.login-more-area {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.login-pwd-form { display: flex; flex-direction: column; gap: 10px; }
.login-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 15px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .2s;
}
.login-input::placeholder { color: rgba(255,255,255,0.4); }
.login-input:focus { border-color: #07c160; }
.login-pwd-btn {
  width: 100%;
  padding: 13px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.login-pwd-btn:hover { background: rgba(255,255,255,0.1); }
.login-pwd-btn:disabled { opacity: .5; }
.login-register-link {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}
.login-register-link a { color: #07c160; text-decoration: none; }
.login-error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
  color: #ff6b6b;
}
.login-tip {
  margin: 14px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
}

/* 扫码登录 */

.login-qr-area {
  margin-top: 14px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  text-align: center;
}
.login-qr-box { display: inline-block; background: #fff; padding: 8px; border-radius: 8px; }
.login-qr-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
}

/* 设置密码弹窗 */
#account-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  padding: 20px;
}
#pwd-set-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  padding: 20px;
}
.pwd-set-card {
  width: 100%;
  max-width: 320px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
}
.pwd-set-card h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 18px;
}
.pwd-set-sub {
  margin: 0 0 18px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  line-height: 1.5;
}
.pwd-set-btn {
  width: 100%;
  padding: 13px;
  margin-top: 12px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.pwd-set-btn:disabled { opacity: .5; }
.pwd-set-skip {
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
}
.pwd-set-skip:hover { color: rgba(255,255,255,0.7); }
#pwd-set-error { margin-top: 10px; font-size: 13px; color: #ff6b6b; min-height: 18px; }

/* ===== Glass Theme (login-style) ===== */
body.theme-glass {
  background: linear-gradient(165deg, #0f2027 0%, #203a43 40%, #2c5364 100%) !important;
}
body.theme-glass .header,
body.theme-glass .nav-bar,
body.theme-glass .card,
body.theme-glass .settings-modal,
body.theme-glass .modal,
body.theme-glass .edit-modal {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}
body.theme-glass .nav-item {
  color: rgba(255,255,255,0.7) !important;
}
body.theme-glass .nav-item.active {
  color: #07c160 !important;
}
body.theme-glass .btn-primary,
body.theme-glass .login-phone-btn {
  background: linear-gradient(135deg, #07c160, #06ad56) !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(7,193,96,0.3) !important;
}
body.theme-glass h1, body.theme-glass h2, body.theme-glass h3, body.theme-glass h4 {
  color: #fff !important;
}
body.theme-glass .text-secondary,
body.theme-glass p {
  color: rgba(255,255,255,0.6) !important;
}

/* Profile inline layout */
.profile-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-inline .profile-avatar {
  width: 40px;
  height: 40px;
  font-size: 20px;
  margin: 0;
}
.profile-inline .profile-info {
  flex: 1;
}
.profile-inline .profile-info h2 {
  font-size: 16px;
  margin: 0;
}
.profile-inline .profile-tag {
  font-size: 12px;
  margin: 0;
}

/* 昵称编辑弹窗 - 毛玻璃风格 */
.nickname-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9998;
  display: none;
}
.nickname-modal-overlay.show { display: block; }

.nickname-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90%; max-width: 360px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  z-index: 9999;
  display: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.3s ease;
}
.nickname-modal.show { display: block; }

@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.nickname-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.nickname-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.nickname-modal-close {
  width: 32px; height: 32px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.nickname-modal-close:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.nickname-modal-body {
  padding: 20px;
}
.nickname-modal-body input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}
.nickname-modal-body input::placeholder {
  color: rgba(255,255,255,0.4);
}
.nickname-modal-body input:focus {
  border-color: #07c160;
  background: rgba(255,255,255,0.12);
}

.nickname-modal-footer {
  display: flex;
  gap: 12px;
  padding: 0 20px 20px;
}
.nickname-modal-footer .btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.nickname-modal-footer .btn-cancel {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
}
.nickname-modal-footer .btn-cancel:hover {
  background: rgba(255,255,255,0.15);
}
.nickname-modal-footer .btn-save {
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  box-shadow: 0 4px 12px rgba(7,193,96,0.3);
}
.nickname-modal-footer .btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(7,193,96,0.4);
}

/* 修改密码弹窗 - 毛玻璃风格 */
.changepwd-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9998;
}

.changepwd-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90%; max-width: 360px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  z-index: 9999;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.changepwd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.changepwd-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.changepwd-close {
  width: 32px; height: 32px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.changepwd-close:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.changepwd-body {
  padding: 20px;
}
.changepwd-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}
.changepwd-input::placeholder {
  color: rgba(255,255,255,0.4);
}
.changepwd-input:focus {
  border-color: #07c160;
  background: rgba(255,255,255,0.12);
}

.changepwd-error {
  color: #ff4d4f;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 20px;
}

.changepwd-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  box-shadow: 0 4px 12px rgba(7,193,96,0.3);
}
.changepwd-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(7,193,96,0.4);
}
.changepwd-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 设置页 - 账号信息 */
.account-info {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
}
.account-row:not(:last-child) {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.account-label {
  color: rgba(255,255,255,0.6);
  font-size: 16px;
}
.account-value {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}
.settings-action-btn {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.settings-action-btn:hover {
  background: rgba(255,255,255,0.12);
}
.settings-action-btn.logout-btn {
  background: rgba(255,59,48,0.15);
  color: #ff3b30;
}
.settings-action-btn.logout-btn:hover {
  background: rgba(255,59,48,0.25);
}

/* 毛玻璃主题 - 关闭按钮适配 */
body.theme-glass .modal-close,
body.theme-glass .nickname-modal-close,
body.theme-glass .changepwd-close {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
body.theme-glass .modal-close:hover,
body.theme-glass .nickname-modal-close:hover,
body.theme-glass .changepwd-close:hover {
  background: rgba(255,255,255,0.25) !important;
}

/* 毛玻璃主题 - 关闭按钮适配 */
body.theme-glass .modal-close,
body.theme-glass .edit-modal-close,
body.theme-glass .nickname-modal-close,
body.theme-glass .changepwd-close {
  background: rgba(255,255,255,0.15) !important;
  color: #fff !important;
}
body.theme-glass .modal-close:hover,
body.theme-glass .edit-modal-close:hover,
body.theme-glass .nickname-modal-close:hover,
body.theme-glass .changepwd-close:hover {
  background: rgba(255,255,255,0.25) !important;
}

/* 设置弹窗 - 限制高度，内容可滚动 */
.settings-modal {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.settings-modal .modal-header {
  flex-shrink: 0;
}
.settings-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* 日历组件样式 */
.calendar-section {
  margin-bottom: 24px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.cal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.cal-nav {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.cal-nav:hover {
  background: var(--bg-tertiary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.cal-weekday {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 12px;
  font-weight: 500;
}

.cal-day {
  position: relative;
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.cal-day-inner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day::before {
  content: '';
  display: block;
  padding-bottom: 100%;
}

.cal-day:hover {
  background: var(--bg-tertiary);
}

.cal-day.empty {
  background: transparent;
  cursor: default;
}

.cal-day.today {
  border: 2px solid #07c160;
  font-weight: 600;
}

.cal-day.planned {
  background: rgba(255, 59, 48, 0.15);
  border: 2px solid #ff3b30;
}

.cal-day.completed::after {
  content: '✓';
  position: absolute;
  font-size: 16px;
  color: #07c160;
  font-weight: bold;
}

.cal-day.failed::after {
  content: '✗';
  position: absolute;
  font-size: 16px;
  color: #ff3b30;
  font-weight: bold;
}

.cal-day.completed,
.cal-day.failed {
  color: transparent;
}

/* 副标题行 - 计划按钮 */
.header-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.header-sub-row .header-sub {
  margin: 0;
}
.plan-btn {
  padding: 6px 12px;
  border: none;
  background: rgba(7, 193, 96, 0.15);
  color: #07c160;
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.plan-btn:hover {
  background: rgba(7, 193, 96, 0.25);
}

/* AI 学习计划聊天弹窗 */
.plan-chat-modal {
  width: 90%;
  max-width: 500px;
  height: 80vh;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}
.plan-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.plan-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.chat-message {
  display: flex;
  margin-bottom: 16px;
  gap: 10px;
}
.chat-message.user-message {
  flex-direction: row-reverse;
}
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.message-content {
  max-width: 75%;
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: 16px;
}
.user-message .message-content {
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
}
.message-content p {
  margin: 0 0 8px 0;
}
.message-content p:last-child {
  margin-bottom: 0;
}
.quick-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.quick-btn {
  padding: 8px 14px;
  border: 1px solid rgba(7, 193, 96, 0.3);
  background: rgba(7, 193, 96, 0.1);
  color: #07c160;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.quick-btn:hover {
  background: rgba(7, 193, 96, 0.2);
  border-color: #07c160;
}
.plan-chat-input-area {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}
.plan-chat-input-area textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  resize: none;
  outline: none;
}
.plan-chat-input-area textarea:focus {
  border-color: #07c160;
}
.plan-chat-send-btn {
  padding: 10px 20px;
  border: none;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.plan-chat-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}
.plan-chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   设置弹窗 - 栏位默认隐藏，悬停下拉展开
   ============================================================ */
.settings-section h4 {
  padding: 8px 12px;
  margin: 0;
}

/* 内容默认全部展开（取消点击展开交互） */
.settings-section .account-info,
.settings-section .settings-action-btn {
  display: block;
}
.settings-section .theme-grid {
  display: grid;
}
.settings-section .qrcode-container {
  display: flex;
}
.settings-section .settings-action-btn {
  width: 100%;
  margin-top: 8px;
}

/* 设置弹窗栏位分割线 */
.settings-section + .settings-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}


/* 登录页底部链接行 */
.login-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.login-links a {
  color: #07c160;
  text-decoration: none;
}
.login-links a:hover { text-decoration: underline; }
.login-links-sep {
  color: rgba(255,255,255,0.3);
}

/* 账户设置弹窗按钮行 */
.acc-modal-btns {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.acc-modal-btns .pwd-set-btn { margin-top: 0; flex: 1; }
.acc-modal-btns .acc-cancel {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.acc-modal-btns .acc-cancel:hover { background: rgba(255,255,255,0.16); }

/* ===== 笔记编辑按钮 + 编辑器 ===== */
.notes-edit-btn {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  vertical-align: middle;
  transition: background .2s, color .2s;
}
.notes-edit-btn:hover { background: rgba(124,77,255,.15); }
.video-notes-editor {
  width: 100%;
  min-height: 340px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
}
.video-notes-editor:focus { outline: none; border-color: var(--accent); }
.notes-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}
.notes-edit-save, .notes-edit-cancel {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}
.notes-edit-save {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.notes-edit-save:disabled { opacity: .6; cursor: not-allowed; }
.notes-edit-cancel {
  background: transparent;
  color: var(--text-secondary);
}
.notes-edit-cancel:hover { color: var(--text-primary); }

/* ---------- 错题收藏 ---------- */
.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.modal-footer .btn {
  flex: 1;
  padding: 13px 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}

/* 收藏按钮（解析输出每题） */
.err-collect-btn {
  flex-shrink: 0;
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.err-collect-btn:hover { background: var(--accent); color: #000; }

/* 错题集卡片 */
.err-card .as-thumb { font-size: 28px; }

/* 错题详情页 */
.err-list { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.err-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.err-item-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.err-item-question {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.err-item-opts { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.err-opt { font-size: 14px; color: var(--text-secondary); }
.err-mark.ok { color: #4CAF50; font-weight: 700; }
.err-mark.ans { color: #4CAF50; }
.err-mark.wrong { color: #f44336; }
.err-item-explain {
  font-size: 13px;
  line-height: 1.6;
  padding: 10px;
  background: var(--bg-input);
  border-radius: 8px;
  color: var(--text-secondary);
}

/* 错题收藏弹窗层级：高于视频播放器(z-index:300)，避免被遮挡 */
#err-collect-overlay { z-index: 600; }
#err-collect-modal { z-index: 601; }

/* 错题详情：列表收起 + 点击展开 */
.err-item-title { cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.err-arrow { color: var(--text-secondary); font-size: 12px; flex-shrink: 0; }
.err-detail { margin-top: 8px; }
.err-title-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-title-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.err-del-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
}
.err-del-btn:hover { color: #f44336; background: rgba(244, 67, 54, 0.12); }

/* AI笔记聊天 - 用户上传的图片 */
.msg-images { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat-upload-img { max-width: 200px; max-height: 200px; border-radius: 8px; object-fit: contain; cursor: pointer; background: rgba(255,255,255,0.05); }
.chat-upload-img:hover { opacity: 0.85; }

/* 拍题按钮 */
.camera-btn {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, border-color .2s;
}
.camera-btn:hover {
  border-color: var(--accent);
  background: var(--bg-input);
}

/* 拍题弹窗 */
.camera-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.camera-modal-content {
  background: var(--bg-card);
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.camera-bottom-bar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.camera-title {
  font-size: 16px;
  font-weight: 500;
}
.camera-bottom-left,
.camera-bottom-right {
  flex: 0 0 auto;
  min-width: 40px;
}
.camera-bottom-actions {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
}
.camera-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}
.camera-close:hover {
  color: var(--text-primary);
}
.camera-view {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 16/9;
  max-height: calc(100vh - 80px);
  margin: auto;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.crop-box {
  position: absolute;
  border: 2px dashed #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  cursor: move;
}
.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
}
.crop-handle::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  bottom: -15px;
}
.crop-tl { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-tr { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-br { bottom: -6px; right: -6px; cursor: nwse-resize; }
.camera-preview {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.camera-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}
.cam-btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
}
.cam-capture {
  background: var(--accent);
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.cam-capture:hover {
  background: var(--accent-hover, #5a4fff);
  transform: scale(1.05);
}
.cam-retake {
  background: var(--bg-input);
  color: var(--text-primary);
}
.cam-retake:hover {
  background: var(--border);
}
.cam-confirm {
  background: var(--accent);
  color: #fff;
}
.cam-confirm:hover {
  background: var(--accent-hover, #5a4fff);
}

/* 横屏按钮 */
.camera-rotate-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.camera-rotate-btn:hover {
  background: rgba(255,255,255,0.1);
}

/* 横屏模式 - 旋转整个内容 */
.camera-modal.landscape .camera-modal-content {
  width: 100vw !important;
  height: 100vh !important;
}
.camera-modal.landscape .camera-view {
  flex: 1;
  aspect-ratio: 9/16;
  max-height: none;
  margin: 0;
}
.camera-modal.landscape .camera-preview {
  flex: 1;
  aspect-ratio: auto;
  max-height: none;
  margin: 0;
}

.file-input-hidden {  position: absolute;  top: 0;  left: 0;  width: 100%;  height: 100%;  opacity: 0;  cursor: pointer;}
