/* ==========================================================================
   导航站前台样式 — 现代卡片式，响应式，支持系统深色模式
   ========================================================================== */

:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #12151c;
  --muted: #6b7280;
  --faint: #9aa1ae;
  --line: #e6e8f0;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef0ff;
  --gold: #d99a2b;
  --gold-deep: #b7791f;
  --gold-soft: #fff8e9;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px -14px rgba(16, 24, 40, .18);
  --edge: 32px;            /* 全宽布局的左右留白 */
  --header-h: 64px;
}

/* 深色主题：跟随系统（用户手动选过浅色时除外） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1017;
    --card: #151a23;
    --text: #e8ebf2;
    --muted: #98a1b2;
    --faint: #6f7889;
    --line: #232a37;
    --brand: #818cf8;
    --brand-dark: #a5b4fc;
    --brand-soft: #1d2233;
    --gold: #e6b355;
    --gold-deep: #f0c674;
    --gold-soft: #241f14;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 32px -16px rgba(0, 0, 0, .6);
  }
}

/* 手动切换为深色 */
:root[data-theme="dark"] {
  --bg: #0d1017;
  --card: #151a23;
  --text: #e8ebf2;
  --muted: #98a1b2;
  --faint: #6f7889;
  --line: #232a37;
  --brand: #818cf8;
  --brand-dark: #a5b4fc;
  --brand-soft: #1d2233;
  --gold: #e6b355;
  --gold-deep: #f0c674;
  --gold-soft: #241f14;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 32px -16px rgba(0, 0, 0, .6);
}

:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(75% 42% at 50% 0%, color-mix(in srgb, var(--brand) 6%, transparent), transparent 72%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap {
  width: 100%;
  padding: 0 var(--edge);
}

/* ------------------------------- 头部 ------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 60%, #d946ef);
  box-shadow: 0 6px 14px -6px rgba(99, 102, 241, .8);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.brand-text em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search {
  flex: 1 1 auto;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  font-size: 14px;
}

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

.search input:focus {
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}

.search button {
  position: absolute;
  right: 5px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.search button:hover { background: var(--brand-soft); color: var(--brand); }

.header-nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
/* 首页隐藏顶部搜索框后，导航靠右对齐，中间不留空 */
.site-header.no-search .header-nav { margin-left: auto; }
.header-nav > a { color: var(--muted); transition: color .15s; }
.header-nav > a:hover { color: var(--text); }

.btn-submit {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff !important;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9);
  transition: transform .15s, background .15s;
}

.btn-submit:hover { background: var(--brand-dark); transform: translateY(-1px); }

/* ------------------------------- 主体 ------------------------------- */
/* 主内容区：全宽铺满，只留左右安全边距，宽屏下多出的横向空间直接给卡片用 */
.site-main {
  width: 100%;
  padding: 34px var(--edge) 56px;
  min-height: 60vh;
}

