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

:root {
  --bg: #0a0c14;
  --bg2: #0f1220;
  --card: #141828;
  --card-hover: #1a2035;
  --border: rgba(255,255,255,0.07);
  --accent: #6c63ff;
  --accent2: #00d4aa;
  --accent3: #ff6b6b;
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --sidebar-w: 200px;
  --sidebar-w-sm: 60px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

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

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 100;
  background: rgba(10,12,20,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: left 0.3s ease;
}
body.sidebar-collapsed .navbar { left: var(--sidebar-w-sm); }
.nav-inner {
  display: flex; align-items: center; gap: 32px;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.25rem; font-weight: 700;
  white-space: nowrap;
}
.logo-icon { font-size: 1.4rem; }
.accent { color: var(--accent); }
.nav-links {
  display: flex; gap: 28px; margin-left: auto;
}
.nav-links a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); }

/* ── 导航下拉 ── */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
  cursor: pointer; white-space: nowrap; transition: color 0.2s;
}
.nav-dropdown:hover .nav-dropdown-toggle { color: var(--text); }
.dropdown-arrow { font-size: 0.65rem; transition: transform 0.2s; }
.nav-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; min-width: 148px; padding: 6px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 9px 16px;
  font-size: 0.875rem; color: var(--text-muted); white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.nav-dropdown-menu a:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* ── 资讯卡片"深度阅读"按钮 ── */
