/*
Theme Name: SenBaoAI 导航
Theme URI: https://senbaoai.com
Author: SenBaoAI
Description: 导航站前台。深色侧栏 + Hero 聚合搜索 + 搜索弹层智能提示 + 分类 Tab + 热门条 + 分区卡片栅格 + 右栏统计排行 + 悬浮工具与暗色模式；桌面与手机两档布局。
Version: 0.9.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: senbao-nav
*/

:root {
  --sb-theme: #f1404b;
  --sb-theme-hover: #d12768;
  --sb-ink: #1f2430;
  --sb-ink-2: #5b6576;
  --sb-muted: #8a97a8;
  --sb-line: #e9edf3;
  --sb-bg: #f4f6fa;
  --sb-card: #ffffff;
  --sb-side: #1d2130;
  --sb-side-ink: #c3c9d8;
  --sb-warn: #f59f00;
  --sb-danger: #e03131;
  --sb-radius: 14px;
  --sb-shadow: 0 10px 30px -22px rgba(20, 30, 60, .45);
  --sb-shadow-hover: 0 16px 34px -20px rgba(20, 30, 60, .32);
  --sb-nav-h: 66px;
  --sb-aside-w: 216px;
  --sb-aside-w-collapsed: 76px;
  --sb-rail-w: 296px;
  --sb-green: var(--sb-theme);
  --sb-green-dark: var(--sb-theme-hover);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.sb-body,
body.page-body {
  margin: 0;
  background: var(--sb-bg);
  color: var(--sb-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.page-body { background: var(--sb-bg); }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===================== shell ===================== */
.sb-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* ===================== 侧栏 ===================== */
.sb-aside {
  position: sticky;
  top: 0;
  align-self: flex-start;
  z-index: 60;
  width: var(--sb-aside-w);
  flex: 0 0 var(--sb-aside-w);
  height: 100vh;
  background: linear-gradient(180deg, #1d2130, #191d29);
  color: var(--sb-side-ink);
}

body.admin-bar .sb-aside { height: calc(100vh - 32px); top: 32px; }

.sb-aside-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  color: #fff;
}

.sb-logo { display: flex; align-items: center; gap: 10px; color: #fff; }

.sb-logo-mark {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  background: linear-gradient(135deg, #f1404b, #ff8a5c);
  color: #fff;
  box-shadow: 0 8px 18px -8px rgba(241, 64, 75, .9);
}

.sb-logo-img { display: none; }

.sb-logo-text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
}

.sb-aside-search { padding: 4px 14px 10px; position: relative; }

.sb-aside-search > i {
  position: absolute;
  left: 26px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #7e8698;
  pointer-events: none;
}

.sb-aside-search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 30px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .06);
  color: #e8ebf3;
  outline: none;
}

.sb-aside-search input::placeholder { color: #7e8698; }
.sb-aside-search input:focus {
  border-color: rgba(241, 64, 75, .6);
  background: rgba(255, 255, 255, .1);
}

.sb-aside-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 10px 12px;
  scrollbar-width: thin;
}

.sb-aside-nav::-webkit-scrollbar { width: 6px; }
.sb-aside-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 6px;
}

.sb-aside-menu,
.sb-aside-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sb-aside-item { margin-bottom: 2px; position: relative; }

.sb-aside-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  color: #dfe4ef;
}

.sb-aside-link:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.sb-aside-link > i:first-child {
  width: 7px; height: 7px;
  font-size: 0;
  border-radius: 50%;
  background: var(--sb-theme);
  flex: 0 0 7px;
}

.sb-aside-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-nav-count {
  font-style: normal;
  font-size: 11px;
  color: #79818f;
}

.sb-aside-caret {
  font-size: 11px;
  color: #666f80;
  transition: transform .2s ease;
}

.sb-aside-item.is-open > .sb-aside-link { background: rgba(255, 255, 255, .06); }
.sb-aside-item.is-open .sb-aside-caret { transform: rotate(180deg); }

/* 二级菜单：默认收起，按 .is-open 单开（手风琴） */
.sb-aside-sub {
  padding-left: 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .24s ease;
}

.sb-aside-item.is-open > .sb-aside-sub { max-height: 420px; }

.sb-aside-sub a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #a9b1c2;
  border-left: 1px solid rgba(255, 255, 255, .07);
}

