/* ============================================================
   在线文档库 · MIUIX 风格
   纯灰阶设计（图标为单色 SVG），支持浅色 / 深色模式
   兼容性说明：
   - 全部 flex/grid 间距采用「margin 回退 + @supports gap 增强」
     兼容不支持 flex gap 的手机浏览器（微信 X5、老版 UC/QQ 等）
   - 不使用 color-mix()/inset/min() 等新特性作为唯一写法
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  --bg: #f4f4f6;
  --bg-soft: #ebebee;
  --card: #ffffff;
  --card-2: #f9f9fb;
  --text: #17171b;
  --text-2: #5b5b66;
  --text-3: #9a9aa5;
  --border: #e7e7eb;
  --border-strong: #d9d9de;
  --hover: #f1f1f4;
  --active: #17171b;
  --active-text: #ffffff;
  --danger: #b3261e;
  --danger-soft: #fbeae9;
  --success-soft: #e9f3ec;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.16);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --header-h: 62px;
}

html.dark {
  --bg: #0e0e11;
  --bg-soft: #17171b;
  --card: #1b1b20;
  --card-2: #202027;
  --text: #f1f1f3;
  --text-2: #a8a8b3;
  --text-3: #6d6d78;
  --border: #2b2b31;
  --border-strong: #3a3a42;
  --hover: #25252c;
  --active: #f1f1f3;
  --active-text: #0e0e11;
  --danger: #f2877f;
  --danger-soft: #3a1e1c;
  --success-soft: #1d3027;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "MiSans", "HarmonyOS Sans SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  transition: background .25s ease, color .25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--text); }
::placeholder { color: var(--text-3); }
::selection { background: var(--active); color: var(--active-text); }

.icon { width: 20px; height: 20px; flex: none; display: block; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

.muted { color: var(--text-3); }
.hidden { display: none !important; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 22px; }

/* ---------- 顶部栏 ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.bar { display: flex; align-items: center; height: var(--header-h); }
.bar-left { display: flex; align-items: center; }
.bar-left .icon-btn + .icon-btn { margin-left: 6px; }
.bar-search {
  flex: 1; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.search-trigger { color: var(--text-2); }
.search-trigger:hover { background: var(--hover); color: var(--text); }
.search-panel { display: none; width: 100%; align-items: center; position: relative; }
.bar-search.open .search-trigger { display: none; }
.bar-search.open .search-panel { display: flex; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-panel input {
  width: 100%; height: 40px; border-radius: 999px;
  border: 1px solid transparent; background: var(--bg-soft);
  padding: 0 42px 0 16px; outline: none;
  transition: border-color .18s ease, background .18s ease;
}
.search-panel input:focus { border-color: var(--border-strong); background: var(--card); }
.search-panel input::placeholder { color: var(--text-3); }
#searchGo { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; }
#searchClose { flex: none; margin-left: 8px; }
.bar-right { margin-left: 10px; display: flex; align-items: center; }
.bar-right .icon-btn + .icon-btn { margin-left: 6px; }

@supports (gap: 10px) {
  .bar { gap: 10px; }
  .bar-left .icon-btn + .icon-btn { margin-left: 0; }
  .bar-right { gap: 6px; }
  .bar-right .icon-btn + .icon-btn { margin-left: 0; }
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--text-2); transition: background .18s ease, color .18s ease;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(.94); }

/* ---------- 目录抽屉 ---------- */
.overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 90;
  background: rgba(0,0,0,.42);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.overlay.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 95;
  width: 86vw; max-width: 320px;
  background: var(--card);
  border-right: 1px solid var(--border);
  transform: translateX(-102%);
  transition: transform .28s cubic-bezier(.32,.72,.28,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); padding: 0 18px 0 22px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 16px;
}

.drawer-nav { padding: 10px 12px; border-bottom: 1px solid var(--border); display: grid; grid-gap: 4px; }
.d-link {
  display: flex; align-items: center;
  padding: 10px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; transition: background .16s ease, color .16s ease;
}
.d-link:hover { background: var(--hover); color: var(--text); }
.d-link .icon { margin-right: 12px; width: 18px; height: 18px; }

