/* ============================================================
   码途导航 · 首页样式 (index.css)
   依赖 base.css 的设计变量与共享原语
   ============================================================ */

/* ============================================================
   1. 顶部导航
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  transition: box-shadow 0.25s var(--ease), background-color 0.25s;
}
.site-header.is-scrolled {
  box-shadow: 0 1px 0 var(--border), 0 10px 30px -22px rgba(15, 23, 42, 0.35);
}
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--grad-brand);
  border-radius: 2px;
  z-index: 2;
  transition: width 0.1s linear;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  border-radius: var(--r-sm);
}
.brand-mark {
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 10px rgba(99, 102, 241, 0.28));
  transition: transform 0.25s var(--ease);
}
.brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.04);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-text strong {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand-sub {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  color: var(--text-3);
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.nav-link:hover {
  background: var(--surface-3);
  color: var(--text);
}
.nav-chevron {
  transition: transform 0.22s var(--ease);
  color: var(--text-3);
}
.nav-mega-trigger[aria-expanded="true"] {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-soft-2);
}
.nav-mega-trigger[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
  color: currentColor;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 8px 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 13px;
  transition: border-color 0.18s, background-color 0.18s, color 0.18s;
}
.header-search:hover {
  border-color: var(--primary-soft-2);
  background: var(--surface);
  color: var(--text-2);
}
.header-search .kbd {
  margin-left: 4px;
}
.theme-toggle {
  border-color: var(--border);
}
.menu-toggle {
  display: none;
}
.header-cta {
  height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
}

/* ---- 全部导航面板 ---- */
.mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 99;
}
.mega-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.mega-inner {
  padding-top: 22px;
  padding-bottom: 18px;
}
.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 28px;
}
.mega-cat {
  padding: 10px 10px 11px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background-color 0.18s, border-color 0.18s;
}
.mega-cat:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.mega-cat__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.mega-cat__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--cat-color) 14%, transparent);
  color: var(--cat-color);
  flex: none;
}
.mega-cat__name {
  font-size: 13.5px;
  font-weight: 700;
}
.mega-cat__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
}
.mega-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding-left: 34px;
}
.mega-sub {
  font-size: 12px;
  color: var(--text-3);
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s;
}
.mega-sub:hover {
  color: var(--primary);
}
.mega-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.mega-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-3);
}
.mega-note b {
  color: var(--text-2);
  font-family: var(--font-mono);
}
.mega-note__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent);
}
.mega-links {
  display: flex;
  gap: 8px;
}

/* ============================================================
   2. Hero
   ============================================================ */
.hero {
  position: relative;
  padding: 62px 0 46px;
  background-image: var(--grad-hero);
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  font-size: 12.5px;
  animation: float-in 0.7s var(--ease) both;
}
.hero-eyebrow b {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
.hero-title {
  margin: 20px 0 14px;
  max-width: 900px;
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.035em;
  animation: float-in 0.7s var(--ease) 0.05s both;
}
.hero-title .text-gradient {
  white-space: nowrap;
}
.hero-sub {
  max-width: 620px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.7;
  animation: float-in 0.7s var(--ease) 0.1s both;
}

/* ---- 搜索 ---- */
.hero-search {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin-top: 30px;
  animation: float-in 0.7s var(--ease) 0.15s both;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 62px;
  padding: 0 8px 0 8px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow-lg);
}
.engine-select {
  position: relative;
  flex: none;
}
.engine-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 0.18s;
}
.engine-btn:hover {
  background: var(--surface-3);
}
.engine-btn .icon {
  color: var(--text-3);
}
.engine-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.engine-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: 168px;
  padding: 6px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: float-in 0.16s var(--ease);
}
.engine-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  transition: background-color 0.15s, color 0.15s;
}
.engine-option:hover {
  background: var(--surface-2);
  color: var(--text);
}
.engine-option.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.engine-option .icon {
  margin-left: auto;
}
.engine-option__hint {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.search-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex: none;
}
.search-icon {
  color: var(--text-3);
  margin-left: 6px;
  flex: none;
}
.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15.5px;
  color: var(--text);
}
.search-input::placeholder {
  color: var(--text-3);
}
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-kbd {
  flex: none;
  margin-right: 2px;
}
.search-submit {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 13px;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
  transition: transform 0.18s var(--ease), filter 0.18s;
}
.search-submit:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.06);
}
.search-submit:active {
  transform: scale(0.97);
}