/* 首页头图：一块轻量渐变面板，比纯文字更有层次，也不至于压过内容 */
.hero {
  position: relative;
  margin: 8px 0 4px;
  padding: 30px 32px 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(120% 150% at 100% 0%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 58%),
    radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, #a855f7 8%, transparent), transparent 62%),
    var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  right: -70px;
  top: -90px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%);
  pointer-events: none;
}
.hero h1 {
  position: relative;
  margin: 0 auto 10px;
  text-align: center;
  font-size: 33px;
  line-height: 1.28;
  letter-spacing: -.6px;
}
.hero h1 span {
  background: linear-gradient(120deg, var(--brand), #a855f7 55%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p,
.hero .hero-sub {
  position: relative;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
  max-width: 700px;
}

.cat-head { padding: 8px 0 4px; }
.cat-head h1 { margin: 0 0 10px; font-size: 26px; letter-spacing: -.3px; }
.cat-head .definition {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 820px;
}
.cat-head .definition strong { color: var(--text); font-weight: 600; }

.breadcrumb { margin: 0 0 14px; font-size: 13px; color: var(--faint); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 6px; }

/* ------------------------------ 分类 chips --------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13.5px;
  color: var(--muted);
  transition: all .16s;
  white-space: nowrap;
}

.chip b {
  font-weight: 600;
  font-size: 11.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--faint);
}

.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.chip:hover b { background: var(--brand-soft); color: var(--brand); }

.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(79, 70, 229, .9);
}
.chip.is-active b { background: rgba(255, 255, 255, .22); color: #fff; }

/* ------------------------------- 区块标题 ---------------------------- */
.section { margin-top: 34px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -.2px;
  display: flex;
  align-items: center;
  gap: 9px;
}
/* 每个板块标题前的一小段渐变竖条，用来分节，不抢内容 */
.section-head h2::before {
  content: "";
  flex: none;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), #a855f7);
}
.section-head .count { font-size: 12.5px; color: var(--faint); font-weight: 400; }
.section-head .more { font-size: 13px; color: var(--brand); }

/* ------------------------------- VIP 区 ----------------------------- */
.vip-panel {
  position: relative;
  margin-top: 26px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  background: var(--card);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%),
    var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.vip-panel::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 22%, transparent), transparent 70%);
  pointer-events: none;
}

.vip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  color: #7a4d05;
  background: linear-gradient(135deg, #ffe9b8, #ffd479);
  box-shadow: 0 4px 10px -6px rgba(217, 154, 43, .9);
}

.vip-head h2 { margin: 0; font-size: 16px; }
.vip-head .vip-tip { font-size: 12.5px; color: var(--faint); }

.vip-grid {
  display: grid;
  /* auto-fit：VIP 站少时卡片自动撑开一些，不会一小撮挤在左边留一大片空白。
     v1.8.0 起铺满整行，不再限宽——全宽布局下限宽反而会在右侧留白。 */
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.vip-grid .card {
  background: var(--card);
  background: color-mix(in srgb, var(--gold-soft) 62%, var(--card));
  border-color: color-mix(in srgb, var(--gold) 30%, var(--line));
}
.vip-grid .card:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 26px -16px rgba(183, 121, 31, .55);
}

.vip-flag {
  position: absolute;
  top: 8px;
  right: 9px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-deep);
  letter-spacing: .5px;
}
/* NEW 与 VIP 同时出现时错开，避免叠字 */
.card.has-new .vip-flag { right: 46px; }

/* ------------------------------- 卡片 ------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  min-height: 84px;
}
/* 卡片主体链接：保持原来的 flex 布局与点击行为 */
.card-hit {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 22px;
  color: inherit;
  text-decoration: none;
}
/* 详情入口：右下角，指向自动生成的介绍页 */
.card-detail {
  position: absolute;
  right: 11px; bottom: 8px;
  font-size: 11.5px;
  color: var(--brand);
  text-decoration: none;
  opacity: .85;
}
.card-detail:hover { opacity: 1; text-decoration: underline; }

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
  box-shadow: 0 14px 30px -18px rgba(16, 24, 40, .34), var(--shadow-sm);
}
.card:hover .card-body h3 { color: var(--brand); }
.card:hover .fav img { transform: scale(1.07); }

.fav {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  background: hsl(var(--h, 230) 68% 56%);
  overflow: hidden;
}
.fav img { transition: transform .18s ease; }

.fav img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  background: var(--card);
}

.card-body { min-width: 0; flex: 1; }

.card-body h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-body p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body .host {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 互链标记：对方站点挂了本站链接（站长互换友链的标识） */
.card-body .host .bl-flag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  font-style: normal;
  font-size: 10px;
  line-height: 15px;
  border-radius: 4px;
  color: #0a7a5a;
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .28);
  vertical-align: 1px;
}

[data-theme="dark"] .card-body .host .bl-flag {
  color: #5eead4;
  background: rgba(16, 185, 129, .18);
  border-color: rgba(16, 185, 129, .34);
}

