:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --border: #e5e9f0;
  --text: #1f2733;
  --muted: #6b7686;
  --primary: #3b6ef5;
  --primary-d: #2f5bd0;
  --accent: #f3f6ff;
  --shadow: 0 1px 3px rgba(20, 30, 50, .06), 0 6px 20px rgba(20, 30, 50, .05);
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

/* 顶部栏 */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 19px; color: var(--text); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand .logo { font-size: 22px; }
.top-actions a { margin-left: 4px; padding: 8px 14px; border-radius: 8px; font-size: 13px; background: var(--accent); color: var(--primary); border: 1px solid var(--border); white-space: nowrap; }
.top-actions a:hover { background: #e7eeff; }

/* Hero */
.hero { max-width: 1200px; margin: 26px auto 8px; padding: 30px 28px; text-align: center; background: linear-gradient(135deg, #eef3ff 0%, #f7f9ff 60%, #ffffff 100%); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.hero h1 { font-size: 26px; margin: 0 0 8px; }
.hero p { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
/* Hero 搜索（百度式：单一圆角容器 + 渐变按钮） */
.hero-search { max-width: 620px; margin: 0 auto; }
.hero-search form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 22px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.hero-search form:focus-within {
  border-color: #7b5dff;
  box-shadow: 0 0 0 4px rgba(123, 93, 255, .12);
}
.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  padding: 10px 0;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search button {
  flex: 0 0 auto;
  height: 40px;
  border: 0;
  background: linear-gradient(135deg, #4f7cff 0%, #7b5dff 100%);
  color: #fff;
  border-radius: 999px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  transition: filter .2s, transform .05s;
}
.hero-search button:hover  { filter: brightness(1.08); }
.hero-search button:active { transform: scale(.98); }
.hero-stats { margin-top: 16px; color: var(--muted); font-size: 13px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.hero-stats b { color: var(--primary); }

/* 分类胶囊导航 */
.catnav { position: sticky; top: 60px; z-index: 25; background: rgba(245,247,250,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); }
.catnav-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 8px; overflow-x: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--border); white-space: nowrap; }
.pill:hover { background: var(--accent); }
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pill .pc { font-size: 11px; background: var(--bg); color: var(--muted); border-radius: 999px; padding: 0 7px; }
.pill.active .pc { background: rgba(255,255,255,.25); color: #fff; }

/* 主区 */
.main { max-width: 1200px; margin: 22px auto; padding: 0 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .ph-left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; }

/* 结果页内联搜索框（复用 Hero 搜索观感） */
.mini-search { display: flex; gap: 0; max-width: 360px; flex: 1; min-width: 220px; }
.mini-search input { flex: 1; font-size: 14px; padding: 9px 12px; border: 1px solid var(--border); border-right: 0; border-radius: 999px 0 0 999px; background: var(--panel); color: var(--text); outline: none; }
.mini-search input:focus { border-color: var(--primary); }
.mini-search button { font-size: 14px; padding: 9px 18px; border: 0; border-radius: 0 999px 999px 0; background: var(--primary); color: #fff; cursor: pointer; }
.mini-search button:hover { filter: brightness(1.08); }

/* 搜索结果中的相关分类 */
.cat-results { margin-top: 26px; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* 分区 */
.sec { margin-bottom: 28px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; }
.sec-head h2 .si { font-size: 20px; }
.sec-head h2 .cnt { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; font-weight: 400; }
.sec-head .more { font-size: 13px; color: var(--primary); }

/* 卡片网格（工具卡片 = 整卡链接） */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 14px; }
.tool {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s;
  display: flex; flex-direction: column; gap: 8px; color: var(--text);
}
.tool:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(20,30,50,.10); border-color: #cdd9f7; }
.tool .ava {
  width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg,#eaf0ff,#dfe8ff);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex: none; overflow: hidden;
}
.tool .ava img { width: 100%; height: 100%; object-fit: cover; }
.tool .tname { font-weight: 600; font-size: 15px; color: var(--text); }
.tool .tdesc { color: var(--muted); font-size: 13px; min-height: 38px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool .tmeta { display: flex; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--primary); border: 1px solid var(--border); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }

/* 详情 */
.detail-wrap { max-width: 760px; }
.detail { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.detail .head { display: flex; gap: 16px; align-items: center; }
.detail h1 { margin: 0 0 4px; font-size: 24px; }
.detail .info { color: var(--muted); font-size: 14px; }
.detail .desc { margin: 16px 0; font-size: 15px; }
.detail .tags-row { margin: 6px 0 18px; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* 后台 */
.admin-wrap { max-width: 1080px; margin: 26px auto; padding: 0 20px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.admin-top h1 { font-size: 22px; margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; }
.info { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; }
.stat { background: var(--accent); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .num { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat .lbl { font-size: 13px; color: var(--muted); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.tbl th { color: var(--muted); font-weight: 600; background: var(--bg); }
table.tbl tr:hover td { background: #fafbfe; }

.btn { display: inline-block; padding: 7px 14px; border-radius: 8px; font-size: 13px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.ok { background: #e8f7ee; color: #1f9d57; border-color: #bce9cd; }
.btn.warn { background: #fff4e5; color: #c8761a; border-color: #f5d9ad; }
.btn.danger { background: #fdecec; color: #d6453d; border-color: #f3c2c0; }
.btn.sm { padding: 4px 10px; font-size: 12px; }

form .row { margin-bottom: 14px; }
form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
form input[type=text], form input[type=url], form input[type=password], form textarea, form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  outline: none; background: #fff; font-family: inherit;
}
form input:focus, form textarea:focus, form select:focus { border-color: var(--primary); }
form textarea { min-height: 80px; resize: vertical; }

.pager { margin-top: 16px; color: var(--muted); font-size: 13px; }
.tag-inline { display:inline-block; background: var(--accent); border:1px solid var(--border); color: var(--primary); border-radius:999px; padding:1px 9px; font-size:12px; margin:0 4px 4px 0; }

.msg { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; font-size: 14px; }
.msg.ok { background: #e8f7ee; color: #1f9d57; border: 1px solid #bce9cd; }
.msg.err { background: #fdecec; color: #d6453d; border: 1px solid #f3c2c0; }

.login-box { max-width: 380px; margin: 80px auto; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 20px; }
.foot a { color: var(--muted); }
.foot-inner { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; align-items: center; }
.beian { display: inline-flex; align-items: center; }
.beian a { color: var(--muted); }
.beian a:hover { color: var(--text); }
.foot-preview { padding: 14px 18px; background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 12px; text-align: center; max-width: 760px; }

/* 页脚导航行（申请收录 / 联系我们 / 首页） */
.foot-nav { margin-top: 10px; display: inline-flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.foot-nav a { color: var(--muted); font-size: 12px; }
.foot-nav a:hover { color: var(--text); }

/* QQ 展示页卡片 */
.qq-card { margin: 18px auto 4px; max-width: 460px; padding: 22px 20px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.qq-num { font-size: 30px; font-weight: 800; letter-spacing: 2px; color: var(--primary); font-family: "SF Mono", "Cascadia Code", Consolas, monospace; }
.qq-actions { margin-top: 14px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* 广告位 */
.ad-slot { max-width: 1200px; margin: 16px auto; padding: 0 20px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.ad-item { display: block; background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.ad-item:hover { text-decoration: none; }
.ad-demo { color: var(--muted); font-size: 14px; }
.ad-label { align-self: flex-end; font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; }

/* ====== 左右两侧悬浮广告 ====== */
.float-ads { position: fixed; inset: 0; pointer-events: none; z-index: 35; }
.float-ad-wrap { position: absolute; top: 50%; transform: translateY(-50%); }
.float-ad-wrap.left  { left: 10px; }
.float-ad-wrap.right { right: 10px; }
.float-ad { display: block; position: relative; line-height: 0; pointer-events: auto; }
.float-ad-img { width: 130px; max-width: 40vw; height: auto; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.22); display: block; }
.float-ad-close { position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 22px; text-align: center; cursor: pointer; pointer-events: auto; }
.float-ad-wrap.left .float-ad-close { right: auto; left: -10px; }
@media (max-width: 860px) { .float-ads { display: none; } }

/* 跳转中转页 */
.redirect-page { max-width: 640px; margin: 40px auto; padding: 0 20px; text-align: center; }
.redirect-box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 28px; box-shadow: var(--shadow); }
.redirect-box .rb-ico { font-size: 42px; }
.redirect-box h1 { font-size: 21px; margin: 10px 0 6px; }
.rb-host { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.rb-host b { color: var(--primary); }
.rb-tip { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.rb-tip #cd { color: var(--primary); font-weight: 700; }
.rb-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero { margin: 16px; padding: 22px 18px; }
  .catnav { top: 58px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ================================================================
   后台暗色侧边栏布局（参照管理后台截图风格）
   ================================================================ */

/* 后台 body：深色背景 */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: #0f1219;
  color: #c9d1d9;
}

/* ----- 左侧边栏 ----- */
.aside {
  width: 220px;
  min-height: 100vh;
  background: #161b26;
  border-right: 1px solid #21262e;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.aside-head {
  padding: 20px 16px 14px;
  border-bottom: 1px solid #21262e;
}
.aside-logo { font-size: 20px; }
.aside-title {
  font-size: 15px; font-weight: 700; color: #e6edf3; margin-top: 4px;
}
.aside-user {
  font-size: 12px; color: #7d8590; margin-top: 2px;
}
.role-tag {
  display: inline-block; margin-left: 4px; padding: 1px 7px;
  font-size: 11px; line-height: 1.6; border-radius: 999px;
  background: #1f6feb33; color: #79c0ff; border: 1px solid #1f6feb66;
}

/* 侧边栏导航 */
.aside-nav { padding: 10px 8px; flex: 1; }
.anav {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; color: #8b949e;
  transition: background .15s, color .15s;
  text-decoration: none; margin-bottom: 2px;
}
.anav:hover { background: #1c2333; color: #c9d1d9; text-decoration: none; }
.anav.active {
  background: rgba(59,110,245,.15); color: #58a6ff; font-weight: 600;
}
.anav .aico { font-size: 15px; width: 22px; text-align: center; flex-shrink: 0; }
.anav .atxt { white-space: nowrap; }

/* 侧边栏底部 */
.aside-foot { padding: 12px 16px; border-top: 1px solid #21262e; }
.aside-link {
  display: block; padding: 7px 0; font-size: 12.5px; color: #7d8590;
  transition: color .15s;
}
.aside-link:hover { color: #c9d1d9; text-decoration: none; }
.aside-link.danger:hover { color: #f85149; }

/* ----- 主内容区 ----- */
.amain {
  flex: 1; min-width: 0;
  padding: 24px 28px;
  overflow-x: hidden;
}
.amain-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 10px;
}
.amain-head h1 {
  font-size: 21px; font-weight: 700; color: #e6edf3; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.amain-actions { display: flex; gap: 8px; }

/* 后台面板（暗色） */
.admin-body .panel,
.admin-body .stats { /* 覆盖前台亮色 */ }
.admin-body .panel {
  background: #161b26; border-color: #21262e;
  box-shadow: none; border-radius: 10px;
}
.admin-body .stat {
  background: #1c2333; border-color: #21262e;
}

/* 后台表格 */
.admin-body table.tbl th {
  background: #0f1219; color: #7d8590; border-color: #21262e;
}
.admin-body table.tbl td {
  border-color: #21262e; color: #c9d1d9;
}
.admin-body table.tbl tr:hover td { background: #1c2333; }

/* 后台表单 */
.admin-body form input[type=text],
.admin-body form input[type=url],
.admin-body form input[type=password],
.admin-body form textarea,
.admin-body form select {
  background: #0f1219; border-color: #30363d; color: #e6edf3;
}
.admin-body form input:focus,
.admin-body form textarea:focus,
.admin-body form select:focus {
  border-color: #3b6ef5; box-shadow: 0 0 0 2px rgba(59,110,245,.25);
}
.admin-body form label { color: #8b949e; }
.admin-body form .info { color: #7d8590; }

/* 后台按钮 */
.admin-body .btn {
  background: #21262e; border-color: #30363d; color: #c9d1d9;
}
.admin-body .btn:hover { background: #30363d; color: #fff; }
.admin-body .btn.primary {
  background: #238636; border-color: #238636; color: #fff;
}
.admin-body .btn.primary:hover { background: #2ea043; }
.admin-body .btn.ok {
  background: rgba(35,134,54,.15); color: #3fb950; border-color: #238636;
}
.admin-body .btn.warn {
  background: rgba(187,128,9,.15); color: #d29922; border-color: #9e6a03;
}
.admin-body .btn.danger {
  background: rgba(248,81,73,.15); color: #f85149; border-color: #da3633;
}

/* 后台消息条 */
.admin-body .msg.ok {
  background: rgba(35,134,54,.12); color: #3fb950; border-color: #23863633;
}
.admin-body .msg.err {
  background: rgba(248,81,73,.12); color: #f85149; border-color: #da363333;
}

/* 后台页脚 */
.admin-body .foot {
  color: #484f58; border-top: 1px solid #21262e;
  margin-top: 32px; padding-top: 20px;
}
.admin-body .foot a { color: #7d8590; }
.admin-body .foot a:hover { color: #c9d1d9; }

/* 后台通用文字色 */
:root {
  --admuted: #7d8590;
}

/* ====== 仪表盘专用样式 ====== */
.dash-section { margin-bottom: 28px; }
.dash-title {
  font-size: 15px; font-weight: 600; color: #e6edf3;
  margin: 0 0 14px; letter-spacing: .3px;
}

/* 服务状态卡片 */
.status-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.status-card {
  background: #161b26; border: 1px solid #21262e; border-radius: 10px;
  padding: 24px 16px; text-align: center;
}
.status-ico { font-size: 24px; margin-bottom: 8px; line-height: 1; }
.status-lbl { font-size: 13px; color: #8b949e; }

/* 数据概览卡片 */
.stat-cards {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px;
}
.scard {
  background: #161b26; border: 1px solid #21262e; border-radius: 10px;
  padding: 18px 14px; text-align: center; transition: border-color .15s;
  text-decoration: none; display: block;
}
.scard:hover { border-color: #3b6ef5; text-decoration: none; }
.scard .sc-num { font-size: 26px; font-weight: 700; color: #e6edf3; }
.scard .sc-lbl { font-size: 12px; color: var(--admuted); margin-top: 4px; }
.scard.sc-green .sc-num { color: #3fb950; }
.scard.sc-orange .sc-num { color: #d29922; }
.scard.sc-red .sc-num { color: #f85149; }

/* 快速操作按钮 */
.quick-btns {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.qbtn {
  display: inline-block; padding: 9px 18px; border-radius: 8px;
  font-size: 13px; border: 1px solid #30363d;
  background: #21262e; color: #c9d1d9; cursor: pointer;
  transition: all .15s; text-decoration: none;
}
.qbtn:hover { background: #30363d; color: #fff; text-decoration: none; }
.qbtn-primary {
  background: #238636; border-color: #238636; color: #fff;
}
.qbtn-primary:hover { background: #2ea043; }

.empty-card {
  background: #161b26; border: 1px solid #21262e; border-radius: 10px;
  padding: 28px; text-align: center; color: var(--admuted); font-size: 14px;
}

/* ====== 右侧抽屉（点击左侧菜单 → 右侧展开） ====== */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  z-index: 90;
}
.drawer-mask.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: 660px; max-width: 94vw; background: #0f1219;
  border-left: 1px solid #21262e;
  transform: translateX(102%);
  transition: transform .28s cubic-bezier(.22,.61,.36,1);
  z-index: 100; display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,.45);
}
.drawer.open { transform: translateX(0); }
.drawer-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid #21262e; background: #11151f;
}
.drawer-bar .dt { font-size: 14px; font-weight: 600; color: #e6edf3; }
.drawer-close {
  border: 1px solid #30363d; background: #21262e; color: #c9d1d9;
  border-radius: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.drawer-close:hover { background: #30363d; color: #fff; }
.drawer-ext {
  border: 1px solid #30363d; background: #21262e; color: #8b949e;
  border-radius: 8px; padding: 5px 10px; font-size: 12px; text-decoration: none;
}
.drawer-ext:hover { background: #30363d; color: #c9d1d9; text-decoration: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; }
.drawer-body .amain-head { margin-bottom: 18px; }
.drawer-body > .panel:first-child { margin-top: 0; }
.drawer-loading { color: var(--admuted); font-size: 14px; text-align: center; padding: 40px 0; }

/* QQ 多号列表（前台展示页） */
.qq-list { display: flex; flex-direction: column; gap: 14px; max-width: 460px; margin: 0 auto; }
.qq-card + .qq-card { margin-top: 0; }
.qq-role { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ====== 响应式：后台小屏隐藏侧边栏 ====== */
@media (max-width: 900px) {
  .aside { display: none; }
  .amain { padding: 16px; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
  .drawer { width: 100vw; max-width: 100vw; }
}
@media (max-width: 600px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .quick-btns { flex-direction: column; }
  .qbtn { text-align: center; }
}

/* ====== 站内集成（iframe 播放页 / 详情内联） ====== */
.badge.in { background: #e7f7ec; color: #1a7f37; border-color: #bfe6cb; }

.embed-body { display: flex; flex-direction: column; min-height: 100vh; }
.embed-bar {
  flex: none; position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.embed-bar-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.eb-brand { font-weight: 700; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.eb-brand .logo { font-size: 18px; }
.eb-sep { color: var(--muted); }
.eb-name { color: var(--text); font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed-bar-r { display: flex; align-items: center; gap: 8px; flex: none; }
.embed-tip { flex: none; padding: 8px 18px; font-size: 12.5px; color: var(--muted); background: var(--accent); border-bottom: 1px solid var(--border); }
.embed-tip b { color: var(--text); }
.embed-tip-local { color: #1f7a3d; background: #e7f6ec; border-bottom-color: #bfe3cb; }
.embed-frame { flex: 1; width: 100%; border: 0; min-height: 480px; background: #fff; }

/* ====== 自建访问统计（前台底部） ====== */
.foot-stats { margin-top: 8px; font-size: 12px; color: var(--muted); }
.foot-stats b { color: var(--text); }

/* ====== 第三方统计图标（前台底部悬浮） ====== */
.tp-stats { position: fixed; right: 16px; bottom: 16px; z-index: 60; font-size: 13px; }
.tp-stats-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  font-size: 20px; cursor: pointer; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.tp-stats-btn:hover { transform: scale(1.06); }
.tp-stats-panel {
  position: absolute; right: 0; bottom: 56px; width: 320px; max-width: 86vw;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.tp-stats-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.tp-stats-close {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1;
}
.tp-stats-body { padding: 12px; color: var(--text); max-height: 60vh; overflow: auto; }
.tp-stats-body :where(img, iframe) { max-width: 100%; }

/* ====== 后台访问统计 ====== */
.scard.sc-blue .sc-num { color: #3b6ef5; }
.trend-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.tb-row { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.tb-date { color: var(--admuted); }
.tb-bar { height: 12px; border-radius: 6px; background: linear-gradient(90deg,#3b6ef5,#5b8def); min-width: 2px; }
.tb-val { color: var(--admuted); white-space: nowrap; }
.mini-bar { display: inline-block; height: 10px; border-radius: 5px; background: #3b6ef5; min-width: 2px; vertical-align: middle; }

/* 详情页内联 iframe */
.detail-embed { margin-top: 18px; }
.detail-embed .embed-frame { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); height: 70vh; }

/* ====== 打开方式「自动判定」预览提示（后台审核 / 新增） ====== */
.emb-hint {
  margin-top: 8px; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  font-size: 12px; line-height: 1.7; color: var(--muted);
}
.emb-h-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.emb-hint code {
  display: inline-block; padding: 1px 7px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all;
}
.emb-reason { margin-top: 4px; color: var(--muted); }

/* ====== 全站搜索（后台） ====== */
.search-bar { display: flex; gap: 10px; align-items: center; }
.search-bar input { flex: 1; font-size: 15px; padding: 12px 14px; }
.search-summary { font-size: 14px; color: var(--admuted); margin-bottom: 12px; }
.search-summary b { color: #e6edf3; }
.scope-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
  background: #21262e; border: 1px solid #30363d; color: #c9d1d9; text-decoration: none;
}
.chip:hover { background: #30363d; color: #fff; text-decoration: none; }
.chip.on { background: #238636; border-color: #238636; color: #fff; }

.srch-head {
  font-size: 15px; font-weight: 600; color: #e6edf3;
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.srch-cnt { font-size: 12px; color: var(--admuted); background: #0f1219; border: 1px solid #21262e; border-radius: 999px; padding: 1px 9px; font-weight: 400; }
.srch-list { display: flex; flex-direction: column; gap: 8px; }
.srch-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid #21262e; border-radius: 10px;
  background: #0f1219; text-decoration: none; transition: border-color .15s, background .15s;
}
.srch-item:hover { border-color: #3b6ef5; background: #11151f; text-decoration: none; }
.srch-main { min-width: 0; }
.srch-title { font-size: 14px; font-weight: 600; color: #e6edf3; }
.srch-sub { font-size: 12px; color: #7d8590; margin-top: 2px; word-break: break-all; }
.srch-meta { font-size: 12px; color: var(--admuted); margin-top: 4px; word-break: break-all; }
.srch-go { color: #7d8590; font-size: 20px; flex: none; }

/* ================================================================
   前端布局增强：左侧分类侧栏 + 暗色模式（参考 zxbm / 易工具网）
   ================================================================ */

/* 顶部栏微调：左侧分组 + 移动端汉堡 + 主题切换按钮 */
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.menu-btn {
  display: none; border: 1px solid var(--border); background: var(--panel);
  color: var(--text); width: 38px; height: 38px; border-radius: 9px;
  font-size: 18px; line-height: 1; cursor: pointer; flex: none;
}
.menu-btn:hover { background: var(--accent); }
.theme-toggle {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  width: 38px; height: 38px; border-radius: 9px; font-size: 15px; line-height: 1;
  cursor: pointer; flex: none; transition: background .15s;
}
.theme-toggle:hover { background: var(--accent); }

/* 左右布局容器 */
.app-shell { max-width: 1320px; margin: 0 auto; display: flex; align-items: flex-start; gap: 0; }

/* 左侧分类侧栏（仿 zxbm 左侧导航） */
.sidenav {
  width: 224px; flex: 0 0 224px; align-self: flex-start;
  position: sticky; top: 60px; max-height: calc(100vh - 76px);
  overflow-y: auto; padding: 14px 10px;
}
.sidenav-inner { display: flex; flex-direction: column; gap: 2px; }
.sidenav-title {
  font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .4px;
  padding: 6px 12px 8px;
}
.snav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 10px; color: var(--text); font-size: 14px; text-decoration: none;
  transition: background .15s, color .15s;
}
.snav-item:hover { background: var(--accent); text-decoration: none; }
.snav-item.active { background: var(--primary); color: #fff; }
.snav-item .si { font-size: 16px; width: 20px; text-align: center; flex: none; }
.snav-item .st { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snav-item .sc {
  font-size: 12px; color: var(--muted); background: var(--bg);
  border-radius: 999px; padding: 0 7px; flex: none;
}
.snav-item.active .sc { background: rgba(255,255,255,.22); color: #fff; }

/* 内容区 */
.content { flex: 1; min-width: 0; padding: 0 20px; }
.main { max-width: none; margin: 22px 0; padding: 0; }
.hero { margin: 22px 0 8px; }

/* 移动端侧栏遮罩 */
.sb-overlay { display: none; }

/* ===== 暗色主题（覆盖前端变量；默认亮色，可切换） ===== */
[data-theme="dark"] {
  --bg: #0f141b;
  --panel: #161c26;
  --border: #283041;
  --text: #e6edf3;
  --muted: #8b97a8;
  --accent: #1b2433;
  --primary: #5b8bff;
  --primary-d: #3b6ef5;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.35);
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #18222f 0%, #131a24 60%, #0f141b 100%);
  border-color: var(--border);
}
[data-theme="dark"] .hero-search form { background: #0f141b; }
[data-theme="dark"] .top-actions a { background: var(--accent); }
[data-theme="dark"] .float-ad-img { box-shadow: 0 8px 24px rgba(0,0,0,.5); }
[data-theme="dark"] .redirect-box,
[data-theme="dark"] .qq-card,
[data-theme="dark"] .ad-item { background: var(--panel); }

/* ===== 响应式：<960px 侧栏变为抽屉 ===== */
@media (max-width: 960px) {
  .app-shell { display: block; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidenav {
    position: fixed; top: 0; left: 0; height: 100vh; width: 264px; max-height: none;
    background: var(--panel); border-right: 1px solid var(--border);
    transform: translateX(-103%); transition: transform .25s cubic-bezier(.22,.61,.36,1);
    z-index: 80; padding: 14px 10px; box-shadow: 8px 0 40px rgba(0,0,0,.28);
  }
  .sidenav.open { transform: translateX(0); }
  .sb-overlay {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 70; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
  }
  .sb-overlay.show { opacity: 1; visibility: visible; }
  .content { padding: 0 14px; }
  .hero { margin: 16px 0 8px; padding: 22px 16px; }
}
@media (max-width: 600px) {
  .topbar-inner { padding: 10px 14px; }
  .tool { padding: 14px; }
}

