/* ============================================================
   老李鱼塘课程平台 · 深海蓝金主题
   深色外壳 + 纸质阅读卡片 + 香槟金强调 + 衬线标题
   ============================================================ */
:root {
  --bg: #0a1322;
  --bg-2: #0d1a2f;
  --panel: #101d33;
  --panel-2: #15243d;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #e9eef7;
  --ink-2: #aab6c8;
  --ink-3: #76839a;
  --gold: #d8b878;
  --gold-2: #e8cf9a;
  --gold-weak: rgba(216, 184, 120, .14);
  --paper: #f8f5ec;
  --paper-ink: #24292f;
  --paper-ink-2: #57606a;
  --green: #6cc179;
  --red: #e5735f;
  --blue: #6da8ff;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 34px rgba(0, 0, 0, .45);
  --sidebar-w: 276px;
  --serif: Georgia, "Nimbus Roman", "Songti SC", "STSong", "SimSun", serif;
  font-size: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  background-image: radial-gradient(1100px 700px at 85% -10%, #16283f 0%, rgba(10, 19, 34, 0) 60%),
                    radial-gradient(900px 600px at -10% 110%, #101f36 0%, rgba(10, 19, 34, 0) 55%);
  background-attachment: fixed;
  color: var(--ink); line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(216, 184, 120, .3); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .24); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- 动效 ---------- */
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes bubbleUp { from { transform: translateY(105vh); opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } to { transform: translateY(-12vh); opacity: 0; } }
@keyframes glowPulse { 0%, 100% { opacity: .55; } 50% { opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  padding: 7px 15px; font-size: 14px; line-height: 1.4; transition: all .18s ease;
  background: transparent; color: var(--ink); user-select: none; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, #e6c98a 0%, #cfa963 100%);
  color: #1c2333; font-weight: 600;
  box-shadow: 0 2px 12px rgba(216, 184, 120, .25);
}
.btn-primary:not(:disabled):hover { box-shadow: 0 4px 20px rgba(216, 184, 120, .45); filter: brightness(1.05); }
.btn-ghost { border-color: var(--line-2); background: rgba(255, 255, 255, .03); color: var(--ink); }
.btn-ghost:not(:disabled):hover { border-color: var(--gold); color: var(--gold-2); }
.btn-gold-active { border-color: var(--gold); color: var(--gold-2); background: var(--gold-weak); }
.btn-danger { background: rgba(229, 115, 95, .16); color: var(--red); border-color: rgba(229, 115, 95, .35); }
.btn-danger:not(:disabled):hover { background: var(--red); color: #fff; }
.btn-link { color: var(--gold); padding: 4px 7px; border-radius: 7px; }
.btn-link:hover { background: var(--gold-weak); }
.btn-sm { padding: 4px 11px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- 登录页（深海门面） ---------- */
#login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 620px at 70% 18%, #16283f 0%, #0a1322 60%),
              radial-gradient(700px 500px at 18% 85%, #0f2036 0%, #0a1322 55%),
              #0a1322;
  padding: 24px; position: relative; overflow: hidden;
}
#login-view::before {
  content: ''; position: absolute; inset: -30%;
  background: radial-gradient(600px 400px at 75% 30%, rgba(216, 184, 120, .07), transparent 70%);
  animation: glowPulse 7s ease-in-out infinite; pointer-events: none;
}
.login-bubble {
  position: absolute; bottom: -60px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(233, 238, 247, .16), rgba(233, 238, 247, .03) 65%);
  border: 1px solid rgba(233, 238, 247, .06);
  animation: bubbleUp linear infinite; pointer-events: none;
}
.login-card {
  width: 410px; max-width: 100%; position: relative; z-index: 2;
  background: rgba(14, 25, 44, .78); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(216, 184, 120, .22); border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  padding: 38px 36px 26px; animation: pageIn .45s ease;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-logo {
  width: 76px; height: 76px; display: inline-block; margin-bottom: 12px;
  border-radius: 50%; box-shadow: 0 6px 24px rgba(216, 184, 120, .3), 0 0 0 1px rgba(216, 184, 120, .3);
}
.login-brand h1 {
  font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--gold-2);
  letter-spacing: 2px;
}
.login-brand p { color: var(--ink-3); font-size: 12.5px; margin-top: 7px; letter-spacing: 3px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px;
  font-size: 14px; outline: none; transition: border .18s, box-shadow .18s;
  background: rgba(10, 19, 34, .65); color: var(--ink); font-family: inherit;
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 184, 120, .15);
}
.field select option { background: #101d33; color: var(--ink); }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { flex-shrink: 0; }
.field-err { color: var(--red); font-size: 12px; margin-top: 4px; min-height: 16px; }
.login-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.login-tab {
  flex: 1; padding: 10px 0; background: none; border: none; border-bottom: 2px solid transparent;
  font-size: 14.5px; color: var(--ink-3); cursor: pointer; margin-bottom: -1px; font-weight: 500; transition: all .18s;
}
.login-tab.active { color: var(--gold-2); border-bottom-color: var(--gold); font-weight: 600; }
.login-tip { color: var(--ink-3); font-size: 12px; margin-top: 14px; text-align: center; }
.login-err { color: var(--red); font-size: 13px; margin-top: 10px; text-align: center; min-height: 18px; }
.login-alt { text-align: center; margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.login-alt a { color: var(--gold); cursor: pointer; }

/* ---------- 顶栏 ---------- */
#shell { display: flex; flex-direction: column; height: 100vh; }
#topbar {
  height: 54px; background: rgba(11, 20, 36, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  flex-shrink: 0; z-index: 60; position: relative;
}
.topbar-left { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.topbar-left .logo-img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(216, 184, 120, .35); }
.topbar-left .brand-name { font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--gold-2); letter-spacing: 1px; }
.topbar-left .brand-sub { font-size: 12px; color: var(--ink-3); letter-spacing: 2px; }
.topbar-right { display: flex; align-items: center; gap: 7px; min-width: 0; }
.user-chip {
  display: flex; align-items: center; gap: 6px; padding: 4px 11px; max-width: 200px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 16px;
  font-size: 13px; color: var(--ink-2);
}
.user-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 布局 ---------- */
#layout { flex: 1; display: flex; min-height: 0; }
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: rgba(13, 23, 41, .6);
  border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 8px 26px;
}
#content { flex: 1; overflow-y: auto; padding: 26px 30px 70px; }
.page-inner { max-width: 860px; margin: 0 auto; animation: pageIn .3s ease; }
.page-inner-admin { max-width: 1080px; margin: 0 auto; animation: pageIn .3s ease; }

/* ---------- 侧边栏目录树 ---------- */
.side-title {
  font-size: 12px; color: var(--ink-3); padding: 6px 12px 6px; letter-spacing: 2px;
  display: flex; justify-content: space-between; align-items: center;
}
.course-group { margin-bottom: 2px; border-radius: 9px; }
.course-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px;
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); word-break: break-all;
  transition: background .15s;
}
.course-head:hover { background: rgba(255, 255, 255, .05); }
.course-head .arrow { font-size: 10px; color: var(--ink-3); transition: transform .18s; flex-shrink: 0; }
.course-group.open .course-head .arrow { transform: rotate(90deg); }
.course-head .c-icon { flex-shrink: 0; }
.course-badge-pub { font-size: 11px; font-weight: 400; color: var(--gold); background: var(--gold-weak); padding: 0 6px; border-radius: 4px; flex-shrink: 0; }
.course-badge-stu { font-size: 11px; font-weight: 400; color: var(--blue); background: rgba(109, 168, 255, .13); padding: 0 6px; border-radius: 4px; flex-shrink: 0; }
.lesson-list { display: none; padding: 2px 0 4px 14px; }
.course-group.open .lesson-list { display: block; }
.lesson-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer; word-break: break-all;
  transition: background .15s, color .15s; border-left: 2px solid transparent;
}
.lesson-item:hover { background: rgba(255, 255, 255, .05); color: var(--ink); }
.lesson-item.active { background: var(--gold-weak); color: var(--gold-2); font-weight: 600; border-left-color: var(--gold); }
.lesson-item .lock, .lesson-item .type-ico { flex-shrink: 0; font-size: 12px; }
.lesson-item .t { min-width: 0; }
.badge-free {
  flex-shrink: 0; font-size: 10.5px; color: var(--gold-2); background: var(--gold-weak);
  padding: 0 6px; border-radius: 4px; border: 1px solid rgba(216, 184, 120, .4);
}
.side-empty { color: var(--ink-3); font-size: 13px; padding: 20px 14px; text-align: center; }
#side-mask { position: fixed; inset: 0; background: rgba(4, 9, 17, .6); z-index: 88; display: none; }
#side-mask.show { display: block; }