.sb-aside-sub a:hover { color: #fff; background: rgba(255, 255, 255, .05); text-decoration: none; }
.sb-aside-sub a span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-aside-sub a em { font-style: normal; font-size: 11px; color: #6e7687; }
.sb-aside-subitem.is-active > a {
  color: #fff;
  border-left-color: var(--sb-theme);
  background: rgba(241, 64, 75, .14);
}

.sb-aside-item.is-hidden { display: none; }

.sb-aside-bottom {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.sb-aside-collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  background: transparent;
  color: #9aa2b4;
  font-size: 12.5px;
  cursor: pointer;
}

.sb-aside-collapse:hover { color: #fff; border-color: rgba(255, 255, 255, .22); }
.sb-aside-collapse i { margin: 0; }

/* ===== 收成图标条 ===== */
body.aside-collapsed .sb-aside { width: var(--sb-aside-w-collapsed); flex-basis: var(--sb-aside-w-collapsed); }
body.aside-collapsed .sb-logo-text,
body.aside-collapsed .sb-aside-text,
body.aside-collapsed .sb-nav-count,
body.aside-collapsed .sb-aside-caret,
body.aside-collapsed .sb-aside-search { display: none; }
body.aside-collapsed .sb-aside-link { justify-content: center; padding: 12px 0; }
body.aside-collapsed .sb-aside-link > i:first-child { width: 10px; height: 10px; flex-basis: 10px; }
body.aside-collapsed .sb-brand { justify-content: center; padding: 18px 0 14px; }

/* 折叠态下不裁切横向溢出，才能让子菜单浮到右侧 */
body.aside-collapsed .sb-aside-nav { overflow: visible; }
body.aside-collapsed .sb-aside-item > .sb-aside-sub {
  position: absolute;
  left: 100%;
  top: 0;
  width: 192px;
  max-height: none;
  margin-left: 4px;
  padding: 6px;
  border-radius: 10px;
  background: #232838;
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 34px -16px rgba(0, 0, 0, .75);
  z-index: 70;
  display: none;
}

body.aside-collapsed .sb-aside-item:hover > .sb-aside-sub,
body.aside-collapsed .sb-aside-item:focus-within > .sb-aside-sub { display: block; }

body.aside-collapsed .sb-aside-item > .sb-aside-sub a { border-left: 0; }

body.aside-collapsed .sb-aside-collapse i { margin: 0; }

.sb-aside-mask { display: none; }

/* ===================== 主区 ===================== */
.sb-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sb-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 22px;
  background: rgba(244, 246, 250, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(233, 237, 243, .9);
}

body.admin-bar .sb-topbar { top: 32px; }

.sb-topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sb-menu-btn {
  display: none;
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  border: 1px solid var(--sb-line);
  background: #fff;
  font-size: 16px;
  color: var(--sb-ink-2);
  cursor: pointer;
}

.sb-search {
  flex: 1;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 5px 0 16px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid var(--sb-line);
  box-shadow: var(--sb-shadow);
  transition: border-color .16s ease;
}

.sb-search:focus-within { border-color: rgba(241, 64, 75, .45); }

.sb-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--sb-ink);
}

.sb-search input::placeholder { color: var(--sb-muted); }

.sb-search button {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--sb-theme), var(--sb-theme-hover));
}

.sb-top-nav { display: none; }

.sb-top-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.sb-top-icon {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--sb-line);
  background: #fff;
  color: var(--sb-ink-2);
}

.sb-top-icon:hover { color: var(--sb-theme); border-color: rgba(241, 64, 75, .35); }

.sb-top-cta {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sb-theme), var(--sb-theme-hover));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.sb-top-cta:hover { color: #fff; }

/* ===================== 内容区 ===================== */
.sb-content,
.sb-home {
  display: flex;
  gap: 20px;
  padding: 0 22px 8px;
  align-items: flex-start;
}

.sb-col-main,
.sb-home-main {
  flex: 1;
  min-width: 0;
  padding-top: 16px;
}

.sb-col-rail,
.sb-rail {
  flex: 0 0 var(--sb-rail-w);
  width: var(--sb-rail-w);
  padding-top: 16px;
  position: sticky;
  top: calc(var(--sb-nav-h) + 10px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.admin-bar .sb-col-rail,
body.admin-bar .sb-rail { top: calc(var(--sb-nav-h) + 42px); }

/* hero */
.sb-hero {
  padding: 22px 26px;
  margin-bottom: 16px;
  border-radius: 16px;
  text-align: center;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(241, 64, 75, .10), transparent 60%),
    radial-gradient(120% 140% at 100% 0%, rgba(124, 92, 255, .12), transparent 60%),
    linear-gradient(180deg, #fff, #fbfcfe);
  border: 1px solid var(--sb-line);
  box-shadow: var(--sb-shadow);
}

.sb-hero h1,
.sb-hero .sb-hero-title {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: .4px;
  color: var(--sb-ink);
  font-weight: 700;
}

.sb-hero p {
  margin: 0;
  color: var(--sb-ink-2);
  font-size: 13px;
}

/* panel 通用 */
.sb-panel,
.sb-content-card,
.sb-rail-card {
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  overflow: hidden;
}

.sb-panel-head,
.sb-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
}

.sb-panel-head h2,
.sb-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--sb-ink);
}

.sb-panel-head h2 i,
.sb-card-title i { color: var(--sb-theme); font-size: 14px; }

.sb-panel-links { margin-left: auto; display: flex; gap: 12px; }
.sb-panel-links a { font-size: 12px; color: var(--sb-muted); }
.sb-panel-links a:hover { color: var(--sb-theme); }

.sb-panel-more,
.sb-card-more {
  margin-left: auto;
  font-size: 12px;
  color: var(--sb-muted);
}

.sb-panel-more:hover,
.sb-card-more:hover { color: var(--sb-theme); }

.sb-card-head-line { display: none; }

/* ===================== 热门条 ===================== */
.sb-hot-panel { padding-bottom: 6px; margin-bottom: 18px; }

.sb-hot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px;
}

.sb-hot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f8fafc;
  border: 1px solid transparent;
  transition: .16s;
}

.sb-hot:hover {
  background: #fff;
  border-color: rgba(241, 64, 75, .28);
  box-shadow: var(--sb-shadow-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

.sb-hot-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }

.sb-hot-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--sb-ink);
}