/* ------------------------------- 分页 ------------------------------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 34px 0 6px;
}

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13.5px;
  color: var(--muted);
  transition: all .15s;
}

.pg:hover { border-color: var(--brand); color: var(--brand); }

.pg.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

.pg-dot { color: var(--faint); padding: 0 2px; }

/* ------------------------------- 空状态 ----------------------------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty strong { display: block; font-size: 16px; color: var(--text); margin-bottom: 6px; }

/* ------------------------------- 提示条 ----------------------------- */
.alert {
  margin: 0 0 18px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--card);
}
.alert-ok {
  color: #11623a;
  background: #eafaf1;
  border-color: #bfe9d1;
}
.alert-err {
  color: #98221b;
  background: #fdeeec;
  border-color: #f6c9c4;
}
@media (prefers-color-scheme: dark) {
  .alert-ok { color: #8ce0b3; background: #10241a; border-color: #1f4a35; }
  .alert-err { color: #f6a9a1; background: #2a1412; border-color: #58241f; }
}

/* ------------------------------- 表单 ------------------------------- */
.form-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.form-card h1 { margin: 0 0 6px; font-size: 22px; }
.form-card .lead { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

.submit-tips {
  margin: 0 0 20px;
  padding: 13px 16px 13px 32px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.submit-tips li { margin: 1px 0; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
}
.field label .req { color: #e05252; margin-left: 2px; }
.field .hint { margin-top: 5px; font-size: 12px; color: var(--faint); }

.input, .textarea, .select {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  font-size: 14px;
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 13%, transparent);
}

.captcha-row { display: flex; align-items: center; gap: 12px; }
.captcha-q {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 1px;
  user-select: none;
}
.captcha-row .input { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 10px 22px -12px rgba(79, 70, 229, .9);
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-block { width: 100%; }

.form-foot { margin-top: 16px; font-size: 12.5px; color: var(--faint); text-align: center; }

/* ------------------------------- 页脚 ------------------------------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 30px 0 22px;
  font-size: 13px;
  color: var(--muted);
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 42%, transparent), transparent);
  pointer-events: none;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: space-between;
  padding-bottom: 18px;
}
.footer-brand { max-width: 560px; }
.footer-brand strong { color: var(--text); font-size: 14.5px; }
.footer-brand p { margin: 6px 0 0; line-height: 1.7; }

.footer-links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.footer-links a:hover { color: var(--brand); }

/* 页脚备案号：与版权行同排，窄屏自动换行 */
.footer-beian { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-beian a { color: var(--faint); text-decoration: none; transition: color .15s; }
.footer-beian a:hover { color: var(--brand); }

.footer-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
}

/* ---------------------------- 主题切换按钮 --------------------------- */
.theme-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .15s;
}
.theme-btn:hover { color: var(--brand); border-color: var(--brand); transform: rotate(-12deg); }

/* ------------------------------ NEW 角标 ----------------------------- */
.new-flag {
  position: absolute;
  top: 8px;
  right: 9px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .5px;
  line-height: 1.6;
  padding: 0 5px;
  border-radius: 5px;
  color: #15803d;
  background: #dcfce7;
}
.card.has-new .vip-flag { top: 27px; }

/* ----------------------------- 搜索高亮 ------------------------------ */
mark.hl {
  background: color-mix(in srgb, var(--gold) 32%, transparent);
  color: inherit;
  padding: 0 1px;
  border-radius: 3px;
}

/* ------------------------------ 热门榜 ------------------------------- */
.hot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}
.hot-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 13.5px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.hot-list a:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.hot-rank {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg);
  color: var(--faint);
}
.hot-list li:nth-child(1) .hot-rank { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.hot-list li:nth-child(2) .hot-rank { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.hot-list li:nth-child(3) .hot-rank { background: linear-gradient(135deg, #fdba74, #f97316); color: #fff; }
.hot-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-clicks { font-size: 11.5px; color: var(--faint); white-space: nowrap; }

/* ---------------------------- 分类介绍块 ----------------------------- */
.about-box {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}
.about-box p { margin: 0 0 9px; }
.about-box p:last-child { margin-bottom: 0; }
.about-box strong { color: var(--text); }

/* ---------------------------- 页脚分类链接 --------------------------- */
.footer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 10px !important;
  font-size: 12.5px;
}
.footer-cats a { color: var(--muted); }
.footer-cats a:hover { color: var(--brand); }

/* ---------------------------- 回到顶部 ------------------------------- */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 60;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, visibility .2s, transform .2s, color .15s, border-color .15s;
}
.to-top.on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--brand); border-color: var(--brand); }

/* favicon 透明底，加载失败时露出首字母色块 */
.fav img { background: transparent; }

/* -------------------------- 榜单页 / 最新收录 ------------------------- */
.page-head { margin: 6px 0 18px; }
.page-head h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.4px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.page-head strong { color: var(--brand); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.tab {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  transition: border-color .15s, color .15s, background .15s;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.rank-list { grid-template-columns: 1fr 1fr; }
.rank-meta { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--faint); margin-left: 7px; }

.new-date { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.new-date h2 { font-size: 15px; margin: 0; }
.new-date span { font-size: 12px; color: var(--faint); }
.new-date::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 900px) {
  .header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .brand-text em { display: none; }
  .search { order: 3; flex: 1 0 100%; max-width: none; }
  .header-nav { margin-left: auto; }

  .site-main { padding: 22px var(--edge) 40px; }
  .hero h1 { font-size: 23px; }
  .cat-head h1 { font-size: 21px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }
  .vip-grid { grid-template-columns: 1fr; }
  .hot-list { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 20px; border-radius: 14px; }
  .footer-inner { flex-direction: column; gap: 14px; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 var(--edge); }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; font-size: 15px; }
  .header-nav > a:not(.btn-submit) { display: none; }
  .card { padding: 12px; min-height: 78px; }
  .vip-panel { padding: 14px; }
  .pager { gap: 6px; }
  .pg { min-width: 32px; height: 32px; padding: 0 9px; font-size: 13px; }
  .hot-list { grid-template-columns: 1fr; }
  .to-top { right: 14px; bottom: 16px; width: 38px; height: 38px; }
  .theme-btn { width: 32px; height: 32px; flex-basis: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   v1.4 新增：标签云 / 广告位 / 友链 / 搜索建议
   ========================================================================== */

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; text-decoration: none;
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.tag-pill b { font-size: 11px; font-weight: 600; color: var(--faint); font-variant-numeric: tabular-nums; }
.tag-pill:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.tag-pill.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tag-pill.is-active b { color: rgba(255, 255, 255, .82); }

.tag-section { margin: 20px 0 8px; }
.tag-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.tag-section-head h2 { margin: 0; font-size: 15px; letter-spacing: -.1px; }
.tag-section-head span { font-size: 12px; color: var(--faint); }
.tag-cloud-sm { margin-top: 12px; }
.tag-cloud-label { align-self: center; margin-right: 2px; font-size: 12px; color: var(--faint); }

.suggest-box { margin-top: 20px; padding: 16px 16px 6px; border: 1px dashed var(--line); border-radius: var(--radius); }
.suggest-box h3 { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.suggest-box .grid { margin-bottom: 10px; }

/* 广告位 */
.ad-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.ad-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; text-decoration: none;
  box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s;
}
.ad-item em {
  font-style: normal; font-size: 10px; line-height: 1.6;
  padding: 1px 5px; border-radius: 4px;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap;
}
.ad-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ad-item img { display: block; height: 28px; width: auto; max-width: 180px; object-fit: contain; border-radius: 6px; }
.ad-item:hover { border-color: var(--brand); transform: translateY(-1px); }

/* 友情链接 */
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.friend-card {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.friend-card strong { font-size: 14px; }
.friend-card .friend-host { font-size: 12px; color: var(--faint); }
.friend-card p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.friend-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.friend-mine {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px; line-height: 1.95; color: var(--muted);
}

.footer-friends {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 14px 0 0; margin-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.footer-friends-label { color: var(--faint); }
.footer-friends a { color: var(--muted); }
.footer-friends a:hover { color: var(--brand); }
.footer-friends .more { color: var(--brand); }

@media (max-width: 640px) {
  .ad-item span { max-width: 180px; }
  .friend-grid { grid-template-columns: 1fr; }
  .tag-pill { padding: 5px 10px; font-size: 12.5px; }
}

/* ==========================================================================
   分类页内容加厚 + 专题合集（v1.7）
   ========================================================================== */
/* 分类页顶部介绍：比定义句更长的说明文字 */
.cat-head .cat-intro {
  margin: 10px 0 0;
  max-width: 860px;
  font-size: 13.8px;
  line-height: 1.85;
  color: var(--muted);
}

/* 分类 FAQ：原生 details 折叠，无 JS 依赖 */
.faq-list { display: grid; gap: 10px; max-width: 860px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  padding-right: 26px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 2px; top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  font-weight: 400;
  color: var(--faint);
}
.faq-item[open] summary::after { content: '−'; }
.faq-item .faq-a {
  padding: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 11px;
}

/* 专题页头 */
.topic-head { padding: 6px 0 2px; }
.topic-head h1 { margin: 8px 0 8px; font-size: 26px; letter-spacing: -.3px; }
.topic-head .topic-sub { margin: 0 0 8px; font-size: 15px; color: var(--text); }
.topic-head .definition { margin: 0; max-width: 820px; font-size: 14px; color: var(--muted); }
.topic-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
}
.topic-intro-box { margin-top: 6px; }

/* 专题卡片网格 */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.topic-grid-lg { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.topic-card {
  display: block;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.topic-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.topic-card h3 { margin: 8px 0 6px; font-size: 15.5px; line-height: 1.45; }
.topic-card p { margin: 0 0 8px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.topic-card .topic-intro-line { font-size: 12.5px; color: var(--faint); }
.topic-meta { font-size: 12px; color: var(--faint); }

/* 专题卡片里的推荐语 */
.card-body p.card-note {
  color: var(--text);
  border-left: 2px solid var(--brand);
  padding-left: 7px;
}

/* 首页专题区块 */
.home-topics { margin-bottom: 6px; }

@media (max-width: 640px) {
  .topic-head h1 { font-size: 21px; }
  .topic-grid, .topic-grid-lg { grid-template-columns: 1fr; }
}

/* ==========================================================================
   友链代码卡片（提交页 / 友链页共用，v1.7.1）
   ========================================================================== */
.bl-box {
  margin: 14px 0;
  padding: 16px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.bl-head { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.bl-sub { margin: 0 0 10px; font-size: 13px; line-height: 1.8; color: var(--muted); }
.bl-code {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.bl-code code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
}
.bl-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-copy {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, transform .1s;
}
.btn-copy:hover { background: var(--brand-dark); }
.btn-copy:active { transform: translateY(1px); }
.btn-copy.is-done { background: #16a34a; }
.bl-tip { font-size: 12px; color: var(--faint); }
.bl-rule {
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12.5px;
  line-height: 1.75;
}

/* 提交页里的折叠块 */
.bl-details {
  margin: 14px 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0 16px;
}
.bl-details > summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  position: relative;
  padding-right: 24px;
}
.bl-details > summary::-webkit-details-marker { display: none; }
.bl-details > summary::after {
  content: '▾';
  position: absolute;
  right: 2px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--faint);
  transition: transform .15s;
}
.bl-details[open] > summary::after { transform: translateY(-50%) rotate(180deg); }
.bl-details .bl-box { margin-top: 0; }

@media (max-width: 640px) {
  .bl-box { padding: 13px 14px; }
  .bl-code code { font-size: 11.5px; }
  .bl-actions { gap: 8px; }
}

/* ==========================================================================
   首页视觉微调（v1.7.4）：响应式与细节
   ========================================================================== */
@media (max-width: 900px) {
  .hero { padding: 24px 22px 22px; border-radius: 18px; }
  .hero h1 { font-size: 26px; }
}
@media (max-width: 640px) {
  .hero { padding: 20px 18px 18px; margin-top: 4px; }
  .hero h1 { font-size: 22px; line-height: 1.35; }
  .hero .hero-sub { font-size: 13.5px; }
  .section-head h2 { font-size: 15.5px; }
}

/* 窄屏：分区标题右侧的「提交网址 / 更多」允许换行，避免被挤出容器 */
@media (max-width: 560px) {
  .section-head { flex-wrap: wrap; row-gap: 3px; }
  .section-head .more { font-size: 12.5px; }
}

/* 全宽布局下的边距收敛：小屏别浪费横向空间 */
@media (max-width: 900px) {
  :root { --edge: 20px; }
}
@media (max-width: 640px) {
  :root { --edge: 15px; }
  .site-main { padding: 22px var(--edge) 46px; }
}

/* ==========================================================================
   全宽布局的配套约束（v1.7.5）
   宽度铺满不代表文字也要铺满：说明性段落限制行宽，避免一行横跨 1800px
   ========================================================================== */
.about-box p,
.about-box li { max-width: 900px; }
.about-box > p:last-child { margin-bottom: 0; }

/* 专题卡片：数量少时自动撑开，别挤在左边留一大片空白。
   v1.8.0 专题增至 10 个、首页展示 6 个，铺满整行更好看。 */
.topic-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* 首页「关于本站」这类长文区，行宽收窄后阅读节奏更稳 */
.home-about .about-box p { max-width: 900px; }

/* ==========================================================================
   v1.8.0 首页增强：大搜索框 / 分类导览 / 最新收录
   全部使用主题变量，深色模式自动跟随
   ========================================================================== */

/* Hero 大搜索框 */
.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 640px;
  margin: 20px auto 0;
  padding: 6px 6px 6px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.hero-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.hero-search .hs-icon { flex: none; color: var(--faint); }
.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
  color: var(--text);
  padding: 8px 0;
}
.hero-search input::placeholder { color: var(--faint); }
.hero-search button {
  flex: none;
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.hero-search button:hover { background: var(--brand-dark); transform: translateY(-1px); }

.hero-hotwords {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  font-size: 12.5px;
}
.hero-hotwords > span { color: var(--faint); margin-right: 2px; }
.hero-hotwords a {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--muted);
  transition: color .15s, border-color .15s, transform .15s;
}
.hero-hotwords a:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }

/* 分类导览卡片：12 个分类用固定列数，6/4/3/2 都能整除，
   保证每个宽度下都是整齐的满行网格，不会在右侧留半行空白 */
.cat-guide-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1400px) {
  .cat-guide-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.cat-guide-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.cat-guide-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cg, var(--brand));
  opacity: .85;
}
.cat-guide-card:hover {
  transform: translateY(-3px);
  border-color: var(--cg, var(--brand));
  box-shadow: var(--shadow);
}
.cg-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--cg, var(--brand)), color-mix(in srgb, var(--cg, var(--brand)) 55%, #ffffff));
  box-shadow: 0 4px 12px -4px var(--cg, var(--brand));
}
.cg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cg-body strong { font-size: 14.5px; color: var(--text); letter-spacing: -.2px; }
.cg-body em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-guide-card > b {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--cg, var(--brand));
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--cg, var(--brand)) 10%, transparent);
  padding: 3px 8px;
  border-radius: 999px;
}

/* 最新收录：紧凑列表，避免和上面的卡片网格重复 */
.latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 8px;
}
.latest-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color .15s, transform .15s;
}
.latest-list a:hover { border-color: var(--brand); transform: translateX(2px); }
.lt-date { flex: none; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.lt-name { flex: none; font-size: 13.5px; font-weight: 600; }
.lt-desc {
  flex: 1; min-width: 0;
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lt-host { flex: none; font-size: 11px; color: var(--faint); }

/* 专题卡片：右下角一层淡光晕，卡片之间更有层次 */
.topic-card { position: relative; overflow: hidden; }
.topic-card::after {
  content: "";
  position: absolute;
  right: -30px; bottom: -40px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%);
  pointer-events: none;
}
.topic-card > * { position: relative; z-index: 1; }

/* 窄屏收敛 */
@media (max-width: 900px) {
  .cat-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .latest-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero-search { margin-top: 16px; padding-left: 12px; }
  .hero-search button { padding: 0 14px; }
  .hero-hotwords { gap: 6px; }
  .cat-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .cat-guide-card { padding: 11px 12px; gap: 9px; }
  .cg-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
  .cg-body strong { font-size: 13px; }
  .cg-body em { display: none; }
  .cat-guide-card > b { font-size: 11.5px; padding: 2px 6px; }
  .lt-desc, .lt-host { display: none; }
}

/* ---- 站点详情页 site.php ---- */
.detail-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--brand) 5%, var(--card));
  box-shadow: var(--shadow-sm);
}
.detail-mark {
  width: 56px; height: 56px;
  flex: 0 0 56px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 25px; font-weight: 700;
  color: #fff;
  background: hsl(var(--h, 240) 62% 56%);
}
.detail-head-main { flex: 1 1 auto; min-width: 0; }
.detail-kicker { display: block; margin-bottom: 5px; font-size: 12px; color: var(--brand); font-weight: 600; }
.detail-head h1 { margin: 0 0 8px; font-size: 27px; letter-spacing: -.4px; line-height: 1.3; }
.detail-head .definition { margin: 0; max-width: 820px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.detail-facts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.detail-facts b { color: var(--text); font-weight: 600; }
.detail-visit {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 17px;
  border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  transition: transform .16s, background .16s;
}
.detail-visit:hover { background: var(--brand-dark); transform: translateY(-1px); }
.detail-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; max-width: 900px; }
.detail-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; line-height: 1.65; }
.detail-list .dot { flex: 0 0 6px; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--brand); }
.detail-compare { display: grid; gap: 8px; }
.compare-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 190px;
  align-items: center; gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); text-decoration: none;
  transition: border-color .16s, transform .16s;
}
.compare-row:hover { border-color: var(--brand); transform: translateX(2px); }
.compare-name { font-size: 14px; font-weight: 600; color: var(--text); }
.compare-desc { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compare-host { font-size: 12px; color: var(--faint); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .detail-head { flex-wrap: wrap; padding: 17px; gap: 12px; }
  .detail-mark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; font-size: 20px; }
  .detail-head h1 { font-size: 22px; }
  .detail-visit { margin-left: 56px; }
  .compare-row { grid-template-columns: 1fr; gap: 4px; }
  .compare-host { text-align: left; }
}

