:root {
  --bg: #f5f6fa; --card: #ffffff; --line: #e3e6ee;
  --text: #1f2430; --muted: #7a8299; --brand: #3b6ef5; --brand-dark: #2f57c9;
  --ok: #1a9e5c; --warn: #d98414; --err: #d64545;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }

header { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header h1 { font-size: 18px; margin: 0; }
header nav { display: flex; gap: 14px; align-items: center; }
header nav a { color: var(--brand); text-decoration: none; font-size: 14px; }
header nav a.tab { color: var(--muted); padding: 6px 10px; border-radius: 8px; }
header nav a.tab.active { color: var(--brand); background: #eef2fd; font-weight: 600; }
header nav a.tab.hidden { display: none; }
#nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
#whoami { color: var(--muted); font-size: 14px; }

.hint { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.radio-line { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; align-items: center; }
.rl { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--text); font-size: 14px; white-space: nowrap; line-height: 1; }
.rl input { width: auto; margin: 0; flex-shrink: 0; vertical-align: middle; }
select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { flex: 1; min-width: 160px; }
iframe { width: 100%; aspect-ratio: 16/9; border: none; border-radius: 10px; margin-top: 6px; }
#preview-box { margin-top: 8px; }

.badge.mod { background: #f0e9fd; color: #7a4fd6; }
.badge.cap { background: #e6f7f0; color: #0d8a63; }
.badge.passed { background: #e6f7ee; color: var(--ok); }
.badge.rejected { background: #fdecec; color: var(--err); }
.badge.unreviewed { background: #eef1f8; color: var(--muted); }
.review-info { margin-top: 8px; font-size: 13px; padding: 8px 12px; background: #f7f8fc; border-radius: 8px; color: var(--text); }
.extra-info { margin-top: 6px; font-size: 13px; padding: 7px 12px; background: #fbf7ee; border-left: 3px solid #e0c98a; border-radius: 6px; color: var(--text); word-break: break-word; }
/* 个人主页「我的提交」在宽屏下双列；题库是单题浏览，必须独占整行 */
@media (min-width: 1200px) {
  #mine-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  #mine-list .rec { margin: 0; }
  #bank-list { display: block; }
}
.review-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.review-form select, .review-form input { flex: 1; min-width: 140px; }
.video-slot iframe { margin-top: 8px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); padding: 8px 6px; font-weight: 500; }
.tbl td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.mini-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 4px; }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assign-cell { display: flex; gap: 6px; align-items: center; }

.profile-head { display: flex; gap: 20px; align-items: center; }
.big-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #eef1f8; }
.hidden { display: none !important; }

main { max-width: 1440px; margin: 20px auto; padding: 0 24px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 1500px) { main { padding: 0 40px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 26px; }
.card h2 { margin: 0 0 16px; font-size: 17px; }
.card h2 small { color: var(--muted); font-weight: normal; }

label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 5px; }
input, textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { resize: vertical; }
.row { margin-bottom: 8px; }
.row.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (min-width: 1100px) {
  #page-submit .row.cols,
  #page-submit .row.grid2 { grid-template-columns: 1fr 1fr; }
  #ann-form .row.half { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  /* 提交表单在宽屏下四列排布时间类字段 */
  .row.cols4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
.opt { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.opt input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); }
button { background: var(--brand); color: #fff; border: none; border-radius: 8px; padding: 10px 22px; font-size: 14px; cursor: pointer; margin-top: 10px; }
button:hover { background: var(--brand-dark); }
button:disabled { background: #b9c4e8; cursor: wait; }
button.ghost { background: transparent; color: var(--brand); border: 1px dashed var(--brand); padding: 6px 14px; }
button.mini { padding: 4px 10px; font-size: 12px; margin: 0; }
button.danger { background: transparent; color: var(--err); border: 1px solid var(--err); }
.login-card a { color: var(--brand); font-size: 13px; text-decoration: none; }
#register-form { border-top: 1px dashed var(--line); padding-top: 8px; }
.chk { display: flex; align-items: center; margin-top: 26px; }
.chk input { width: auto; }
#user-form input { min-width: 160px; }

.msg { font-size: 13px; min-height: 18px; }
.msg.ok { color: var(--ok); } .msg.err { color: var(--err); }
.err { color: var(--err); font-size: 13px; }

.rec { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 10px 0; }
.rec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 20px; background: #eef1f8; color: var(--muted); }
.badge.yt { background: #fdecec; color: #c33; }
.badge.bili { background: #e8f1fd; color: #2b7bd6; }
.badge.ready { background: #e6f7ee; color: var(--ok); }
.badge.pending { background: #fdf3e6; color: var(--warn); }
.badge.failed { background: #fdecec; color: var(--err); }
.rec-q { font-weight: 600; margin: 8px 0 4px; }
.rec-url { font-size: 12px; color: var(--brand); text-decoration: none; word-break: break-all; }
.rec-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rec-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
audio.ctl { width: 100%; margin-top: 10px; }
.opts-list { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.opts-list .correct { color: var(--ok); font-weight: 600; }

.hidden { display: none !important; }

/* login */
.login-bg { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg, #e8edfa, #f5f6fa); }
.login-card { background: var(--card); padding: 40px 44px; border-radius: 16px; box-shadow: 0 12px 40px rgba(40,60,120,.12); width: 360px; text-align: center; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-logo { height: 56px; width: auto; display: block; margin: 0 auto 14px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin-top: 0; }
.login-card input { margin: 8px 0; text-align: center; }
.login-card button { width: 100%; margin-top: 16px; }


/* ================= 移动端适配 ================= */
.chk-line { display: flex; gap: 16px; align-items: center; margin: 6px 0 10px; flex-wrap: wrap; }
.chk-line .rl { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; }
.review-form input { margin: 4px 0; }

@media (max-width: 768px) {
  header { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
  header h1 { font-size: 17px; margin: 0; }
  #tabs { flex-wrap: wrap; gap: 6px 12px; }
  #tabs .tab { font-size: 14px; }
  main { padding: 10px 8px 24px; }
  .card { padding: 14px 12px; border-radius: 10px; }
  .card h2 { font-size: 17px; }
    .radio-line { gap: 4px 10px; }
  .rl { font-size: 13px; }
    .rec { padding: 12px 10px; }
  .rec-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .rec-q { font-size: 15px; }
  .rec-url { word-break: break-all; }
  .ctl, audio { width: 100%; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  .login-card { width: auto; margin: 0 14px; padding: 26px 20px; }
  .review-form select, .review-form input { width: 100%; }
  #preview-frame { height: 220px; }
  iframe { width: 100%; }
}


/* ================= 视觉升级 v2 ================= */
:root {
  --brand: #4f6ef7;
  --brand2: #7b5cf0;
  --grad: linear-gradient(135deg, #4f6ef7, #7b5cf0);
}

/* 渐变主按钮 */
button { background: var(--grad); border: none; color: #fff; font-weight: 500;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
button:hover { box-shadow: 0 6px 18px rgba(79,110,247,.35); transform: translateY(-1px); filter: brightness(1.05); }
button:active { transform: translateY(0); }
button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); box-shadow: none; }
button.ghost:hover { background: rgba(79,110,247,.08); transform: none; }
button.mini { padding: 4px 10px; font-size: 12.5px; border-radius: 7px; }
button.danger { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* 卡片悬浮 */
.card { transition: box-shadow .2s ease; }
@media (min-width: 769px) { .card:hover { box-shadow: 0 8px 28px rgba(40,60,120,.10); } }

/* 字体层级 */
.rec-q { font-size: 16px; font-weight: 600; margin: 8px 0 6px; }
.rec-meta { font-size: 12.5px; }
.hint { line-height: 1.6; }
.card h2 { letter-spacing: .3px; }

/* 徽章统一配色 */
.badge { border-radius: 999px; font-size: 12px; padding: 2px 9px; display: inline-block; }
.badge.mod { background: #eef2ff; color: #4f46e5; }
.badge.cap { background: #ecfdf5; color: #059669; }
.badge.yt { background: #fef2f2; color: #dc2626; }
.badge.bili { background: #fdf4ff; color: #c026d3; }
.badge.ready, .badge.passed { background: #ecfdf5; color: #059669; }
.badge.pending { background: #fffbeb; color: #d97706; }
.badge.failed, .badge.rejected { background: #fef2f2; color: #dc2626; }
.badge.unreviewed { background: #f1f5f9; color: #64748b; }

/* 页面切换淡入 */
.page { animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Toast 轻提示 */
#toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 999; display: flex;
  flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: #1e293b; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: toastIn .25s ease;
  max-width: 340px; }
.toast.ok { background: linear-gradient(135deg, #059669, #10b981); }
.toast.err { background: linear-gradient(135deg, #dc2626, #ef4444); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* 空状态 */
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-state .icon { font-size: 40px; display: block; margin-bottom: 8px; }

/* 反馈列表 */
.fb-item { border: 1px solid rgba(0,0,0,.07); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.fb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.fb-content { margin: 6px 0 0; white-space: pre-wrap; }

/* 题目评论区 */
.comments { margin-top: 8px; border-top: 1px dashed rgba(0,0,0,.1); padding-top: 8px; }
.comment { font-size: 13.5px; padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,.05); }
.comment b { margin-right: 6px; }
.comment .del { color: #dc2626; cursor: pointer; font-size: 12px; margin-left: 8px; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input { flex: 1; }


/* 视频框统一外观（修复空白矩形观感） */
#preview-frame, .video-slot iframe, iframe[allowfullscreen] {
  width: 100%; aspect-ratio: 16 / 9; min-height: 220px;
  background: #0f172a; border: 0; border-radius: 10px; display: block;
}
.bank-pager {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 6px 0 14px; padding: 10px 14px;
  background: #f8fafc; border: 1px solid rgba(0,0,0,.06); border-radius: 10px;
}
.bank-pager button { min-width: 88px; margin: 0; }
.bank-pos {
  font-weight: 700; font-size: 14px; color: #334155;
  min-width: 74px; text-align: center;
  font-variant-numeric: tabular-nums;
}



/* ================= 评论/点赞/布局修复 ================= */
/* 评论：头像 + 回复缩进 */
.comment { display: flex; gap: 8px; align-items: flex-start; }
.cmt-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-body b { font-size: 13.5px; }
.comment.is-reply { margin-left: 34px; padding: 4px 0 4px 8px; border-left: 2px solid rgba(79,110,247,.25); }
.creply { color: #4f6ef7; cursor: pointer; font-size: 12px; margin-left: 8px; }
.creply:hover { text-decoration: underline; }
.comment .del { cursor: pointer; font-size: 12px; margin-left: 8px; color: #dc2626; }

/* 点赞状态 */
.like-btn.liked, .fb-like.liked { color: #dc2626; border-color: #dc2626; background: #fef2f2; }
.like-btn.liked::first-line { color: #dc2626; }

/* 删除按钮：红底白字，避免与背景融合 */
button.danger, button.mini.danger, button.ghost.danger {
  background: #dc2626 !important; color: #fff !important; border: none !important;
}
button.ghost.danger:hover { background: #b91c1c !important; }



/* ================= 布局（最终版）：顶部导航栏 ================= */
header {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 12px 24px; background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.07);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
header h1 { font-size: 17px; margin: 0; font-weight: 700; white-space: nowrap; }
/* 品牌区：OmniWave logo + 站名 */
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #0f172a; flex-shrink: 0;
}
.brand-logo { height: 32px; width: auto; display: block; }
.brand-name {
  font-size: 17px; font-weight: 700; white-space: nowrap;
  letter-spacing: .2px; color: #16233b;
}
.brand:hover .brand-name { color: #0e6ebb; }
#tabs {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin-left: auto;
}
#tabs .tab {
  padding: 7px 12px; border-radius: 8px; font-size: 14px;
  color: #475569; text-decoration: none; white-space: nowrap;
}
#tabs .tab:hover { background: #f1f5ff; color: #4f6ef7; }
#tabs .tab.active { background: linear-gradient(135deg,#4f6ef7,#7b5cf0); color: #fff; font-weight: 600; }
#nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; margin-left: 6px; }
#whoami { font-size: 13px; color: #334155; margin-left: 2px; }
#btn-logout { font-size: 13px; color: #94a3b8; text-decoration: none; margin-left: 6px; }
#btn-logout:hover { color: #dc2626; }

main {
  max-width: 1240px; margin: 20px auto; padding: 0 24px 40px;
  display: flex; flex-direction: column; gap: 18px;
}
#page-bank .card, #page-review .card, #page-submit .card { width: 100%; }

@media (max-width: 900px) {
  header { padding: 10px 12px; gap: 10px; }
  header h1 { font-size: 15px; }
  .brand-logo { height: 26px; }
  .brand-name { font-size: 15px; }
  /* 窄屏：品牌靠左，导航单行可横向滑动，避免溢出把 logo 挤到右边 */
  header { justify-content: flex-start; }
  .brand { align-self: flex-start; }
  #tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  #tabs { margin-left: 0; width: 100%; gap: 2px; }
  #tabs .tab { padding: 6px 9px; font-size: 13px; }
  #whoami { display: none; }
  main { padding: 12px 10px 30px; margin: 0; }
}


/* ================= 题库单题：媒体 / 信息 左右两栏 ================= */
.rec-detail {
  container-type: inline-size;
  padding: 0;
  overflow: hidden;
}
.rec-detail > .rec-head {
  padding: 14px 20px 0;
  align-items: flex-start;
}
.rec-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.rec-owner {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px;
  color: #475569; background: #f1f5f9; padding: 3px 9px 3px 4px; border-radius: 999px;
  white-space: nowrap;
}
.rec-owner .mini-avatar { margin: 0; }

.rec-detail > .rec-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px 26px;
  padding: 14px 20px 4px;
  align-items: start;
}
.rec-media { min-width: 0; }
.rec-media .video-slot:empty { display: none; }
.rec-info { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rec-info .rec-q { margin: 0; font-size: 17px; line-height: 1.5; }
.rec-info .rec-url { display: inline-block; max-width: 100%; }
.rec-info .opts-list { margin: 0; padding: 10px 14px; background: #f8fafc; border-radius: 10px; list-style: none; }
.rec-info .opts-list li { padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,.06); }
.rec-info .opts-list li:last-child { border-bottom: none; }
.rec-info .extra-info, .rec-info .review-info { margin: 0; }

/* 两栏：容器足够宽时媒体 42% + 信息剩余全部（两个断点兜底，兼容不支持 container 的浏览器） */
@media (min-width: 760px) {
  .rec-detail > .rec-cols {
    grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
    grid-template-areas: "media info";
  }
}
@container (min-width: 700px) {
  .rec-detail > .rec-cols {
    grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
    grid-template-areas: "media info";
  }
  .rec-detail > .rec-cols > .rec-media { grid-area: media; }
  .rec-detail > .rec-cols > .rec-info  { grid-area: info; }
  .rec-media .video-slot iframe { margin-top: 0; }
}

.rec-detail > .rec-actions {
  padding: 12px 20px;
  margin: 0;
  border-top: 1px solid rgba(0,0,0,.06);
  background: #fcfcfe;
  align-items: center;
}
.rec-detail > .comments { padding: 0 20px 16px; margin: 0; border-top: none; }

.rec { background: #fff; border: 1px solid rgba(0,0,0,.07); border-radius: 12px; padding: 16px 18px; }
.rec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rec-url { font-size: 12.5px; color: #4f6ef7; word-break: break-all; display: block; }
.rec-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.opts-list { margin: 8px 0; padding-left: 4px; list-style: none; }
.opts-list li { padding: 4px 0; font-size: 14px; }
.opts-list li.correct { color: #059669; font-weight: 600; }
.ctl { width: 100%; margin: 8px 0; }


/* ================= 表单栅格（最终版） ================= */
.row { margin-bottom: 10px; }
.row.cols   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row.grid2  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row.cols4  { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.row.half   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) {
  .row.cols, .row.grid2, .row.half { grid-template-columns: 1fr; }
  .row.cols4 { grid-template-columns: 1fr 1fr; }
}

/* ================= 消息中心（私信通知） ================= */
.notice-badge {
  display: inline-block; min-width: 17px; height: 17px; line-height: 17px;
  padding: 0 5px; margin-left: 4px; border-radius: 9px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  text-align: center; vertical-align: 1px;
}
#tabs .tab.active .notice-badge { background: #fff; color: #ef4444; }

#notice-list { display: flex; flex-direction: column; gap: 8px; }
.notice {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(0,0,0,.07); background: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.notice:hover { background: #f8fafc; }
.notice.unread { background: #f6f8ff; border-color: rgba(79,110,247,.35); }
.notice .cmt-avatar { width: 34px; height: 34px; }
.notice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.notice-title { font-size: 14px; font-weight: 600; color: #1f2430; }
.notice.unread .notice-title { color: #2b46b8; }
.notice-text {
  font-size: 13px; color: #475569; word-break: break-word;
  background: #f1f5f9; border-radius: 8px; padding: 6px 10px; margin-top: 2px;
}
.notice-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.notice-go { font-size: 13px; color: #4f6ef7; text-decoration: none; font-weight: 600; margin-left: auto; }
.notice-go:hover { text-decoration: underline; }
.notice-dot {
  position: absolute; top: 14px; right: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
}

@media (max-width: 600px) {
  #tabs .tab { font-size: 12.5px; padding: 5px 7px; }
  .notice { padding: 10px 12px; gap: 9px; }
  .notice .cmt-avatar { width: 28px; height: 28px; }
}

/* ================= 文档（Wiki） ================= */
.badge.loc { background: #fff7ed; color: #c2410c; }
.badge.lock { background: #f1f5f9; color: #64748b; font-weight: 500; }

#page-docs { width: 100%; }
.wiki {
  display: grid; grid-template-columns: 268px minmax(0, 1fr);
  gap: 18px; align-items: start;
}
.wiki-side {
  position: sticky; top: 78px;
  background: #fff; border: 1px solid rgba(0,0,0,.07); border-radius: 12px;
  padding: 12px 10px; max-height: calc(100vh - 100px); overflow: auto;
}
.wiki-side-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: #334155;
  padding: 2px 6px 10px; border-bottom: 1px solid rgba(0,0,0,.06);
}
.wiki-side-head button { margin: 0; }
.wiki-doc-list { padding: 6px 0; display: flex; flex-direction: column; gap: 2px; }
.wiki-doc {
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; color: #334155; line-height: 1.4;
  border-left: 2px solid transparent;
}
.wiki-doc:hover { background: #f1f5ff; color: #4f6ef7; }
.wiki-doc.active {
  background: #eef2ff; color: #3b55d9; font-weight: 600;
  border-left-color: #4f6ef7;
}
.wiki-doc-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wiki-outline-head {
  font-size: 12px; font-weight: 700; color: #94a3b8; letter-spacing: .4px;
  padding: 12px 8px 6px; border-top: 1px solid rgba(0,0,0,.06); margin-top: 4px;
}
.wiki-outline { display: flex; flex-direction: column; gap: 1px; }
.wiki-out-item {
  display: block; font-size: 12.5px; color: #64748b; text-decoration: none;
  padding: 4px 8px; border-radius: 6px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wiki-out-item:hover { background: #f8fafc; color: #4f6ef7; }
.wiki-out-item.lv3 { padding-left: 20px; }
.wiki-out-item.lv4 { padding-left: 32px; }

.wiki-main { padding: 24px 32px 32px; min-width: 0; }
.wiki-titlebar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(0,0,0,.07); padding-bottom: 12px; margin-bottom: 4px;
}
.wiki-titlebar h2 { margin: 0; font-size: 26px; line-height: 1.3; }
.wiki-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.wiki-actions button { margin: 0; }

/* Markdown 正文排版 */
.md-body { font-size: 15px; line-height: 1.78; color: #23293a; word-wrap: break-word; }
.md-body > *:first-child { margin-top: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 {
  line-height: 1.35; margin: 26px 0 12px; scroll-margin-top: 84px; font-weight: 700;
}
.md-body h1 { font-size: 26px; padding-bottom: 8px; border-bottom: 1px solid rgba(0,0,0,.08); }
.md-body h2 { font-size: 21px; padding-bottom: 6px; border-bottom: 1px solid rgba(0,0,0,.06); }
.md-body h3 { font-size: 17.5px; }
.md-body h4 { font-size: 15.5px; color: #475569; }
.md-body p { margin: 12px 0; }
.md-body a { color: #4f6ef7; text-decoration: none; border-bottom: 1px solid rgba(79,110,247,.3); }
.md-body a:hover { border-bottom-color: #4f6ef7; }
.md-body ul, .md-body ol { margin: 12px 0; padding-left: 26px; }
.md-body li { margin: 5px 0; }
.md-body li::marker { color: #94a3b8; }
.md-body blockquote {
  margin: 14px 0; padding: 10px 16px; color: #475569;
  background: #f8fafc; border-left: 4px solid #c7d2fe; border-radius: 0 8px 8px 0;
}
.md-body blockquote p { margin: 4px 0; }
.md-body hr { border: none; border-top: 1px solid rgba(0,0,0,.08); margin: 24px 0; }
.md-body code {
  background: #f1f5f9; color: #b4268a; padding: 1.5px 6px; border-radius: 5px;
  font-size: 13px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
.md-code-wrap { position: relative; margin: 16px 0; }
.md-code-wrap pre {
  background: #0f172a; border-radius: 10px; padding: 16px 18px; overflow: auto;
  margin: 0;
}
.md-code-wrap pre code {
  background: none; color: #e2e8f0; padding: 0; font-size: 13px; line-height: 1.65;
}
.md-lang {
  position: absolute; top: 8px; right: 12px; font-size: 11px; color: #64748b;
  text-transform: uppercase; letter-spacing: .5px;
}
.md-table-wrap { overflow-x: auto; margin: 16px 0; }
.md-body table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md-body th, .md-body td {
  border: 1px solid rgba(0,0,0,.09); padding: 8px 12px; text-align: left; vertical-align: top;
}
.md-body th { background: #f8fafc; font-weight: 600; color: #334155; }
.md-body tbody tr:nth-child(even) { background: #fcfdff; }
.md-img { max-width: 100%; border-radius: 8px; display: block; margin: 12px 0; }

/* 编辑态 */
.md-toolbar {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
  padding: 6px; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 8px 8px 0 0; border-bottom: none;
}
.md-toolbar button { margin: 0; }
.md-toolbar-gap { flex: 1; }
#doc-content {
  border-radius: 0 0 8px 8px; font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13.5px; line-height: 1.7;
}
#doc-preview {
  border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px;
  min-height: 420px; background: #fff;
}
.wiki-edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.wiki-edit-actions button { margin: 0; }

@media (max-width: 900px) {
  .wiki { grid-template-columns: 1fr; }
  .wiki-side {
    position: static; max-height: none;
  }
  .wiki-main { padding: 16px 14px 22px; }
  .wiki-titlebar h2 { font-size: 21px; }
  .wiki-outline-head, .wiki-outline { display: none; }
}

/* ================= v12：可视化文档编辑 / 公告 / 层级徽章 ================= */
.doc-dirty {
  font-size: 12px; color: #d97706; font-weight: 600;
  align-self: center; white-space: nowrap;
  animation: dirtyPulse 1.6s ease-in-out infinite;
}
@keyframes dirtyPulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

#doc-toolbar {
  position: sticky; top: 66px; z-index: 6;
  border-radius: 10px; border-bottom: 1px solid var(--line);
  background: #fff; margin: 8px 0 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
#doc-body {
  min-height: 420px; padding: 4px 2px 40px;
  outline: none; border-radius: 8px;
  transition: background .15s ease;
}
#doc-body:focus { background: #fcfdff; box-shadow: inset 0 0 0 2px rgba(79,110,247,.12); }
#doc-body:empty::before {
  content: "在这里直接输入内容…（支持工具栏排版，改动会自动保存）";
  color: #94a3b8;
}
#doc-body .md-h:hover { background: rgba(79,110,247,.05); border-radius: 4px; }

/* 公告 */
.ann-item {
  border: 1px solid rgba(0,0,0,.07); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 10px; background: #fff;
}
.ann-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-head b { font-size: 15px; }
.ann-body {
  margin-top: 6px; font-size: 13.5px; color: #475569;
  background: #f8fafc; border-radius: 8px; padding: 8px 12px;
  white-space: pre-wrap; word-break: break-word;
}
.ann-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ann-foot button { margin-left: auto; }

/* 层级徽章 */
.badge.su { background: linear-gradient(135deg,#7c3aed,#4f46e5); color: #fff; font-weight: 600; }
.badge.adm { background: #eef2ff; color: #3b55d9; font-weight: 600; }

@media (max-width: 700px) {
  #doc-toolbar { position: static; }
  .wiki-titlebar { gap: 8px; }
  .wiki-actions { width: 100%; }
}

/* ================= v13：类语雀 / 飞书的块编辑体验 ================= */
#doc-view { position: relative; }

/* 表格工具条（光标进入表格时出现） */
.md-toolbar.table-tools {
  border-radius: 8px; border-bottom: 1px solid #dbe3ff;
  background: #f3f6ff; margin: -8px 0 16px;
  animation: ttIn .12s ease-out;
}
@keyframes ttIn { from { opacity: 0; transform: translateY(-3px) } to { opacity: 1 } }
.tt-label { font-size: 12px; color: #3b55d9; font-weight: 600; padding: 0 4px; }

/* 表格：单元格更易点中，空单元格保持高度 */
#doc-body table { table-layout: auto; }
#doc-body th, #doc-body td { min-width: 52px; }
#doc-body th:hover, #doc-body td:hover { background: #f6f9ff; }
#doc-body th:focus, #doc-body td:focus { outline: 2px solid rgba(79,110,247,.35); outline-offset: -2px; }

/* 待办清单 */
.md-body li.md-task { list-style: none; }
.md-body li.md-task .md-check {
  display: inline-block; cursor: pointer; user-select: none;
  color: #4f6ef7; margin-right: 5px; font-size: 15px;
}
.md-body li.md-task[data-checked="1"] { color: #94a3b8; text-decoration: line-through; }
.md-body li.md-task[data-checked="1"] .md-check { color: #94a3b8; }

/* 表格尺寸选择器（悬停选区，像语雀/飞书） */
.table-picker {
  position: absolute; z-index: 40; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; box-shadow: 0 12px 32px rgba(15,23,42,.14);
  width: max-content;
}
.tp-grid { display: grid; gap: 3px; }
.tp-grid .tp-cell {
  width: 18px; height: 18px; padding: 0; margin: 0; min-width: 0;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 3px; cursor: pointer;
}
.tp-grid .tp-cell.on { background: #dbe3ff; border-color: #93a7f5; }
.tp-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: #64748b; }
.tp-foot input { width: 50px; padding: 4px 6px; font-size: 12px; margin: 0; }
.tp-foot .tp-label { min-width: 46px; font-weight: 600; color: #334155; }
.tp-foot .tp-x { color: #94a3b8; }
.tp-foot button { margin: 0 0 0 auto; padding: 4px 10px; font-size: 12px; }

/* 输入技巧面板 */
.help-panel { width: 430px; max-width: 88vw; font-size: 12.5px; color: #475569; line-height: 1.95; }
.help-panel b { color: #23293a; font-size: 13px; }
.help-panel ul { margin: 8px 0 0; padding-left: 18px; }
.help-panel li { margin: 2px 0; }
.help-panel code {
  background: #f1f5f9; padding: 1px 5px; border-radius: 4px;
  color: #b4268a; font-size: 12px;
}
.help-panel kbd {
  background: #f8fafc; border: 1px solid #e2e8f0; border-bottom-width: 2px;
  border-radius: 4px; padding: 0 4px; font-size: 11px; color: #334155;
}

/* ================= 通用弹窗（替代原生 confirm / prompt / alert） ================= */
.uidlg, .recdlg {
  border: none; padding: 0; background: transparent; color: var(--text);
  max-width: none; max-height: none;
}
.uidlg::backdrop, .recdlg::backdrop {
  background: rgba(22, 30, 52, .45); backdrop-filter: blur(3px);
}
.uidlg-inner {
  width: 424px; max-width: calc(100vw - 36px);
  background: #fff; border-radius: 16px; padding: 20px 22px 18px;
  box-shadow: 0 24px 64px rgba(18, 28, 60, .3);
  animation: dlgIn .18s ease-out;
}
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.uidlg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.uidlg-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 17px;
  background: #eef2fd; color: var(--brand);
}
.uidlg-icon.warn { background: #fdf3e6; color: var(--warn); }
.uidlg-icon.danger { background: #fdecec; color: var(--err); }
.uidlg-icon.ok { background: #e6f7ee; color: var(--ok); }
.uidlg-head h3 { margin: 0; font-size: 16px; flex: 1; font-weight: 600; }
.uidlg-x {
  margin: 0; padding: 4px 8px; background: transparent; border: none;
  color: var(--muted); font-size: 13px; border-radius: 8px; line-height: 1;
}
.uidlg-x:hover { background: #f1f3fa; color: var(--text); }
.uidlg-text { font-size: 14px; line-height: 1.7; color: #414a60; margin: 0 0 6px; white-space: pre-wrap; }
.uidlg-input { margin-top: 6px; }
.uidlg-tip { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.uidlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.uidlg-actions button { margin: 0; padding: 8px 18px; font-size: 13.5px; border-radius: 9px; }
.uidlg-actions button.ghost { border-style: solid; border-color: var(--line); color: #5b6478; }
.uidlg-actions button.ghost:hover { background: #f4f6fb; }
.uidlg-actions button.danger { background: var(--err); color: #fff; border: none; }
.uidlg-actions button.danger:hover { background: #bf3a3a; }

/* ================= 题目结果弹窗 ================= */
.recdlg-inner {
  width: 760px; max-width: calc(100vw - 32px); max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 16px;
  box-shadow: 0 24px 64px rgba(18, 28, 60, .3);
  animation: dlgIn .2s ease-out;
}
.recdlg-head {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--line);
}
.recdlg-title { font-size: 15px; font-weight: 600; }
.recdlg-body { padding: 16px 20px 22px; }
.rd-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.rd-q { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 2px 0 10px; }
.rd-opts { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.rd-opts li { padding: 7px 13px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; background: #fbfcff; }
.rd-opts li.correct { border-color: #bfe9d1; background: #effaf4; color: #0f7a4a; font-weight: 600; }
.rd-status {
  display: flex; align-items: center; gap: 9px; font-size: 13px;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 14px;
  background: #f7f9fe; border: 1px dashed var(--line); color: #4a5468;
}
.rd-status.ok { background: #f2fbf6; border-color: #cdebd9; color: #107a4c; }
.rd-status.err { background: #fdf4f4; border-color: #f3d2d2; color: #b93c3c; }
.spinner {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid #ccd8f8; border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rd-foot { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.rd-foot button, .rd-foot a button { margin: 0; }

/* ================= 流式音频理解演示 ================= */
.sd { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.sd-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #f3f7ff, #faf7ff);
}
.sd-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #2b3550; }
.sd-phase {
  font-size: 12px; padding: 2px 10px; border-radius: 20px; white-space: nowrap;
  background: #eef2fd; color: var(--brand);
}
.sd-phase.run { background: #fdf3e6; color: var(--warn); }
.sd-phase.done { background: #e6f7ee; color: var(--ok); }

.sd-wave { display: flex; align-items: center; gap: 2px; height: 46px; padding: 6px 14px; background: #fcfdff; }
.sd-bar { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: #dde3f2; transition: background .12s linear; }
.sd-bar.on { background: linear-gradient(180deg, #7ba3ff, #3b6ef5); }
.sd-track { position: relative; height: 5px; margin: 0 14px; border-radius: 3px; background: #edf0f8; }
.sd-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: linear-gradient(90deg, #7ba3ff, #3b6ef5); transition: width .12s linear; }
.sd-mark { position: absolute; top: -3px; width: 2px; height: 11px; background: #f59e0b; border-radius: 1px; }
.sd-clock { display: flex; justify-content: space-between; padding: 6px 14px 0; font-size: 11px; color: #8a93a8; }
.sd-clock .sd-mark-legend { color: #b45309; }

.sd-flow { padding: 8px 14px 12px; display: flex; flex-direction: column; gap: 7px; }
/* 未触发的步骤不占位，演示时才逐步撑开，看起来像流式输出 */
.sd-step {
  display: none; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.6; color: #3b4459;
}
.sd-step.show { display: flex; animation: stepIn .32s ease-out both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sd-step-body { flex: 1; min-width: 0; }
.sd-dot {
  width: 20px; height: 20px; flex: none; border-radius: 50%; font-size: 11px;
  display: grid; place-items: center; background: #eef2fd; color: var(--brand);
}
.sd-step.warn .sd-dot { background: #fdf3e6; color: var(--warn); }
.sd-step.ok .sd-dot { background: #e6f7ee; color: var(--ok); }
.sd-answer {
  margin-top: 3px; padding: 9px 13px; border-radius: 9px; font-weight: 600;
  background: #e9f9f0; border: 1px solid #bfe9d1; color: #0f7a4a;
}
.sd-cursor { display: inline-block; width: 1px; height: 1em; background: #0f7a4a; vertical-align: -2px; animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.sd-ctrl { display: flex; gap: 8px; align-items: center; padding: 0 14px 14px; flex-wrap: wrap; }
.sd-ctrl button { margin: 0; }
.sd-ctrl .hint { margin: 0; font-size: 12px; }

@media (max-width: 640px) {
  .recdlg-inner { max-height: 92vh; }
  .recdlg-body { padding: 14px 14px 18px; }
  .sd-wave { height: 44px; }
  .uidlg-inner { padding: 18px; }
}

/* 卡片内的演示槽位 / 弹窗底部按钮 */
.stream-slot:not(:empty) { margin-top: 12px; }
.rd-foot a { display: inline-block; text-decoration: none; }
.rec-actions { flex-wrap: wrap; }

/* ---------- 本地下载助手 ---------- */
.helper-line{margin:8px 0 0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.helperdlg{max-width:640px}
.hp-intro{font-size:13px;line-height:1.7;color:#3c4a5a;background:#f5f8ff;border-left:3px solid #4a7dff;padding:10px 12px;border-radius:8px;margin-bottom:14px}
.hp-steps{margin:0;padding-left:20px;font-size:13px;line-height:1.7;color:#333}
.hp-steps>li{margin-bottom:14px}
.hp-steps>li>b{display:block;margin-bottom:6px;font-size:13.5px}
.hp-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.hp-token{flex:1;min-width:220px;font-family:ui-monospace,Consolas,monospace;font-size:12px;background:#f1f3f5;border:1px solid #e2e5e9;border-radius:6px;padding:7px 9px;overflow:auto;white-space:nowrap}
.hp-note{margin:6px 0 0;font-size:12px;color:#888}
.hp-hint{font-size:12px;color:#888}
.hp-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:6px;padding-top:12px;border-top:1px solid #eee}

/* ---------- 预上传音频提示（助手已下好这段音频） ---------- */
.pre-clip{display:flex;align-items:flex-start;gap:8px;margin:0 0 11px;padding:9px 11px;border-radius:9px;
  background:#EFF9F3;border:1px solid #C9E9D7;font-size:12.5px;line-height:1.62;color:#1F6B45}
.pre-clip.hidden{display:none}
.pre-clip.muted{opacity:.45}
.pre-clip .pc-ico{font-size:13px;line-height:1.5;flex:none}
.pre-clip .pc-txt{flex:1;min-width:0}
.pre-clip .pc-txt b{font-weight:700}
.pre-clip .pc-x{align-self:center;flex:none;background:none;border:0;padding:1px 2px;color:#4C7A63;
  font-size:12px;font-family:inherit;cursor:pointer;text-decoration:underline}
.pre-clip .pc-x:hover{color:#145235}