/* ---------- 卡片 & 页头 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 26px; margin-bottom: 16px;
}
.page-head { margin-bottom: 20px; }
.page-head h2 { font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--ink); letter-spacing: 1px; }
.page-head .sub { color: var(--ink-3); font-size: 13px; margin-top: 5px; }

/* 课程网格（首页） */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 15px; }
.course-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px 18px; cursor: pointer; transition: all .22s ease; position: relative; overflow: hidden;
}
.course-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(216, 184, 120, .55), transparent);
  opacity: 0; transition: opacity .22s;
}
.course-card:hover { transform: translateY(-3px); border-color: rgba(216, 184, 120, .45); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.course-card:hover::after { opacity: 1; }
.course-card h3 { font-size: 15.5px; margin-bottom: 6px; word-break: break-all; color: var(--ink); }
.course-card .desc { color: var(--ink-3); font-size: 13px; min-height: 40px; word-break: break-all; }
.course-card .meta { display: flex; gap: 8px; margin-top: 12px; align-items: center; }

/* 课程概览 */
.overview-lessons { border-top: 1px solid var(--line); padding-top: 6px; }
.ov-lesson {
  display: flex; align-items: center; gap: 10px; padding: 13px 8px;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; border-radius: 8px;
  transition: background .15s;
}
.ov-lesson:hover { background: var(--gold-weak); }
.ov-lesson .idx { color: var(--ink-3); font-size: 13px; width: 26px; text-align: right; flex-shrink: 0; }
.ov-lesson .t { flex: 1; word-break: break-all; min-width: 0; }

/* ---------- 章节内容页 ---------- */
.lesson-head { border-bottom: 1px solid var(--line); padding-bottom: 15px; margin-bottom: 22px; }
.lesson-head .crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 7px; }
.lesson-head .crumb a { color: var(--ink-3); }
.lesson-head .crumb a:hover { color: var(--gold-2); }
.lesson-head h2 {
  font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; letter-spacing: .5px;
}
.lesson-body { position: relative; }

