/* AI 漫剧教程导航 —— 样式（浅色 SaaS 数据目录风格） */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 8px 20px rgba(15, 23, 42, 0.10);
  --content-max: 1200px;
  /* 卡片文字尺度：教程库卡片与学习路径卡片共用这两个变量，
     保证两处的「内容显示大小」永远一致，不会各改各的。 */
  --card-title-size: 16px;
  --card-body-size: 13px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* HTML 的 hidden 属性靠浏览器默认样式生效，会被作者样式表的 display 覆盖，
   这里显式兜底一次。 */
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 粘性页脚：内容不足一屏时（比如学习路径只有 3 张卡），
   让页脚贴在窗口最底部，而不是浮在内容下面留一大片空白。
   body 变成纵向 flex 列，main 吃掉剩余空间，footer 自然被顶到底部。
   admin.html 的 body 带 .admin-body（自己管布局），这里排除掉。 */
body:not(.admin-body) {
  min-height: 100vh;
  min-height: 100dvh;   /* 移动端地址栏收放时算得更准 */
  display: flex;
  flex-direction: column;
}
body:not(.admin-body) > main { flex: 1 0 auto; }
body:not(.admin-body) > .footer { flex: 0 0 auto; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }

/* 顶部导航 */
.nav { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--border); z-index: 100; }
.nav-inner {
  max-width: var(--content-max); margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 20px;
}
.logo {
  font-weight: 700; font-size: 17px; color: var(--text);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo .dot { width: 10px; height: 10px; background: var(--primary); border-radius: 50%; display: inline-block; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: var(--text-secondary); padding: 6px 12px; border-radius: 6px; font-size: 14px; }
.nav-links a:hover { background: #f1f5f9; color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.nav-search { margin-left: auto; position: relative; }
.nav-search .icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.nav-search input {
  width: 230px; padding: 8px 12px 8px 34px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff;
}
.nav-search input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 头部 hero */
.hero { padding: 44px 0 28px; border-bottom: 1px solid var(--border); background: #fff; }
.hero h1 { font-size: 32px; letter-spacing: -0.5px; margin-bottom: 10px; }
.hero .subtitle { color: var(--text-secondary); font-size: 16px; max-width: 720px; margin-bottom: 12px; }
.hero .meta { color: var(--text-muted); font-size: 13px; }

/* 主体布局 */
.layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 28px;
  padding: 28px 24px 60px; align-items: start;
}

/* 筛选栏 */
.filters {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px; position: sticky; top: 84px;
}
.filter-group { margin-bottom: 20px; }
.filter-group h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-muted); margin-bottom: 10px; font-weight: 600;
}
.check {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  cursor: pointer; font-size: 14px; color: var(--text-secondary);
}
.check:hover { color: var(--text); }
.check input { accent-color: var(--primary); cursor: pointer; }
.check input[type="checkbox"] { width: 15px; height: 15px; }
.reset-btn {
  width: 100%; padding: 8px; border: 1px solid var(--border); background: #fff;
  border-radius: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.reset-btn:hover { background: #f8fafc; color: var(--text); }

/* 首页入口 */
.home-entry {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
}
.home-entry:hover { background: #f8fafc; color: var(--text); }
.home-entry.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* 工具栏 */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar .count { font-size: 14px; color: var(--text-secondary); }
.toolbar .count strong { color: var(--text); }
.toolbar select {
  margin-left: auto; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; background: #fff; color: var(--text-secondary); cursor: pointer;
}
.toolbar select:focus { outline: none; border-color: var(--primary); }
/* 前台数据来源提示（后台改过本地数据时出现） */
.data-source-tip {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  color: #d97706; background: #fef3c7; font-weight: 600; white-space: nowrap;
}

/* 筛选折叠按钮（窄屏显示） */
.filter-toggle {
  display: none;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.filter-toggle:hover { background: #f8fafc; color: var(--text); }

/* 卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-hover); border-color: #cbd5e1; transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.platform { font-weight: 700; font-size: 13px; }
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge.sample { color: #64748b; background: #f1f5f9; }
.badge.web-only { color: #64748b; background: #f1f5f9; }
.card-title { font-size: var(--card-title-size); line-height: 1.4; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-summary { font-size: var(--card-body-size); color: var(--text-secondary); flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #f1f5f9; color: var(--text-secondary); }
.card-meta {
  display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px;
  color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 10px;
}
.card-meta .updated { color: #64748b; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
}

/* 页脚 */
.footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 28px 0;
  text-align: center;
}
.footer p { color: var(--text-muted); font-size: 13px; margin-bottom: 4px; }

/* 学习路径页 */
/* 内容宽度与全站一致（用 --content-max，大屏自动放宽），两侧留白与 hero 区对齐 */
.path { max-width: var(--content-max); margin: 0 auto; padding: 32px 24px 60px; }

/* 阶段卡片：横向自适应排列，一行最多 3 张。
   3 张并排的前提是每张还能有 ~470px（内容区上限放宽到 1500px 之后），
   所以 1600px 以下一律 2 张，宁可少排也不把卡片挤窄。 */
#pathBox {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}
@media (min-width: 760px)  { #pathBox { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1600px) { #pathBox { grid-template-columns: repeat(3, 1fr); } }

.path-stage {
  display: flex; gap: 18px; min-width: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.path-stage:hover { box-shadow: var(--shadow-hover); border-color: #cbd5e1; }
.stage-num {
  flex: 0 0 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700; font-size: var(--card-title-size);
  display: flex; align-items: center; justify-content: center;
}
.stage-body { min-width: 0; }
/* 字号跟教程库卡片共用变量，保证两页「内容显示大小」一致 */
.stage-body h2 { font-size: var(--card-title-size); line-height: 1.4; margin-bottom: 8px; }
.stage-body p { color: var(--text-secondary); font-size: var(--card-body-size); line-height: 1.6; margin-bottom: 10px; }
.stage-body ul { padding-left: 18px; color: var(--text-secondary); font-size: var(--card-body-size); line-height: 1.6; }
.stage-body li { margin-bottom: 5px; }
.stage-body li:last-child { margin-bottom: 0; }

/* 关于页 */
.prose { padding: 32px 24px 60px; max-width: 760px; }
.prose h2 { font-size: 20px; margin: 24px 0 10px; }
.prose p, .prose li { color: var(--text-secondary); margin-bottom: 8px; }
.prose ul { padding-left: 20px; }

/* ============================================================
   通用弹窗 / 提示条（前台与后台共用，所以放在这个共享样式表里）
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.modal-panel {
  position: relative; background: #fff; border-radius: 14px; width: 100%; max-width: 1000px;
  max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}
.modal-panel-sm { max-width: 520px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.modal-head h2 { font-size: 17px; }
.icon-btn {
  border: none; background: transparent; font-size: 15px; color: var(--text-muted);
  cursor: pointer; padding: 4px 8px; border-radius: 6px; line-height: 1;
}
.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; display: flex; gap: 22px; align-items: flex-start; }
.modal-body-col { flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); flex: 0 0 auto; }
.modal-msg { margin-right: auto; font-size: 12px; color: #b91c1c; }
.modal-msg.ok { color: #15803d; }
/* 登录/注册切换 tab：只作用于前台弹窗，避免和后台登录页的样式互相影响 */
#authModal .auth-tabs { display: flex; gap: 4px; padding: 14px 20px 0; }
#authModal .auth-tab {
  flex: 1; padding: 8px 0; border: none; background: #f1f5f9;
  border-radius: 7px; font-size: 14px; color: var(--text-secondary);
  cursor: pointer; font-family: inherit; transition: background .15s, color .15s;
}
#authModal .auth-tab:hover { color: var(--text); }
#authModal .auth-tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* 没连上后端时的提示条：说清楚为什么用不了、该换成哪个地址打开 */
.auth-warn {
  margin: 12px 20px 0; padding: 9px 12px;
  background: #fffbeb; border: 1px solid #fcd34d; border-left: 3px solid #f59e0b;
  border-radius: 7px; font-size: 12.5px; line-height: 1.6; color: #92400e;
}
.auth-warn b { font-weight: 600; }
.auth-warn a { color: #b45309; font-weight: 600; word-break: break-all; }
.auth-warn a:hover { text-decoration: underline; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #0f172a; color: #fff; font-size: 13px; padding: 10px 18px;
  border-radius: 999px; z-index: 300; box-shadow: 0 10px 30px rgba(15, 23, 42, .3);
  max-width: 78vw; text-align: center;
}
.toast[hidden] { display: none; }

/* ============================================================
   前台用户体系：导航登录入口 / 表单 / 收藏评论 / 列表
   ============================================================ */

/* ---------- 导航栏右侧的登录入口 ---------- */
.nav-user { display: flex; align-items: center; margin-left: 10px; position: relative; }
.nav-login {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.nav-login:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.user-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.user-trigger {
  display: flex; align-items: center; gap: 7px; padding: 5px 10px;
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  cursor: pointer; font-family: inherit; font-size: 13px; color: var(--text);
}
.user-trigger:hover { background: #f8fafc; border-color: #cbd5e1; }
.user-trigger .avatar {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.user-trigger .uname { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger .caret { color: var(--text-muted); font-size: 10px; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: 6px; z-index: 120;
}
.user-dropdown button {
  display: flex; width: 100%; align-items: center; gap: 6px;
  padding: 8px 10px; border: none; background: transparent; border-radius: 7px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  font-family: inherit; text-align: left;
}
.user-dropdown button:hover { background: #f1f5f9; color: var(--text); }
.user-dropdown em { margin-left: auto; font-style: normal; color: var(--text-muted); font-size: 12px; }
.dd-divider { height: 1px; background: var(--border); margin: 5px 4px; }

/* ---------- 通知铃铛 ---------- */
.bell-wrap { position: relative; display: inline-flex; }
.nav-bell {
  position: relative; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  font-family: inherit; padding: 0;
}
.nav-bell:hover { background: #f8fafc; border-color: #cbd5e1; }
.bell-dot {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: #dc2626; color: #fff;
  font-size: 10px; font-style: normal; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  box-sizing: border-box;
}
.bell-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-width: 78vw;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .12); padding: 6px; z-index: 130;
}
.bell-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 7px; font-size: 13px; border-bottom: 1px solid var(--border);
}
.bell-list { max-height: 320px; overflow-y: auto; }
.bell-item { padding: 9px 10px; border-radius: 7px; }
.bell-item + .bell-item { border-top: 1px solid #f1f5f9; }
.bell-item.unread { background: #eff6ff; }
.bell-item .t { font-size: 13px; font-weight: 600; color: var(--text); }
.bell-item .d { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-top: 2px; }
.bell-item .time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.bell-empty { padding: 22px 10px; text-align: center; color: var(--text-muted); font-size: 12.5px; }

/* ---------- 收藏分类 ---------- */
.folder-item {
  display: flex; width: 100%; align-items: center; gap: 6px;
  padding: 7px 10px; margin-bottom: 4px; border: 1px solid transparent;
  background: transparent; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-secondary); font-family: inherit; text-align: left;
}
.folder-item:hover { background: #f8fafc; color: var(--text); }
.folder-item.active { background: #eff6ff; border-color: #bfdbfe; color: var(--primary); font-weight: 600; }
.folder-item em { margin-left: auto; font-style: normal; color: var(--text-muted); font-size: 12px; }
.card-folder {
  margin-top: 8px; width: 100%; padding: 5px 8px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 7px; background: #fff;
  color: var(--text-secondary); font-family: inherit; cursor: pointer;
}
.card-folder:hover { border-color: #cbd5e1; }

/* ---------- 表单 ---------- */
.um-form { display: flex; flex-direction: column; gap: 12px; }
.um-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.um-field em { color: #dc2626; font-style: normal; }
.um-field input, .um-field select, .um-field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; color: var(--text); background: #fff; font-weight: 400;
}
.um-field textarea { resize: vertical; line-height: 1.6; }
.um-field input:focus, .um-field select:focus, .um-field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.um-code-row { display: flex; gap: 8px; }
.um-code-row input { flex: 1 1 auto; min-width: 0; }
.um-code-row .um-btn { flex: 0 0 auto; white-space: nowrap; }
.um-btn {
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border); background: #fff;
  color: var(--text-secondary); font-size: 13px; font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.um-btn:hover { background: #f8fafc; color: var(--text); border-color: #cbd5e1; }
.um-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.um-btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.um-btn.sm { padding: 5px 10px; font-size: 12px; }
.um-btn.danger { color: #b91c1c; }
.um-btn.danger:hover { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.um-btn:disabled { opacity: .5; cursor: not-allowed; }
.um-msg { font-size: 12px; color: #b91c1c; min-height: 16px; line-height: 1.5; margin: 0; }
.um-msg.ok { color: #15803d; }
.um-hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.um-devcode {
  font-size: 12.5px; color: #92400e; background: #fffbeb; border: 1px dashed #fcd34d;
  border-radius: 8px; padding: 8px 10px; margin: 0; line-height: 1.5;
}
.um-forgot { margin: 0; text-align: right; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12.5px; color: var(--primary); font-family: inherit; text-decoration: underline;
}
.link-btn:hover { color: var(--primary-hover); }
.um-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.um-grid .span2 { grid-column: 1 / -1; }
.um-tools { display: flex; flex-wrap: wrap; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #fff; }
.um-tools .check { font-size: 13px; padding: 2px 4px; }

/* ---------- 列表 / 条目 ---------- */
.um-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.um-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #fff; }
.um-item .t { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; line-height: 1.5; }
.um-item .t a { color: var(--text); }
.um-item .t a:hover { color: var(--primary); text-decoration: none; }
.um-item .d { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.um-item .row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.um-empty { padding: 34px 10px; text-align: center; color: var(--text-muted); font-size: 13px; }
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.status-tag.pending { color: #d97706; background: #fef3c7; }
.status-tag.approved { color: #16a34a; background: #dcfce7; }
.status-tag.rejected { color: #dc2626; background: #fee2e2; }
.cmt-item { border-bottom: 1px solid var(--border); padding: 10px 0; }
.cmt-item:last-child { border-bottom: none; }
.cmt-item .who { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.cmt-item .txt { font-size: 13px; color: var(--text-secondary); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ---------- 卡片底部的收藏 / 评论操作条 ---------- */
.card-actions { display: flex; gap: 8px; }
.act-btn {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--border); background: #fff; border-radius: 8px;
  font-size: 12.5px; font-family: inherit; color: var(--text-secondary); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.act-btn:hover { background: #f8fafc; color: var(--text); border-color: #cbd5e1; }
.act-btn.on { color: #d97706; border-color: #fcd34d; background: #fffbeb; font-weight: 600; }
.act-btn .ico { font-size: 13px; line-height: 1; }
.act-btn:disabled { opacity: .6; cursor: not-allowed; }
.view-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 响应式 */
@media (min-width: 1600px) {
  :root { --content-max: 1500px; }
}
@media (min-width: 2000px) {
  :root { --content-max: 1760px; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    align-items: center;
  }
  .filters.open .home-entry,
  .filters.open .reset-btn {
    width: auto;
    margin: 0;
  }
  .filters.open .filter-group {
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
  }
  .filters.open .filter-group h3 {
    margin-bottom: 0;
    white-space: nowrap;
  }
  .filters.open .filter-group > div {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
  }
  .filters.open .check {
    padding: 0;
  }
  .filter-toggle { display: inline-block; }
  .nav-search input { width: 150px; }
  .user-trigger .uname { display: none; }
}
@media (max-width: 560px) {
  .nav-inner { gap: 10px; padding: 0 14px; }
  .nav-links a { padding: 6px 8px; }
  .nav-search { display: none; }
  .nav-user { margin-left: auto; }
  .hero h1 { font-size: 26px; }
  .um-grid { grid-template-columns: 1fr; }
  .modal { padding: 12px; }
  .modal-panel { max-height: calc(100vh - 24px); }
}

/* 手机/窄平板：导航链接放不下，换到第二行横向滑动。
   不处理的话 5 个链接被挤到每个只有几十像素宽，文字逐字换行变成竖排
   还溢出 60px 栏高（线上手机端实际出过这个 bug）。 */
@media (max-width: 760px) {
  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: 52px;
    padding: 4px 14px 0;
    row-gap: 0;
  }
  /* 链接行排到第二行：logo + 登录按钮占第一行 */
  .nav-links {
    order: 3;
    flex: 0 0 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 2px;
    scrollbar-width: none;          /* 隐藏滚动条（Firefox） */
  }
  .nav-links::-webkit-scrollbar { display: none; }   /* 隐藏滚动条（WebKit） */
  .nav-links a {
    white-space: nowrap;            /* 链接文字绝不逐字换行 */
    flex: 0 0 auto;                 /* 不被压缩，放不下就横向滑 */
    padding: 9px 12px;
  }
}

/* ============================================================
   合集卡片 / 投稿中心 / 内容详情页
   ============================================================ */

/* ---- 通用按钮（新页面用，和 nav-login / um-btn 视觉一致）---- */
.btn-primary {
  display: inline-block; padding: 9px 18px; border-radius: 8px;
  border: 1px solid var(--primary); background: var(--primary); color: #fff;
  font-size: 13.5px; font-family: inherit; cursor: pointer; font-weight: 500;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost {
  display: inline-block; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text-secondary);
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: #cbd5e1; }
.btn-ghost:disabled { opacity: .6; cursor: not-allowed; }

/* ---- 卡片上的「合集」角标 + 整张可点 ---- */
.badge.series { color: #7c2d12; background: #ffedd5; }
.card-linked { cursor: pointer; }
.card-linked:hover { border-color: #fdba74; }

/* ---- 优秀短剧卡片 ---- */
/* 紫色系徽章：与「合集」(橙)、「示例」(灰) 一眼区分 */
.badge.short { color: #6d28d9; background: #ede9fe; }
/* 封面上传行：输入框 + 上传按钮 */
.cover-row { display: flex; gap: 8px; align-items: center; }
.cover-row input { flex: 1; min-width: 0; }
/* 封面：等比缩放占卡片顶部，图挂了整块隐藏（onerror 里处理） */
.short-cover {
  margin: -4px 0 10px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  aspect-ratio: 16 / 9;
}
.short-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- 收藏页「优秀短剧」视图 ---- */
/* 切到短剧视图时隐藏教程筛选组，只留视图切换按钮 */
.fav-view-btn .badge.short-count {
  margin-left: auto; font-style: normal; font-size: 12px;
  color: var(--text-muted);
}
.folder-item.short-view em { font-style: normal; }

/* ---- 投稿中心 ---- */
.center-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px; align-items: start;
  padding: 32px 24px 60px;
  max-width: var(--content-max); margin: 0 auto;
}
.center-side {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow);
  position: sticky; top: 78px;
}
.center-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 11px 12px; margin-bottom: 4px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  font-size: 14px; color: var(--text-secondary); font-family: inherit; cursor: pointer;
}
.center-nav small { font-size: 11.5px; color: var(--text-muted); }
.center-nav:hover { background: #f8fafc; color: var(--text); }
.center-nav.active { background: var(--primary-soft); border-color: #bfdbfe; color: var(--primary); font-weight: 600; }
.center-nav.active small { color: var(--primary); }
.center-nav em {
  font-style: normal; font-size: 11.5px; min-width: 20px; text-align: center;
  background: #f1f5f9; border-radius: 10px; padding: 1px 6px; color: var(--text-secondary);
}
.center-tip { margin: 10px 8px 4px; font-size: 11.5px; line-height: 1.7; color: var(--text-muted); }
.center-tip span { color: #b45309; }

.center-main {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-height: 320px;
}
.center-guard { text-align: center; padding: 40px 20px; }
.center-guard h2 { font-size: 18px; margin-bottom: 8px; }
.center-guard p { color: var(--text-secondary); font-size: 14px; margin-bottom: 18px; }
.center-pane { display: flex; flex-direction: column; gap: 14px; }
.pane-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pane-head h2 { font-size: 18px; }
.pane-note { font-size: 12.5px; color: var(--text-muted); }
.pane-actions { display: flex; gap: 10px; margin-top: 4px; }
.um-empty { color: var(--text-muted); font-size: 13.5px; padding: 20px 0; text-align: center; }

/* 剧集动态行 */
.ep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.ep-head span { font-size: 13px; font-weight: 600; color: var(--text); }
.ep-head em { color: #dc2626; font-style: normal; }
.ep-hint { font-size: 12px; line-height: 1.7; color: var(--text-muted); margin: -6px 0 0; }
.ep-hint code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.ep-list { display: flex; flex-direction: column; gap: 8px; }
.ep-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1.6fr) 84px 32px; gap: 8px; align-items: center; }
.ep-row input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; min-width: 0;
}
.ep-row input:focus { outline: none; border-color: var(--primary); }
.ep-idx { font-size: 12px; color: var(--text-muted); text-align: center; }
.ep-del {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; color: var(--text-muted); cursor: pointer; font-size: 12px;
}
.ep-del:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }

/* 我的投稿列表 */
.sub-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.sub-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sub-badge { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.sub-badge.pending  { color: #92400e; background: #fef3c7; }
.sub-badge.approved { color: #15803d; background: #dcfce7; }
.sub-badge.rejected { color: #b91c1c; background: #fee2e2; }
.sub-kind { font-size: 11.5px; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 10px; }
.sub-meta { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.sub-title { font-size: 15px; font-family: inherit; margin-bottom: 6px; }
.sub-summary { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.sub-eps { margin: 6px 0 0 18px; font-size: 12.5px; color: var(--text-secondary); }
.sub-eps li { margin-bottom: 3px; }
.sub-url { font-size: 12.5px; word-break: break-all; }
.sub-reason { font-size: 12.5px; color: #b91c1c; margin-top: 6px; }
.sub-actions { margin-top: 10px; display: flex; gap: 8px; }

/* ---- 内容详情页 ---- */
.cv-layout {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px; align-items: start;
  padding: 28px 24px 60px;
  max-width: var(--content-max); margin: 0 auto;
}
.cv-side {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow);
  position: sticky; top: 78px;
}
.cv-side-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 600; padding: 2px 6px 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.cv-side-head em { font-style: normal; font-size: 12px; color: var(--text-muted); font-weight: 400; }
.cv-eps { display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow-y: auto; }
.cv-ep {
  display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; font-family: inherit; cursor: pointer;
}
.cv-ep:hover { background: #f8fafc; }
.cv-ep.active { background: var(--primary-soft); border-color: #bfdbfe; }
.cv-ep-idx {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: #e2e8f0; color: var(--text-secondary);
  font-size: 11.5px; display: flex; align-items: center; justify-content: center;
}
.cv-ep.active .cv-ep-idx { background: var(--primary); color: #fff; }
.cv-ep-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cv-ep-title { font-size: 13px; color: var(--text); line-height: 1.45; }
.cv-ep.active .cv-ep-title { color: var(--primary); font-weight: 500; }
.cv-ep-sub { font-size: 11.5px; color: var(--text-muted); }
.cv-ep.ext .cv-ep-sub { color: #b45309; }
.cv-back { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; }

.cv-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cv-player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #0f172a; border-radius: var(--radius); overflow: hidden;
}
.cv-player iframe, .cv-player video { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.cv-ext {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: #cbd5e1; font-size: 13.5px; text-align: center; padding: 20px;
}
.cv-title { font-size: 21px; line-height: 1.45; font-family: inherit; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-summary { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }
.cv-meta { font-size: 12.5px; color: var(--text-muted); }

.cv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.cv-author { display: flex; align-items: center; gap: 10px; }
.cv-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
}
.cv-author-name { font-size: 14px; font-weight: 500; }
.cv-actions { display: flex; gap: 8px; }
.cv-act {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 20px; background: #fff;
  font-size: 13px; font-family: inherit; color: var(--text-secondary); cursor: pointer;
}
.cv-act:hover { border-color: #cbd5e1; color: var(--text); }
.cv-act.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.cv-act .num { font-variant-numeric: tabular-nums; }

.cv-comments { display: flex; flex-direction: column; gap: 12px; }
.cv-comments h2 { font-size: 16px; font-family: inherit; }
.cv-comments h2 em { font-style: normal; font-size: 13px; color: var(--text-muted); font-weight: 400; }
.cv-composer { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cv-composer textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; resize: vertical;
}
.cv-composer textarea:focus { outline: none; border-color: var(--primary); }
.cv-comment-list { display: flex; flex-direction: column; gap: 14px; }
.cv-cmt { border-bottom: 1px dashed var(--border); padding-bottom: 12px; }
.cv-cmt:last-child { border-bottom: none; }
.cv-cmt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.cv-cmt-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #f1f5f9; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.cv-cmt-name { font-size: 13px; font-weight: 500; }
.cv-cmt-time { font-size: 11.5px; color: var(--text-muted); }
.cv-cmt-body { font-size: 13.5px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; }
.cv-empty { font-size: 13px; color: var(--text-muted); padding: 8px 0; }
.cv-notfound { text-align: center; padding: 60px 20px; }
.cv-notfound h2 { font-size: 18px; margin-bottom: 10px; }
.cv-notfound p { font-size: 14px; color: var(--text-secondary); margin-bottom: 18px; }

/* ---- 窄屏：两页都收成单列 ---- */
@media (max-width: 900px) {
  .center-layout, .cv-layout { grid-template-columns: 1fr; padding: 22px 16px 48px; }
  .center-side, .cv-side { position: static; top: auto; }
  .cv-eps { max-height: none; }
  .ep-row { grid-template-columns: 52px minmax(0, 1fr) 32px; }
  .ep-row .ep-url { grid-column: 2 / 3; }
  .ep-row .ep-duration { display: none; }
  .cv-title { font-size: 18px; }
}