.sb-hot-desc {
  font-size: 11.5px;
  color: var(--sb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-hot-strip { display: none; }

/* favicon 组件 */
.sb-ico {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 9px;
  overflow: hidden;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 30, 60, .12);
}

.sb-ico-fb {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 52%;
  font-weight: 700;
  color: #fff;
  background: var(--sb-ico-color, #7c5cff);
  font-style: normal;
}

.sb-ico-img {
  position: relative;
  z-index: 1;
  display: block;
  background: #fff;
  border-radius: 9px;
}

.sb-hot .sb-ico { width: 26px; height: 26px; }
.sb-hot .sb-ico-img { width: 20px; height: 20px; }

.sb-load-more,
.senbao-more {
  display: block;
  margin: 10px 14px 8px;
  height: 36px;
  line-height: 34px;
  width: calc(100% - 28px);
  text-align: center;
  cursor: pointer;
  border: 1px dashed var(--sb-line);
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--sb-muted);
  font-size: 12.5px;
  letter-spacing: 2px;
}

.sb-load-more:hover,
.senbao-more a:hover { color: var(--sb-theme); }

/* ===================== 分区 ===================== */
.sb-sec-block { margin-bottom: 20px; }

.sb-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 12px;
}

.sb-sec-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--sb-ink);
}

.sb-sec-bar {
  width: 4px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
  background: var(--sb-theme);
}

.sb-sec-head h2 small {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--sb-muted);
}

.sb-sec-more { margin-left: auto; font-size: 12px; color: var(--sb-muted); }
.sb-sec-more:hover { color: var(--sb-theme); }

.sb-cat-list { display: flex; flex-direction: column; gap: 12px; }

.sb-content-card {
  padding: 0;
  box-shadow: none;
  border: 0;
  background: transparent;
  overflow: visible;
}

.sb-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 14px 16px 12px;
  font-size: 14.5px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--sb-line);
  border-bottom: 0;
  border-radius: var(--sb-radius) var(--sb-radius) 0 0;
  box-shadow: none;
  color: var(--sb-ink);
}

.sb-cat-title i { display: none; }
.sb-cat-title a { color: inherit; }
.sb-cat-title a:hover { color: var(--sb-theme); }
.sb-cat-title small {
  font-weight: 400;
  font-size: 11px;
  color: var(--sb-muted);
  background: #f2f5f9;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 2px;
}

/* 分类卡片：标题 + 栅格合成一块白卡 */
.sb-cat-card {
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  overflow: hidden;
}

.sb-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 16px 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--sb-ink);
}

.sb-cat-title i { display: none; }
.sb-cat-title a { color: inherit; }
.sb-cat-title a:hover { color: var(--sb-theme); }
.sb-cat-title small {
  font-weight: 400;
  font-size: 11px;
  color: var(--sb-muted);
  background: #f2f5f9;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 2px;
}

.sb-cat-desc {
  margin: 4px 0 0;
  padding: 0 16px;
  font-size: 12px;
  color: var(--sb-muted);
}

/* 站点卡片 */
.sb-sites-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px 16px;
}

.sb-site {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 11px;
  background: #fbfcfe;
  border: 1px solid #eef2f7;
  transition: .16s;
}

.sb-site:hover {
  background: #fff;
  border-color: rgba(241, 64, 75, .3);
  box-shadow: var(--sb-shadow-hover);
  transform: translateY(-1px);
}

.sb-site-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  color: inherit;
}

.sb-site-body:hover { text-decoration: none; }

.sb-site-icon {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 9px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 1px 3px rgba(20, 30, 60, .12);
}

.sb-site-icon img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.sb-site-icon .sb-ico { width: 40px; height: 40px; }

.sb-site-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }

.sb-site-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sb-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-site-desc {
  margin: 0;
  font-size: 11.5px;
  color: var(--sb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-site-detail {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--sb-muted);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--sb-line);
  background: #fff;
  opacity: 0;
  transition: opacity .16s ease;
}

.sb-site:hover .sb-site-detail { opacity: 1; }
.sb-site-detail:hover { color: var(--sb-theme); border-color: rgba(241, 64, 75, .35); }

.senbao-badge-warn,
.senbao-badge-danger {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  border-radius: 5px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: 1px;
}

.senbao-badge-warn { background: var(--sb-warn); }
.senbao-badge-danger { background: var(--sb-danger); }

.senbao-coupon {
  display: inline-block;
  margin-top: 3px;
  font-size: 10.5px;
  color: #b23a48;
  background: #fdecee;
  border-radius: 6px;
  padding: 1px 6px;
  cursor: pointer;
  align-self: flex-start;
}

.senbao-empty {
  padding: 14px;
  margin: 12px 16px 16px;
  border: 1px dashed var(--sb-line);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--sb-muted);
  text-align: center;
  background: #fbfcfe;
}

.senbao-empty a { color: var(--sb-theme); }

.senbao-pad { padding: 0 4px; }

/* ===================== 右栏 ===================== */
.sb-rail { flex-direction: column; }