.drawer-body { flex: 1; overflow-y: auto; padding: 12px; }
.drawer-body .sec-title { font-size: 12px; color: var(--text-3); padding: 8px 10px 6px; }
.d-item {
  display: flex; align-items: center;
  padding: 11px 10px; border-radius: var(--radius-sm);
  color: var(--text); transition: background .16s ease;
}
.d-item:hover { background: var(--hover); }
.d-ico {
  width: 34px; height: 34px; border-radius: 10px; margin-right: 12px;
  background: var(--bg-soft); display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); flex: none;
}
.d-ico .icon { width: 18px; height: 18px; }
/* 上传图标（<img>）铺满圆角容器，与首页 soft-ico 一致 */
.d-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.d-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-count {
  font-size: 12px; color: var(--text-3); background: var(--bg-soft);
  padding: 2px 9px; border-radius: 999px; flex: none;
}
.empty-mini { padding: 26px 10px; text-align: center; color: var(--text-3); font-size: 13px; }

@supports (gap: 12px) {
  .drawer-nav { gap: 4px; }
  .d-link { gap: 12px; }
  .d-link .icon { margin-right: 0; }
  .d-item { gap: 12px; }
  .d-ico { margin-right: 0; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--card); color: var(--text);
  transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn .icon { margin-right: 8px; width: 17px; height: 17px; }
.btn-primary { background: var(--active); border-color: var(--active); color: var(--active-text); }
.btn-primary:hover { background: var(--active); opacity: .88; }
.btn-danger { color: var(--danger); border-color: var(--border-strong); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 999px; }
.btn-block { width: 100%; }

@supports (gap: 8px) {
  .btn { gap: 8px; }
  .btn .icon { margin-right: 0; }
}

/* ---------- 页面主体 ---------- */
.page { padding: 26px 0 70px; flex: 1 0 auto; }

.page-head { margin: 8px 0 22px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: .2px; }
.page-sub { color: var(--text-2); margin-top: 6px; font-size: 14px; }

/* 面包屑 */
.crumbs { display: flex; align-items: center; color: var(--text-3); font-size: 13px; margin-bottom: 16px; }
.crumbs > * + * { margin-left: 8px; }
.crumbs a:hover { color: var(--text); }
.crumbs .icon { width: 14px; height: 14px; }

@supports (gap: 8px) {
  .crumbs { gap: 8px; }
  .crumbs > * + * { margin-left: 0; }
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* 软件卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-gap: 16px; }

.soft-card {
  display: block; padding: 22px; position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.soft-card::after {
  content: ""; position: absolute; right: -34px; top: -34px;
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--bg-soft); opacity: .6;
}
.soft-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }

.soft-head { display: flex; align-items: center; position: relative; z-index: 1; }
.soft-head > * + * { margin-left: 12px; }
.soft-ico {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--bg-soft); display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); flex: none; overflow: hidden;
}
.soft-ico .icon { width: 24px; height: 24px; }
.soft-name { font-size: 16px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.soft-desc {
  color: var(--text-2); font-size: 13.5px; margin: 14px 0 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 42px;
}

.soft-meta { display: flex; color: var(--text-3); font-size: 12.5px; position: relative; z-index: 1; }
.soft-meta span { display: inline-flex; align-items: center; }
.soft-meta span + span { margin-left: 16px; }
.soft-meta .icon { margin-right: 5px; width: 14px; height: 14px; }

/* 搜索命中提示 */
.soft-hit {
  display: inline-flex; align-items: center;
  margin-top: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--bg-soft); color: var(--text-2); font-size: 12.5px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.soft-hit .icon { margin-right: 5px; width: 13px; height: 13px; flex: none; }

/* 上传的自定义图标（img 形态）铺满容器，圆角由容器 overflow 裁剪 */
.soft-ico img { width: 100%; height: 100%; object-fit: cover; }

/* 后台：图标选择器（预览 + 内置下拉 + 上传/恢复默认） */
.icon-pick { display: flex; align-items: flex-start; }
.icon-pick > * + * { margin-left: 14px; }
.icon-preview {
  width: 64px; height: 64px; border-radius: 14px; flex: none;
  background: var(--bg-soft); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--text);
}
.icon-preview .icon { width: 30px; height: 30px; }
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-ctrl { flex: 1; min-width: 0; }
.icon-ctrl > * + * { margin-top: 8px; }
.icon-btns { display: flex; align-items: center; flex-wrap: wrap; }
.icon-btns .btn { display: inline-flex; align-items: center; margin-right: 8px; }
.icon-btns .icon { width: 14px; height: 14px; margin-right: 5px; }
.icon-tip { font-size: 12px; }
@supports (gap: 8px) {
  .icon-ctrl > * + * { margin-top: 0; }
  .icon-ctrl { display: flex; flex-direction: column; gap: 8px; }
  .icon-btns { gap: 8px; }
  .icon-btns .btn { margin-right: 0; }
}
@media (max-width: 480px) {
  .icon-pick { flex-direction: column; }
  .icon-pick > * + * { margin-left: 0; margin-top: 12px; }
  .icon-ctrl { width: 100%; }
  @supports (gap: 12px) {
    .icon-pick { gap: 12px; }
    .icon-pick > * + * { margin-left: 0; margin-top: 0; }
  }
}

