:root {
  --bg: #0a0d12;
  --panel: rgba(17, 23, 34, 0.65);
  --border: rgba(70, 90, 120, 0.35);
  --text: #e8edf5;
  --text-muted: #8b97a8;
  --accent: #ff7043;
  --accent-blue: #4ea1ff;
  --gradient-primary: linear-gradient(135deg, #4ea1ff 0%, #7b61ff 55%, #4ea1ff 100%);
  --gradient-accent: linear-gradient(135deg, #ff7043 0%, #ff3b5c 100%);
  --glow-blue: 0 0 18px rgba(78, 161, 255, 0.38), 0 0 46px rgba(78, 161, 255, 0.14);
  --glow-orange: 0 0 18px rgba(255, 112, 67, 0.4), 0 0 46px rgba(255, 112, 67, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 64px;
  --sidebar-w: 320px;
  --font: "Microsoft YaHei UI", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    repeating-linear-gradient(0deg, rgba(78, 161, 255, 0.03) 0, rgba(78, 161, 255, 0.03) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(78, 161, 255, 0.03) 0, rgba(78, 161, 255, 0.03) 1px, transparent 1px, transparent 40px),
    radial-gradient(circle at 10% 0%, rgba(78, 161, 255, 0.12) 0%, transparent 52%),
    radial-gradient(circle at 92% 92%, rgba(255, 112, 67, 0.06) 0%, transparent 46%),
    linear-gradient(180deg, #0a0d12 0%, #0d1118 50%, #0a0d12 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

.bg-layer { display: none; }

/* ── 顶栏（对齐 Webo .top） ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
  padding: 12px 24px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.3);
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* 官方 AQ Logo（与 juexingren.cn 一致） */
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  flex: 0 0 auto;
  font-size: 0;
  color: transparent;
  overflow: hidden;
  background: url("/assets/icons/aq_icon_64.png") center/cover no-repeat;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 24px rgba(78, 161, 255, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-text small {
  font-size: 12px;
  color: var(--text-muted);
}

.header-stats,
.header-course {
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

.header-course strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 2px;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  margin-bottom: 28px;
  animation: cardEnter 0.32s var(--ease) both;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #8eb8ff 0%, #4ea1ff 40%, #7b61ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.2;
  margin-bottom: 12px;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 640px;
}

/* ── 分类导航（对齐 .tabs） ── */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(70, 90, 120, 0.28);
  background: rgba(17, 23, 34, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.cat-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #b3bdcc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.22s var(--ease), background 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
  font-family: inherit;
}

.cat-pill:hover {
  color: #d6deeb;
  background: rgba(78, 161, 255, 0.08);
}

.cat-pill.active {
  color: #fff;
  background: rgba(17, 23, 34, 0.72);
  border-color: rgba(255, 112, 67, 0.45);
  box-shadow: inset 0 -2px 0 rgba(255, 112, 67, 0.55), 0 0 22px rgba(255, 112, 67, 0.14);
  text-shadow: 0 0 14px rgba(255, 112, 67, 0.28);
}

.course-section {
  margin-bottom: 32px;
  animation: cardEnter 0.32s var(--ease) both;
}

.course-section:nth-child(2) { animation-delay: 0.04s; }
.course-section:nth-child(3) { animation-delay: 0.08s; }
.course-section:nth-child(4) { animation-delay: 0.12s; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 18px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.section-head p {
  font-size: 13px;
  color: var(--text-muted);
}

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

/* ── 课程卡片（对齐 .panel） ── */
.course-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(17, 23, 34, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
  min-height: 140px;
  animation: cardEnter 0.32s var(--ease) both;
}

.course-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.55) 35%, rgba(255, 112, 67, 0.45) 70%, rgba(255, 112, 67, 0) 100%);
  pointer-events: none;
}

.course-card:hover {
  transform: translateY(-2px);
  border-color: rgba(78, 161, 255, 0.45);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.course-card h3 {
  font-size: 15px;
  line-height: 1.45;
  flex: 1;
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(78, 161, 255, 0.12);
  color: #8ec8ff;
  font-weight: 600;
  border: 1px solid rgba(78, 161, 255, 0.35);
  box-shadow: 0 0 12px rgba(78, 161, 255, 0.16);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(70, 90, 120, 0.28);
  background: rgba(10, 13, 18, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.site-footer .dot { opacity: 0.4; }

/* ── 播放页 ── */
.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
  gap: 0;
  min-height: calc(100vh - var(--header-h));
}

.player-panel {
  padding: 20px;
  border-right: 1px solid rgba(70, 90, 120, 0.28);
  min-width: 0;
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), var(--glow-blue);
}

.player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.lesson-title-bar { margin-top: 16px; }

.lesson-episode {
  font-size: 12px;
  color: #ffb38a;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.lesson-title-bar h1 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.4;
}

.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ── 分享链接面板 ── */
.share-panel {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(70, 90, 120, 0.35);
  background: rgba(17, 23, 34, 0.44);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.share-panel-head {
  margin-bottom: 14px;
}

.share-panel-head h2 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #eef4ff;
}

.share-panel-head p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.share-row + .share-row {
  margin-top: 12px;
}

.share-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #b8c8de;
  margin-bottom: 6px;
}

.share-field {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.share-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(70, 90, 120, 0.35);
  background: rgba(10, 13, 18, 0.55);
  color: #c8d8ec;
  font-size: 12px;
  font-family: ui-monospace, Consolas, "SF Mono", "Microsoft YaHei UI", monospace;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.share-input:focus {
  outline: none;
  border-color: rgba(78, 161, 255, 0.6);
  box-shadow:
    0 0 0 3px rgba(78, 161, 255, 0.12),
    0 0 16px rgba(78, 161, 255, 0.15);
}

.btn-share {
  flex: 0 0 auto;
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.btn-share.copied {
  border-color: rgba(92, 255, 141, 0.45);
  color: #8dffb0;
  box-shadow: 0 0 12px rgba(92, 255, 141, 0.16);
}

@media (max-width: 600px) {
  .share-field {
    flex-direction: column;
  }

  .btn-share {
    width: 100%;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(70, 90, 120, 0.35);
  background: rgba(13, 17, 24, 0.62);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), filter 0.22s var(--ease);
  font-family: inherit;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-2px);
  border-color: rgba(78, 161, 255, 0.45);
  box-shadow: var(--glow-blue);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-primary);
  border-color: rgba(78, 161, 255, 0.65);
  color: #fff;
  box-shadow: var(--glow-blue);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 14px 40px rgba(78, 161, 255, 0.22), var(--glow-blue);
}

.lesson-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(17, 23, 34, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.sidebar-head {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.28);
}

.sidebar-head h2 { font-size: 14px; margin-bottom: 4px; }
.sidebar-head p { font-size: 12px; color: var(--text-muted); }

.lesson-list {
  flex: 1;
  overflow: auto;
  padding: 8px;
}

.lesson-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  font-family: inherit;
}

.lesson-item:hover {
  background: rgba(78, 161, 255, 0.06);
  color: var(--text);
}

.lesson-item.active {
  background: rgba(255, 112, 67, 0.12);
  border-color: rgba(255, 112, 67, 0.45);
  color: #fff;
  box-shadow: var(--glow-orange);
}

.lesson-num {
  flex-shrink: 0;
  width: 28px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-blue);
  padding-top: 2px;
}

.lesson-item-text {
  font-size: 13px;
  line-height: 1.45;
}

.loading,
.error-box {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.error-box { color: #ff6b6b; }

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

/* ── 滚动条 ── */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: rgba(10, 13, 18, 0.6); }
*::-webkit-scrollbar-thumb {
  background: rgba(70, 90, 120, 0.45);
  border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(100, 120, 150, 0.65); }

@media (max-width: 900px) {
  .course-layout { grid-template-columns: 1fr; }
  .player-panel {
    border-right: none;
    border-bottom: 1px solid rgba(70, 90, 120, 0.28);
  }
  .lesson-sidebar { max-height: 50vh; }
  .site-header { padding: 12px 16px; }
}

@media (max-width: 600px) {
  .page { padding: 24px 14px 36px; }
  .course-grid { grid-template-columns: 1fr; }
  .player-panel { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .course-section, .course-card { animation: none; }
}

/* ── S级视觉精修：纯视觉覆盖，不改结构/逻辑 ── */

/* 1) 卡片层级区分 */
.player-wrap {
  background: rgba(17, 23, 34, 0.72);
  border-color: rgba(92, 116, 154, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 64px rgba(0, 0, 0, 0.38),
    0 10px 24px rgba(0, 0, 0, 0.2),
    0 0 28px rgba(78, 161, 255, 0.12);
}

.lesson-sidebar {
  background: rgba(17, 23, 34, 0.62);
  border-left: 1px solid rgba(70, 90, 120, 0.35);
}

.category-nav {
  background: rgba(17, 23, 34, 0.44);
  border-color: rgba(56, 68, 89, 0.58);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.site-footer {
  background: rgba(17, 23, 34, 0.44);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.cat-pill:not(.active) {
  background: rgba(17, 23, 34, 0.32);
}

/* 2) 章节目录行左侧微高光 */
.lesson-item {
  position: relative;
  overflow: hidden;
  transition:
    background 0.22s var(--ease),
    color 0.22s var(--ease),
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.lesson-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, rgba(255, 146, 97, 0.96) 0%, rgba(255, 112, 67, 0.92) 100%);
  box-shadow: 0 0 14px rgba(255, 112, 67, 0.26);
  transition: width 0.2s var(--ease), opacity 0.2s var(--ease);
  opacity: 0.2;
  pointer-events: none;
}

.lesson-item:hover {
  background: rgba(78, 161, 255, 0.1);
}

.lesson-item:hover::before {
  width: 3px;
  opacity: 1;
}

.lesson-item.active::before {
  width: 3px;
  opacity: 1;
}

/* 3) 关键数字强化 */
.header-stats,
.header-course span,
#footerStats,
.course-meta,
.badge {
  font-variant-numeric: tabular-nums;
}

.badge {
  font-weight: 800;
}

.lesson-num {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #8ec8ff;
  text-shadow: 0 0 12px rgba(78, 161, 255, 0.28);
}

.lesson-episode {
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 179, 138, 0.22);
}

.header-course strong {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* 4) 按钮涟漪 */
@keyframes btnRipple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

.btn,
.cat-pill,
.lesson-item {
  position: relative;
  isolation: isolate;
}

.btn::after,
.cat-pill::after,
.lesson-item::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.btn {
  overflow: hidden;
}

.cat-pill {
  overflow: hidden;
}

.btn:active:not(:disabled)::after,
.cat-pill:active:not(:disabled)::after,
.lesson-item:active:not(:disabled)::after {
  animation: btnRipple 0.4s var(--ease);
}

/* 5) 输入框 focus 发光（预留） */
input,
textarea,
select {
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(78, 161, 255, 0.6);
  box-shadow:
    0 0 0 3px rgba(78, 161, 255, 0.12),
    0 0 16px rgba(78, 161, 255, 0.15);
}

/* 6) 空状态 / 加载态美化 */
.loading,
.error-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 28px 16px 20px;
  color: #9eb0c8;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-align: center;
}

.loading::before,
.error-box::before {
  content: "";
  width: min(220px, 56%);
  height: 1px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(78, 161, 255, 0) 0%, rgba(78, 161, 255, 0.42) 35%, rgba(255, 112, 67, 0.32) 65%, rgba(255, 112, 67, 0) 100%);
  opacity: 0.9;
}

.error-box {
  color: #ffb4b4;
}

.error-box::before {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0) 0%, rgba(255, 107, 107, 0.45) 50%, rgba(255, 107, 107, 0) 100%);
}

/* ── 顶栏工具 / 登录 ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-header-tool,
.btn-header-login {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(70, 90, 120, 0.35);
  background: rgba(17, 23, 34, 0.44);
  color: #d6deeb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s var(--ease);
}

.btn-header-tool:hover,
.btn-header-login:hover {
  border-color: rgba(78, 161, 255, 0.45);
  box-shadow: 0 0 12px rgba(78, 161, 255, 0.16);
}

.btn-header-tool {
  border-color: rgba(255, 112, 67, 0.42);
  color: #ffc2a6;
}

.btn-header-login.logged-in {
  color: #9dffb8;
  border-color: rgba(92, 255, 141, 0.35);
}

.site-header {
  flex-wrap: wrap;
}

/* ── 登录弹窗 ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(420px, 100%);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(70, 90, 120, 0.35);
  background: rgba(17, 23, 34, 0.92);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
}

.modal-head h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.modal-head p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #b8c8de;
  margin: 10px 0 6px;
}

.field-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(70, 90, 120, 0.35);
  background: rgba(10, 13, 18, 0.62);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.field-textarea {
  resize: vertical;
  min-height: 120px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.login-error {
  margin-top: 10px;
  font-size: 12px;
  color: #ff8f8f;
}

.login-error.hidden {
  display: none;
}

/* ── 视频收藏 ── */
.lesson-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lesson-title-row h1 {
  flex: 1;
  min-width: 0;
}

.btn-fav {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 183, 3, 0.35);
  background: rgba(255, 183, 3, 0.08);
  color: #ffd27a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-fav.active {
  border-color: rgba(255, 183, 3, 0.55);
  background: rgba(255, 183, 3, 0.16);
  color: #ffe08a;
  box-shadow: 0 0 12px rgba(255, 183, 3, 0.16);
}

