/* ============================================
   Chrome 下载站 - 共享样式表
   纯原生 CSS，无框架依赖
   ============================================ */

/* ---- CSS 变量 ---- */
:root {
  --color-primary: #1a1a1a;
  --color-body: #333333;
  --color-muted: #666666;
  --color-light-muted: #888888;
  --color-white: #ffffff;
  --color-off-white: #f5f5f5;
  --color-light-grey: #e5e5e5;
  --color-border: #cccccc;
  --color-link: #1a73e8;
  --gradient-accent: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc05 100%);

  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  --max-width: 1200px;
  --page-padding: 24px;
  --section-gap: 80px;
  --card-gap: 24px;
  --card-padding: 32px;
  --element-gap: 16px;
}

/* ---- Reset ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-body);
  background: var(--color-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ---- 工具类 ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

.section-padding {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.text-center {
  text-align: center;
}

.gradient-bg {
  background: var(--gradient-accent);
  color: var(--color-white);
}

/* ---- spin 动画（下载按钮 loading） ---- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* ---- 导航栏 ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-light-grey);
  z-index: 1000;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}

.brand svg {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-body);
  padding: 8px 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-link);
}

.nav-links a.active {
  color: var(--color-link);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-link);
}

/* ---- Hero 区块 ---- */
.hero {
  padding: 160px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero .subtitle {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 8px;
}

.hero .version-info {
  font-size: 14px;
  opacity: 0.7;
  margin-bottom: 32px;
}

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: var(--color-white);
  padding: 14px 32px;
  border: none;
  box-shadow: 0 2px 8px rgba(66,133,244,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(66,133,244,0.4);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-primary);
  padding: 12px 24px;
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-off-white);
}

.btn-cta-light {
  background: var(--color-white);
  color: var(--color-primary);
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-cta-light:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ---- 下载按钮 loading 状态 ---- */
.btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-spinner {
  display: inline-block;
}

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
}

/* ---- 平台下载卡片 ---- */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--card-gap);
}

.platform-card {
  background: var(--color-off-white);
  border-radius: 12px;
  padding: var(--card-padding);
  text-align: center;
  transition: all 0.3s ease;
}

.platform-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.platform-card .platform-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.platform-card .platform-icon svg {
  width: 100%;
  height: 100%;
}

.platform-card h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.platform-card .version {
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.platform-card .os-info {
  font-size: 14px;
  color: var(--color-light-muted);
  margin-bottom: 20px;
}

/* ---- 新闻卡片 ---- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--card-gap);
}

.news-card {
  background: var(--color-white);
  border: 1px solid var(--color-light-grey);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.news-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.news-card:hover .news-title {
  color: var(--color-link);
}

.news-card .news-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.news-card .news-content {
  padding: 24px;
}

.news-card .news-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.4;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.news-card .news-excerpt {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-light-muted);
}

.news-card .news-tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--color-off-white);
  border-radius: 12px;
  font-size: 12px;
  color: var(--color-muted);
}

/* ---- 资源滚动条 marquee ---- */
.marquee-section {
  background: var(--color-off-white);
  padding: 40px 0;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-section:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--color-white);
  border-radius: 20px;
  font-size: 14px;
  color: var(--color-muted);
  white-space: nowrap;
}

.marquee-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---- 性能统计 ---- */
.stats-section {
  padding: 60px 0;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 40px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}

/* ---- Section 标题 ---- */
.section-header {
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.25;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
}

.section-header-flex h2 {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-primary);
}

.section-header-flex .view-all {
  font-size: 15px;
  color: var(--color-link);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s ease;
}

.section-header-flex .view-all:hover {
  gap: 8px;
}

/* ---- 下载页大卡片 ---- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--card-gap);
}

.download-card {
  background: var(--color-off-white);
  border-radius: 12px;
  padding: 40px;
  transition: all 0.3s ease;
}

.download-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.download-card .download-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
}

.download-card .download-icon svg {
  width: 100%;
  height: 100%;
}

.download-card h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 16px;
}

.download-card .download-meta {
  margin-bottom: 20px;
}

.download-card .download-meta p {
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.8;
}

.download-card .download-meta .meta-label {
  color: var(--color-light-muted);
}

.download-card .os-requirements {
  font-size: 13px;
  color: var(--color-light-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ---- 更新日志 ---- */
.changelog {
  background: var(--color-off-white);
  padding: 60px 0;
}

.changelog-list {
  max-width: 800px;
  margin: 0 auto;
}

.changelog-item {
  display: flex;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-light-grey);
}

.changelog-item:last-child {
  border-bottom: none;
}

.changelog-date {
  flex-shrink: 0;
  width: 100px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
}

.changelog-content {
  flex: 1;
}

.changelog-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
}

.changelog-tag.security {
  background: #fce8e8;
  color: #d93025;
}

.changelog-tag.feature {
  background: #e8f0fe;
  color: #1a73e8;
}

.changelog-tag.performance {
  background: #e6f4ea;
  color: #137333;
}

