/* ============================================
   Chrome 安全下载站 - 全局样式
   ============================================ */

/* ---- CSS 变量 ---- */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-dark: #0f172a;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --nav-height: 64px;
  --transition: all 0.3s ease;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ---- 动画 ---- */
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---- Loading 遮罩 ---- */
.dl-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.dl-loading-overlay.hidden {
  display: none;
}

.dl-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: relative;
}

.dl-loading-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---- 导航栏 ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.nav-brand svg {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

.nav-links a.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---- 页脚 ---- */
.site-footer {
  background: var(--bg-dark);
  color: #94a3b8;
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}

.site-footer p {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ---- 通用布局 ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 60px 0;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 15px;
}

/* ---- 卡片 ---- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ---- 标签 ---- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}

/* ---- 面包屑 ---- */
.breadcrumb {
  padding: 16px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  margin: 0 8px;
  color: var(--border);
}

/* ---- 文章元信息 ---- */
.meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.meta-item svg {
  width: 14px;
  height: 14px;
}

/* ---- 滚动条 ---- */
.marquee-track {
  display: flex;
  gap: 32px;
  animation: marquee 30s linear infinite;
  width: max-content;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- FAQ ---- */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.faq-header:hover {
  background: var(--bg-secondary);
}

.faq-header svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.faq-item.open .faq-header svg {
  transform: rotate(180deg);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-body {
  max-height: 500px;
}

.faq-body-inner {
  padding: 0 20px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

/* ---- 表格 ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.data-table tr:hover td {
  background: var(--bg-secondary);
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  .nav-inner {
    padding: 0 16px;
  }

  .nav-links a {
    padding: 6px 10px;
    font-size: 13px;
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 22px;
  }

  .container {
    padding: 0 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-title {
    font-size: 28px !important;
  }
}

/* ---- 工具类 ---- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none; }

/* ---- 性能统计条 ---- */
.stat-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-bar-label {
  width: 80px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.stat-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 1s ease;
}

.stat-bar-value {
  width: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-align: right;
  flex-shrink: 0;
}