/* 搜索联想面板 */
.search-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 70;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: left;
  animation: float-in 0.18s var(--ease);
}
.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
  font-size: 11.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.sp-head b {
  color: var(--text-2);
}
.sp-list {
  max-height: 348px;
  overflow-y: auto;
  padding: 0 6px 8px;
}
.sp-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background-color 0.14s;
  cursor: pointer;
}
.sp-item:hover,
.sp-item.is-active {
  background: var(--primary-soft);
}
.sp-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background-color: var(--c, var(--primary));
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 55%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), var(--shadow-xs);
}
.sp-main {
  flex: 1;
  min-width: 0;
}
.sp-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.sp-cat {
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
}
.sp-desc {
  margin-top: 1px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-item mark {
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}
.sp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-3);
}
.sp-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
  font-weight: 600;
  font-size: 12.5px;
}
.sp-action:hover {
  text-decoration: underline;
}
.sp-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.sp-empty b {
  color: var(--text-2);
}

/* ---- 热门搜索 / 统计 ---- */
.hot-search {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  animation: float-in 0.7s var(--ease) 0.2s both;
}
.hot-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--text-3);
  text-transform: uppercase;
}
.hot-terms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.hot-term {
  padding: 4px 9px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 12.5px;
  transition: all 0.18s var(--ease);
}
.hot-term:hover {
  color: var(--primary);
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-1px);
}

.hero-stats {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-top: 42px;
  animation: float-in 0.7s var(--ease) 0.25s both;
}
.hero-stat {
  min-width: 132px;
  padding: 0 30px;
  border-left: 1px solid var(--border);
  text-align: center;
}
.hero-stat:first-child {
  border-left: 0;
}
.hero-stat__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.hero-stat__label {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
}

/* ============================================================
   3. 主体布局
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) 292px;
  align-items: start;
  gap: 24px;
  padding: 30px 0 70px;
}

/* ---- 左侧栏 ---- */
.sidebar-inner {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 2px;
  scrollbar-width: none;
}
.sidebar-inner::-webkit-scrollbar {
  display: none;
}
.side-card {
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.side-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.side-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-2);
}
.side-title__icon {
  color: var(--primary);
}
.side-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}
.side-hint {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.side-link {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
  transition: color 0.15s;
}
.side-link:hover {
  color: var(--primary);
}

/* 收藏 */
.fav-list,
.recent-list,
.custom-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.fav-row,
.recent-row,
.custom-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px;
  margin: 0 -6px;
  border-radius: var(--r-xs);
  transition: background-color 0.15s;
}
.fav-row:hover,
.recent-row:hover,
.custom-row:hover {
  background: var(--surface-2);
}
.mini-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: none;
  border-radius: 7px;
  background-color: var(--c, var(--primary));
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 55%);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.fav-main-link {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  border-radius: 6px;
}
.fav-main,
.recent-main,
.custom-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.fav-name,
.recent-name,
.custom-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fav-host,
.recent-host,
.custom-host {
  font-size: 10.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fav-del,
.custom-del {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 6px;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.15s, background-color 0.15s, color 0.15s;
}
.fav-row:hover .fav-del,
.custom-row:hover .custom-del,
.fav-del:focus-visible,
.custom-del:focus-visible {
  opacity: 1;
}
.fav-del:hover,
.custom-del:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.side-empty {
  padding: 6px 2px 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
}

/* 快捷入口手风琴 */
.quick-groups {
  margin: 0 -4px;
}
.qg {
  border-top: 1px solid var(--border);
}
.qg:first-child {
  border-top: 0;
}
.qg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 4px;
  border-radius: var(--r-xs);
  color: var(--text-2);
  text-align: left;
  transition: color 0.15s;
}
.qg-head:hover {
  color: var(--text);
}
.qg-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--qg-color) 14%, transparent);
  color: var(--qg-color);
  flex: none;
}
.qg-name {
  font-size: 12.5px;
  font-weight: 600;
  flex: 1;
}
.qg-arrow {
  color: var(--text-3);
  transition: transform 0.22s var(--ease);
}
.qg.is-open .qg-arrow {
  transform: rotate(180deg);
}
.qg-panel {
  display: none;
  padding: 0 0 8px 30px;
}
.qg.is-open .qg-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
}
.qg-link {
  display: block;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.qg-link:hover {
  background: var(--surface-2);
  color: var(--primary);
}

/* ---- 中间内容 ---- */
.content {
  min-width: 0;
}

/* 分类吸顶条 */
.catbar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  margin: 0 -6px 14px;
  padding: 8px 6px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.catbar-inner {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.catbar-inner::-webkit-scrollbar {
  display: none;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
  transition: all 0.18s var(--ease);
}
.cat-chip:hover {
  background: var(--surface);
  color: var(--text);
}
.cat-chip__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat-color, var(--text-3));
  flex: none;
  transition: transform 0.18s;
}
.cat-chip__count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.cat-chip.is-active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}
.cat-chip.is-active .cat-chip__count {
  color: var(--primary);
}
.cat-chip--all {
  border-color: var(--border);
  background: var(--surface-2);
}

