/* ========================================
   Chrome Safe Download Hub - Global Styles
   ======================================== */

/* CSS Variables */
:root {
  --color-primary: #4285F4;
  --color-primary-dark: #3367D6;
  --color-danger: #EA4335;
  --color-warning: #FBBC05;
  --color-success: #34A853;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8F9FA;
  --color-bg-dark: #202124;
  --color-text: #202124;
  --color-text-secondary: #5F6368;
  --color-text-muted: #80868B;
  --color-border: #DADCE0;
  --color-border-light: #E8EAED;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --max-width: 1200px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* ========================================
   Utility Classes
   ======================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-dark {
  background: var(--color-bg-dark);
  color: #fff;
}

.text-center {
  text-align: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ========================================
   Animations
   ======================================== */

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Navigation
   ======================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text);
}

.navbar-brand:hover {
  text-decoration: none;
}

.navbar-brand svg {
  width: 32px;
  height: 32px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.navbar-links a {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.navbar-links a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.navbar-links a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.navbar-cta {
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.navbar-cta:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  padding: var(--space-sm);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-secondary {
  background: #fff;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}

.btn-large {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

.btn-white {
  background: #fff;
  color: var(--color-primary);
}

.btn-white:hover {
  background: var(--color-bg-alt);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* ========================================
   Section Headers
   ======================================== */

.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.section-header p {
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-dark .section-header p {
  color: #9AA0A6;
}

/* ========================================
   Cards
   ======================================== */

.card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ========================================
   Feature Blocks (alternating layout)
   ======================================== */

.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  margin-bottom: var(--space-3xl);
}

.feature-block:last-child {
  margin-bottom: 0;
}

.feature-block.reverse {
  direction: rtl;
}

.feature-block.reverse > * {
  direction: ltr;
}

.feature-block .feature-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.feature-block .feature-text p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.feature-block .feature-image img {
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Review Cards
   ======================================== */

.review-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.review-stars {
  color: var(--color-warning);
  margin-bottom: var(--space-md);
  font-size: 1rem;
}

.review-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.review-header img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.review-header .name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.review-card .review-text {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ========================================
   Stats
   ======================================== */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  text-align: center;
}

.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
}

.stat-label {
  color: #9AA0A6;
  font-size: 0.9375rem;
  margin-top: var(--space-sm);
}

/* ========================================
   Comparison Table
   ======================================== */

.comparison-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.comparison-table th {
  background: var(--color-bg-alt);
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  border-bottom: 2px solid var(--color-border);
}

.comparison-table th:first-child {
  text-align: left;
}

.comparison-table td {
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9375rem;
}

.comparison-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.comparison-table td.chrome-col {
  background: rgba(66, 133, 244, 0.04);
  border-left: 3px solid var(--color-primary);
}

.comparison-table .check {
  color: var(--color-success);
  font-weight: 600;
}

.comparison-table .dash {
  color: var(--color-text-muted);
}

/* ========================================
   FAQ Accordion
   ======================================== */

.accordion {
  max-width: 800px;
  margin: 0 auto;
}

.accordion-item {
  border-bottom: 1px solid var(--color-border-light);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}

.accordion-trigger:hover {
  color: var(--color-primary);
}

.accordion-icon {
  color: var(--color-primary);
  font-size: 1.25rem;
  font-weight: 300;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.accordion-item.active .accordion-icon {
  transform: rotate(45deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.accordion-item.active .accordion-content {
  max-height: 500px;
  padding-bottom: var(--space-lg);
}

.accordion-content p {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ========================================
   Timeline (Install Guide)
   ======================================== */

.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-left: 70px;
  padding-bottom: var(--space-2xl);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-number {
  position: absolute;
  left: 0;
  top: 0;
  width: 50px;
  height: 50px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.125rem;
  z-index: 1;
}

.timeline-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.timeline-content p {
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ========================================
   Version Cards (Changelog)
   ======================================== */

.version-card {
  background: #fff;
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.version-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.version-number {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1rem;
}

.version-date {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.version-changes {
  list-style: disc;
  padding-left: var(--space-lg);
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.version-changes li {
  margin-bottom: var(--space-xs);
}

/* ========================================
   CTA Banner
   ======================================== */

.cta-banner {
  background: var(--color-primary);
  padding: 60px 0;
  text-align: center;
}

.cta-banner h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-lg);
  font-size: 1.0625rem;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--color-bg-dark);
  color: #9AA0A6;
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: #fff;
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

.footer-brand svg {
  width: 28px;
  height: 28px;
}

.footer-tagline {
  color: #9AA0A6;
  font-size: 0.875rem;
  margin-bottom: var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.footer-column h4 {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-column a {
  display: block;
  color: #9AA0A6;
  font-size: 0.875rem;
  padding: var(--space-xs) 0;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid #3C4043;
  padding-top: var(--space-lg);
}

.footer-bottom p {
  font-size: 0.8125rem;
  line-height: 1.7;
}

.footer-bottom .safety-badge {
  color: var(--color-success);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
}

/* ========================================
   Platform Cards
   ======================================== */

.platform-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  transition: box-shadow 0.3s;
}

.platform-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.platform-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
}

.platform-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.platform-card .version {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  margin-bottom: var(--space-sm);
}

.platform-card .requirements {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.platform-card .install-steps {
  text-align: left;
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
}

.platform-card .install-steps li {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
  padding-left: var(--space-sm);
}

/* ========================================
   Download Card (Hero)
   ======================================== */

.download-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: var(--space-2xl);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.download-card .requirements-list {
  text-align: left;
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
}

.download-card .requirements-list li {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  padding: var(--space-xs) 0;
}

/* ========================================
   Step Cards (macOS guide)
   ======================================== */

.step-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.step-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto var(--space-md);
}

.step-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.step-card p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ========================================
   Trust Items
   ======================================== */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.trust-item {
  text-align: center;
  padding: var(--space-xl);
}

.trust-item .trust-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-md);
  color: var(--color-primary);
}

.trust-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.trust-item p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ========================================
   Requirements Table
   ======================================== */

.req-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.req-table th {
  background: var(--color-bg-alt);
  padding: var(--space-md);
  font-weight: 600;
  font-size: 0.9375rem;
  border-bottom: 2px solid var(--color-border);
}

.req-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.req-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

/* ========================================
   Badges
   ======================================== */

.badge-row {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.badge svg {
  width: 18px;
  height: 18px;
  color: var(--color-success);
}

/* ========================================
   Article Styles (zh-cn page)
   ======================================== */

.article-content {
  max-width: 800px;
  margin: 0 auto;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: var(--space-2xl) 0 var(--space-md);
}

.article-content h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: var(--space-xl) 0 var(--space-md);
  color: var(--color-text);
}

.article-content p {
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
  font-size: 1rem;
}

/* ========================================
   Tip Cards
   ======================================== */

.tip-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.tip-card h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.tip-card p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }

  .feature-block {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .feature-block.reverse {
    direction: ltr;
  }

  .step-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .navbar-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: var(--space-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    gap: var(--space-md);
  }

  .navbar-links.active {
    display: flex;
  }

  .navbar-toggle {
    display: block;
  }

  .navbar-cta {
    display: none;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .badge-row {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .step-cards {
    grid-template-columns: 1fr;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }
}

/* ========================================
   Print styles
   ======================================== */

@media print {
  .navbar,
  .cta-banner,
  .footer {
    display: none;
  }

  .section {
    padding: var(--space-md) 0;
    page-break-inside: avoid;
  }
}
