/* ============================================================
   OneNav Theme — 核心样式
   一款简洁、现代的导航站主题
   ============================================================ */

/* === CSS Variables === */
:root {
  --primary: #5961f9;
  --primary-dark: #4850e0;
  --primary-light: #7b82ff;
  --primary-gradient: linear-gradient(135deg, #5961f9, #7b82ff);
  --primary-gradient-soft: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --bg-body: #f0f2f5;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f5f6fa;
  --bg-search: #f0f2f5;
  --bg-badge: #eef0ff;

  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #8e8ea0;
  --text-category: #3a3a5a;
  --text-badge: #5961f9;

  --border-color: #e8eaef;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.05);

  --sidebar-width: 240px;
  --sidebar-collapsed: 0px;
  --header-height: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Dark Mode === */
[data-theme='dark'] {
  --bg-body: #101014;
  --bg-sidebar: #18181d;
  --bg-card: #1e1e26;
  --bg-hover: #282833;
  --bg-search: #282833;
  --bg-badge: rgba(89, 97, 249, 0.15);

  --text-primary: #e4e4ec;
  --text-secondary: #9898b4;
  --text-muted: #6b6b82;
  --text-category: #c4c4d4;
  --text-badge: #8e95ff;

  --border-color: #2a2a35;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* === Reset & Base === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-slow), background var(--transition);
  box-shadow: var(--shadow-sm);
}

.sidebar-logo {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo .logo-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-badge);
  color: var(--text-badge);
  font-weight: 600;
  margin-left: auto;
}


.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

.sidebar-menu-inner {
  padding: 0 8px;
}

/* Menu Item */
.sidebar-item {
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.sidebar-item > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.sidebar-item > a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item > a .icon-fw {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-item > a:hover .icon-fw {
  color: var(--primary);
}

.sidebar-item.active > a {
  background: var(--bg-badge);
  color: var(--primary);
  font-weight: 600;
}

.sidebar-item.active > a .icon-fw {
  color: var(--primary);
}

/* 子菜单 */
.sidebar-item .sub-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
  padding-left: 32px;
}

.sidebar-item.expanded .sub-menu {
  max-height: 800px;
}

.sidebar-item .sub-menu li a {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all var(--transition);
}

.sidebar-item .sub-menu li a:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.sidebar-item .sub-menu li a .sub-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
  transition: background var(--transition);
}

.sidebar-item .sub-menu li a:hover .sub-dot {
  background: var(--primary);
}

.sidebar-item .sub-menu li.active a {
  color: var(--primary);
  font-weight: 500;
}

.sidebar-item .sub-menu li.active .sub-dot {
  background: var(--primary);
  width: 6px;
  height: 6px;
}

/* 展开箭头 */
.sidebar-item.has-children > a::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'FontAwesome';
  font-weight: 900;
  margin-left: auto;
  transition: transform var(--transition);
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-item.has-children.expanded > a::after {
  transform: rotate(-180deg);
}

/* === Sidebar Overlay (mobile) === */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   HEADER (Mobile top bar)
   ============================================================ */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  z-index: 900;
  display: none;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition);
}

.top-header .hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 18px;
  transition: background var(--transition);
}

.top-header .hamburger:hover {
  background: var(--border-color);
}

.top-header .header-title {
  font-size: 16px;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin var(--transition-slow);
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px 60px;
}

/* ============================================================
   TOP BAR (Search + Theme toggle)
   ============================================================ */
/* ============================================================
   HERO SEARCH — 居中大搜索
   ============================================================ */
.hero-search {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 32px;
  text-align: center;
}

.hero-inner {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(89, 97, 249, 0.25);
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.hero-search-box {
  flex: none !important;
  width: 100%;
  max-width: 540px !important;
}

.hero-search-box input {
  height: 52px !important;
  font-size: 16px !important;
  padding: 0 20px 0 48px !important;
  border-radius: 14px !important;
  border-color: var(--border-color) !important;
  box-shadow: var(--shadow-md) !important;
  background: var(--bg-card) !important;
}

.hero-search-box input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(89, 97, 249, 0.12), var(--shadow-md) !important;
}

.hero-search-box .search-icon {
  left: 18px !important;
  font-size: 18px !important;
}

.hero-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hero-tools .theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* 继承的 search-box 基础样式 */
.search-box {
  flex: 1;
  position: relative;
  max-width: 520px;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 40px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--bg-search);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}

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

.search-box input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(89, 97, 249, 0.1);
}

.search-box .search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: none;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--transition);
}

.search-box .search-clear:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.search-box input:not(:placeholder-shown) ~ .search-clear {
  display: block;
}

/* Theme toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-search);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  transition: all var(--transition);
}

.theme-toggle:hover,
.theme-toggle-mobile:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

/* ============================================================
   TABS
   ============================================================ */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg-search);
  border-radius: var(--radius-md);
  width: fit-content;
}

.tab-nav button {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.tab-nav button:hover {
  color: var(--text-primary);
}

.tab-nav button.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 8px;
}