.sb-promo {
  padding: 16px;
  color: #fff;
  border: 0;
  border-radius: var(--sb-radius);
  background: linear-gradient(135deg, #f1404b 0%, #a21caf 58%, #5b21b6 100%);
  box-shadow: 0 18px 34px -22px rgba(110, 20, 120, .85);
}

.sb-promo-badge {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  letter-spacing: 1px;
}

.sb-promo h3 { margin: 10px 0 6px; font-size: 17px; color: #fff; }
.sb-promo p { margin: 0 0 12px; font-size: 12px; line-height: 1.5; color: rgba(255, 255, 255, .86); }

.sb-promo-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: #8a1c8a;
  font-size: 12px;
  font-weight: 700;
}

.sb-stats { padding: 14px; }

.sb-stat-wide {
  border-radius: 11px;
  background: linear-gradient(135deg, #fdecee, #fff5f5);
  border: 1px solid #fbd7db;
  text-align: center;
  padding: 12px 8px;
}

.sb-stat-wide b { display: block; font-size: 26px; line-height: 1.1; color: var(--sb-theme); }
.sb-stat-wide span { font-size: 11.5px; color: #a8606a; }

.sb-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }

.sb-stat {
  border-radius: 11px;
  text-align: center;
  padding: 10px 4px;
  border: 1px solid transparent;
}

.sb-stat b { display: block; font-size: 19px; line-height: 1.2; }
.sb-stat span { font-size: 11px; }

.sb-stat.s-pink { background: #f2f7ff; border-color: #dbe9ff; color: #2f72d6; }
.sb-stat.s-pink span { color: #7c9bcc; }
.sb-stat.s-green { background: #effaf4; border-color: #d4f0e2; color: #12996a; }
.sb-stat.s-green span { color: #61a98d; }
.sb-stat.s-amber { background: #fff8ec; border-color: #fbe7c6; color: #c47f10; }
.sb-stat.s-amber span { color: #bf9a5f; }

.sb-rail-card { padding: 0 0 8px; }

.sb-rail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
}

.sb-rail-head h3 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }

.sb-rail-head h3::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sb-theme);
  box-shadow: 0 0 0 3px rgba(241, 64, 75, .16);
}

.sb-rail-tag {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--sb-theme);
  background: #fdecee;
  border-radius: 999px;
  padding: 1px 8px;
}

.sb-rail-list {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  columns: 2;
  column-gap: 4px;
}

.sb-rail-item { break-inside: avoid; }

.sb-rail-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
  font-size: 12.5px;
}

.sb-rail-item a:hover { background: #f8fafc; text-decoration: none; }

.sb-rail-rank {
  width: 16px; height: 16px;
  flex: 0 0 16px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #98a2b3;
  background: #f1f4f8;
}

.sb-rail-item.is-top .sb-rail-rank {
  color: #fff;
  background: linear-gradient(135deg, var(--sb-theme), #ff8a5c);
}

.sb-rail-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--sb-ink);
}

.sb-rail-title:hover { color: var(--sb-theme); }

.sb-rail-count { font-size: 10.5px; color: var(--sb-muted); }
.sb-rail-tip { margin: 8px 16px 0; font-size: 11.5px; color: var(--sb-muted); }

.sb-tip { padding: 14px 16px; }
.sb-tip h3 { margin: 0 0 6px; font-size: 13.5px; }
.sb-tip p { margin: 0; font-size: 12px; color: var(--sb-ink-2); line-height: 1.6; }

/* ===================== 内页 ===================== */
.sb-pad {
  padding: 18px 22px 8px;
  flex: 1;
  min-width: 0;
}

body:not(.home) .sb-main > .sb-pad,
body:not(.home) .sb-main > .senbao-pad { max-width: 1120px; }

.senbao-page-title {
  margin: 8px 0 14px;
  font-size: 22px;
  font-weight: 700;
  color: var(--sb-ink);
}

.senbao-panel {
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.senbao-panel h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; }

.senbao-meta-list { list-style: none; margin: 0; padding: 0; }
.senbao-meta-list li {
  padding: 7px 0;
  border-bottom: 1px dashed var(--sb-line);
  font-size: 13px;
  color: var(--sb-ink-2);
}
.senbao-meta-list li:last-child { border-bottom: 0; }

.senbao-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sb-muted);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.senbao-breadcrumb .sep { color: #c8d0dc; }
.senbao-breadcrumb a:hover { color: var(--sb-theme); }

.senbao-article {
  padding: 10px 0;
  border-bottom: 1px dashed var(--sb-line);
  font-size: 13.5px;
}
.senbao-article:last-child { border-bottom: 0; }
.senbao-article a { color: var(--sb-ink); }
.senbao-article a:hover { color: var(--sb-theme); }

.senbao-form {
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.senbao-muted { color: var(--sb-muted); }

.senbao-btn,
.btn.senbao-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sb-theme), var(--sb-theme-hover));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.senbao-btn:hover { color: #fff; opacity: .92; text-decoration: none; }

.senbao-coupon-box {
  display: inline-block;
  margin: 8px 0 12px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #fdecee;
  border: 1px solid #fbd7db;
  color: #b23a48;
  font-size: 13px;
}

.senbao-coupon-box code { cursor: pointer; font-weight: 700; }

.senbao-hot-strip { display: none; }

/* 分页 */
.pagination,
.senbao-more { margin-top: 16px; }
.pagination a,
.pagination span {
  display: inline-block;
  min-width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--sb-line);
  background: #fff;
  font-size: 13px;
  color: var(--sb-ink-2);
  margin-right: 6px;
}
.pagination span.current,
.pagination a:hover { background: var(--sb-theme); color: #fff; border-color: var(--sb-theme); }

/* ===================== 页脚 ===================== */
.sb-footer,
.senbao-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 24px 26px;
  color: var(--sb-muted);
  font-size: 12px;
  border: 0;
  background: transparent;
}

.senbao-footer p { margin: 0; }
.senbao-footer a:hover { color: var(--sb-theme); }

/* 站长工具栏 */
.senbao-webmaster-bar {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: 12px;
  box-shadow: var(--sb-shadow);
  font-size: 12px;
  padding: 8px 10px;
}

/* ===================== 响应式：桌面收窄 ===================== */
@media (max-width: 1280px) {
  .sb-col-rail,
  .sb-rail { display: none; }
  .sb-hot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sb-sites-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===================== 响应式：手机 ===================== */
@media (max-width: 900px) {
  :root { --sb-aside-w: 236px; }

  .sb-aside {
    position: fixed;
    left: calc(-1 * var(--sb-aside-w));
    top: 0;
    height: 100vh;
    width: var(--sb-aside-w);
    flex-basis: var(--sb-aside-w);
    transition: left .24s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .35);
  }

  body.admin-bar .sb-aside { top: 32px; height: calc(100vh - 32px); }

  .sb-aside.is-open { left: 0; }

  .sb-aside-mask {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 20, 30, .45);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s;
  }

  .sb-aside-mask.is-show { opacity: 1; pointer-events: auto; }

  .sb-menu-btn { display: block; }
  .sb-topbar { padding: 10px 14px; }
  .sb-topbar-inner { gap: 8px; }
  .sb-top-nav { display: none; }
  .sb-top-tools { display: none; }

  .sb-content,
  .sb-home { padding: 0 14px 6px; }
  .sb-col-main,
  .sb-home-main { padding-top: 12px; }

  .sb-hero { padding: 18px 16px; }
  .sb-hero h1,
  .sb-hero .sb-hero-title { font-size: 20px; }
  .sb-hero p { font-size: 12px; line-height: 1.6; }

  .sb-hot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 12px; gap: 8px; }
  .sb-panel-links { display: none; }

  .sb-sites-grid { grid-template-columns: 1fr; gap: 8px; padding: 10px 12px 12px; }
  .sb-cat-title { padding: 12px 12px 0; }
  .sb-cat-desc { padding: 0 12px; }
  .sb-site-detail { display: none; }

  .sb-pad { padding: 14px; }
  .senbao-page-title { font-size: 19px; }
  .sb-footer,
  .senbao-footer { padding: 16px 14px 24px; }
}

