/* 南国怪才 · 中小学教学资源平台 —— 蓝色科技风主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2f7dff;        /* 电光蓝 */
  --primary-2: #37e0ff;      /* 冰青 */
  --primary-dark: #1b5fd9;
  --deep: #1b355e;
  --bg: #142744;
  --bg-2: #1d3a63;
  --panel: rgba(186, 216, 255, 0.10);
  --panel-hover: rgba(186, 216, 255, 0.16);
  --line: rgba(186, 216, 255, 0.24);
  --text: #f2f7ff;
  --muted: #b6cbe8;
  --glow: 0 0 22px rgba(47, 125, 255, .35);
}
html { color-scheme: dark; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(1100px 520px at 85% -8%, rgba(60,140,255,.28), transparent 60%),
    radial-gradient(900px 480px at -10% 30%, rgba(75,225,255,.16), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}
/* 科技网格底纹 */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(186,216,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(186,216,255,.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 30%, transparent 78%);
}
a { text-decoration: none; color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
button { cursor: pointer; font-family: inherit; }
::selection { background: rgba(47,125,255,.4); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(186,216,255,.07); }
::-webkit-scrollbar-thumb { background: rgba(186,216,255,.28); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,184,255,.35); }

/* 顶条 */
.topbar {
  background: rgba(34, 58, 96, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148,184,255,.10);
  color: #9db6dd; font-size: 12px;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar-right { display: flex; gap: 14px; align-items: center; }
.topbar-right a { color: #9db6dd; transition: color .15s; }
.topbar-right a:hover { color: var(--primary-2); }
.ai-dot i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748e; margin-right: 4px; }
.ai-dot.ok i { background: #2fe08f; box-shadow: 0 0 8px rgba(47,224,143,.8); }
.ai-dot.bad i { background: #ff5f7a; box-shadow: 0 0 8px rgba(255,95,122,.6); }

/* 头部 */
.header {
  background: rgba(36, 62, 104, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  position: relative;
  overflow: hidden;
}
.header::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent 4%, var(--primary) 32%, var(--primary-2) 55%, transparent 92%);
  opacity: .65;
}
.header-inner { display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-mark { width: 56px; height: 56px; filter: drop-shadow(0 0 14px rgba(47,125,255,.5)); }
.logo-mark.sm { width: 32px; height: 32px; }
.logo-text b {
  display: block; font-size: 26px; letter-spacing: 4px;
  font-family: "STKaiti", "KaiTi", serif;
  background: linear-gradient(120deg, #eaf4ff 30%, #7cc2ff 55%, #37e0ff 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.logo-text i { display: block; font-style: normal; font-size: 12px; color: var(--muted); letter-spacing: 2.5px; margin-top: 2px; }
.search-box { flex: 1; max-width: 560px; }
.search-row {
  display: flex; height: 46px; overflow: hidden;
  background: rgba(10, 20, 40, .8);
  border: 1px solid rgba(148,184,255,.28);
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.search-row:focus-within { border-color: var(--primary); box-shadow: var(--glow); }
.search-row select { border: none; border-right: 1px solid var(--line); padding: 0 10px; font-size: 14px; outline: none; background: transparent; color: var(--text); }
.search-row select option { background: #1d3a63; color: var(--text); }
.search-row input { flex: 1; border: none; outline: none; padding: 0 14px; font-size: 14px; background: transparent; color: var(--text); }
.search-row input::placeholder { color: #6a82a6; }
.search-row button {
  width: 96px; border: none; font-size: 16px; letter-spacing: 6px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transition: filter .2s;
}
.search-row button:hover { filter: brightness(1.18); }
.hot-words { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 12px; }
.hot-words a:hover { color: var(--primary-2); text-shadow: 0 0 8px rgba(55,224,255,.5); }
.header-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.btn-ai {
  background: linear-gradient(135deg, var(--primary), #6a5cff);
  border: 1px solid rgba(122,168,255,.5);
  color: #fff; padding: 10px 24px; border-radius: 22px; font-size: 15px; font-weight: bold;
  box-shadow: 0 0 18px rgba(47,125,255,.4), inset 0 0 12px rgba(255,255,255,.08);
  transition: transform .15s, box-shadow .2s;
}
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 0 26px rgba(47,125,255,.65); }
.stat-line { font-size: 12px; color: var(--muted); }
.stat-line b { color: var(--primary-2); text-shadow: 0 0 8px rgba(55,224,255,.45); }

/* 导航 */
.nav {
  background: rgba(8, 14, 28, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.nav .wrap { display: flex; gap: 6px; }
.nav a { padding: 13px 20px; font-size: 15px; color: #b9cbec; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s, background .15s; }
.nav a:hover { color: var(--primary-2); }
.nav a.active { color: #fff; border-bottom-color: var(--primary); font-weight: bold; text-shadow: 0 0 12px rgba(47,125,255,.6); }

/* 布局 */
.layout { display: grid; grid-template-columns: 220px 1fr 240px; gap: 16px; padding: 18px 16px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 24px rgba(2,8,20,.35);
}
.panel-title {
  font-size: 15px; margin-bottom: 12px; color: #eaf3ff;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
}
.panel-title::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, var(--primary-2), var(--primary)); box-shadow: 0 0 8px rgba(47,125,255,.6); }

/* 学科列表 */
.subject-list { list-style: none; }
.subject-list li { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; transition: background .15s, color .15s; }
.subject-list li:hover { background: var(--panel-hover); color: #fff; }
.subject-list li.active {
  background: linear-gradient(135deg, rgba(47,125,255,.9), rgba(27,95,217,.9));
  color: #fff; box-shadow: 0 0 14px rgba(47,125,255,.35);
}
.subject-list li .cnt { font-size: 12px; color: var(--muted); }
.subject-list li.active .cnt { color: #cfe6ff; }

/* 排行榜 */
.rank-list { list-style: none; counter-reset: rk; }
.rank-list li { display: flex; gap: 8px; padding: 7px 0; font-size: 13px; cursor: pointer; counter-increment: rk; color: #b9cbec; }
.rank-list li::before {
  content: counter(rk); width: 18px; height: 18px; flex-shrink: 0;
  background: rgba(148,184,255,.14); color: #9db6dd; border-radius: 4px;
  font-size: 12px; text-align: center; line-height: 18px;
}
.rank-list li:nth-child(-n+3)::before { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #04101f; font-weight: bold; box-shadow: 0 0 8px rgba(55,224,255,.4); }
.rank-list li:hover { color: var(--primary-2); }
.rank-list li span.t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* AI 面板 */
.ai-panel p { font-size: 12px; color: var(--muted); line-height: 1.75; margin-bottom: 10px; }
.ai-panel p b { color: #bcd8ff; }
.btn, .btn-primary { display: inline-block; border: none; padding: 9px 16px; border-radius: 8px; font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; width: 100%;
  box-shadow: 0 0 12px rgba(47,125,255,.25);
  transition: box-shadow .2s, filter .2s;
}
.btn-primary:hover { filter: brightness(1.15); box-shadow: 0 0 20px rgba(47,125,255,.5); }

/* 工具栏 */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
}
.stage-tabs { display: flex; gap: 6px; }
.stage-tabs a { padding: 7px 18px; font-size: 14px; border-radius: 18px; cursor: pointer; color: #b9cbec; border: 1px solid transparent; transition: all .15s; }
.stage-tabs a:hover { color: #fff; border-color: var(--line); }
.stage-tabs a.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: bold; box-shadow: 0 0 14px rgba(47,125,255,.4);
}
.toolbar-right select {
  height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; margin-left: 8px;
  font-size: 13px; background: rgba(10,20,40,.8); color: var(--text); outline: none;
}
.toolbar-right select option { background: #1d3a63; }
.crumb { font-size: 12px; color: var(--muted); margin: 14px 2px; }

/* 资源卡片 */
.res-list { display: flex; flex-direction: column; gap: 12px; }
.res-card {
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  display: flex; justify-content: space-between; gap: 16px;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  position: relative;
}
.res-card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px;
  border-radius: 2px; background: linear-gradient(180deg, var(--primary-2), transparent);
  opacity: .45; transition: opacity .2s;
}
.res-card:hover { border-color: rgba(47,125,255,.55); box-shadow: 0 0 22px rgba(47,125,255,.18), inset 0 1px 0 rgba(255,255,255,.07); transform: translateY(-1px); }
.res-card:hover::before { opacity: 1; }
.res-main { flex: 1; min-width: 0; }
.res-title { font-size: 15px; color: #eaf3ff; cursor: pointer; display: block; transition: color .15s; }
.res-title:hover { color: var(--primary-2); text-shadow: 0 0 10px rgba(55,224,255,.35); }
.res-title .fmt-ico { margin-right: 6px; }
.res-title .ver-tag { font-size: 11px; color: #7cc2ff; border: 1px solid rgba(124,194,255,.35); background: rgba(47,125,255,.12); border-radius: 4px; padding: 1px 6px; margin-left: 8px; vertical-align: 2px; }
.res-title .free-tag { font-size: 11px; color: #2fe08f; border: 1px solid rgba(47,224,143,.35); background: rgba(47,224,143,.10); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.res-desc { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-meta { font-size: 12px; color: var(--muted); margin-top: 9px; display: flex; gap: 14px; flex-wrap: wrap; }
.res-meta b { color: var(--primary-2); font-weight: normal; }
.res-action { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 8px; flex-shrink: 0; width: 92px; }
.btn-dl {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; padding: 9px 0; border-radius: 8px; font-size: 14px; font-weight: bold;
  box-shadow: 0 0 12px rgba(47,125,255,.22); transition: filter .2s, box-shadow .2s;
}
.btn-dl:hover { filter: brightness(1.15); box-shadow: 0 0 18px rgba(47,125,255,.5); }
.btn-detail {
  background: transparent; color: #b9cbec; border: 1px solid var(--line);
  padding: 7px 0; border-radius: 8px; font-size: 12px; transition: all .15s;
}
.btn-detail:hover { border-color: var(--primary); color: var(--primary-2); }
.empty {
  text-align: center; color: var(--muted); padding: 60px 0;
  background: var(--panel); border: 1px dashed var(--line); border-radius: 12px;
}

/* 公告 & 数据 */
.notice-list { list-style: none; }
.notice-list li { font-size: 12px; color: var(--muted); padding: 7px 0; line-height: 1.65; }
.notice-list .tag {
  display: inline-block; font-size: 11px; color: #04101f; font-weight: bold;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  border-radius: 3px; padding: 1px 6px; margin-right: 6px;
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-grid div { text-align: center; background: rgba(47,125,255,.06); border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; }
.stat-grid b { display: block; font-size: 18px; background: linear-gradient(120deg, #eaf4ff, #7cc2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-grid span { font-size: 12px; color: var(--muted); }

/* 用户条 & 登录注册 */
.user-chip { display: inline-flex; gap: 10px; align-items: center; color: #cfe0ff; }
.user-chip .uc-name { color: var(--primary-2); }
.user-chip .uc-pts b { color: var(--primary-2); }
.user-chip a { color: #9db6dd; font-size: 12px; }
.user-chip a:hover { color: #fff; }
.mask { display: none; position: fixed; inset: 0; background: rgba(14, 28, 52, .68); backdrop-filter: blur(6px); z-index: 100; align-items: flex-start; justify-content: center; padding: 60px 16px; }
.mask.show { display: flex; }
.modal {
  background: linear-gradient(160deg, rgba(44, 74, 118, .97), rgba(30, 56, 94, .97));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(148,184,255,.22);
  border-radius: 14px; width: 640px; max-width: 100%; padding: 28px; position: relative;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 40px rgba(47,125,255,.12);
}
.modal-sm { width: 380px; }
.modal-close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 22px; color: var(--muted); }
.modal h3 { color: #eaf3ff; font-size: 17px; line-height: 1.5; padding-right: 24px; }
.modal .m-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; font-size: 13px; }
.modal .m-meta span { background: rgba(47,125,255,.09); border: 1px solid var(--line); border-radius: 5px; padding: 4px 10px; color: var(--muted); }
.modal .m-meta span b { color: #bcd8ff; font-weight: normal; }
.modal .m-desc { font-size: 13px; color: var(--muted); line-height: 1.8; border-top: 1px dashed var(--line); padding-top: 14px; }
.modal .m-desc b { color: #bcd8ff; }
.modal .m-actions { margin-top: 18px; display: flex; gap: 12px; }
.modal .m-actions .btn-dl { flex: 1; padding: 12px 0; font-size: 15px; }
.btn-ghost { flex: 1; background: transparent; border: 1px solid var(--primary); color: var(--primary-2); border-radius: 8px; padding: 12px 0; font-size: 15px; transition: all .15s; }
.btn-ghost:hover { background: rgba(47,125,255,.12); box-shadow: var(--glow); }

/* 登录注册表单 */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.auth-tabs .tab-btn { flex: 1; padding: 9px 0; border: 1px solid var(--line); background: transparent; border-radius: 8px; font-size: 14px; color: var(--muted); transition: all .15s; }
.auth-tabs .tab-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: transparent; color: #fff; font-weight: bold; box-shadow: 0 0 12px rgba(47,125,255,.3); }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.auth-form input {
  height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px;
  font-size: 14px; outline: none; background: rgba(10,20,40,.7); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.auth-form input::placeholder { color: #6a82a6; }
.auth-form input:focus { border-color: var(--primary); box-shadow: var(--glow); }
.auth-msg { font-size: 12px; color: #ff7a92; min-height: 16px; white-space: pre-line; }
.auth-hint { font-size: 12px; color: var(--muted); line-height: 1.7; }
.btn-dl.full { width: 100%; padding: 12px 0; }
.mine-list { list-style: none; border-top: 1px dashed var(--line); margin-top: 12px; max-height: 260px; overflow-y: auto; }
.mine-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; color: #b9cbec; }
.mine-list li small { color: var(--muted); flex-shrink: 0; }
.mine-list li.none { color: var(--muted); justify-content: center; }

/* 分页 */
.page-nav { display: flex; justify-content: center; gap: 8px; padding: 22px 0; }
.page-nav a {
  min-width: 34px; height: 34px; line-height: 32px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; cursor: pointer; padding: 0 8px; color: #b9cbec; transition: all .15s;
}
.page-nav a.active { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: transparent; box-shadow: 0 0 12px rgba(47,125,255,.35); }
.page-nav a:hover { border-color: var(--primary); color: var(--primary-2); }
.page-nav a.active:hover { color: #fff; }
.page-nav a.nav-btn { padding: 4px 12px; font-size: 12px; }
.page-nav a.dots { border: none; background: none; cursor: default; color: var(--muted); }
.page-nav a.dots:hover { border: none; color: var(--muted); }

/* 筛选面板（学科网式多维筛选） */
.filter-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 14px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.f-row { display: flex; align-items: flex-start; gap: 10px; }
.f-label { flex-shrink: 0; font-size: 12px; color: var(--muted); line-height: 26px; width: 34px; }
.f-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.f-chip {
  font-size: 12px; line-height: 1; padding: 7px 10px; border-radius: 14px;
  border: 1px solid var(--line); color: var(--text); background: rgba(186,216,255,.06);
  transition: all .15s;
}
.f-chip i { font-style: normal; opacity: .6; font-size: 11px; margin-left: 3px; }
.f-chip:hover { border-color: var(--primary); color: var(--primary-2); }
.f-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: transparent; box-shadow: 0 0 10px rgba(47,125,255,.35);
}
.f-chip.active i { opacity: .85; }
.meta-tag { color: #8fd3ff; }

/* 关于 */
.about {
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; margin-top: 18px; padding: 22px 26px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.about h2 {
  font-size: 18px; margin-bottom: 12px;
  background: linear-gradient(120deg, #eaf4ff, #7cc2ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.about p { font-size: 13px; color: var(--muted); line-height: 1.9; margin-bottom: 8px; }
.about p b { color: #bcd8ff; }

/* 页脚 */
.footer {
  background: rgba(6, 10, 20, .85);
  border-top: 1px solid var(--line);
  color: #7d94b8; margin-top: 26px; padding: 28px 0; font-size: 12px; text-align: center;
}
.footer-brand { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 10px; }
.footer-brand b {
  color: transparent; font-size: 18px; letter-spacing: 4px; font-family: "STKaiti", "KaiTi", serif;
  background: linear-gradient(120deg, #eaf4ff, #7cc2ff);
  -webkit-background-clip: text; background-clip: text;
}
.footer-inner p { margin-top: 4px; }
.footer-inner a { color: var(--primary-2); }

/* 弹窗复用 mask/modal（见上） */

/* AI 抽屉 */
.ai-fab {
  position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid rgba(122,168,255,.5);
  background: linear-gradient(135deg, var(--primary), #6a5cff);
  color: #fff; font-size: 26px;
  box-shadow: 0 0 22px rgba(47,125,255,.55); z-index: 90;
  transition: transform .15s, box-shadow .2s;
}
.ai-fab:hover { transform: scale(1.06); box-shadow: 0 0 30px rgba(47,125,255,.8); }
.ai-drawer {
  display: none; flex-direction: column; position: fixed; right: 24px; bottom: 24px;
  width: 400px; height: 560px; max-height: calc(100vh - 48px);
  background: linear-gradient(160deg, rgba(14, 24, 46, .97), rgba(8, 14, 28, .97));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(148,184,255,.25); border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,.6), 0 0 30px rgba(47,125,255,.15);
  z-index: 95; overflow: hidden;
}
.ai-drawer.show { display: flex; }
.ai-head {
  background: linear-gradient(135deg, rgba(47,125,255,.28), rgba(106,92,255,.18));
  border-bottom: 1px solid var(--line);
  color: #fff; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center;
}
.ai-title small { font-size: 11px; opacity: .8; margin-left: 6px; }
.ai-head-right { display: flex; align-items: center; gap: 8px; }
.ai-head-right select { border: 1px solid var(--line); border-radius: 5px; font-size: 12px; padding: 3px 5px; background: rgba(34,60,100,.9); color: var(--text); outline: none; }
.ai-close { border: none; background: none; color: #cfe0ff; font-size: 20px; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px; background: rgba(26, 48, 82, .55); display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.msg.bot { background: rgba(148,184,255,.08); border: 1px solid var(--line); border-top-left-radius: 2px; align-self: flex-start; color: #d7e5ff; }
.msg.user { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-top-right-radius: 2px; align-self: flex-end; }
.msg.err { background: rgba(255,95,122,.10); border: 1px solid rgba(255,95,122,.3); color: #ffb3c1; align-self: flex-start; }
.ai-input { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; background: rgba(9, 15, 30, .8); }
.ai-input textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 8px; resize: none; padding: 8px;
  font-size: 13px; font-family: inherit; outline: none;
  background: rgba(10,20,40,.7); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.ai-input textarea::placeholder { color: #6a82a6; }
.ai-input textarea:focus { border-color: var(--primary); box-shadow: var(--glow); }
.ai-input button {
  width: 74px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border: none; border-radius: 8px; font-size: 14px;
}
.ai-input button:disabled { opacity: .55; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(10, 20, 40, .95); border: 1px solid rgba(47,125,255,.45);
  box-shadow: 0 0 20px rgba(47,125,255,.35);
  color: #eaf3ff; font-size: 13px; padding: 10px 22px; border-radius: 22px;
  display: none; z-index: 120;
}
.toast.show { display: block; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* 响应式 */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 200px 1fr; }
  .side-right { display: none; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; max-width: 100%; width: 100%; }
  .ai-drawer { right: 12px; left: 12px; width: auto; }
}

/* ============ 新增：收藏星 / 专题标签 / 侧栏空态 ============ */
.fav-star { margin-left: 8px; color: var(--muted); font-size: 16px; cursor: pointer; transition: all .15s; display: inline-block; vertical-align: middle; text-decoration: none; }
.fav-star:hover { transform: scale(1.25); color: #ffce4d; }
.fav-star.on { color: #ffce4d; text-shadow: 0 0 8px rgba(255,206,77,.45); }
.topic-tag { color: var(--primary-2) !important; border-color: rgba(55,224,255,.35) !important; }
.side-empty { color: var(--muted); font-size: 12px; padding: 8px 0; cursor: default; }
.side-more { color: var(--primary-2); font-size: 12px; padding: 8px 0; cursor: pointer; }
.side-more:hover { text-decoration: underline; }

/* ============ 新增：在线预览弹窗 ============ */
.modal-wide { width: min(960px, 94vw); max-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.pv-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.pv-head b { display: block; color: #eaf3ff; font-size: 16px; line-height: 1.5; padding-right: 28px; }
.pv-head span { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.pv-body { overflow-y: auto; min-height: 300px; max-height: calc(100vh - 220px); background: #f4f7fb; border-radius: 10px; padding: 24px; }
.pv-loading, .pv-error { text-align: center; padding: 60px 20px; color: #4a628f; font-size: 14px; line-height: 2; }
.pv-error { padding: 40px 20px; }
/* 试卷正文（白纸样式，模拟 Word 版面） */
.paper-view { background: #fff; max-width: 720px; margin: 0 auto; padding: 46px 52px; box-shadow: 0 2px 16px rgba(20,39,68,.15); border-radius: 4px; color: #1c2b3a; font-size: 15px; line-height: 1.9; font-family: "Microsoft YaHei", "PingFang SC", serif; }
.paper-view h1, .paper-view h2, .paper-view h3, .paper-view h4 { color: #10233f; margin: 14px 0 8px; line-height: 1.5; }
.paper-view h1 { font-size: 20px; text-align: center; }
.paper-view h2 { font-size: 17px; }
.paper-view p { margin: 8px 0; }
.paper-view img { max-width: 100%; height: auto; }
.paper-view table { border-collapse: collapse; width: 100%; margin: 10px 0; }
.paper-view td, .paper-view th { border: 1px solid #9db4cc; padding: 6px 9px; font-size: 14px; }
.paper-view ol, .paper-view ul { padding-left: 26px; }
.paper-view a { color: #2f7dff; }
/* docx-preview 原版面渲染微调 */
.pv-body .docx-wrapper { background: #d9e2ef; padding: 26px 10px; }
.pv-body .docx-wrapper > section.docx { box-shadow: 0 3px 18px rgba(20,39,68,.22); margin-bottom: 18px; }