/* 后台：疑难解答 Q&A 编辑器 */
.qa-row {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 12px; background: var(--bg-soft);
}
.qa-row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qa-row-no { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 1px; }
.qa-row .field + .field { margin-top: 10px; }
#qaAddBtn { margin-top: 4px; display: inline-flex; align-items: center; }
#qaAddBtn .icon { width: 15px; height: 15px; margin-right: 5px; }

/* 详情页：疑难解答 Q&A 展示 */
.qa-item { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.qa-item:first-child { padding-top: 4px; }
.qa-item:last-child { border-bottom: none; padding-bottom: 2px; }
.qa-q { font-weight: 600; font-size: 14.5px; display: flex; align-items: baseline; }
.qa-label {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-strong, var(--border)); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; margin-right: 8px; transform: translateY(2px);
}
.qa-a { color: var(--text-2); margin: 8px 0 0 28px; font-size: 14px; line-height: 1.7; }
/* Q&A 答案下的演示按钮：紧贴答案并居中 */
.qa-item .demo-link-wrap { margin: 8px 0 0; }
.qa-item .demo-btn { margin-top: 10px; }

/* 后台：演示视频上传 */
.demo-box {
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; background: var(--bg-soft);
}
.demo-status { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.demo-btns { display: flex; align-items: center; }
.demo-btns .btn { display: inline-flex; align-items: center; margin-right: 8px; }
.demo-btns .icon { width: 14px; height: 14px; margin-right: 5px; }
@supports (gap: 8px) {
  .demo-btns { gap: 8px; }
  .demo-btns .btn { margin-right: 0; }
}

/* 详情页：查看演示按钮（居中） */
.demo-link-wrap { margin-top: 14px; margin-bottom: 14px; text-align: center; }
.demo-btn { display: inline-flex; align-items: center; }
.demo-btn .icon { width: 15px; height: 15px; margin-right: 6px; }

/* 演示视频播放器（模态框） */
.video-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 200;
  background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity .18s ease;
}
.video-overlay.show { opacity: 1; }
.video-modal {
  width: 100%; max-width: 860px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(.98); transition: transform .18s ease;
}
.video-overlay.show .video-modal { transform: none; }
.video-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.video-head > span { display: inline-flex; align-items: center; }
.video-head .icon { width: 16px; height: 16px; margin-right: 7px; }
.video-modal video { display: block; width: 100%; max-height: 74vh; background: #000; }

@supports (gap: 16px) {
  .soft-head { gap: 12px; }
  .soft-head > * + * { margin-left: 0; }
  .soft-meta { gap: 16px; }
  .soft-meta span + span { margin-left: 0; }
  .soft-meta .icon { margin-right: 5px; }
}
@supports (gap: 5px) {
  .soft-meta span { gap: 5px; }
  .soft-meta .icon { margin-right: 0; }
}

/* 标签 */
.tag {
  display: inline-flex; align-items: center;
  font-size: 12px; color: var(--text-2); background: var(--bg-soft);
  padding: 2px 10px; border-radius: 999px; flex: none;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-brand { background: var(--active); color: var(--active-text); }

/* 空状态 */
.empty {
  text-align: center; padding: 70px 20px; color: var(--text-3);
}
.empty .icon { width: 44px; height: 44px; margin: 0 auto 14px; opacity: .5; }
.empty p { font-size: 14px; }

.loading { text-align: center; padding: 60px 0; color: var(--text-3); font-size: 14px; }

/* ---------- 软件详情页 ---------- */
.hero {
  padding: 26px 26px 22px; display: flex; align-items: flex-start; flex-wrap: wrap;
}
.hero > * + * { margin-left: 18px; }
.hero .soft-ico { width: 58px; height: 58px; border-radius: 17px; flex: none; }
.hero .soft-ico .icon { width: 30px; height: 30px; }
.hero-info { flex: 1; min-width: 0; }
.hero-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; }
.hero-title > * + * { margin-left: 10px; }
.hero-desc { color: var(--text-2); margin-top: 8px; font-size: 14px; }

.tabs { display: flex; margin: 20px 0; }
.tab {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 20px; border-radius: 999px;
  font-size: 14px; color: var(--text-2); background: var(--card);
  border: 1px solid var(--border); transition: all .18s ease;
}
.tab + .tab { margin-left: 8px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--active); color: var(--active-text); border-color: var(--active); }
.tab .icon { margin-right: 8px; width: 16px; height: 16px; }
.tab .cnt { font-size: 12px; opacity: .65; }