@media (max-width: 420px) {
  .sb-hot-grid { grid-template-columns: 1fr; }
  .sb-search { height: 38px; padding-left: 12px; }
  .sb-search button { padding: 0 12px; }
}

/* ==========================================================================
   融合层 v0.8.0 —— 参考 OneNav 的「搜索中枢 / 分组引擎 / Tab / 悬浮工具」交互，
   视觉沿用 SenBaoAI 自己的 sb-* 体系，不复用参考站外观。
   ========================================================================== */

/* 作者样式（display:flex/grid）会盖掉 UA 的 [hidden]，这里统一兜底 */
[hidden] { display: none !important; }

/* ---------- 1. Hero 聚合搜索（big-search） ---------- */
.sb-hero.is-portal {
  position: relative;
  overflow: hidden;
  padding: 30px 24px 26px;
  border: 0;
  color: #fff;
  background: linear-gradient(125deg, #241033 0%, #5d1b4c 34%, #a82255 70%, #e34a4f 100%);
  box-shadow: 0 18px 40px -26px rgba(120, 20, 70, .8);
}
.sb-hero.is-portal::before,
.sb-hero.is-portal::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.sb-hero.is-portal::before {
  width: 380px; height: 380px;
  left: -120px; top: -210px;
  background: radial-gradient(circle, rgba(255, 255, 255, .20), transparent 68%);
}
.sb-hero.is-portal::after {
  width: 460px; height: 460px;
  right: -160px; bottom: -320px;
  background: radial-gradient(circle, rgba(255, 190, 120, .22), transparent 68%);
}
.sb-hero-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }
.sb-hero.is-portal .sb-hero-title {
  margin: 0 0 16px;
  font-size: 29px;
  letter-spacing: 1px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.sb-hero.is-portal .sb-hero-sub {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .82);
}
.sb-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 12px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .4px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .22);
}

.senbao-portal-search { margin: 20px auto 0; max-width: 740px; text-align: left; }
.senbao-portal-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.senbao-portal-tabs::-webkit-scrollbar { display: none; }
.senbao-portal-tab {
  flex: 0 0 auto;
  padding: 5px 15px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .86);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .18s, color .18s, transform .18s;
}
.senbao-portal-tab:hover { background: rgba(255, 255, 255, .24); }
.senbao-portal-tab.is-active {
  background: #fff;
  border-color: #fff;
  color: #b3244c;
  font-weight: 700;
  transform: translateY(-1px);
}
.senbao-portal-form {
  display: flex;
  align-items: stretch;
  height: 54px;
  margin-top: 10px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 14px 30px -14px rgba(20, 10, 30, .65);
}
.senbao-portal-input {
  flex: 1;
  min-width: 0;
  padding: 0 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1f2430;
  font-size: 15px;
}
.senbao-portal-input::placeholder { color: #9aa3b2; }
.senbao-portal-submit {
  flex: 0 0 64px;
  border: 0;
  cursor: pointer;
  color: #fff;
  font-size: 19px;
  background: linear-gradient(135deg, #f1404b, #d12768);
  transition: filter .18s;
}
.senbao-portal-submit:hover { filter: brightness(1.1); }
.senbao-portal-engines { margin-top: 10px; min-height: 28px; }
.senbao-portal-engine-row { display: flex; flex-wrap: wrap; gap: 6px; }
.senbao-portal-engine-row[hidden] { display: none; }
.senbao-portal-engine {
  padding: 3px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .82);
  font-size: 11.5px;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.senbao-portal-engine:hover { background: rgba(255, 255, 255, .24); }
.senbao-portal-engine.is-active {
  background: #fff;
  border-color: #fff;
  color: #b3244c;
  font-weight: 700;
}
.sb-hero-hot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .72);
}
.sb-hero-hot a {
  padding: 2px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  transition: background .16s;
}
.sb-hero-hot a:hover { background: rgba(255, 255, 255, .3); }