.course-card.has-favorite {
  border-color: rgba(255, 183, 3, 0.38);
}

.fav-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #ffe08a;
  background: rgba(255, 183, 3, 0.14);
  border: 1px solid rgba(255, 183, 3, 0.35);
}

.lesson-fav-mark {
  flex: 0 0 auto;
  opacity: 0;
  color: #ffd27a;
  font-size: 12px;
  transition: opacity 0.2s var(--ease);
}

.lesson-item.is-favorite .lesson-fav-mark {
  opacity: 1;
}

.lesson-item-text {
  flex: 1;
  min-width: 0;
}

.lesson-item {
  align-items: flex-start;
}

/* ── 指令工具页 ── */
.tool-page {
  min-height: 100vh;
  background: #0a0d12;
}

.tool-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.28);
  background: rgba(17, 23, 34, 0.72);
}

.tool-topbar small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.tool-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

.tool-sidebar {
  border-right: 1px solid rgba(70, 90, 120, 0.28);
  background: rgba(17, 23, 34, 0.55);
  padding: 12px;
}

.tool-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.tool-category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}

.tool-category-item.active {
  background: rgba(255, 112, 67, 0.12);
  border-color: rgba(255, 112, 67, 0.35);
  color: #fff;
}

.tool-category-actions i {
  font-style: normal;
  opacity: 0.7;
  cursor: pointer;
  padding: 0 2px;
}