.section-header .section-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-header .section-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-search);
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: auto;
}

/* Child category name */
.subcategory-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-category);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.subcategory-label::before {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

/* ============================================================
   CARD GRID
   ============================================================ */
.url-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.url-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.url-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.url-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.url-card:hover::before {
  opacity: 1;
}

.url-card .card-img {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.url-card:hover .card-img {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(89, 97, 249, 0.2);
}

.url-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

/* 渐变图标占位符 */
.url-card .card-img .img-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.url-card .card-img .img-placeholder.show {
  display: flex;
}

.url-list-item .list-img .img-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  border-radius: 6px;
}

.url-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.url-card .card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

/* ============================================================
   LIST VIEW
   ============================================================ */
.url-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.url-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
}

.url-list-item:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.url-list-item .list-img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.url-list-item:hover .list-img {
  transform: scale(1.1);
}

.url-list-item .list-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.url-list-item .list-info {
  flex: 1;
  min-width: 0;
}

.url-list-item .list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.url-list-item .list-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.url-list-item .list-cat {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-search);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ============================================================
   VIEW SWITCH
   ============================================================ */
.view-switch {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.view-switch button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}

.view-switch button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.view-switch button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-results-header {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.search-results-header.show {
  display: flex;
}

.search-results-header .keyword {
  font-weight: 600;
  color: var(--primary);
}

.search-results-header .count {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: auto;
}

.search-results-header .clear-search {
  border: none;
  background: var(--bg-hover);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}

.search-results-header .clear-search:hover {
  background: var(--border-color);
}

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

.no-results .no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ============================================================
   BANNER / ADS
   ============================================================ */
.banner-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

/* ======= 卡片模式（无图片） ======= */
.banner-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
  position: relative;
}

.banner-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.banner-item a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  text-decoration: none;
  position: relative;
}

.banner-item .banner-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.banner-item .banner-text {
  flex: 1;
  min-width: 0;
}

.banner-item .banner-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.banner-item .banner-text p {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ======= 图片模式 ======= */
.banner-item.banner-has-img {
  border: none;
  background: transparent;
}

.banner-item.banner-has-img a {
  display: block;
  padding: 0;
}

.banner-img-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.banner-img-wrap img.banner-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* 图片加载失败时的后备 */
.banner-icon-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 20px;
  color: #fff;
  text-align: center;
  min-height: 100px;
  border-radius: var(--radius-md);
}

.banner-icon-fallback i {
  font-size: 28px;
  margin-bottom: 4px;
}

.banner-icon-fallback h4 {
  font-size: 16px;
  font-weight: 600;
}

.banner-icon-fallback p {
  font-size: 12px;
  opacity: 0.8;
}

/* 图片底部文字叠加层 */
.banner-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55) 60%, rgba(0,0,0,0.7));
}

.banner-overlay .banner-overlay-text {
  flex: 1;
  min-width: 0;
}

.banner-overlay .banner-overlay-text h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.banner-overlay .banner-overlay-text p {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-overlay .banner-tag {
  flex-shrink: 0;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-weight: 600;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* ======= 通用标签（图标模式） ======= */
.banner-item .banner-tag {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-badge);
  color: var(--text-badge);
  font-weight: 500;
}

/* ============================================================
   FOOTER
   ============================================================ */
.main-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copyright {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-copyright a {
  color: var(--text-secondary);
}

.footer-copyright a:hover {
  color: var(--primary);
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-size: 16px;
  transition: all var(--transition);
}

.footer-social a:hover {
  background: var(--primary);
  color: #fff;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  box-shadow: var(--shadow-md);
  z-index: 800;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all var(--transition);
}

#back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet & below */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .top-header {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0;
    padding-top: var(--header-height);
  }

  .main-content {
    padding: 16px;
  }

  .url-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .banner-row {
    grid-template-columns: 1fr;
  }

  .banner-overlay {
    padding: 12px 10px 8px;
  }

  .banner-overlay .banner-overlay-text h4 {
    font-size: 13px;
  }

  .banner-overlay .banner-overlay-text p {
    font-size: 11px;
  }

  .hero-search {
    padding: 16px 12px 20px;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-logo {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .hero-search-box input {
    height: 46px !important;
    font-size: 15px !important;
  }

  .hero-subtitle {
    font-size: 13px;
  }


  #back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .url-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .url-card {
    padding: 12px 8px;
  }

  .url-card .card-img {
    width: 40px;
    height: 40px;
  }

  .url-card .card-title {
    font-size: 13px;
  }

  .tab-nav {
    width: 100%;
    overflow-x: auto;
  }

  .tab-nav button {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .section-header h2 {
    font-size: 16px;
  }

  .banner-item a {
    padding: 12px 14px;
  }

  .footer-links {
    gap: 6px 12px;
    font-size: 12px;
  }
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--text-muted);
}

.mb-2 {
  margin-bottom: 8px;
}
.mb-3 {
  margin-bottom: 12px;
}
.mb-4 {
  margin-bottom: 16px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-4 {
  margin-top: 16px;
}