/* 分类区块 */
.cat-section {
  padding: 8px 0 30px;
  scroll-margin-top: calc(var(--header-h) + 64px);
}
.cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.cat-head__main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.cat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  background: color-mix(in srgb, var(--cat-color) 13%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cat-color) 22%, transparent);
  color: var(--cat-color);
}
.cat-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cat-en {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  color: var(--text-3);
  text-transform: uppercase;
}
.cat-desc {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.cat-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}
.cat-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.cat-more:hover {
  color: var(--primary);
  border-color: var(--primary-soft-2);
  background: var(--primary-soft);
}
.cat-more .icon {
  transition: transform 0.22s var(--ease);
}
.cat-more.is-open .icon {
  transform: rotate(180deg);
}

/* 站点卡片 */
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 10px;
}
.site-card {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s,
    background-color 0.2s;
}
.site-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--card-color, var(--primary)) 35%, var(--border));
  box-shadow: var(--shadow-md);
}
.site-card.is-flash {
  animation: card-flash 1.6s var(--ease);
}
@keyframes card-flash {
  0%,
  100% {
    box-shadow: var(--shadow-xs);
  }
  30% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--card-color, var(--primary)) 28%, transparent),
      var(--shadow-md);
  }
}
.site-card__main {
  display: flex;
  gap: 11px;
  padding: 13px 13px 12px;
  border-radius: var(--r-md);
}
.site-card__main:focus-visible {
  outline-offset: 1px;
}
.site-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  background-color: var(--c, var(--primary));
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 4px 10px -4px rgba(15, 23, 42, 0.35);
  transition: transform 0.2s var(--ease);
}
.site-card:hover .site-icon {
  transform: scale(1.06) rotate(-2deg);
}
.site-card__body {
  flex: 1;
  min-width: 0;
  padding-right: 18px;
}
.site-card__title {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.site-card__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-card__desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 3px 0 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
  min-height: 37px;
}
.site-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.site-card__tags .tag {
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10px;
  background: var(--surface-2);
}
.site-card .badge {
  height: 18px;
  padding: 0 5px;
  font-size: 9.5px;
  border-radius: 5px;
  flex: none;
}
.fav-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--text-3);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s, transform 0.16s, background-color 0.16s, color 0.16s;
}
.site-card:hover .fav-btn,
.fav-btn:focus-visible,
.fav-btn.is-active {
  opacity: 1;
  transform: none;
}
.fav-btn:hover {
  background: var(--surface-2);
  color: var(--warn);
}
.fav-btn.is-active {
  color: var(--warn);
}