.news-related-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: var(--accent);
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.35);
  border-radius: 4px; padding: 3px 8px; margin-top: 10px;
  cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.news-related-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── AI科普文章区块 ── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.article-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  cursor: pointer; transition: border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.article-card-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(99,102,241,0.12); color: var(--accent);
}
.article-card-tag.tag-tutorial { background: rgba(16,185,129,0.12); color: #10b981; }
.article-card-tag.tag-deep    { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.article-card-tag.tag-popular { background: rgba(251,146,60,0.12);  color: #fb923c; }
.article-card-title {
  font-size: 0.95rem; font-weight: 600; color: var(--text);
  line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.article-card-desc {
  font-size: 0.8rem; color: var(--text-muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.article-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-muted); margin-top: 4px;
}
.hamburger {
  display: none; background: none; border: none;
  color: var(--text); font-size: 1.4rem; cursor: pointer;
  margin-left: auto;
}
.mobile-menu {
  display: none; flex-direction: column;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 12px 24px;
}
.mobile-menu a { padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.mobile-menu.open { display: flex; }

/* ===== HERO ===== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center;
  overflow: hidden; padding-top: 64px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(108,99,255,0.18) 0%, transparent 70%),
              radial-gradient(ellipse 50% 50% at 80% 70%, rgba(0,212,170,0.1) 0%, transparent 60%),
              var(--bg);
}
.hero-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 24px; padding: 80px 24px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: 999px; padding: 6px 16px;
  font-size: 0.85rem; color: #a89fff;
}
.hero-title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700; line-height: 1.15;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  max-width: 560px; color: var(--text-muted);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
}
.search-bar {
  display: flex; width: 100%; max-width: 540px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.2);
}
.search-bar input {
  flex: 1; padding: 14px 20px;
  background: none; border: none; outline: none;
  color: var(--text); font-size: 0.95rem;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar button {
  padding: 12px 24px; background: var(--accent);
  color: #fff; border: none; cursor: pointer;
  font-weight: 600; font-size: 0.9rem;
  border-radius: 0 999px 999px 0;
  transition: background 0.2s;
}
.search-bar button:hover { background: #7c74ff; }
.search-wrap {
  position: relative;
  width: 100%; max-width: 540px;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  z-index: 200;
  max-height: 300px;
  overflow-y: auto;
}
.sr-section { padding: 8px 0; }
.sr-section + .sr-section { border-top: 1px solid var(--border); }
.sr-label {
  padding: 6px 16px 4px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--accent); text-transform: uppercase;
}
.sr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; cursor: pointer;
  transition: background 0.15s;
  text-decoration: none; color: var(--text);
}
.sr-item:hover { background: rgba(108,99,255,0.1); }
.sr-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.sr-body { flex: 1; min-width: 0; }
.sr-title {
  font-size: 0.85rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sr-sub {
  font-size: 0.75rem; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sr-tag {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 999px;
  flex-shrink: 0; white-space: nowrap;
}
.sr-tag-tool     { background: rgba(0,212,170,0.15); color: var(--accent2); }
.sr-tag-article  { background: rgba(108,99,255,0.15); color: var(--accent); }
.sr-tag-news     { background: rgba(251,146,60,0.15); color: #fb923c; }
.sr-tag-glossary { background: rgba(96,165,250,0.15); color: #60a5fa; }
.sr-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.875rem; }
.hero-stats {
  display: flex; gap: 40px; margin-top: 8px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--accent2); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.hero-particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.particle {
  position: absolute; border-radius: 50%;
  background: var(--accent); opacity: 0.4;
  animation: float linear infinite;
}
@keyframes float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-20px) scale(1); opacity: 0; }
}

/* ===== SECTIONS ===== */
.section { padding: 80px 0; }
.section-dark { background: var(--bg2); }
.section-header {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 16px; margin-bottom: 40px;
}
.section-title { font-size: 1.6rem; font-weight: 700; }
.section-sub { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

/* Filter tabs */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  padding: 6px 16px; border-radius: 999px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 0.85rem;
  transition: all 0.2s;
}
.tab:hover { border-color: var(--accent); color: var(--text); }
.tab.active {
  background: var(--accent); border-color: var(--accent);
  color: #fff;
}

/* ===== NEWS GRID ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.news-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer; display: flex; flex-direction: column; gap: 12px;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(108,99,255,0.3);
}
.news-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--card) 60%, rgba(108,99,255,0.1));
}
.news-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.8rem; color: var(--text-muted);
}
.news-tag {
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.tag-model { background: rgba(108,99,255,0.2); color: #a89fff; }
.tag-product { background: rgba(0,212,170,0.2); color: #00d4aa; }
.tag-research { background: rgba(255,107,107,0.2); color: #ff8585; }
.tag-industry { background: rgba(255,193,7,0.2); color: #ffc107; }
.news-title {
  font-size: 1rem; font-weight: 600; line-height: 1.45;
}
.news-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }
.news-footer {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-muted);
}
.news-source { display: flex; align-items: center; gap: 6px; }
.source-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2); }

/* ===== TOOL CATEGORIES ===== */
.tool-categories {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  /* reset button styles */
  font-family: inherit;
  font-size: inherit;
}
.category-card:hover { border-color: var(--accent); color: var(--text); }
.category-card.active {
  border-color: var(--accent);
  background: rgba(108,99,255,0.1);
  color: var(--text);
}
.cat-icon { font-size: 1.4rem; }
.cat-name { font-size: 0.8rem; font-weight: 500; }
.cat-count { font-size: 0.7rem; color: var(--text-muted); }
.category-card.active .cat-count { color: var(--accent); }

.tool-list-header {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ===== TOOL LIST ===== */
.tool-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.tool-list-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  height: 88px;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.tool-list-item:hover {
  border-color: var(--cat-color, rgba(108,99,255,0.5));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--cat-color-faint, rgba(108,99,255,0.1));
}
.tool-list-item:hover .tool-list-name {
  color: var(--cat-color, var(--accent));
}
/* row 1: favicon + name | badge + tutorial */
.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}
.tool-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.tool-list-icon {
  width: 22px; height: 22px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
}
.tool-logo-img { width: 18px; height: 18px; object-fit: contain; display: block; }
.tool-list-name { font-weight: 600; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
/* row 2: description */
.tool-list-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== HOME NEWS LIST ===== */
.section-more {
  font-size: 0.85rem; color: var(--accent);
  text-decoration: none; transition: opacity 0.2s;
}
.section-more:hover { opacity: 0.7; }

.home-news-list { display: flex; flex-direction: column; }
.home-news-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s;
}
.home-news-item:last-child { border-bottom: none; }
.home-news-item:hover { color: var(--accent); }
.home-news-title {
  flex: 1; font-size: 0.9rem; line-height: 1.4;
}
.home-news-date {
  font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
}

/* ===== TOOLS GRID ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: all 0.2s; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(108,99,255,0.3);
}
.tool-header { display: flex; align-items: center; gap: 12px; }
.tool-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.tool-name { font-weight: 600; font-size: 0.95rem; }
.tool-category {
  font-size: 0.75rem; color: var(--text-muted);
}
.tool-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }
.tool-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.tool-badge {
  font-size: 0.66rem; padding: 1px 6px; border-radius: 999px;
  font-weight: 500; white-space: nowrap; flex-shrink: 0;
}
.badge-free { background: rgba(0,212,170,0.15); color: var(--accent2); }
.badge-paid { background: rgba(255,107,107,0.15); color: var(--accent3); }
.badge-freemium { background: rgba(255,193,7,0.15); color: #ffc107; }
.tool-stars { font-size: 0.8rem; color: #ffd700; }

/* ===== TIMELINE ===== */
.timeline {
  position: relative; padding-left: 40px;
  display: flex; flex-direction: column; gap: 0;
}
.timeline::before {
  content: ''; position: absolute; left: 14px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(to bottom, var(--accent), var(--accent2));
}
.timeline-item {
  position: relative; padding-bottom: 36px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -33px; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
  z-index: 1;
}
.timeline-dot.green { background: var(--accent2); }
.timeline-dot.red { background: var(--accent3); }
.timeline-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.timeline-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: border-color 0.2s;
}
.timeline-card:hover { border-color: rgba(108,99,255,0.3); }
.timeline-company {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--accent); font-weight: 600;
  margin-bottom: 6px;
}
.timeline-title { font-weight: 600; margin-bottom: 8px; }
.timeline-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }
.timeline-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.t-tag {
  font-size: 0.75rem; padding: 2px 10px; border-radius: 999px;
  background: rgba(108,99,255,0.15); color: #a89fff;
}

/* ===== MODELS TABLE ===== */
.models-table-wrap { overflow-x: auto; border-radius: var(--radius); }
.models-table {
  width: 100%; border-collapse: collapse;
  background: var(--card); font-size: 0.9rem;
}
.models-table th {
  background: rgba(108,99,255,0.15); padding: 14px 16px;
  text-align: left; font-weight: 600; color: var(--accent);
  white-space: nowrap;
}
.models-table td {
  padding: 14px 16px; border-top: 1px solid var(--border);
}
.models-table tr:hover td { background: rgba(255,255,255,0.03); }
.rank-badge {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.rank-1 { background: #ffd700; color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #000; }
.rank-n { background: var(--border); color: var(--text-muted); }
.score-bar-wrap { display: flex; align-items: center; gap: 10px; }
.score-bar {
  height: 6px; border-radius: 999px; background: var(--accent);
  transition: width 1s ease;
}
.model-name { font-weight: 600; }
.model-maker { font-size: 0.8rem; color: var(--text-muted); }
.capability-dots { display: flex; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.dot.filled { background: var(--accent2); }

/* ===== FOOTER ===== */
.footer { background: #07090f; padding: 48px 0 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 40px; padding-bottom: 40px; }
.footer-brand { flex: 1; min-width: 200px; }
.footer-brand .logo { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.footer-brand p { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }
.footer-links { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-links div { display: flex; flex-direction: column; gap: 8px; }
.footer-links h4 { font-size: 0.9rem; margin-bottom: 4px; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 16px 24px;
  text-align: center; font-size: 0.8rem; color: var(--text-muted);
}

.tool-tutorial-btn {
  display: inline-flex; align-items: center;
  font-size: 0.64rem; color: var(--accent2);
  background: rgba(0,212,170,0.08); border: 1px solid rgba(0,212,170,0.3);
  border-radius: 4px; padding: 1px 5px;
  white-space: nowrap; text-decoration: none;
  transition: all 0.15s; flex-shrink: 0;
}
.tool-tutorial-btn:hover { background: var(--accent2); color: #000; border-color: var(--accent2); }

/* ===== BACK TO TOP ===== */
.back-top {
  position: fixed; bottom: 32px; right: 32px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
  opacity: 0; transition: opacity 0.3s;
  display: flex; align-items: center; justify-content: center;
}
.back-top.visible { opacity: 1; }

/* ===== MAIN WRAP ===== */
.main-wrap {
  margin-left: var(--sidebar-w);
  transition: margin-left 0.3s ease;
}
body.sidebar-collapsed .main-wrap { margin-left: var(--sidebar-w-sm); }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(9,11,18,0.97);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border);
  z-index: 110;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  overflow: hidden;
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-sm); }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 18px;
  height: 64px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.04); color: var(--text); }

.toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  display: inline-block;
}
body.sidebar-collapsed .sidebar .toggle-icon { transform: rotate(180deg); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.sidebar-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidebar-item.active {
  color: var(--accent);
  background: rgba(108,99,255,0.1);
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.sidebar-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-label {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 1;
  transition: opacity 0.15s ease;
}
body.sidebar-collapsed .sidebar-label { opacity: 0; }

/* Tooltip when collapsed */
body.sidebar-collapsed .sidebar-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-w-sm) + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
}
body.sidebar-collapsed .sidebar-item:hover::after { opacity: 1; }

/* ===== ARTICLE MODAL ===== */
.article-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.article-modal.open { opacity: 1; pointer-events: all; }

.article-panel {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%; max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 0;
  transform: translateY(16px);
  transition: transform 0.25s ease;
}
.article-modal.open .article-panel { transform: translateY(0); }

.article-hero-img {
  width: 100%; max-height: 320px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
  display: block;
}
.article-hero-placeholder {
  width: 100%; height: 80px;
  background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(0,212,170,0.15));
  border-radius: 16px 16px 0 0;
  display: flex; align-items: center; padding: 0 40px;
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.article-close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(0,0,0,0.4); border: 1px solid var(--border);
  color: var(--text); width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.article-close:hover { background: rgba(255,255,255,0.12); }

.article-body > .article-meta,
.article-body > .article-title,
.article-body > .article-orig-link,
.article-body > .article-content {
  padding-left: 40px; padding-right: 40px;
}
.article-body > .article-meta { padding-top: 24px; }
.article-body > .article-content { padding-bottom: 40px; }

.article-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.article-source-name {
  font-size: 0.82rem; color: var(--text-muted);
}
.article-date { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

.article-title {
  font-size: 1.5rem; font-weight: 700; line-height: 1.3;
  margin-bottom: 12px;
}

.article-orig-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.8rem; color: var(--accent); font-weight: 500;
  border: 1px solid rgba(108,99,255,0.35); border-radius: 999px;
  padding: 3px 12px; margin-bottom: 24px;
  transition: background 0.2s;
}
.article-orig-link:hover { background: rgba(108,99,255,0.12); }

.article-content { line-height: 1.75; }
.article-content h3 {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin: 24px 0 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.article-content h3:first-child { margin-top: 0; }
.article-content p {
  font-size: 0.9rem; color: var(--text-muted);
  margin-bottom: 12px;
}
.article-content ul {
  padding-left: 0; list-style: none;
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 12px;
}
.article-content li {
  font-size: 0.885rem; color: var(--text-muted);
  padding-left: 18px; position: relative; line-height: 1.6;
}
.article-content li::before {
  content: '▸'; position: absolute; left: 0;
  color: var(--accent2); font-size: 0.75rem; top: 2px;
}
.article-content strong { color: var(--text); font-weight: 600; }

/* ===== ANIMATIONS ===== */

/* 尊重用户减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Keyframes ── */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,99,255,0.55); }
  60%       { box-shadow: 0 0 0 8px rgba(108,99,255,0); }
}
@keyframes pulseDotGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,170,0.55); }
  60%       { box-shadow: 0 0 0 8px rgba(0,212,170,0); }
}
@keyframes pulseDotRed {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.55); }
  60%       { box-shadow: 0 0 0 8px rgba(255,107,107,0); }
}
@keyframes glowBreath {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── 滚动触发淡入 ── */
.anim-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s cubic-bezier(0.22,1,0.36,1),
              transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
.anim-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hero 入场序列 ── */
.hero-badge  { animation: heroIn 0.65s cubic-bezier(0.22,1,0.36,1) 0.05s both; }
.hero-title  { animation: heroIn 0.65s cubic-bezier(0.22,1,0.36,1) 0.18s both; }
.hero-sub    { animation: heroIn 0.65s cubic-bezier(0.22,1,0.36,1) 0.30s both; }
.search-bar  { animation: heroIn 0.65s cubic-bezier(0.22,1,0.36,1) 0.42s both; }
.hero-stats  { animation: heroIn 0.65s cubic-bezier(0.22,1,0.36,1) 0.54s both; }

/* ── 渐变文字流光（覆盖原有静态渐变）── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 40%, var(--accent) 80%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 5s linear infinite;
}

/* ── Hero 背景光晕呼吸 ── */
.hero-bg { animation: glowBreath 7s ease-in-out infinite; }

/* ── 时间线圆点脉冲 ── */
.timeline-dot        { animation: pulseDot      2.8s ease-in-out infinite; }
.timeline-dot.green  { animation: pulseDotGreen 2.8s ease-in-out infinite; }
.timeline-dot.red    { animation: pulseDotRed   2.8s ease-in-out infinite; }

/* ── 导航栏滚动后加深 ── */
.navbar.scrolled {
  background: rgba(10,12,20,0.97);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 4px 24px rgba(0,0,0,0.5);
}

/* ── 卡片 hover 光晕增强 ── */
.news-card:hover,
.tool-card:hover,
.article-card:hover,
.timeline-card:hover {
  box-shadow: 0 0 0 1px rgba(108,99,255,0.25),
              0 8px 32px rgba(108,99,255,0.14);
}

/* ── Tab 切换内容淡入 ── */
.grid-fade { animation: fadeIn 0.22s ease; }

/* ── 分数条入场 ── */
.score-bar {
  transition: width 1.3s cubic-bezier(0.22,1,0.36,1) !important;
}

/* ===== RESPONSIVE =====*/
/* ===== Article Preview Tabs (hero section) ===== */
.article-preview-tabs {
  width: 100%;
  max-width: 800px;
}
.apt-nav {
  display: flex; gap: 6px;
  justify-content: center; margin-bottom: 14px;
}
.apt-tab {
  padding: 6px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.82rem; font-weight: 500;
  transition: all 0.18s;
}
.apt-tab:hover { border-color: var(--accent); color: var(--accent); }
.apt-tab.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.apt-panel { display: none; }
.apt-panel.active { display: block; }
.apt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.apt-card {
  position: relative; display: block;
  border-radius: 10px; overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--card); border: 1px solid var(--border);
  text-decoration: none;
}
.apt-card img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.32s ease;
}
.apt-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 45%, rgba(0,0,0,0.18) 100%);
  opacity: 0; transition: opacity 0.22s;
  display: flex; align-items: flex-end; padding: 10px 10px;
}
.apt-card:hover .apt-card-overlay { opacity: 1; }
.apt-card:hover img { transform: scale(1.05); }
.apt-card-title {
  font-size: 0.75rem; line-height: 1.4;
  color: #fff; font-weight: 500; text-align: left;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-wrap { margin-left: 0 !important; }
  .navbar { left: 0 !important; }
  .nav-links { display: none; }
  .hamburger { display: block; }
  .hero-stats { gap: 24px; }
  .news-card.featured { grid-column: span 1; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .footer-links { flex-direction: column; }
  .article-body > .article-meta,
  .article-body > .article-title,
  .article-body > .article-orig-link,
  .article-body > .article-content { padding-left: 20px; padding-right: 20px; }
  .article-modal { padding: 12px; }
  .tool-categories { grid-template-columns: repeat(4, 1fr); }
  .tool-list { grid-template-columns: 1fr; }
  .home-news-item { gap: 8px; }
  .home-news-date { display: none; }
  .apt-grid { grid-template-columns: repeat(2, 1fr); }
}
