/* ============================================
   WPS Office Official Website - Global Styles
   Pure HTML + CSS + JS, No Frameworks
   ============================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Color System */
  --bg-base: #f9f9f9;
  --surface-pure: #ffffff;
  --surface-dark: #0a0a0c;
  --text-primary: #000000;
  --text-secondary: #2a2a2a;
  --text-tertiary: #686868;
  --text-light: #ffffff;
  --border-divider: #dfdfdf;
  --border-dark: #333333;
  --accent-pin: rgba(233, 210, 168, 0.2);
  --color-bg-sweep: rgba(200, 200, 200, 0.3);

  /* Font System */
  --font-stack: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  /* Spacing */
  --container-max: 1200px;
  --container-padding: 40px;
  --section-gap: 160px;
  --section-gap-sm: 80px;

  /* Transitions */
  --transition-fast: 200ms linear;
  --transition-smooth: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-stack);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-base);
  overflow-x: hidden;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.display {
  font-size: 62px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1, .h1 {
  font-size: 32px;
  font-weight: 600;
}

h2, .h2 {
  font-size: 20px;
  font-weight: 600;
}

.caption {
  font-size: 13px;
  font-weight: 500;
}

.text-tertiary {
  color: var(--text-tertiary);
}

/* ---- Layout ---- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
}

.section {
  padding: var(--section-gap) 0;
}

.section-sm {
  padding: var(--section-gap-sm) 0;
}

/* ---- Grid ---- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.gap-0 {
  gap: 0;
}

/* ---- Dividers ---- */
.divider {
  height: 1px;
  background-color: var(--border-divider);
  border: none;
  width: 100%;
}

.divider-dark {
  background-color: var(--border-dark);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  border-radius: 0;
  line-height: 1;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: #1d1d1d;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--text-primary);
  color: var(--text-light);
}

.btn-large {
  padding: 20px 56px;
  font-size: 16px;
}

/* ---- Spin Animation ---- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(249, 249, 249, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-divider);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---- Footer ---- */
.footer {
  background-color: var(--surface-dark);
  color: var(--text-light);
  padding: 80px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 60px;
}

.footer-col h4 {
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-light);
}

.footer-bottom {
  border-top: 1px solid var(--border-dark);
  padding-top: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.8;
}

.footer-disclaimer {
  margin-top: 8px;
  font-size: 11px;
  color: #555;
}

/* ---- Cards ---- */
.card {
  background: var(--surface-pure);
  border: 1px solid var(--border-divider);
  padding: 32px;
  transition: background-color var(--transition-smooth);
}

.card:hover {
  background-color: #f5f5f5;
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.card-desc {
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.7;
}

/* ---- FAQ Accordion ---- */
.faq-item {
  border-top: 1px solid var(--border-divider);
}

.faq-item:last-child {
  border-bottom: 1px solid var(--border-divider);
}

.faq-question {
  width: 100%;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-stack);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}

.faq-question svg {
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform var(--transition-smooth);
}

.faq-question.open svg {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-smooth);
}

.faq-answer.open {
  max-height: 500px;
}

.faq-answer-inner {
  padding-bottom: 24px;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.8;
}

/* ---- Star Rating ---- */
.star-rating {
  display: flex;
  gap: 2px;
}

.star-rating svg {
  width: 16px;
  height: 16px;
}

/* ---- Highlight Sweep ---- */
mark.sweep-highlight {
  background: linear-gradient(90deg, var(--color-bg-sweep), var(--color-bg-sweep));
  background-size: 0% 100%;
  background-repeat: no-repeat;
  color: var(--text-primary);
  padding: 0 2px;
  border-radius: 0;
  transition: background-size 1.2s ease-out;
}

mark.sweep-highlight.active {
  background-size: 100% 100%;
}

/* ---- Stats Counter ---- */
.stat-number {
  font-size: 48px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* ---- Dark Section Overrides ---- */
.dark-section {
  background-color: var(--surface-dark);
  color: var(--text-light);
}

.dark-section h1,
.dark-section h2,
.dark-section h3,
.dark-section .display {
  color: var(--text-light);
}

.dark-section .stat-number {
  color: var(--text-light);
}

.dark-section .stat-label {
  color: rgba(255, 255, 255, 0.5);
}

.dark-section .divider {
  background-color: var(--border-dark);
}

.dark-section .text-tertiary {
  color: rgba(255, 255, 255, 0.5);
}

/* ---- Review Cards ---- */
.review-card {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 24px;
  min-width: 320px;
}

.review-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 16px;
}

.review-author {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ---- Scroll Container ---- */
.scroll-container {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-divider) transparent;
}

.scroll-container::-webkit-scrollbar {
  height: 4px;
}

.scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-container::-webkit-scrollbar-thumb {
  background: var(--border-divider);
}

/* ---- Download Section ---- */
.download-panel {
  background: var(--surface-pure);
  border: 1px solid var(--border-divider);
  padding: 60px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.platform-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border-divider);
}

.platform-tab {
  padding: 16px 32px;
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
  margin-bottom: -1px;
}

.platform-tab:hover {
  color: var(--text-primary);
}

.platform-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
  font-weight: 600;
}

.platform-content {
  display: none;
}

.platform-content.active {
  display: block;
}

.version-info {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 16px;
}

.system-requirements {
  margin-top: 48px;
  text-align: left;
}

/* ---- Timeline ---- */
.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border-divider);
}

.timeline-date {
  font-size: 13px;
  color: var(--text-tertiary);
}

.timeline-version {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.timeline-list {
  list-style: none;
}

.timeline-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  position: relative;
  padding-left: 16px;
}

.timeline-list li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--text-tertiary);
}

/* ---- Comparison Table ---- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  padding: 20px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border-divider);
  font-size: 14px;
}

.compare-table th {
  font-weight: 600;
  color: var(--text-primary);
  background-color: #f5f5f5;
}

.compare-table td {
  color: var(--text-secondary);
}

.compare-table .highlight-row td {
  background-color: rgba(233, 210, 168, 0.1);
}

/* ---- SEO Content Block ---- */
.seo-content h2 {
  font-size: 32px;
  margin-bottom: 24px;
  margin-top: 80px;
}

.seo-content h2:first-child {
  margin-top: 0;
}

.seo-content p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.seo-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.seo-content ul {
  margin-bottom: 24px;
  padding-left: 24px;
}

.seo-content li {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.seo-cta {
  background: #f5f5f5;
  border: 1px solid var(--border-divider);
  padding: 60px;
  text-align: center;
  margin-top: 80px;
}

.seo-cta h3 {
  font-size: 24px;
  margin-bottom: 16px;
}

.seo-cta p {
  color: var(--text-tertiary);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Installation Steps ---- */
.install-steps {
  counter-reset: step;
}

.install-step {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border-divider);
}

.install-step:last-child {
  border-bottom: none;
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--text-primary);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.7;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  :root {
    --container-padding: 20px;
    --section-gap: 80px;
  }

  .display {
    font-size: 36px;
  }

  h1, .h1 {
    font-size: 24px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    gap: 16px;
  }

  .nav-inner {
    height: 56px;
  }

  .stat-number {
    font-size: 36px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .download-panel {
    padding: 32px 20px;
  }

  .seo-content h2 {
    font-size: 24px;
  }

  .seo-cta {
    padding: 40px 24px;
  }

  .platform-tabs {
    flex-wrap: wrap;
  }

  .platform-tab {
    padding: 12px 20px;
    font-size: 13px;
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