.tool-main {
  padding: 14px;
  min-width: 0;
}

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

.tool-main-head h2 {
  font-size: 16px;
}

.tool-table-wrap {
  border: 1px solid rgba(70, 90, 120, 0.28);
  border-radius: 12px;
  overflow: auto;
  background: rgba(17, 23, 34, 0.44);
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tool-table th,
.tool-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.2);
  vertical-align: top;
}

.tool-table th {
  text-align: left;
  color: #b8c8de;
  background: rgba(10, 13, 18, 0.35);
}

.col-actions {
  width: 180px;
  white-space: nowrap;
}

.prompt-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.prompt-preview {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.prompt-thumb {
  display: block;
  max-width: 160px;
  max-height: 90px;
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid rgba(70, 90, 120, 0.28);
}

.btn-xs,
.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-danger-lite {
  color: #ffb4b4;
  border-color: rgba(255, 107, 107, 0.35);
}

.tool-editor {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(78, 161, 255, 0.28);
  background: rgba(17, 23, 34, 0.55);
}

.tool-editor.hidden {
  display: none;
}

.tool-empty-hint,
.tool-empty-cell {
  color: var(--text-muted);
  font-size: 12px;
  padding: 12px;
}

.editor-image-preview img {
  max-width: 200px;
  max-height: 120px;
  border-radius: 8px;
  margin-top: 8px;
}

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

  .tool-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(70, 90, 120, 0.28);
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
