/* ==========================================================================
   品牌手册知识库 · 深色主题样式
   ========================================================================== */
:root {
  --bg: #0e0f13;
  --bg-elev: #16181d;
  --bg-card: #1a1d24;
  --bg-hover: #22262f;
  --border: #2a2e38;
  --border-light: #343a46;
  --text: #e8eaed;
  --text-dim: #9aa0ab;
  --text-mute: #6b7280;
  --primary: #5b8cff;
  --primary-hover: #6f9bff;
  --accent: #a55eea;
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
  --radius: 12px;
  --sidebar-w: 240px;
  --topbar-h: 68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
button, input, select { font-family: inherit; }
button { cursor: pointer; }
kbd {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
}

/* ===== 顶部栏 ===== */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 26px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 250px; cursor: pointer; user-select: none; }
.brand-logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 140, 255, .35);
}
.brand-text h1 { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.brand-text span { font-size: 9px; color: var(--text-mute); letter-spacing: 1.5px; }

.search-wrap {
  flex: 1;
  max-width: 620px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color .2s, box-shadow .2s;
}
.search-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 140, 255, .15); }
.search-icon { color: var(--text-mute); flex-shrink: 0; }
.search-wrap input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 13px;
}
.search-wrap input::placeholder { color: var(--text-mute); }
.search-clear {
  display: none; background: none; border: none;
  color: var(--text-mute); font-size: 22px; line-height: 1; padding: 0 4px;
}
.search-clear.show { display: block; }
.search-clear:hover { color: var(--text); }

.topbar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.stat-badge { display: flex; align-items: baseline; gap: 5px; color: var(--text-dim); }
.stat-badge strong { font-size: 20px; color: var(--text); font-weight: 700; }
.stat-badge span { font-size: 12px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text-dim);
  transition: all .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--primary); }

/* ===== 布局 ===== */
.layout { display: flex; height: calc(100vh - var(--topbar-h)); }

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar, .content::-webkit-scrollbar, .preview-body::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb, .content::-webkit-scrollbar-thumb, .preview-body::-webkit-scrollbar-thumb {
  background: var(--border-light); border-radius: 4px;
}
.side-section { margin-bottom: 26px; }
.side-title {
  font-size: 12px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px;
  padding: 0 10px 12px;
}
.side-sub { font-size: 9px; color: var(--text-mute); font-weight: 500; margin-left: 4px; }
.filter-item {
  width: 100%; height: 38px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px;
  background: none; border: none; border-radius: 8px;
  color: var(--text-dim); font-size: 13px; text-align: left;
  transition: all .15s;
}
.filter-item:hover { background: var(--bg-hover); color: var(--text); }
.filter-item.active { background: rgba(91, 140, 255, .15); color: var(--primary-hover); font-weight: 600; }
.fi-icon { font-size: 16px; width: 20px; text-align: center; }
.fi-name { flex: 1; }
.fi-count { font-size: 11px; color: var(--text-mute); background: var(--bg); padding: 1px 7px; border-radius: 10px; }
.filter-item.active .fi-count { background: rgba(91, 140, 255, .2); color: var(--primary-hover); }