.post-list { display: grid; grid-gap: 14px; }

.post-card { padding: 0; overflow: hidden; }
.post-head {
  display: flex; align-items: center;
  padding: 18px 22px; cursor: pointer;
  transition: background .16s ease;
}
.post-head > * + * { margin-left: 12px; }
.post-card:hover .post-head { background: var(--hover); }
.post-t-ico {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--text-2);
}
.post-t-ico .icon { width: 19px; height: 19px; }
.post-title { flex: 1; font-size: 15px; font-weight: 600; }
.post-title-row { display: flex; align-items: center; flex-wrap: wrap; }
.post-title-row > * + * { margin-left: 10px; }
.post-time { font-size: 12px; color: var(--text-3); }
.post-time .tag { margin-left: 8px; }
.post-chev { color: var(--text-3); transition: transform .22s ease; }
.post-chev .icon { width: 18px; height: 18px; }
.post-card.open .post-chev { transform: rotate(180deg); }

.post-body {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.post-card.open .post-body { max-height: 1600px; }
.post-content {
  padding: 4px 22px 22px 72px;
  color: var(--text-2); font-size: 14px; line-height: 1.75;
}
.post-content h3 { font-size: 15px; color: var(--text); margin: 16px 0 8px; font-weight: 600; }
.post-content h4 { font-size: 14px; color: var(--text); margin: 12px 0 6px; font-weight: 600; }
.post-content p { margin: 8px 0; }
.post-content ul { margin: 8px 0; padding-left: 20px; }
.post-content li { margin: 4px 0; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.post-content code {
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 12.5px; background: var(--bg-soft); color: var(--text);
  padding: 2px 6px; border-radius: 6px;
}
.post-content pre {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 10px 0;
  overflow-x: auto; font-size: 12.5px; line-height: 1.6;
}
.post-content pre code { background: none; padding: 0; }

@supports (gap: 18px) {
  .hero { gap: 18px; }
  .hero > * + * { margin: 0; }
  .hero-title { gap: 10px; }
  .hero-title > * + * { margin-left: 0; }
  .tabs { gap: 8px; }
  .tab + .tab { margin-left: 0; }
  .tab { gap: 8px; }
  .tab .icon { margin-right: 0; }
  .post-list { gap: 14px; }
  .post-head { gap: 12px; }
  .post-head > * + * { margin-left: 0; }
  .post-title-row { gap: 10px; }
  .post-title-row > * + * { margin-left: 0; }
}

/* ---------- 反馈页 ---------- */
.fb-card { max-width: 640px; margin: 0 auto; padding: 30px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 8px; }
.field .hint { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card-2); padding: 11px 14px; outline: none;
  transition: border-color .18s ease, background .18s ease;
}
.textarea { resize: vertical; min-height: 160px; line-height: 1.7; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--text-3); background: var(--card); }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; position: relative; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* 成功提示卡 */
.success-box {
  text-align: center; padding: 46px 20px; max-width: 640px; margin: 0 auto;
}
.success-box .icon { width: 52px; height: 52px; margin: 0 auto 16px; color: var(--text); }
.success-box h3 { font-size: 20px; margin-bottom: 8px; }
.success-box p { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); border-radius: 999px;
  padding: 11px 22px; font-size: 14px; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  display: flex; align-items: center; max-width: 86vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .icon { margin-right: 9px; width: 17px; height: 17px; }