.changelog-tag.ui {
  background: #fef7e0;
  color: #b06000;
}

.changelog-desc {
  font-size: 15px;
  color: var(--color-body);
  line-height: 1.6;
}

/* ---- FAQ 折叠面板 ---- */
.faq-section {
  padding: 80px 0;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-light-grey);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 500;
  color: var(--color-primary);
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: var(--color-link);
}

.faq-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  opacity: 1;
}

.faq-answer p {
  padding-bottom: 24px;
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.7;
}

/* ---- 中文版配置教程 ---- */
.tutorial-section {
  padding: 80px 0;
}

.tutorial-content {
  max-width: 800px;
  margin: 0 auto;
}

.tutorial-content h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 48px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-light-grey);
}

.tutorial-content h2:first-child {
  margin-top: 0;
}

.tutorial-content h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.tutorial-content p {
  font-size: 16px;
  color: var(--color-body);
  line-height: 1.75;
  margin-bottom: 16px;
}

.tutorial-content ul,
.tutorial-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.tutorial-content ul li {
  list-style: disc;
  font-size: 16px;
  color: var(--color-body);
  line-height: 1.75;
  margin-bottom: 8px;
}

.tutorial-content ol li {
  list-style: decimal;
  font-size: 16px;
  color: var(--color-body);
  line-height: 1.75;
  margin-bottom: 8px;
}

.tutorial-content code {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-off-white);
  border-radius: 4px;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 14px;
  color: var(--color-primary);
}

.tutorial-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}

.tutorial-content th,
.tutorial-content td {
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--color-light-grey);
}

.tutorial-content th {
  background: var(--color-off-white);
  font-weight: 600;
  color: var(--color-primary);
}

.tutorial-content td {
  color: var(--color-body);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--gradient-accent);
  color: var(--color-white);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  margin-right: 10px;
  flex-shrink: 0;
}

/* ---- 新闻列表页 ---- */
.news-list {
  padding: 80px 0;
}

.news-list-item {
  display: flex;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--color-light-grey);
  transition: all 0.3s ease;
  cursor: pointer;
}

.news-list-item:hover .news-list-image {
  transform: scale(1.03);
}

.news-list-item:hover .news-list-title {
  color: var(--color-link);
}

.news-list-image-wrap {
  flex-shrink: 0;
  width: 280px;
  height: 158px;
  border-radius: 8px;
  overflow: hidden;
}

.news-list-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-list-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.3;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.news-list-excerpt {
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-list-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-light-muted);
}

/* ---- 文章详情页 ---- */
.article-page {
  padding: 120px 0 80px;
}

.article-container {
  max-width: 800px;
  margin: 0 auto;
}

.article-header-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 32px;
}

.article-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.25;
  margin-bottom: 20px;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-light-grey);
  font-size: 14px;
  color: var(--color-muted);
}

.article-meta-bar .article-tag {
  padding: 2px 12px;
  background: var(--color-off-white);
  border-radius: 12px;
  font-size: 12px;
}

.article-body h2 {
  font-size: 26px;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 40px;
  margin-bottom: 16px;
}

.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
  margin-top: 28px;
  margin-bottom: 12px;
}

.article-body p {
  font-size: 16px;
  color: var(--color-body);
  line-height: 1.8;
  margin-bottom: 16px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-body ul li {
  list-style: disc;
  font-size: 16px;
  color: var(--color-body);
  line-height: 1.8;
  margin-bottom: 8px;
}

.article-body ol li {
  list-style: decimal;
  font-size: 16px;
  color: var(--color-body);
  line-height: 1.8;
  margin-bottom: 8px;
}

.article-body strong {
  font-weight: 600;
  color: var(--color-primary);
}

.article-body code {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-off-white);
  border-radius: 4px;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 14px;
  color: var(--color-primary);
}

.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
  padding: 12px 24px;
  background: var(--color-off-white);
  border-radius: 6px;
  font-size: 15px;
  color: var(--color-link);
  transition: background 0.2s ease;
}

.article-back-link:hover {
  background: var(--color-light-grey);
}

.article-back-link svg {
  width: 18px;
  height: 18px;
}

/* ---- 页脚 ---- */
.footer {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.footer p {
  opacity: 0.8;
}

.footer .footer-safety {
  margin-bottom: 4px;
  font-weight: 500;
}

/* ---- 移动端菜单按钮 ---- */
.mobile-menu-btn {
  display: none;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

/* ---- 响应式 ---- */
@media (max-width: 1024px) {
  .platform-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .download-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero .subtitle {
    font-size: 16px;
  }

  .section-header h2,
  .section-header-flex h2 {
    font-size: 24px;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    flex-direction: column;
    gap: 24px;
  }

  .news-list-item {
    flex-direction: column;
  }

  .news-list-image-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .download-card {
    padding: 24px;
  }

  .article-title {
    font-size: 24px;
  }

  .changelog-item {
    flex-direction: column;
    gap: 8px;
  }

  .changelog-date {
    width: auto;
  }

  .faq-question {
    font-size: 16px;
  }
}