.type-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 8px; }
.type-chip {
  padding: 5px 11px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 16px; color: var(--text-dim); font-size: 12px;
  transition: all .15s;
}
.type-chip:hover { border-color: var(--border-light); color: var(--text); }
.type-chip.active { background: rgba(165, 94, 234, .15); border-color: var(--accent); color: #c99bf0; }

.side-footer { margin-top: auto; }
.tip-card {
  display: flex; gap: 10px;
  background: rgba(91, 140, 255, .07);
  border: 1px solid rgba(91, 140, 255, .18);
  border-radius: 10px; padding: 12px;
}
.tip-icon { font-size: 18px; }
.tip-card strong { font-size: 12px; color: var(--text); }
.tip-card p { font-size: 11px; color: var(--text-dim); margin-top: 4px; line-height: 1.6; }

/* ===== 主内容 ===== */
.content { flex: 1; overflow-y: auto; padding: 0 28px 40px; }
.content-toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 16px;
  background: linear-gradient(var(--bg) 75%, transparent);
}
.result-info { display: flex; align-items: baseline; gap: 12px; }
.result-info > span:first-child { font-size: 17px; font-weight: 700; }
.result-count { font-size: 12px; color: var(--text-mute); }
.toolbar-actions { display: flex; align-items: center; gap: 16px; }
.sort-wrap { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 12px; }
.sort-wrap select {
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 10px; font-size: 12px; outline: none;
}
.view-toggle { display: flex; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.view-btn {
  width: 30px; height: 28px; display: grid; place-items: center;
  background: none; border: none; border-radius: 5px; color: var(--text-mute);
}
.view-btn.active { background: var(--bg-hover); color: var(--primary); }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.active-filters:empty { display: none; }
.filter-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(91, 140, 255, .12); color: var(--primary-hover);
  border: 1px solid rgba(91, 140, 255, .25);
  border-radius: 16px; padding: 4px 6px 4px 12px; font-size: 12px;
}
.filter-tag button { background: none; border: none; color: inherit; font-size: 16px; line-height: 1; opacity: .7; padding: 0 2px; }
.filter-tag button:hover { opacity: 1; }

/* ===== 卡片网格 ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  animation: cardIn .35s ease backwards;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--border-light); }

.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  color: #fff;
}
.cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.12), transparent 45%);
  pointer-events: none;
}
.cover-deco { position: absolute; border-radius: 50%; opacity: .25; pointer-events: none; }
.cover-deco.d1 { width: 110px; height: 110px; right: -30px; top: -40px; border: 16px solid rgba(255,255,255,.5); }
.cover-deco.d2 { width: 60px; height: 60px; left: -20px; bottom: -10px; background: rgba(255,255,255,.35); }
.cover-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.cover-brand-en { font-size: 8px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .8; font-weight: 600; }
.cover-type-badge {
  font-size: 8px; font-weight: 700; letter-spacing: .5px;
  border: 1px solid rgba(255,255,255,.5); border-radius: 4px;
  padding: 2px 5px; opacity: .9;
}
.cover-center { position: relative; z-index: 1; margin-top: auto; margin-bottom: auto; }
.cover-brand-cn { font-size: 22px; font-weight: 800; letter-spacing: 1px; line-height: 1.2; text-shadow: 0 2px 12px rgba(0,0,0,.2); }
.cover-guidelines { font-size: 8px; letter-spacing: 3px; opacity: .75; margin-top: 6px; text-transform: uppercase; }
.cover-bottom {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; opacity: .8; border-top: 1px solid rgba(255,255,255,.3); padding-top: 8px;
}
.cover-hover {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(10, 12, 18, .78);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.card:hover .cover-hover { opacity: 1; }
.preview-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff;
  padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 600;
  transform: scale(.9); transition: transform .2s;
}
.card:hover .preview-pill { transform: scale(1); }

.card-info { padding: 12px 13px 14px; }
.card-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.industry-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 4px;
  background: var(--bg-hover); color: var(--text-dim);
}
.card-meta-right { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-mute); }
.mini-dl {
  width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 5px; color: var(--text-mute); transition: all .15s;
}
.mini-dl:hover { background: var(--primary); color: #fff; }

/* 列表视图 */
.card-grid.list-view { grid-template-columns: 1fr; gap: 10px; }
.card-grid.list-view .card { display: flex; align-items: center; }
.card-grid.list-view .cover { width: 88px; aspect-ratio: 16/9; flex-shrink: 0; padding: 5px; }
.card-grid.list-view .cover-brand-cn { font-size: 11px; }
.card-grid.list-view .cover-brand-en, .card-grid.list-view .cover-guidelines,
.card-grid.list-view .cover-bottom, .card-grid.list-view .cover-type-badge,
.card-grid.list-view .cover-deco { display: none; }
.card-grid.list-view .cover-center { margin: 0; }
.card-grid.list-view .card-info { flex: 1; display: flex; align-items: center; justify-content: space-between; }
.card-grid.list-view .card-meta { margin: 0; gap: 20px; }