.toast.err .icon { color: var(--danger); }

@supports (gap: 9px) {
  .toast { gap: 9px; }
  .toast .icon { margin-right: 0; }
}

/* ---------- 模态框 ---------- */
.modal-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 150; background: rgba(0,0,0,.48);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow-lg); transform: translateY(14px) scale(.98);
  transition: transform .24s cubic-bezier(.32,.72,.28,1);
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0; font-size: 17px; font-weight: 600;
}
.modal-body { padding: 18px 24px 24px; }

/* ---------- 后台布局 ---------- */
.admin-wrap { display: flex; min-height: 100vh; }

.admin-side {
  width: 230px; flex: none; background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.admin-logo { display: flex; align-items: center; padding: 20px 22px; font-weight: 700; font-size: 16px; }
.admin-logo .icon { margin-right: 10px; width: 22px; height: 22px; }
.admin-nav { flex: 1; padding: 8px 12px; display: grid; grid-gap: 4px; align-content: start; }
.admin-nav .nav-item {
  display: flex; align-items: center;
  padding: 11px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 14px; transition: background .16s ease, color .16s ease;
  position: relative;
}
.admin-nav .nav-item:hover { background: var(--hover); color: var(--text); }
.admin-nav .nav-item.active { background: var(--active); color: var(--active-text); }
.admin-nav .nav-item .icon { margin-right: 12px; width: 18px; height: 18px; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; min-width: 18px; height: 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.admin-nav .nav-item.active .nav-badge { background: var(--active-text); color: var(--active); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top {
  height: var(--header-h); display: flex; align-items: center;
  padding: 0 26px; border-bottom: 1px solid var(--border);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  position: sticky; top: 0; z-index: 40;
}
.admin-top > * + * { margin-left: 14px; }
.admin-top .title { font-size: 16px; font-weight: 600; }
.admin-top .spacer { flex: 1; }
.admin-body { padding: 26px; }

@supports (gap: 14px) {
  .admin-logo { gap: 10px; }
  .admin-logo .icon { margin-right: 0; }
  .admin-nav { gap: 4px; }
  .admin-nav .nav-item { gap: 12px; }
  .admin-nav .nav-item .icon { margin-right: 0; }
  .admin-top { gap: 14px; }
  .admin-top > * + * { margin-left: 0; }
}

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 12px 14px; color: var(--text-3); font-size: 12.5px;
  font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--hover); }
.t-actions { display: flex; justify-content: flex-end; }
.t-actions .icon-btn + .icon-btn { margin-left: 6px; }
.t-actions .icon-btn { width: 34px; height: 34px; }
.t-actions .icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

.toolbar { display: flex; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar > * + * { margin-left: 12px; }
.toolbar .spacer { flex: 1; }
.toolbar .input { width: auto; min-width: 220px; }

.switch { position: relative; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 999px; background: var(--bg-soft);
  border: 1px solid var(--border-strong); transition: background .18s ease;
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease;
}
.switch input:checked + .track { background: var(--active); border-color: var(--active); }
.switch input:checked + .track + .thumb { transform: translateX(18px); background: var(--active-text); }

@supports (gap: 12px) {
  .toolbar { gap: 12px; }
  .toolbar > * + * { margin-left: 0; }
}
@supports (gap: 6px) {
  .t-actions { gap: 6px; }
  .t-actions .icon-btn + .icon-btn { margin-left: 0; }
}

/* 反馈卡片 */
.fb-item { padding: 18px 22px; display: flex; align-items: flex-start; }
.fb-item > * + * { margin-left: 14px; }
.fb-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--border-strong); }
.fb-item.unread .fb-dot { background: var(--danger); }
.fb-main { flex: 1; min-width: 0; }
.fb-top { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.fb-top > * + * { margin-left: 10px; }
.fb-soft { font-size: 13px; font-weight: 600; }
.fb-time { font-size: 12px; color: var(--text-3); }
.fb-content { color: var(--text-2); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.fb-contact { margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.fb-actions { display: flex; flex: none; }
.fb-actions .icon-btn + .icon-btn { margin-left: 6px; }

@supports (gap: 14px) {
  .fb-item { gap: 14px; }
  .fb-item > * + * { margin-left: 0; }
  .fb-top { gap: 10px; }
  .fb-top > * + * { margin-left: 0; }
  .fb-actions { gap: 6px; }
  .fb-actions .icon-btn + .icon-btn { margin-left: 0; }
}

/* 子标签（后台文档管理） */
.sub-tabs { display: flex; }
.sub-tab {
  height: 34px; padding: 0 16px; border-radius: 999px; font-size: 13px;
  color: var(--text-2); border: 1px solid var(--border); background: var(--card);
  display: inline-flex; align-items: center; transition: all .16s ease;
}
.sub-tab + .sub-tab { margin-left: 6px; }
.sub-tab.active { background: var(--active); color: var(--active-text); border-color: var(--active); }
.sub-tab .icon { margin-right: 7px; width: 15px; height: 15px; }

@supports (gap: 6px) {
  .sub-tabs { gap: 6px; }
  .sub-tab + .sub-tab { margin-left: 0; }
  .sub-tab { gap: 7px; }
  .sub-tab .icon { margin-right: 0; }
}

/* 登录卡 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; padding: 36px 32px; }
.login-logo { display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; margin-bottom: 26px; }
.login-logo .icon { margin-right: 10px; width: 26px; height: 26px; }

@supports (gap: 10px) {
  .login-logo { gap: 10px; }
  .login-logo .icon { margin-right: 0; }
}

/* 页脚 */
.footer { border-top: 1px solid var(--border); padding: 26px 0 34px; margin-top: 50px; flex-shrink: 0; }
.footer-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px;
}
.footer-inner > * + * { margin-left: 12px; }
.footer a:hover { color: var(--text-2); }

@supports (gap: 12px) {
  .footer-inner { gap: 12px; }
  .footer-inner > * + * { margin-left: 0; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .container { padding: 0 14px; }
  .bar { position: relative; flex-wrap: wrap; height: auto; padding: 8px 0; }
  .bar-left { margin-right: 6px; }
  .bar-right { margin-left: 6px; }
  .bar-search { order: 0; width: auto; max-width: none; margin: 0; flex: none; }
  .bar-search.open { position: absolute; top: 0; right: 0; left: 0; bottom: 0; z-index: 70; width: auto; background: var(--bg); }
  .bar-search.open .search-panel { display: flex; height: 100%; padding: 0 10px; }
  .bar-search.open .search-field { flex: 1; min-width: 0; }
  .header { height: auto; }
  .page { padding: 18px 0 50px; }
  .post-content { padding-left: 22px; }
  .admin-side { width: 68px; }
  .admin-side .admin-logo span, .admin-side .nav-item span { display: none; }
  .admin-side .nav-item { justify-content: center; }
  .admin-nav .nav-item .icon { margin-right: 0; }
  .admin-body { padding: 16px; }
}

@supports (gap: 10px) {
  @media (max-width: 720px) {
    .bar { gap: 6px; }
    .bar-left { margin-right: 0; }
    .bar-right { margin-left: 0; }
  }
}