/* 富文本：纸质阅读卡 */
.rich-content {
  background: var(--paper); color: var(--paper-ink);
  border: 1px solid rgba(0, 0, 0, .1); border-radius: var(--radius);
  padding: 30px 34px; box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
  font-size: 15.5px; word-break: break-word;
}
.rich-content a { color: #1d5fbf; }
.rich-content h1, .rich-content h2, .rich-content h3 { font-family: var(--serif); margin: 1.2em 0 .5em; line-height: 1.4; color: #1a2029; }
.rich-content h2 { font-size: 21px; } .rich-content h3 { font-size: 17.5px; }
.rich-content p { margin: .6em 0; }
.rich-content ul, .rich-content ol { padding-left: 1.6em; margin: .6em 0; }
.rich-content blockquote {
  border-left: 3px solid var(--gold); background: rgba(216, 184, 120, .12);
  padding: 10px 16px; border-radius: 0 8px 8px 0; margin: 1em 0; color: var(--paper-ink-2);
}
.rich-content pre { background: #eef0e9; border: 1px solid #dcd9ce; border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 1em 0; }
.rich-content code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; background: #eef0e9; padding: 1px 5px; border-radius: 4px; }
.rich-content pre code { padding: 0; background: none; }
.rich-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.rich-content iframe { max-width: 100%; border-radius: 8px; aspect-ratio: 16/9; width: 100%; height: auto; }

/* 播放器 */
.player-wrap { position: relative; background: #000; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); }
.player-wrap video { display: block; width: 100%; max-height: 74vh; }
.player-tip { color: var(--ink-3); font-size: 12.5px; margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.decrypt-box { background: var(--panel); border: 1px dashed var(--line-2); border-radius: 12px; padding: 64px 20px; text-align: center; color: var(--ink-2); }
.decrypt-box .big { font-size: 34px; margin-bottom: 10px; }
.progress-bar { height: 6px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; margin: 14px auto 0; max-width: 320px; }
.progress-bar > div {
  height: 100%; border-radius: 3px; transition: width .25s;
  background: linear-gradient(90deg, #c9a86a, #eed9a8, #c9a86a);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}

/* 锁定/空态 */
.lock-box { text-align: center; padding: 62px 20px; }
.lock-box .big { font-size: 42px; margin-bottom: 14px; }
.lock-box h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 8px; color: var(--ink); letter-spacing: 1px; }
.lock-box p { color: var(--ink-3); font-size: 13.5px; }

/* ---------- 动态水印 ---------- */
.wm-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 40; }
.wm-tile {
  position: absolute; transform: rotate(-22deg); font-size: 13px; font-weight: 600;
  color: rgba(36, 41, 47, .1); white-space: nowrap; user-select: none; letter-spacing: 1px;
}
.wm-strip { position: absolute; top: 46%; left: 0; width: 100%; overflow: hidden; }
.wm-strip span {
  display: inline-block; white-space: nowrap; font-size: 14px; font-weight: 600;
  color: rgba(255, 255, 255, .82); letter-spacing: 1px;
  background: rgba(8, 15, 28, .42); backdrop-filter: blur(2px);
  padding: 3px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  padding-left: 100%; animation: wmMove 16s linear infinite; user-select: none;
}
@keyframes wmMove { from { transform: translateX(0); } to { transform: translateX(-100%); } }
/* 视频画面上：水印用白色 */
.player-wrap .wm-tile, .ll-video-wrap video ~ .wm-layer .wm-tile { color: rgba(255, 255, 255, .16); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }

/* ---------- 内嵌视频卡片 ---------- */
.ll-video-wrap { margin: 14px 0; }
.ll-video-wrap video { width: 100%; max-height: 70vh; display: block; border-radius: 10px; background: #000; }
.ll-video {
  border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 24px 18px;
  text-align: center; background: rgba(255, 255, 255, .03);
}
.ll-video-name { font-weight: 600; font-size: 14px; word-break: break-all; color: var(--ink); }
.ll-video-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.ll-video-loading { color: var(--ink-2); font-size: 13px; margin-bottom: 10px; }
.ll-video-err { color: var(--red); }
.ql-editor .ll-video-wrap { user-select: none; }

/* ---------- 后台 ---------- */
.admin-nav { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a {
  padding: 9px 16px; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; font-weight: 500; white-space: nowrap; transition: all .15s;
}
.admin-nav a.active { color: var(--gold-2); border-bottom-color: var(--gold); font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--ink-3); font-weight: 500; font-size: 12px; letter-spacing: 1px; background: rgba(255, 255, 255, .03); }
.table tr { transition: background .13s; }
.table tbody tr:hover { background: rgba(255, 255, 255, .035); }
.table .actions { display: flex; gap: 4px; flex-wrap: wrap; }
.role-tag { font-size: 12px; padding: 1px 9px; border-radius: 10px; }
.role-admin { color: var(--gold-2); background: var(--gold-weak); border: 1px solid rgba(216, 184, 120, .4); }
.role-student { color: var(--blue); background: rgba(109, 168, 255, .13); }
.role-guest { color: var(--ink-3); background: rgba(255, 255, 255, .06); }
.flag-tag { color: var(--red); background: rgba(229, 115, 95, .15); font-size: 12px; padding: 1px 8px; border-radius: 10px; }
.toolbar-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.admin-hint {
  background: var(--gold-weak); border: 1px solid rgba(216, 184, 120, .25); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 16px;
}

/* 骨架屏 */
.skeleton {
  height: 16px; border-radius: 8px; margin: 12px 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .11) 50%, rgba(255, 255, 255, .05) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}

/* 编辑器 */
.editor-title-input {
  width: 100%; border: none; outline: none; font-size: 24px; font-family: var(--serif); font-weight: 700;
  padding: 6px 2px 10px; color: var(--ink); background: transparent; letter-spacing: 1px;
}
.quill-wrap { background: #fff; border-radius: 12px; overflow: hidden; }
.quill-wrap .ql-toolbar { border-color: #dcd9ce; background: #f3f0e7; }
.quill-wrap .ql-container { border-color: #dcd9ce; height: 480px; font-size: 15px; color: var(--paper-ink); }
.upload-box {
  border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 30px;
  text-align: center; color: var(--ink-2); cursor: pointer; transition: all .18s;
}
.upload-box:hover { border-color: var(--gold); background: rgba(216, 184, 120, .05); }
.upload-box.has-file { border-style: solid; border-color: var(--green); background: rgba(108, 193, 121, .1); }

/* ---------- 弹窗 ---------- */
#modal-root .modal-mask {
  position: fixed; inset: 0; background: rgba(4, 9, 17, .66); backdrop-filter: blur(3px); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto;
}
.modal {
  background: #101d33; border: 1px solid var(--line-2); border-radius: 14px; width: 470px; max-width: 100%;
  box-shadow: var(--shadow-lg); animation: pageIn .2s ease;
}
.modal-head { padding: 17px 22px 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.modal-body { padding: 14px 22px; }
.modal-foot { padding: 0 22px 18px; display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(14, 25, 44, .92); backdrop-filter: blur(10px); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 10px 20px; font-size: 13.5px; display: flex; align-items: center; gap: 8px;
  animation: pageIn .2s ease; max-width: 86vw; color: var(--ink);
}
.toast.error { color: #f0967f; border-color: rgba(229, 115, 95, .4); }
.toast.ok { color: var(--gold-2); border-color: rgba(216, 184, 120, .4); }

/* ---------- 响应式（移动端优先体验） ---------- */
#btn-menu { display: none; }
@media (max-width: 768px) {
  #btn-menu { display: inline-flex; }
  .brand-sub { display: none; }
  .user-chip { max-width: 110px; }
  #topbar { padding: 0 8px; }
  .topbar-right { gap: 4px; }
  .topbar-right .btn { padding: 6px 9px; font-size: 13px; }

  #sidebar {
    position: fixed; left: 0; top: 54px; bottom: 0; z-index: 90; width: min(84vw, 320px);
    background: #0d1a2f; transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 8px 0 30px rgba(0, 0, 0, .4);
  }
  #sidebar.show { transform: none; }
  #content { padding: 16px 12px 70px; }

  .course-grid { grid-template-columns: 1fr; }
  .rich-content { padding: 20px 18px; font-size: 15px; }
  .lesson-head h2 { font-size: 20px; }
  .page-head h2 { font-size: 20px; }
  .card { padding: 16px 16px; border-radius: 10px; }

  /* 后台表格 → 卡片 */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px;
    padding: 4px 0; background: rgba(255, 255, 255, .02); overflow: hidden;
  }
  .table td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    border-bottom: 1px dashed var(--line); padding: 9px 14px; text-align: right; word-break: break-all;
  }
  .table td:last-child { border-bottom: none; }
  .table td::before {
    content: attr(data-label); color: var(--ink-3); font-size: 12px; flex-shrink: 0;
    text-align: left; letter-spacing: 1px;
  }
  .table td .actions { justify-content: flex-end; }

  .toolbar-row { flex-direction: column; align-items: stretch; }
  .toolbar-row .btn { width: 100%; }
  .admin-hint { font-size: 12.5px; }

  .modal { width: 100%; }
  #modal-root .modal-mask { padding: 20px 10px 10px; align-items: stretch; }
  .quill-wrap .ql-container { height: 56vh; }
  .quill-wrap .ql-toolbar { overflow-x: auto; }
  .login-card { padding: 30px 22px 22px; }
}