/* ===== 空状态 / 加载更多 ===== */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }
.load-more-wrap { text-align: center; padding: 30px 0; }
.page-footer {
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 30px; padding-top: 20px;
  color: var(--text-mute); font-size: 11px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; transition: all .18s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: var(--bg-hover); color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-light); }
.btn-baidu { background: #2d64f5; color: #fff; }
.btn-baidu:hover { background: #3b72ff; }
.baidu-panda { font-size: 14px; }
.btn-load { background: var(--bg-elev); color: var(--text); border-color: var(--border); padding: 10px 28px; }
.btn-load:hover { border-color: var(--primary); color: var(--primary); }

/* ===== 弹窗通用 ===== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.modal-close {
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-dim); width: 34px; height: 34px;
  border-radius: 8px; font-size: 22px; line-height: 1;
  display: grid; place-items: center; transition: all .15s;
}
.modal-close:hover { color: #fff; background: #e74c3c; border-color: #e74c3c; }

/* ===== 产品详情弹窗（1200px） ===== */
.detail-dialog {
  position: relative;
  width: min(900px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  padding: 34px 38px 30px;
}
.detail-close { position: absolute; top: 16px; right: 16px; z-index: 5; }
.detail-top {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  align-items: stretch;
}
.dt-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}
.dt-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, #5b8cff, #1e2a44);
  border: 1px solid var(--border);
  position: sticky;
  top: 0;
}
.dt-title { font-size: 19px; font-weight: 800; margin: 0 0 6px; letter-spacing: .5px; line-height: 1.3; }
.dt-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.dt-badge {
  font-size: 12px; font-weight: 700; border: 1px solid currentColor;
  border-radius: 6px; padding: 3px 10px; opacity: .9;
}
.dt-spec { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }
.spec-row {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 6px 2px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.spec-k { color: var(--text-mute); flex-shrink: 0; }
.spec-v { font-weight: 600; text-align: right; word-break: break-all; }
.dt-download { margin-top: 0; padding-top: 6px; }
.dt-baidu-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #2f6bff, #1e4fd6);
  color: #fff; border: none; border-radius: 10px;
  padding: 8px 18px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: 0 8px 24px rgba(47,107,255,.35);
}
.dt-baidu-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(47,107,255,.45); }
.dt-baidu-btn.dl-locked { opacity: .45; cursor: not-allowed; box-shadow: none; }
.dt-baidu-btn.dl-locked:hover { transform: none; }
.dt-dl-hint { margin-top: 8px; font-size: 12px; color: var(--text-mute); }
.dt-dl-hint:empty { display: none; }
.dt-dl-hint a { color: var(--primary); font-weight: 600; }
.detail-bottom { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border-light); }
.db-title { font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.db-sub { font-size: 11px; font-weight: 600; color: var(--text-mute); letter-spacing: 1px; margin-left: 8px; }
.dtp-item { margin: 0 0 20px; }
.dtp-item img {
  width: 100%; display: block; border-radius: 12px;
  border: 1px solid var(--border); background: #14161f;
}
.dtp-item figcaption { text-align: center; font-size: 11px; color: var(--text-mute); margin-top: 8px; }
.dtp-empty {
  text-align: center; color: var(--text-mute); font-size: 13px;
  padding: 46px 20px; border: 1px dashed var(--border); border-radius: 12px;
}
@media (max-width: 900px) {
  .detail-dialog { padding: 24px 18px; }
  .detail-top { grid-template-columns: 1fr; gap: 20px; }
  .dt-cover { position: static; height: auto; aspect-ratio: 16 / 9; }
}
/* ===== 旧预览弹窗（已由 detail-dialog 取代） ===== */
.preview-dialog {
  position: relative;
  width: min(960px, 96vw); height: min(760px, 94vh);
  background: var(--bg-elev);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.ph-left { display: flex; align-items: center; gap: 14px; }
.ph-thumb { width: 62px; height: 35px; border-radius: 4px; flex-shrink: 0; overflow: hidden; }
.ph-meta h2 { font-size: 16px; font-weight: 700; }
.ph-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.preview-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pdf-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.pdf-tools-left, .pdf-page-nav { display: flex; align-items: center; gap: 8px; }
.pdf-tool {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-dim); font-size: 16px;
}
.pdf-tool:hover { color: var(--text); border-color: var(--primary); }
.zoom-label, .pdf-page-nav span { font-size: 12px; color: var(--text-dim); min-width: 44px; text-align: center; }
.pdf-hint { font-size: 11px; color: var(--text-mute); }

.pdf-viewport {
  flex: 1; overflow-y: auto;
  background: #202329;
  display: flex; justify-content: center;
  padding: 24px;
}
.pdf-page {
  width: 420px; min-height: 594px;
  background: #fff; color: #1a1a1a;
  border-radius: 2px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
  transform-origin: top center;
  padding: 44px 40px;
  flex-shrink: 0;
}
/* CDN 真实 PDF 预览 */
.pdf-frame {
  width: 100%; height: 100%;
  border: none; background: #fff;
  border-radius: 2px;
}
.pdf-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--text-dim); font-size: 13px;
  background: #202329;
}
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pdf-viewport { position: relative; }

