/* ===========================================================
  CC 520 · 全局样式
   配色参考原站的深色蓝黑主题
   =========================================================== */

:root {
  --bg: #0b0f19;
  --bg-soft: #101625;
  --card: #151b2b;
  --card-hover: #1c2436;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --fg: #f4f7f9;
  --muted: #99a1af;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

/* 保证 hidden 属性永远生效（否则会被 .btn 等 display 规则覆盖） */
[hidden] { display: none !important; }

/* ---------------- 白色外观（点右上角按钮切换） ---------------- */

:root[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-hover: #f1f3f9;
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.22);
  --fg: #111827;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .app-header { background: rgba(255, 255, 255, 0.92); }
:root[data-theme="light"] .nav a:hover { background: rgba(15, 23, 42, 0.06); }
:root[data-theme="light"] .nav a.active { color: #4338ca; background: rgba(99, 102, 241, 0.14); }
:root[data-theme="light"] .hero {
  background:
    radial-gradient(900px 260px at 12% -30%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(700px 220px at 92% 0%, rgba(34, 211, 238, 0.18), transparent 60%),
    linear-gradient(180deg, #eef1fb, #ffffff);
}
:root[data-theme="light"] input,
:root[data-theme="light"] textarea,
:root[data-theme="light"] select { background: rgba(15, 23, 42, 0.035); }
:root[data-theme="light"] .btn { background: rgba(15, 23, 42, 0.05); }
:root[data-theme="light"] .btn:hover { background: rgba(15, 23, 42, 0.1); }
:root[data-theme="light"] .btn-primary { background: var(--primary); color: #fff; }
:root[data-theme="light"] .tag { background: rgba(99, 102, 241, 0.12); color: #4338ca; }
:root[data-theme="light"] .chip { background: rgba(15, 23, 42, 0.04); }
:root[data-theme="light"] .chip.active { background: rgba(99, 102, 241, 0.16); color: #4338ca; }
:root[data-theme="light"] .card-cover .badge { background: rgba(255, 255, 255, 0.85); color: #4338ca; }
:root[data-theme="light"] .card:hover .card-title { color: var(--primary); }
:root[data-theme="light"] .rank-list a { color: #374151; }
:root[data-theme="light"] .rank-list a:hover { background: rgba(15, 23, 42, 0.05); color: #111827; }
:root[data-theme="light"] .mini-title { color: #1f2937; }
:root[data-theme="light"] .article { color: #1f2937; }
:root[data-theme="light"] .comment .text { color: #1f2937; }
:root[data-theme="light"] .comment .who { color: #4338ca; }
:root[data-theme="light"] .pager button { background: #fff; color: #374151; }
:root[data-theme="light"] table.data th { background: rgba(15, 23, 42, 0.035); }
:root[data-theme="light"] table.data tr:hover td { background: rgba(15, 23, 42, 0.03); }
:root[data-theme="light"] .modal { background: #fff; }
:root[data-theme="light"] .toast { background: #fff; }
:root[data-theme="light"] .download-box { background: linear-gradient(180deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.02)); }
:root[data-theme="light"] .download-box .row .value { color: #3730a3; }
:root[data-theme="light"] .skeleton { background: linear-gradient(90deg, #eef1f7, #e2e8f0, #eef1f7); background-size: 200% 100%; }

/* 主题切换按钮 */
.theme-toggle {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px; cursor: pointer; font-size: 15px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border); color: var(--fg);
  transition: all 0.16s;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.14); }
:root[data-theme="light"] .theme-toggle { background: rgba(15, 23, 42, 0.05); }
:root[data-theme="light"] .theme-toggle:hover { background: rgba(15, 23, 42, 0.12); }

/* ---------------- 热门月榜 ---------------- */

/* ---------------- 后台：标签页 / 未读标记 / 评论消息 ---------------- */

/* 后台：从 Steam 自动填写 */
.steam-autofill {
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.09);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 16px;
}
.steam-autofill-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 9px;
}
.steam-autofill-head b { font-size: 14px; }
.steam-autofill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.steam-autofill-row input { flex: 1; min-width: 220px; }
.steam-results { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; }
.steam-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px; border-radius: 9px; cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  color: var(--fg); font-family: inherit; font-size: 13.5px;
}
.steam-item:hover { background: rgba(99, 102, 241, 0.18); border-color: rgba(99, 102, 241, 0.5); }
.steam-item img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.steam-item-name { flex: 1; }

/* ---------------- 下载区：电脑扫码 / 手机直达 ---------------- */

/* 游戏视频 */
.video-list { display: grid; gap: 14px; }
.video-slot { display: block; }
.video-placeholder {
  aspect-ratio: 16 / 9; display: grid; place-items: center;
  border: 1px dashed var(--border-strong); border-radius: 14px;
  color: var(--muted); font-size: 13px; background: rgba(255, 255, 255, 0.03);
}
:root[data-theme="light"] .video-placeholder { background: rgba(15, 23, 42, 0.03); }
@media (max-width: 560px) { .video-placeholder { border-radius: 10px; } }

/* 电脑端：网盘选择列表 */
.pan-list { display: grid; gap: 10px; }
.pan-option {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  color: var(--fg); font-size: 15px; font-family: inherit; text-align: left;
  transition: all 0.16s;
}
.pan-option:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateX(2px);
}
:root[data-theme="light"] .pan-option { background: rgba(15, 23, 42, 0.035); }
:root[data-theme="light"] .pan-option:hover { background: rgba(99, 102, 241, 0.1); }
.pan-option-name { font-weight: 700; }
.pan-option-arrow { margin-left: auto; font-size: 13px; color: var(--muted); }
.pan-option:hover .pan-option-arrow { color: #c7d2fe; }
:root[data-theme="light"] .pan-option:hover .pan-option-arrow { color: var(--primary); }

/* 评论区：身份提示 */
.comment-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.comment-tip {
  font-size: 13px; color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 10px; padding: 8px 12px;
}
.comment-del {
  margin-left: auto; font-size: 12px; color: var(--muted);
  background: none; border: none; cursor: pointer; padding: 0 2px;
}
.comment-del:hover { color: #ef4444; }
.comment-identity { font-size: 12.5px; color: var(--muted); }
.comment-identity b { color: var(--fg); }
.comment-identity a { color: var(--primary); margin-left: 2px; }

@media (max-width: 560px) {
  .pan-option { padding: 12px 14px; font-size: 14px; }
  .comment-actions { gap: 10px; }
}

.game-video {
  width: 100%; aspect-ratio: 16 / 9; display: block;
  border-radius: 14px; border: 1px solid var(--border);
  background: #000; overflow: hidden;
}
@media (max-width: 560px) {
  .game-video { border-radius: 10px; }
}

.dl-scan-hint {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 600; color: var(--fg); margin-bottom: 14px;
}
.qr-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.qr-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px 14px; text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.qr-img { width: 152px; height: 152px; }
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-name { margin-top: 9px; font-size: 13.5px; font-weight: 700; color: #111827; }
.qr-code { margin-top: 3px; font-size: 12.5px; color: #6b7280; }
.qr-code b { color: #111827; font-family: Consolas, monospace; letter-spacing: 0.5px; }

.dl-mobile { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.dl-mobile:last-child { border-bottom: none; padding-bottom: 0; }
.dl-mobile-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 14px;
}
.dl-mobile-head .name { font-weight: 700; }
.dl-mobile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-mobile-actions .btn-primary { box-shadow: none; }

@media (max-width: 560px) {
  .qr-grid { gap: 12px; }
  .qr-card { flex: 1 1 140px; padding: 10px; }
  .qr-img { width: 100%; max-width: 150px; height: auto; aspect-ratio: 1; margin: 0 auto; }
}

.admin-tabs { display: flex; gap: 8px; margin: 4px 0 16px; }
.admin-tabs .chip { cursor: pointer; position: relative; padding: 7px 16px; font-size: 14px; }
.unread-badge {
  display: inline-block; margin-left: 6px;
  min-width: 18px; padding: 1px 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  line-height: 16px; text-align: center; vertical-align: 1px;
}

.comment-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid transparent; border-radius: var(--radius);
  padding: 13px 15px; margin-bottom: 10px;
}
.comment-card.is-new { border-left-color: var(--primary); background: rgba(99, 102, 241, 0.07); }
:root[data-theme="light"] .comment-card.is-new { background: rgba(99, 102, 241, 0.06); }

.comment-card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
.comment-card-head .who { color: #c7d2fe; font-weight: 600; }
:root[data-theme="light"] .comment-card-head .who { color: var(--primary); }
.comment-card-head .mail { color: var(--muted); }
.comment-card-head .spacer { flex: 1; }
.comment-card-head .game-link { font-size: 13px; color: var(--muted); }
.comment-card-head .game-link:hover { color: var(--primary); }
.new-tag {
  background: #ef4444; color: #fff; font-size: 11px;
  padding: 1px 6px; border-radius: 999px;
}
.comment-card-body { font-size: 14px; line-height: 1.7; color: var(--fg); white-space: pre-wrap; }

@media (max-width: 560px) {
  .comment-card { padding: 11px 12px; }
  .comment-card-head { gap: 8px; font-size: 12.5px; }
  .comment-card-head .spacer { display: none; }
  .comment-card-body { font-size: 13.5px; }
  .admin-tabs { margin-bottom: 12px; }
}

.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px;
  border-bottom: 1px solid var(--border);
  transition: background 0.16s;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: rgba(255, 255, 255, 0.05); }
:root[data-theme="light"] .rank-row:hover { background: rgba(15, 23, 42, 0.04); }

.rank-no {
  flex: none; width: 26px; text-align: center;
  font-size: 15px; font-weight: 800; font-style: italic;
  color: var(--muted);
}
.rank-no.top { color: #f59e0b; }
.rank-row:nth-child(2) .rank-no.top { color: #94a3b8; }
.rank-row:nth-child(3) .rank-no.top { color: #f97316; }

.rank-row img {
  width: 76px; height: 43px; object-fit: cover; border-radius: 8px;
  flex: none; border: 1px solid var(--border);
}
.rank-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rank-title {
  font-size: 13.5px; font-weight: 600; color: var(--fg); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rank-row:hover .rank-title { color: #c7d2fe; }
:root[data-theme="light"] .rank-row:hover .rank-title { color: var(--primary); }
.rank-meta { font-size: 11.5px; color: var(--muted); }
.rank-score {
  flex: none; font-size: 15px; font-weight: 700; color: #c7d2fe;
  min-width: 42px; text-align: right;
}
:root[data-theme="light"] .rank-score { color: var(--primary); }

@media (max-width: 560px) {
  .rank-row { gap: 9px; padding: 8px 6px; }
  .rank-row img { width: 62px; height: 35px; }
  .rank-title { font-size: 12.5px; }
  .rank-score { font-size: 14px; min-width: 34px; }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶部导航 ---------------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.app-header .inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 62px;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; white-space: nowrap; }

.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #fff; letter-spacing: 0.5px;
}

.brand > span:last-child { min-width: 0; }
.brand small {
  display: block; font-size: 11px; color: var(--muted); font-weight: 400;
  letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 7px 13px; border-radius: 9px; color: var(--muted);
  font-size: 14px; transition: all 0.16s;
}
.nav a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.nav a.active { color: #fff; background: rgba(99, 102, 241, 0.22); }

.header-search { flex: 1; max-width: 340px; margin-left: auto; }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------------- 搜索框 / 输入框 ---------------- */

input, textarea, select {
  font-family: inherit;
  font-size: 14px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.16s, background 0.16s;
  width: 100%;
}

input:focus, textarea:focus, select:focus { border-color: var(--primary); background: rgba(99, 102, 241, 0.08); }
input::placeholder, textarea::placeholder { color: #6b7280; }
select option { background: var(--card); color: var(--fg); }
textarea { resize: vertical; min-height: 90px; line-height: 1.7; }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.06);
  color: var(--fg); font-size: 14px; cursor: pointer;
  transition: all 0.16s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn-primary { background: var(--primary); border-color: transparent; color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); border-color: transparent; color: #04231a; font-weight: 600; }
.btn-danger { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.28); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------- 首页头图 ---------------- */

.hero {
  margin: 22px 0 8px;
  border-radius: var(--radius);
  padding: 26px 28px;
  background:
    radial-gradient(900px 260px at 12% -30%, rgba(99, 102, 241, 0.45), transparent 60%),
    radial-gradient(700px 220px at 92% 0%, rgba(34, 211, 238, 0.28), transparent 60%),
    linear-gradient(180deg, #161d2f, #121826);
  border: 1px solid var(--border);
}
.hero h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: 0.5px; }
.hero p { margin: 0 0 18px; color: var(--muted); max-width: 640px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- 区块标题 ---------------- */

.section { margin: 28px 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.section-head h2::before {
  content: ""; width: 4px; height: 17px; border-radius: 2px;
  background: linear-gradient(180deg, #6366f1, #22d3ee);
}
.section-head .more { color: var(--muted); font-size: 13px; }
.section-head .more:hover { color: var(--primary); }

/* ---------------- 游戏卡片 ---------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); gap: 16px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.18s, border-color 0.18s, background 0.18s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--card-hover); }
.card-cover { position: relative; aspect-ratio: 16 / 9; background: #0d1220; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover .badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(11, 15, 25, 0.78); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; color: #c7d2fe;
}
.card-cover .hot {
  position: absolute; top: 8px; right: 8px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.card-body { padding: 12px 13px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title {
  font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--fg);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 0;
}
.card:hover .card-title { color: #c7d2fe; }
.card-desc {
  color: var(--muted); font-size: 12.5px; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* ---------------- 标签 ---------------- */

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: rgba(99, 102, 241, 0.14); border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe; font-size: 11.5px;
}
a.tag:hover { background: rgba(99, 102, 241, 0.3); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 13px; border-radius: 999px; font-size: 13px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all 0.16s;
}
.chip:hover { color: var(--fg); border-color: var(--border-strong); }
.chip.active { background: rgba(99, 102, 241, 0.24); border-color: rgba(99, 102, 241, 0.55); color: #fff; font-weight: 600; }

/* ---------------- 两栏布局 ---------------- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }

.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.panel + .panel { margin-top: 16px; }

.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: rank; }
.rank-list li { counter-increment: rank; }
.rank-list a {
  display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px;
  font-size: 13px; color: #d1d5db; line-height: 1.45;
}
.rank-list a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.rank-list a::before {
  content: counter(rank); flex: none; width: 18px; text-align: center;
  font-weight: 700; font-style: italic; color: var(--muted); font-size: 13px;
}
.rank-list li:nth-child(1) a::before { color: #fbbf24; }
.rank-list li:nth-child(2) a::before { color: #cbd5e1; }
.rank-list li:nth-child(3) a::before { color: #f97316; }

/* ---------------- 小卡片（侧栏列表） ---------------- */

.mini {
  display: flex; gap: 10px; align-items: center;
  padding: 7px 8px; border-radius: 10px; transition: background 0.16s;
}
.mini:hover { background: rgba(255, 255, 255, 0.06); }
.mini img {
  width: 66px; height: 38px; border-radius: 8px; object-fit: cover; flex: none;
  border: 1px solid var(--border);
}
.mini-title {
  font-size: 13px; line-height: 1.4; color: #dbe1ea;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini:hover .mini-title { color: #c7d2fe; }
.mini-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------------- 分页 ---------------- */

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 26px 0 10px; flex-wrap: wrap; }
.pager button {
  min-width: 36px; height: 34px; padding: 0 10px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  border-radius: 9px; color: var(--muted); cursor: pointer; font-size: 13px;
}
.pager button:hover:not(:disabled) { color: var(--fg); border-color: var(--border-strong); }
.pager button.active { background: var(--primary); border-color: transparent; color: #fff; font-weight: 600; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager .info { color: var(--muted); font-size: 13px; margin: 0 6px; }

/* ---------------- 详情页 ---------------- */

.breadcrumb { color: var(--muted); font-size: 13px; margin: 18px 0 14px; }
.breadcrumb a:hover { color: var(--primary); }

.detail-head { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 22px; }
.detail-cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/9; background: #0d1220; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.detail-title { margin: 0 0 10px; font-size: 21px; line-height: 1.45; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 13px; margin: 12px 0; }

.author-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px;
}

.download-box {
  margin-top: 16px; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0.04));
  border: 1px solid rgba(99, 102, 241, 0.35);
}
.download-box .row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px dashed var(--border); flex-wrap: wrap;
}
.download-box .row:last-child { border-bottom: none; }
.download-box .row .name { width: 78px; color: var(--muted); font-size: 13px; flex: none; }
.download-box .row .value {
  flex: 1; min-width: 200px; font-family: Consolas, monospace; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dbeafe;
}
.code-pill {
  font-family: Consolas, monospace; background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4); color: #6ee7b7;
  padding: 2px 10px; border-radius: 6px; font-size: 13px;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gallery img { border-radius: var(--radius-sm); border: 1px solid var(--border); aspect-ratio: 16/9; object-fit: cover; width: 100%; }

.article { white-space: pre-wrap; color: #d5dbe5; line-height: 1.9; font-size: 14px; }

.req-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.req-table th, .req-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.req-table th { color: var(--muted); font-weight: 500; width: 130px; background: rgba(255, 255, 255, 0.03); }
.req-col-title { font-weight: 600; color: #c7d2fe; margin: 0 0 8px; }

/* ---------------- 评论 ---------------- */

.comment { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: none; }
.comment .who { font-size: 13px; color: #c7d2fe; font-weight: 600; }
.comment .when { font-size: 12px; color: var(--muted); }
.comment .text { margin: 4px 0 0; color: #d5dbe5; font-size: 13.5px; white-space: pre-wrap; }

/* ---------------- 提示 & 状态 ---------------- */

.empty { text-align: center; color: var(--muted); padding: 46px 20px; }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.loading { text-align: center; color: var(--muted); padding: 40px; }

.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: rgba(21, 27, 43, 0.97); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--primary);
  padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px;
  animation: slideIn 0.2s ease;
}
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.skeleton { background: linear-gradient(90deg, #151b2b, #1e2637, #151b2b); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------------- 后台编辑界面（仅内部使用） ---------------- */

.login-wrap { max-width: 380px; margin: 80px auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; }
.stat .num { font-size: 24px; font-weight: 700; letter-spacing: 0.5px; }
.stat .label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 180px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { color: var(--muted); font-weight: 500; background: rgba(255, 255, 255, 0.03); white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(255, 255, 255, 0.03); }
table.data .title-cell { max-width: 340px; }
table.data .title-cell a { color: #c7d2fe; }
table.data .title-cell a:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 6px; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(4, 7, 14, 0.72);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 16px; z-index: 150; overflow-y: auto;
}
.modal {
  width: 100%; max-width: 860px; background: var(--bg-soft);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.close-x:hover { color: #fff; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; }

/* ---------------- 页脚 ---------------- */

.site-footer {
  margin-top: 46px; padding: 26px 0 34px;
  border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px;
}
.site-footer .inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--primary); }

/* ---------------- 响应式 ---------------- */

/* ===========================================================
   视觉优化：卡片质感、按钮渐变、Hero 层次、访问趋势图
   =========================================================== */

/* 卡片：封面底部加渐变，悬停更立体 */
.card { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.card-cover::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 45%;
  background: linear-gradient(180deg, transparent, rgba(6, 10, 18, 0.55));
  transition: opacity 0.18s;
}
.card:hover { box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35); }
:root[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
:root[data-theme="light"] .card:hover { box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12); }
:root[data-theme="light"] .card-cover::after { background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.16)); }

/* 主按钮：加一点渐变和投影 */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}
.btn-primary:hover { background: linear-gradient(135deg, #7c7ff5, #4338ca); }
:root[data-theme="light"] .btn-primary { background: linear-gradient(135deg, #6366f1, #4f46e5); }

/* 面板与区块 */
.panel { border-radius: 16px; }
.section-head { margin-bottom: 16px; }
.section-head h2 { letter-spacing: 0.3px; }

/* Hero 首屏 */
.hero-inner { display: flex; align-items: center; gap: 18px; }
.hero-avatar {
  width: 86px; height: 86px; flex: none;
  border-radius: 22px; object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
:root[data-theme="light"] .hero-avatar { border-color: rgba(15, 23, 42, 0.12); box-shadow: 0 10px 22px rgba(15, 23, 42, 0.15); }
@media (max-width: 860px) {
  .hero-inner { gap: 14px; }
  .hero-avatar { width: 64px; height: 64px; border-radius: 16px; }
}

.hero { position: relative; overflow: hidden; border-radius: 18px; }
.hero::before {
  content: ''; position: absolute; top: -45%; right: -8%; width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.38), transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: 28px; letter-spacing: 0.5px; }
.hero-stats {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 18px; color: var(--muted); font-size: 13px;
}
.hero-stats b { color: var(--fg); font-size: 16px; font-weight: 700; margin: 0 2px; }
.hero-stats .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }

/* 详情页封面投影 */
.detail-cover { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }
:root[data-theme="light"] .detail-cover { box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12); }

/* 后台：最近 7 天访问趋势 */
.visit-chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 20px; }
.visit-bar {
  flex: 1; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
}
.visit-bar-count { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.visit-bar-fill {
  width: 100%; max-width: 48px; min-height: 3px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #6366f1, #22d3ee);
  transition: height 0.3s;
}
.visit-bar-day { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* 细一点的滚动条（桌面浏览器） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .detail-head { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  /* 手机/平板：品牌和按钮占一行，导航可横向滑动，搜索框独占一行 */
  .app-header .inner {
    height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px 12px; align-items: center;
  }
  .brand { order: 1; flex: 1 1 auto; min-width: 0; gap: 8px; font-size: 16px; }
  .brand .logo { width: 30px; height: 30px; font-size: 12px; border-radius: 8px; }
  .brand small { font-size: 10px; letter-spacing: 0.2px; }
  .header-actions { order: 2; margin-left: auto; gap: 8px; }
  .header-actions .btn-sm { padding: 6px 12px; font-size: 13px; }
  .theme-toggle { width: 32px; height: 32px; font-size: 14px; }
  .nav {
    order: 3; flex-basis: 100%; width: 100%;
    overflow-x: auto; white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 2px 0;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 11px; font-size: 13.5px; }
  .header-search { order: 4; flex-basis: 100%; max-width: none; margin: 0; }
  .hero { padding: 20px; margin-top: 16px; }
  .hero h1 { font-size: 23px; }
  .hero p { font-size: 13.5px; }
  .hero-stats { gap: 9px; font-size: 12.5px; margin-bottom: 14px; }
  .hero-stats b { font-size: 15px; }
  .visit-chart { gap: 6px; height: 130px; }
  .visit-bar-fill { max-width: 32px; }
  .visit-bar-day { font-size: 10.5px; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .container { padding: 0 14px; }
  .section { margin: 20px 0; }
  .section-head h2 { font-size: 16px; }
  .hero { padding: 16px 15px; }
  .hero h1 { font-size: 19px; }
  .hero p { font-size: 13px; margin-bottom: 14px; }
  .hero-stats { flex-wrap: wrap; gap: 7px; font-size: 12px; }
  .hero-stats b { font-size: 14px; }
  .hero-stats .dot { display: none; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn { padding: 8px 14px; font-size: 13px; }
  .detail-title { font-size: 18px; }
  .detail-meta { gap: 10px; font-size: 12.5px; }
  .download-box { padding: 13px; }
  .download-box .row .name { width: 64px; font-size: 12.5px; }
  .download-box .row .value { font-size: 12px; min-width: 140px; }
  .modal-mask { padding: 14px 10px; }
  .modal-body { padding: 15px; }
  .modal-foot { padding: 12px 15px; }
  .pager button { min-width: 32px; height: 32px; font-size: 12.5px; }
  .panel { padding: 13px; }
  .req-table th, .req-table td { padding: 7px 9px; font-size: 12.5px; }
  .site-footer .inner { flex-direction: column; gap: 8px; }
}