/* ---------- 2. 顶栏搜索弹层（search-modal） ---------- */
.sb-search-trigger { font-size: 15px; }
.sb-search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  padding: 11vh 16px 24px;
  overflow-y: auto;
  background: rgba(14, 18, 30, .58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sb-search-modal.is-open { display: block; animation: sb-modal-in .18s ease-out; }
@keyframes sb-modal-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.sb-modal-card {
  max-width: 680px;
  margin: 0 auto;
  background: var(--sb-card);
  border: 1px solid var(--sb-line);
  border-radius: 16px;
  box-shadow: 0 30px 70px -30px rgba(8, 12, 24, .7);
  overflow: hidden;
}
.sb-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--sb-line);
}
.sb-modal-types { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.sb-modal-type {
  padding: 5px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sb-ink-2);
  font-size: 12.5px;
  cursor: pointer;
}
.sb-modal-type.is-active { background: rgba(241, 64, 75, .12); color: var(--sb-theme); font-weight: 700; }
.sb-modal-close {
  width: 30px; height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sb-muted);
  font-size: 18px;
  cursor: pointer;
}
.sb-modal-close:hover { background: rgba(127, 140, 160, .12); color: var(--sb-ink); }
.sb-modal-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px;
  padding: 0 6px 0 16px;
  height: 50px;
  border: 1px solid var(--sb-line);
  border-radius: 12px;
  background: var(--sb-bg);
}
.sb-modal-form:focus-within { border-color: rgba(241, 64, 75, .5); }
.sb-modal-form input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  color: var(--sb-ink); font-size: 15px;
}
.sb-modal-form button {
  height: 38px; padding: 0 18px;
  border: 0; border-radius: 9px;
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  background: linear-gradient(135deg, var(--sb-theme), var(--sb-theme-hover));
}
.sb-smart-tips { list-style: none; margin: 0 14px; padding: 0; max-height: 264px; overflow-y: auto; }
.sb-smart-tips[hidden] { display: none; }
.sb-smart-tip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--sb-ink);
  font-size: 13px;
}
.sb-smart-tip:hover,
.sb-smart-tip.is-active { background: rgba(241, 64, 75, .09); }
.sb-smart-tip .sb-tip-name { font-weight: 600; }
.sb-smart-tip .sb-tip-desc {
  flex: 1; min-width: 0;
  color: var(--sb-muted); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-smart-tip .sb-tip-cat { color: var(--sb-muted); font-size: 11px; }
.sb-modal-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--sb-line);
  font-size: 11.5px; color: var(--sb-muted);
}
.sb-modal-hot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sb-modal-hot a {
  padding: 2px 9px; border-radius: 999px;
  background: var(--sb-bg); border: 1px solid var(--sb-line);
  color: var(--sb-ink-2);
}
.sb-modal-hot a:hover { color: var(--sb-theme); border-color: rgba(241, 64, 75, .4); }
.sb-modal-keys { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.sb-modal-keys kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid var(--sb-line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--sb-bg);
  color: var(--sb-ink-2);
  font: inherit; font-size: 10.5px; text-align: center;
}

/* ---------- 3. 版块分类 chips ---------- */
.sb-sec-tabs {
  display: flex; gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 10px 0 4px;
  padding-bottom: 2px;
}
.sb-sec-tabs::-webkit-scrollbar { display: none; }
.sb-sec-tab {
  flex: 0 0 auto;
  padding: 4px 12px;
  border: 1px solid var(--sb-line);
  border-radius: 999px;
  background: var(--sb-card);
  color: var(--sb-ink-2);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all .16s;
}
.sb-sec-tab:hover { border-color: rgba(241, 64, 75, .4); color: var(--sb-theme); }
.sb-sec-tab.is-active {
  background: linear-gradient(135deg, var(--sb-theme), var(--sb-theme-hover));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.sb-sec-tab em { font-style: normal; opacity: .65; margin-left: 4px; }

/* ---------- 4. 悬浮工具条 / 进度条 ---------- */
.sb-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0;
  z-index: 130;
  background: linear-gradient(90deg, #f1404b, #7c5cff);
  transition: width .1s linear;
}
.sb-tools {
  position: fixed; right: 18px; bottom: 22px;
  z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
}
.sb-tool-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--sb-line);
  border-radius: 50%;
  background: var(--sb-card);
  box-shadow: var(--sb-shadow);
  color: var(--sb-ink-2);
  font-size: 15px;
  cursor: pointer;
  transition: transform .16s, color .16s, box-shadow .16s;
}
.sb-tool-btn:hover {
  transform: translateY(-2px);
  color: var(--sb-theme);
  box-shadow: var(--sb-shadow-hover);
}
.sb-tool-btn[hidden] { display: none; }
.sb-tool-btn.is-on { color: var(--sb-theme); }
.sb-fav-panel {
  position: fixed; right: 66px; bottom: 22px;
  z-index: 61;
  width: 268px; max-height: 340px; overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--sb-line);
  border-radius: 12px;
  background: var(--sb-card);
  box-shadow: 0 20px 50px -20px rgba(12, 18, 32, .5);
}
.sb-fav-panel[hidden] { display: none; }
.sb-fav-panel h3 { margin: 0 0 8px; font-size: 13px; color: var(--sb-ink); }
.sb-fav-list { list-style: none; margin: 0; padding: 0; }
.sb-fav-list li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 12.5px; }
.sb-fav-list a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sb-ink-2); }
.sb-fav-list a:hover { color: var(--sb-theme); }
.sb-fav-list button { border: 0; background: transparent; color: var(--sb-muted); cursor: pointer; }
.sb-fav-empty { margin: 0; font-size: 12px; color: var(--sb-muted); }