/* 模拟 PDF 页面内容 */
.pdf-cover-page { display: flex; flex-direction: column; height: 100%; min-height: 506px; }
.pdf-cover-band { height: 8px; border-radius: 4px; margin-bottom: 40px; }
.pdf-cover-en { font-size: 11px; letter-spacing: 3px; color: #999; text-transform: uppercase; }
.pdf-cover-cn { font-size: 40px; font-weight: 800; margin-top: 10px; line-height: 1.15; }
.pdf-cover-title { font-size: 15px; color: #555; margin-top: 14px; }
.pdf-cover-spacer { flex: 1; }
.pdf-cover-line { height: 1px; background: #ddd; margin-bottom: 14px; }
.pdf-cover-foot { display: flex; justify-content: space-between; font-size: 10px; color: #aaa; }
.pdf-content-page h3 { font-size: 20px; margin-bottom: 8px; color: #222; }
.pdf-content-page .pdf-kicker { font-size: 10px; letter-spacing: 2px; color: var(--primary); text-transform: uppercase; margin-bottom: 6px; }
.pdf-content-page p { font-size: 11px; color: #666; line-height: 1.9; margin-bottom: 14px; }
.pdf-swatch-row { display: flex; gap: 8px; margin: 14px 0 24px; }
.pdf-swatch { flex: 1; height: 70px; border-radius: 3px; }
.pdf-swatch-label { display: flex; justify-content: space-between; font-size: 8px; color: #999; margin-top: 5px; }
.pdf-grid-demo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.pdf-grid-item { aspect-ratio: 1; border-radius: 3px; }
.pdf-typo-sample { font-size: 34px; font-weight: 800; margin: 10px 0; }

.preview-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.pf-info { font-size: 12px; color: var(--text-dim); }
.pf-info b { color: var(--text); }
.pf-actions { display: flex; gap: 10px; }

/* ===== 使用说明弹窗 ===== */
.help-dialog {
  position: relative;
  width: min(620px, 94vw); max-height: 86vh;
  background: var(--bg-elev); border: 1px solid var(--border-light);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  animation: modalIn .25s ease;
}
.help-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.help-header h2 { font-size: 18px; }
.help-body { padding: 22px 26px; overflow-y: auto; color: var(--text-dim); font-size: 13px; line-height: 1.8; }
.help-body h3 { color: var(--text); font-size: 14px; margin: 20px 0 8px; }
.help-body h3:first-child { margin-top: 0; }
.help-body ul, .help-body ol { padding-left: 20px; }
.help-body li { margin: 4px 0; }
.help-body b { color: var(--text); }
.help-body code { background: var(--bg-hover); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 11px; color: #c99bf0; }
.help-note { margin-top: 16px; padding: 12px; background: rgba(247,183,49,.08); border: 1px solid rgba(247,183,49,.2); border-radius: 8px; font-size: 12px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border-light); border-left: 3px solid var(--primary);
  padding: 12px 20px; border-radius: 8px; box-shadow: var(--shadow);
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .brand-text h1 { font-size: 14px; }
  .brand { min-width: auto; }
  .search-wrap { max-width: none; }
  .stat-badge { display: none; }
}
@media (max-width: 640px) {
  .sidebar { display: none; }
  .topbar { padding: 0 14px; gap: 12px; }
  .brand-text { display: none; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
  .content { padding: 0 14px 30px; }
  .preview-footer { flex-direction: column; gap: 12px; align-items: stretch; }
  .pf-actions { justify-content: center; }
}

/* ==========================================================================
   会员鉴权相关样式（登录入口 / 登录弹窗 / 下载锁 / 角色徽章）
   ========================================================================== */
.auth-area { display: flex; align-items: center; }
.btn-login {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  transition: opacity .2s;
}
.btn-login:hover { opacity: .88; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px 4px 4px; color: var(--text);
}
.user-chip:hover { border-color: var(--primary); }
.u-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff;
}
.u-name { font-size: 12px; }
.role-badge { font-size: 10px; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.role-badge.admin { background: rgba(165,94,234,.18); color: #c99bf0; }
.role-badge.ok { background: rgba(38,222,129,.15); color: #4ade80; }
.role-badge.pend { background: rgba(247,183,49,.15); color: #f7b731; }
.user-menu-wrap { position: relative; }
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 500;
  width: 200px; background: var(--bg-elev, #161b2b);
  border: 1px solid var(--border-light, rgba(255,255,255,.08));
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.45);
  padding: 6px; animation: udIn .18s ease;
}
@keyframes udIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.ud-head { padding: 10px 12px; border-bottom: 1px solid var(--border, rgba(255,255,255,.06)); margin-bottom: 6px; }
.ud-name { font-size: 13px; font-weight: 700; color: var(--text, #fff); }
.ud-role { font-size: 11px; color: var(--text-dim, #8b93a7); margin-top: 3px; }
.menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text, #fff); transition: background .15s;
}
.menu-item:hover { background: rgba(91,140,255,.12); color: var(--primary, #5b8cff); }
.menu-item.mi-icon, .menu-item .mi-icon { font-size: 14px; }
.menu-item.mi-quit:hover { background: rgba(255,107,107,.12); color: #ff6b6b; }
.expire-chip {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 18px; padding: 8px 14px; font-size: 12px;
  color: var(--text-dim); white-space: nowrap;
}
.expire-chip.exp-out { border-color: rgba(255,107,107,.4); color: #ff6b6b; }
.expire-chip.exp-pend { border-color: rgba(247,183,49,.4); color: #f7b731; }

/* 登录弹窗 */
.auth-dialog {
  position: relative;
  width: min(400px, 94vw);
  background: var(--bg-elev);
  border: 1px solid var(--border-light);
  border-radius: 16px; box-shadow: var(--shadow);
  padding: 30px 28px 26px;
  animation: modalIn .25s ease;
}
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-logo { font-size: 36px; margin-bottom: 10px; }
.auth-head h2 { font-size: 20px; margin-bottom: 6px; }
.auth-head p { font-size: 12px; color: var(--text-dim); }
.auth-form label { display: block; font-size: 12px; color: var(--text-dim); margin: 14px 0 6px; }
.auth-form input {
  width: 100%; height: 42px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 12px; color: var(--text); font-size: 14px; outline: none;
}
.auth-form input:focus { border-color: var(--primary); }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; }
.btn-code {
  width: 120px; flex-shrink: 0;
  background: rgba(91,140,255,.12); color: var(--primary-hover);
  border: 1px solid rgba(91,140,255,.3); border-radius: 8px;
  font-size: 12px; font-weight: 600;
}
.btn-code:disabled { opacity: .6; cursor: not-allowed; }
.auth-submit { width: 100%; height: 44px; margin-top: 22px; font-size: 14px; }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }
.auth-err { color: #ff6b6b; font-size: 12px; min-height: 16px; margin-top: 4px; }
.auth-tip { font-size: 11px; color: var(--text-mute); text-align: center; margin-top: 16px; line-height: 1.6; }

/* 下载锁 */
.pf-locked {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-dim); font-size: 12px;
}
.pf-locked span { margin-right: 4px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

@media (max-width: 640px) {
  .u-name, .role-badge { display: none; }
  .user-chip { padding: 4px; }
  .pf-locked { flex-wrap: wrap; }
}