/* 后台数据页：8 个指标排成 4×2，避免自动换行后最后一张孤零零 */
.kpis.stats-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .kpis.stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 后台数据页：搜索词 / 无结果搜索双栏 */
.stats-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
@media (max-width: 980px) {
  .stats-two { grid-template-columns: 1fr; }
}

/* ==========================================================================
   后台全自动运维控制台
   ========================================================================== */
.ops-console { border-color: var(--brand); }
.ops-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ops-state {
  flex: none; padding: 5px 11px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ops-state.running { background: var(--brand-soft); color: var(--brand); }
.ops-state.done { background: var(--brand-soft); color: var(--brand); }
.ops-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; }
.ops-auto { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ops-auto input { margin: 0; }
.ops-track {
  height: 10px; border-radius: 99px; overflow: hidden;
  background: var(--line); border: 1px solid var(--line);
}
.ops-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), #8b93f7);
  transition: width .35s ease;
}
.ops-meta {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 8px; font-size: 12.5px; color: var(--muted);
}
.ops-log {
  margin-top: 12px; max-height: 190px; overflow: auto;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--muted);
  font-size: 12px; line-height: 1.8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ops-log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 760px) {
  .ops-head { flex-direction: column; }
  .ops-actions .btn { flex: 1 1 auto; }
}
