/* ==========================================
   全新国潮极客审美 - 黛紫顶部导航扁平布局设计系统
   ========================================== */

@import url('https://fonts.loli.net/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* 配色方案 (60% 比例的白/淡灰底色与背景板) */
  --bg-base: #ffffff;
  --bg-gradient: linear-gradient(135deg, #ffffff 0%, #f3f4f6 61.8%, #ffffff 100%);
  --bg-panel: #f9fafb;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.8);
  
  /* 信息展示 (30% 比例的深黑/深灰文字，在白底上确保极佳的易读性) */
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-inverse: #ffffff;
  
  /* 黄金焦点 (10% 比例的深海皇家蓝高亮渐变) */
  --accent-1: #2563eb;
  --accent-2: #1d4ed8;
  --accent-blue: #3b82f6;
  --accent-gradient: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  --accent-glow: 0 8px 24px -8px rgba(37, 99, 235, 0.25);
  
  --border-glass: rgba(59, 130, 246, 0.12);
  --border-focus: rgba(37, 99, 235, 0.5);
  --border-card-hover: rgba(37, 99, 235, 0.3);
  
  /* 亮色阴影微调 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 20px -6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px -12px rgba(37, 99, 235, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-round: 50%;
  
  --font-sans: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-base);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-smooth);
}

/* 布局外层容器 */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
}

/* 1. 顶部粘性导航栏 */
.tab-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.logo-text {
  font-family: 'Outfit', -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #0f172a 0%, #2563eb 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.15));
}

.nav-menu {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-item {
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 15.5px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(37, 99, 235, 0.06);
}

.nav-item.active {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-weight: 600;
  box-shadow: var(--accent-glow);
}

/* 移动端返回首页按钮 */
.mobile-menu-btn {
  display: none;
  font-size: 20px;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.mobile-menu-btn:hover {
  color: var(--accent-1);
}

/* 2. 主页面区 (内容整体居中布局) */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 24px 60px 24px;
  display: flex;
  flex-direction: column;
}

/* 公告板 */
.bulletin-box {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
}

.bulletin-icon {
  color: var(--accent-2);
}

.bulletin-carousel {
  flex: 1;
  height: 20px;
  overflow: hidden;
  position: relative;
}

.bulletin-track {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  width: 100%;
}

.bulletin-item {
  height: 20px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bulletin-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

/* 品牌 Hero Banner & 极简居中搜索框 */
.brand-hero-section {
  text-align: center;
  margin: 40px 0 28px 0;
  position: relative;
}

.brand-hero-title {
  font-size: 38px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.brand-hero-subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
}

.search-container {
  max-width: 640px;
  margin: 0 auto 48px auto;
  width: 100%;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 40px;
  padding: 6px 8px 6px 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.search-wrapper:focus-within {
  border-color: var(--border-card-hover);
  box-shadow: var(--accent-glow);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  padding: 8px 0;
}

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

.search-btn {
  background: var(--accent-gradient);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* 分类与高密度卡片网格 */
.category-section {
  margin-bottom: 40px;
  scroll-margin-top: 80px; /* 适配 sticky 导航高度 */
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.category-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-subtags {
  display: flex;
  gap: 6px;
}

.subtag-btn {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.subtag-btn:hover, .subtag-btn.active {
  color: var(--text-main);
  border-color: var(--accent-1);
  background: rgba(37, 99, 235, 0.06);
}

/* 网址卡网格 (采用自适应自动填充网格，保证 PC 端卡片宽度下限不被压扁) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
}

/* 网址卡片 (采用精致高密度的头部横向、说明纵向的混合排版) */
.url-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: var(--transition-smooth);
  backdrop-filter: blur(8px);
}

.url-card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  opacity: 0;
  transition: var(--transition-smooth);
}

.url-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-lg);
}

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

/* 新增：头部 Logo 与标题横排容器 */
.card-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
}

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

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.3;
}

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

.card-tags-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.url-card-tag {
  font-size: 9.5px;
  background: rgba(37, 99, 235, 0.05);
  color: #2563eb;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

/* 详情页面 */
.breadcrumb-nav {
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumb-nav a:hover {
  color: var(--accent-2);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  font-size: 13.5px;
  color: var(--accent-1);
  margin-bottom: 20px;
  font-weight: 500;
}

.back-btn:hover {
  color: var(--accent-2);
}

.site-detail-header {
  display: flex;
  gap: 24px;
  align-items: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 24px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
}

.site-large-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.site-detail-meta h1 {
  font-size: 22px;
  margin-bottom: 6px;
}

.site-title-desc {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.site-meta-info-line {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.tag-badge {
  font-size: 11px;
  background: rgba(37, 99, 235, 0.05);
  color: var(--accent-1);
  padding: 3px 10px;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.site-detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.site-main-col, .site-side-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.visit-actions-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
}

.visit-btns-row {
  display: flex;
  gap: 8px;
}

.btn-visit {
  background: var(--accent-gradient);
  color: var(--text-main);
  font-weight: 600;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  font-size: 14px;
}

.btn-visit:hover {
  transform: translateY(-1px);
  box-shadow: var(--accent-glow);
}

.btn-primary {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--accent-1);
}

.site-info-card, .faq-card, .security-panel, .speed-panel, .hot-recommend-card, .feedback-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 24px;
  backdrop-filter: blur(12px);
}

.section-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--accent-2);
  padding-left: 10px;
}

.article-content-body {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* 测速线路与安全检测 */
.security-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.security-item {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.security-item-icon {
  font-size: 18px;
}

.security-item-title {
  font-weight: 600;
  color: var(--text-main);
}

.security-item-desc {
  color: var(--text-muted);
  font-size: 12px;
}

.speed-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.speed-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.speed-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.speed-value {
  font-family: var(--font-mono);
  color: var(--accent-blue);
  font-weight: 600;
}

.speed-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.speed-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.speed-bar {
  height: 100%;
  background: var(--accent-blue);
  width: 0;
  transition: width 0.6s ease-in-out;
}

.ping-status {
  font-size: 11px;
  font-weight: bold;
}

.status-loading { color: var(--text-muted); }
.status-fast { color: #10b981; }
.status-normal { color: #f59e0b; }
.status-slow { color: #ef4444; }

/* 底部声明与友情链接 */
.friend-links-section {
  margin-top: 48px;
  padding: 24px;
  border-top: 1px solid var(--border-glass);
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

/* 浮动操作按钮 */
.float-actions-group {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.float-action-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-round);
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.float-action-btn:hover {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  transform: scale(1.05);
  box-shadow: var(--accent-glow);
}

/* 响应式样式 */
@media (max-width: 992px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-menu {
    display: none;
  }
  
  .site-detail-layout {
    grid-template-columns: 1fr;
  }
}

/* 新增：小屏幕移动端全站间距与排版优化 */
@media (max-width: 640px) {
  .main-content {
    padding: 16px 12px 40px 12px;
  }
  
  .brand-hero-section {
    margin: 24px 0 16px 0;
  }
  
  .search-container {
    margin-bottom: 24px;
  }
  
  .category-section {
    margin-bottom: 24px;
    scroll-margin-top: 60px;
  }
  
  .site-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 16px;
  }
  
  .site-detail-meta {
    width: 100%;
  }
  
  .site-detail-meta h1 {
    font-size: 20px;
    margin-bottom: 8px;
  }
  
  .site-meta-info-line {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  
  .site-detail-layout {
    gap: 16px;
  }
  
  .visit-actions-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 14px;
  }
  
  .visit-btns-row {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  
  .visit-btns-row .btn-primary,
  .visit-btns-row .btn-visit {
    flex: 1;
    padding: 10px 6px;
    font-size: 13px;
    text-align: center;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    height: 38px;
  }

  /* 移动端分类头与小标签筛选排列优化 */
  .category-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 12px;
  }
  .category-header .category-title {
    display: none;
  }
  .category-subtags {
    width: 100%;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  .category-subtags::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
  }
  .subtag-btn {
    flex-shrink: 0;
    font-weight: 600;
  }
}