/* ---------- 5. 卡片增强：收藏星 / 直达箭头 / hover ---------- */
.sb-site { position: relative; transition: transform .18s ease, box-shadow .18s ease; }
.sb-site:hover { transform: translateY(-2px); box-shadow: var(--sb-shadow-hover); }
.sb-site-fav {
  position: absolute; right: 6px; top: 6px;
  z-index: 2;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px;
  background: transparent;
  color: var(--sb-muted);
  font-size: 13px; line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .16s, color .16s, background .16s;
}
.sb-site:hover .sb-site-fav,
.sb-site-fav.is-on,
.sb-site-fav:focus-visible { opacity: 1; }
.sb-site-fav:hover { background: rgba(241, 64, 75, .1); color: var(--sb-theme); }
.sb-site-fav.is-on { color: #f59f00; }
.sb-site-go {
  position: absolute; right: 10px; bottom: 8px;
  font-size: 13px; color: var(--sb-theme);
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity .18s, transform .18s;
  pointer-events: none;
}
.sb-site:hover .sb-site-go { opacity: 1; transform: none; }

/* ---------- 6. 右栏最近访问 ---------- */
.sb-recent-list { list-style: none; margin: 0; padding: 4px 14px 14px; }
.sb-recent-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--sb-line); font-size: 12px; }
.sb-recent-item:last-child { border-bottom: 0; }
.sb-recent-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sb-ink-2); }
.sb-recent-item a:hover { color: var(--sb-theme); }
.sb-recent-item time { font-size: 10.5px; color: var(--sb-muted); }
.sb-recent-empty { margin: 0; padding: 0 14px 14px; font-size: 12px; color: var(--sb-muted); }