/* 搜索结果 */
.search-results {
  padding: 6px 0 40px;
}
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.results-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.results-title mark {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0 7px;
  border-radius: 7px;
  font-weight: 800;
}
.results-sub {
  font-size: 12.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.results-empty {
  padding: 66px 20px;
  text-align: center;
  border-radius: var(--r-lg);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
}
.results-empty__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.results-empty h3 {
  font-size: 16px;
  margin-bottom: 6px;
}
.results-empty p {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 18px;
}
.results-suggest {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

/* ============================================================
   4. 右侧栏
   ============================================================ */
.rightbar-inner {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  scrollbar-width: none;
}
.rightbar-inner::-webkit-scrollbar {
  display: none;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
}
.card-head__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex: none;
}
.card-head__icon--notice {
  background: var(--warn-soft);
  color: var(--warn);
}
.card-head__icon--rank {
  background: linear-gradient(135deg, var(--danger-soft), var(--warn-soft));
  color: var(--danger);
}
.card-head__title {
  font-size: 13.5px;
  font-weight: 700;
}
.rank-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* 公告 */
.notice-card,
.rank-card {
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.notice-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notice-item {
  display: block;
  padding: 8px 7px;
  margin: 0 -7px;
  border-radius: var(--r-xs);
  transition: background-color 0.15s;
}
.notice-item:hover {
  background: var(--surface-2);
}
.notice-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}
.notice-tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9.5px;
  font-weight: 700;
}
.notice-date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
}
.notice-text {
  display: block;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
}
.notice-item:hover .notice-text {
  color: var(--text);
}
.notice-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--text-3);
}
.notice-foot:hover {
  color: var(--primary);
}

/* 榜单 */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px;
  margin: 0 -7px;
  border-radius: var(--r-xs);
  transition: background-color 0.15s;
}
.rank-row:hover {
  background: var(--surface-2);
}
.rank-no {
  width: 16px;
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
}
.rank-row.is-top .rank-no {
  color: var(--primary);
}
.rank-row:nth-child(1) .rank-no {
  color: #f59e0b;
}
.rank-row:nth-child(2) .rank-no {
  color: #94a3b8;
}
.rank-row:nth-child(3) .rank-no {
  color: #d97706;
}
.rank-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.rank-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-cat {
  font-size: 10px;
  color: var(--text-3);
}
.rank-heat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: none;
}
.rank-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.rank-value .icon {
  color: var(--success);
}
.rank-value.is-down .icon {
  color: var(--danger);
}
.rank-bar {
  display: block;
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}
.rank-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* CTA */
.cta-card {
  position: relative;
  overflow: hidden;
  padding: 18px 16px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--primary-soft-2);
  background: linear-gradient(155deg, var(--primary-soft), var(--surface) 62%);
  text-align: center;
}
.cta-glow {
  position: absolute;
  top: -70px;
  right: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 26%, transparent), transparent 68%);
  pointer-events: none;
}
.cta-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.cta-title {
  font-size: 14px;
  font-weight: 700;
}
.cta-text {
  margin: 6px 0 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.cta-card .btn {
  height: 36px;
  font-size: 13px;
  position: relative;
}
.cta-random {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  border-radius: var(--r-xs);
  color: var(--text-3);
  font-size: 11.5px;
  transition: color 0.15s, background-color 0.15s;
}
.cta-random:hover {
  color: var(--primary);
  background: var(--surface-2);
}

/* ============================================================
   5. 页脚
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding-top: 46px;
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) 2fr;
  gap: 48px;
  padding-bottom: 40px;
}
.brand--footer {
  margin-bottom: 14px;
}
.footer-desc {
  max-width: 330px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-3);
}
.footer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 16px;
}
.footer-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.footer-stats b {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.footer-stats span {
  font-size: 10.5px;
  color: var(--text-3);
}
.footer-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.footer-group__title {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  font-size: 12.5px;
  color: var(--text-2);
  width: fit-content;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 22px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-3);
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-top-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  font-size: 11.5px;
}
.footer-top-link:hover {
  color: var(--primary);
}

/* 回到顶部 */
.backtop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.24s var(--ease);
}
.backtop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.backtop:hover {
  color: var(--primary);
  border-color: var(--primary-soft-2);
  transform: translateY(-2px);
}

/* ============================================================
   6. 移动端抽屉
   ============================================================ */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 160;
  visibility: hidden;
}
.drawer.is-open {
  visibility: visible;
}
.drawer-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.24s;
}
.drawer.is-open .drawer-overlay {
  opacity: 1;
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(88vw, 390px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
}
.drawer.is-open .drawer-panel {
  transform: none;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 20px;
}
.drawer-group {
  margin-bottom: 20px;
}
.drawer-group__title {
  margin-bottom: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.drawer-cats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  margin: 0 -8px;
  border-radius: var(--r-sm);
  transition: background-color 0.15s;
}
.drawer-cat:hover {
  background: var(--surface-2);
}
.drawer-cat__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: color-mix(in srgb, var(--cat-color) 14%, transparent);
  color: var(--cat-color);
}
.drawer-cat__name {
  font-size: 13.5px;
  font-weight: 600;
}
.drawer-cat__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
}
.drawer-cat__subs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex: none;
}
body.is-locked {
  overflow: hidden;
}

/* ============================================================
   7. 弹窗 / 表单
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: grid;
  place-items: center;
  padding: 20px;
  visibility: hidden;
}
.modal.is-open {
  visibility: visible;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.24s;
}
.modal.is-open .modal-overlay {
  opacity: 1;
}
.modal-dialog {
  position: relative;
  width: min(100%, 440px);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.26s var(--ease), opacity 0.26s;
}
.modal.is-open .modal-dialog {
  transform: none;
  opacity: 1;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.field-input {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
}
.field-input::placeholder {
  color: var(--text-3);
}
.field-input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.modal-hint {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-3);
}
.modal-error {
  min-height: 16px;
  font-size: 11.5px;
  color: var(--danger);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

/* ============================================================
   8. 响应式
   ============================================================ */
@media (max-width: 1380px) {
  .layout {
    grid-template-columns: 216px minmax(0, 1fr) 280px;
    gap: 20px;
  }
  .site-grid {
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  }
}
@media (max-width: 1280px) {
  .main-nav .nav-link:not(.nav-mega-trigger) {
    display: none;
  }
  .layout {
    grid-template-columns: 224px minmax(0, 1fr);
  }
  .rightbar {
    grid-column: 1 / -1;
  }
  .rightbar-inner {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}
@media (max-width: 1100px) {
  .main-nav {
    display: none;
  }
  .menu-toggle {
    display: grid;
  }
  .header-search span {
    display: none;
  }
  .header-search .kbd {
    display: none;
  }
  .header-search {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
}
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 20px;
  }
  .sidebar {
    display: none;
  }
  .catbar {
    margin-inline: 0;
    padding-inline: 0;
  }
  .mega-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero {
    padding: 44px 0 36px;
  }
}
@media (max-width: 860px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
  .mega-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mega-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
@media (max-width: 760px) {
  .header-cta,
  .header-search {
    display: none;
  }
  .header-inner {
    gap: 10px;
  }
  .brand-sub {
    display: none;
  }
  .hero-title {
    font-size: 27px;
  }
  .hero-title .br-desktop {
    display: none;
  }
  .hero-sub {
    font-size: 13.5px;
  }
  .search-box {
    height: 56px;
    border-radius: var(--r-md);
  }
  .search-submit {
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }
  .search-kbd {
    display: none;
  }
  .search-input {
    font-size: 16px;
  }
  .engine-btn {
    padding: 0 7px;
    font-size: 12.5px;
  }
  .engine-btn .engine-dot {
    display: none;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 0;
    width: 100%;
    max-width: 340px;
    margin-top: 30px;
  }
  .hero-stat {
    min-width: 0;
    padding: 0 12px;
  }
  .hero-stat:nth-child(3) {
    border-left: 0;
  }
  .hero-stat__value {
    font-size: 19px;
  }
  .cat-head {
    align-items: flex-start;
  }
  .cat-en {
    display: none;
  }
  .cat-desc {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .cat-more .cat-more__text {
    display: none;
  }
  .cat-more {
    width: 30px;
    padding: 0;
    justify-content: center;
  }
  .rightbar-inner {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .backtop {
    right: 16px;
    bottom: 16px;
  }
}
@media (max-width: 520px) {
  .hero-eyebrow {
    font-size: 11.5px;
  }
  .hero {
    padding: 34px 0 30px;
  }
  .hero-search {
    margin-top: 22px;
  }
  .hot-search {
    display: none;
  }
  .site-grid {
    grid-template-columns: 1fr;
  }
  .site-card__desc {
    -webkit-line-clamp: 2;
    min-height: 0;
  }
  .mega-panel {
    display: none;
  }
  .hero-stats {
    margin-top: 24px;
  }
  .backtop {
    width: 38px;
    height: 38px;
  }
}