/* ---------- 7. 暗色主题 ---------- */
html[data-sb-theme="dark"] {
  --sb-bg: #12161f;
  --sb-card: #1b212d;
  --sb-ink: #e8ecf4;
  --sb-ink-2: #aab4c6;
  --sb-muted: #7d889c;
  --sb-line: #2b3342;
  --sb-side: #141922;
  --sb-side-ink: #c3c9d8;
  --sb-shadow: 0 10px 30px -22px rgba(0, 0, 0, .9);
  --sb-shadow-hover: 0 16px 34px -20px rgba(0, 0, 0, .8);
}
html[data-sb-theme="dark"] body.sb-body,
html[data-sb-theme="dark"] body.page-body { background: var(--sb-bg); }
html[data-sb-theme="dark"] .sb-topbar {
  background: rgba(18, 22, 31, .9);
  border-bottom-color: var(--sb-line);
}
html[data-sb-theme="dark"] .sb-menu-btn,
html[data-sb-theme="dark"] .sb-top-icon,
html[data-sb-theme="dark"] .sb-search,
html[data-sb-theme="dark"] .sb-panel,
html[data-sb-theme="dark"] .sb-content-card,
html[data-sb-theme="dark"] .sb-rail-card,
html[data-sb-theme="dark"] .sb-cat-card,
html[data-sb-theme="dark"] .sb-cat-title,
html[data-sb-theme="dark"] .sb-hot,
html[data-sb-theme="dark"] .sb-site,
html[data-sb-theme="dark"] .sb-modal-card,
html[data-sb-theme="dark"] .sb-tool-btn,
html[data-sb-theme="dark"] .sb-fav-panel,
html[data-sb-theme="dark"] .senbao-webmaster-bar,
html[data-sb-theme="dark"] .sb-aside-collapse {
  background: var(--sb-card);
  color: var(--sb-ink);
  border-color: var(--sb-line);
}
html[data-sb-theme="dark"] .sb-cat-title small,
html[data-sb-theme="dark"] .sb-modal-hot a,
html[data-sb-theme="dark"] .sb-modal-keys kbd { background: #232b38; color: var(--sb-ink-2); }
html[data-sb-theme="dark"] .sb-modal-form { background: #12161f; }
html[data-sb-theme="dark"] .sb-site-desc,
html[data-sb-theme="dark"] .sb-cat-desc { color: var(--sb-ink-2); }
html[data-sb-theme="dark"] .sb-sec-tab { background: var(--sb-card); }
html[data-sb-theme="dark"] .sb-hero.is-portal { color: #fff; }
html[data-sb-theme="dark"] .sb-footer,
html[data-sb-theme="dark"] .senbao-footer { background: var(--sb-card); border-color: var(--sb-line); }
html[data-sb-theme="dark"] .sb-hot-strip { color: var(--sb-ink-2); }

/* ---------- 8. 融合层响应式 ---------- */
@media (max-width: 900px) {
  .sb-hero.is-portal { padding: 22px 14px 20px; }
  .sb-hero.is-portal .sb-hero-title { font-size: 22px; }
  .senbao-portal-form { height: 46px; }
  .senbao-portal-input { font-size: 13.5px; padding: 0 12px; }
  .senbao-portal-submit { flex-basis: 52px; }
  .sb-hero-hot { display: none; }
  .sb-tools { right: 12px; bottom: 14px; }
  .sb-fav-panel { right: 12px; bottom: 60px; width: min(280px, calc(100vw - 24px)); }
  .sb-modal-keys { display: none; }
  .sb-site-fav { opacity: 1; }
}
@media (max-width: 420px) {
  .senbao-portal-tab { padding: 4px 11px; font-size: 12px; }
  .sb-search-modal { padding: 8vh 10px 16px; }
}

/* ---------- 9. 预留位（空收录位） ----------
   数据里 url 为空的条目会渲染成占位卡片：不可点击、不发外链请求，
   用户填上 https:// 网址后自动变回正式站点卡片。 */
.sb-slot {
  background: transparent;
  border: 1px dashed #d7deea;
  box-shadow: none;
  cursor: default;
}
.sb-slot:hover {
  background: transparent;
  border-color: #c3ccdc;
  box-shadow: none;
  transform: none;
}
.sb-slot .sb-slot-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.sb-slot-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px dashed #cfd8e6;
  border-radius: 9px;
  color: #a7b1c2;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}
.sb-slot-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sb-slot-title {
  display: block;
  color: #8b96a8;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}
.sb-slot-hint {
  display: block;
  color: #aeb7c5;
  font-size: 11.5px;
  line-height: 1.4;
  margin-top: 3px;
}
.sb-slot-empty {
  grid-column: 1 / -1;
  padding: 22px 14px;
  border: 1px dashed #d7deea;
  border-radius: 10px;
  color: #8b96a8;
  font-size: 13px;
  text-align: center;
}
.sb-rail-empty {
  padding: 10px 16px;
  color: #8b96a8;
  font-size: 13px;
  list-style: none;
}
html[data-sb-theme="dark"] .sb-slot,
html[data-sb-theme="dark"] .sb-slot:hover {
  background: transparent;
  border-color: #333d4d;
  box-shadow: none;
}
html[data-sb-theme="dark"] .sb-slot-plus { border-color: #3b4657; color: #6f7c90; }
html[data-sb-theme="dark"] .sb-slot-title { color: #8894a7; }
html[data-sb-theme="dark"] .sb-slot-hint { color: #6f7c90; }
html[data-sb-theme="dark"] .sb-slot-empty { border-color: #333d4d; color: #8894a7; }
html[data-sb-theme="dark"] .sb-rail-empty { color: #8894a7; }
@media (max-width: 900px) {
  .sb-slot-hint { font-size: 11px; }
}

/* ==========================================================================
   10. 胶囊密度网格（分区卡片）
   参考 zmt.cn：分区内不再用「图标+标题+描述」大卡，改成一行 7~9 个胶囊，
   一屏能扫到的收录数提升 3~4 倍；热门推荐区仍保留大卡承载描述与优惠码。
   ========================================================================== */
.sb-pills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  gap: 10px;
  padding: 2px 16px 18px;
}

.sb-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--sb-bg);
  color: var(--sb-ink);
  font-size: 14.5px;
  line-height: 1.35;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.sb-pill:hover {
  background: var(--sb-card);
  border-color: var(--sb-line);
  box-shadow: var(--sb-shadow-hover);
  transform: translateY(-1px);
  color: var(--sb-ink);
  text-decoration: none;
}

.sb-pill-icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-pill .sb-ico { width: 26px; height: 26px; border-radius: 7px; box-shadow: none; }
.sb-pill .sb-ico-img { width: 21px; height: 21px; border-radius: 6px; }
.sb-pill .sb-ico-fb { font-size: 13px; }

.sb-pill-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sb-pill-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 14.5px;
}

.sb-pill-desc {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--sb-muted);
}

.sb-pill-flag {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
}

.sb-pill-flag.is-warn { background: #fff4e0; color: #b26a00; }
.sb-pill-flag.is-danger { background: #ffe9e9; color: #c92a2a; }

/* 预留位：虚线胶囊，不再铺满大块空卡 */
.sb-pill-slot {
  background: transparent;
  border: 1px dashed var(--sb-line);
  color: var(--sb-muted);
  cursor: default;
  align-self: stretch;
  min-height: 66px;
}

.sb-pill-slot:hover { background: transparent; border-color: var(--sb-line); box-shadow: none; transform: none; }

.sb-pill-plus {
  flex: 0 0 20px;
  text-align: center;
  color: var(--sb-muted);
  font-size: 13px;
  line-height: 1;
}

html[data-sb-theme="dark"] .sb-pill { background: #232a38; color: #e6eaf2; }
html[data-sb-theme="dark"] .sb-pill:hover { background: #2b3342; border-color: #39445a; }
html[data-sb-theme="dark"] .sb-pill-slot { background: transparent; border-color: #39445a; color: #8894a7; }
html[data-sb-theme="dark"] .sb-pill-flag.is-warn { background: #3a2e17; color: #f0b445; }
html[data-sb-theme="dark"] .sb-pill-flag.is-danger { background: #3a1f22; color: #f08c8c; }

@media (max-width: 1200px) {
  .sb-pills { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }
}

@media (max-width: 760px) {
  .sb-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 2px 12px 14px; }
  .sb-pill { font-size: 13.5px; padding: 10px; gap: 9px; }
  /* 手机两列时宽度只有 ~170px，简介允许折两行，比截成 6 个字有用 */
  .sb-pill-desc {
    font-size: 11.5px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .sb-pill-slot { min-height: 72px; }
}

/* 空版块：一行虚线分类，替代整屏空卡片；这里只有名字，所以比正常胶囊小一号 */
.sb-pills-cats {
  padding: 0 16px 16px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.sb-pills-cats .sb-pill-slot {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
}
.sb-sec-block.is-empty .sb-pill-slot { background: transparent; }
.sb-sec-block.is-empty .sb-sec-head h2 small { color: var(--sb-muted); font-weight: 400; }
