/* CSS Variables - Light Mode */
:root {
  --bg: #f8f9fa;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1a1a2e;
  --text-secondary: #6c757d;
  --muted: #868e96;
  --accent: #ff8a5b;
  --accent-hover: #ff6f3d;
  --accent-2: #2fd7c4;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --bg-soft: #121923;
    --card: rgba(21, 28, 39, 0.92);
    --border: rgba(255, 255, 255, 0.1);
    --text: #f5f7fb;
    --text-secondary: #c9d1d9;
    --muted: #8b949e;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(circle at top left, rgba(47, 215, 196, 0.15), transparent 40%),
      radial-gradient(circle at 80% 20%, rgba(255, 138, 91, 0.2), transparent 45%),
      var(--bg);
  }
}

/* Header */
.header {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.header-container .lang-switcher {
  position: absolute;
  right: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: var(--accent);
}

.lang-arrow {
  font-size: 10px;
  opacity: 0.6;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 200;
}

.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.lang-option:hover {
  background: var(--border);
}

.lang-option:first-child {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.lang-option:last-child {
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* Download Button */
.download-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 138, 91, 0.4);
}

/* Main */
.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}

/* Features Section */
.features {
  margin-bottom: 50px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.feature-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 13px;
  color: var(--muted);
}

/* FAQ Section */
.faq-section {
  margin-bottom: 50px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

/* FAQ Tabs */
.faq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.faq-tab {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.faq-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.faq-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-color: transparent;
  color: white;
}

/* FAQ Items */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.faq-item:hover {
  box-shadow: var(--shadow);
}

.faq-item.hidden {
  display: none;
}

.faq-question {
  width: 100%;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  background: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s;
}

.faq-question:hover {
  background: var(--border);
}

.faq-arrow {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.3s;
}

.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-item.open .faq-answer {
  max-height: 1000px;
}

.faq-answer > * {
  padding: 0 20px;
}

.faq-answer > *:first-child {
  padding-top: 0;
}

.faq-answer > *:last-child {
  padding-bottom: 20px;
}

.faq-answer p {
  margin-bottom: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-answer ol {
  margin-bottom: 16px;
  padding-left: 40px;
  color: var(--text-secondary);
}

.faq-answer li {
  margin-bottom: 8px;
}

.faq-note {
  padding: 12px 16px !important;
  margin: 12px 20px !important;
  background: rgba(255, 138, 91, 0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  font-size: 14px;
}

.faq-tip {
  color: var(--accent-2) !important;
  font-size: 14px;
}

/* FAQ Images */
.faq-images {
  display: flex;
  gap: 12px;
  padding: 12px 20px 20px !important;
  flex-wrap: wrap;
}

.faq-image {
  max-width: 200px;
  max-height: 350px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  object-fit: contain;
}

.faq-image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

/* Contact Section */
.contact-section {
  text-align: center;
  padding: 40px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 50px;
}

.contact-desc {
  color: var(--muted);
  margin-bottom: 24px;
}

.wechat-box {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
}

.wechat-id {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.copy-btn svg {
  width: 18px;
  height: 18px;
}

/* Inline WeChat Copy */
.wechat-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 138, 91, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.wechat-inline strong {
  color: var(--accent);
}

.copy-inline {
  padding: 2px 8px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.copy-inline:hover {
  background: var(--accent);
  color: white;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-divider {
  margin: 0 12px;
  opacity: 0.5;
}

.footer-copyright {
  font-size: 13px;
  opacity: 0.7;
}

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  cursor: zoom-out;
}

.image-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-image {
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* RTL Support for Arabic */
[dir="rtl"] .faq-question {
  text-align: right;
}

[dir="rtl"] .faq-answer ol {
  padding-left: 20px;
  padding-right: 40px;
}

/* Responsive */
@media (max-width: 600px) {
  .header-container {
    padding: 12px 16px;
  }

  .logo-text {
    display: none;
  }

  .download-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .main {
    padding: 24px 16px 40px;
  }

  .hero {
    padding: 24px 0 32px;
  }

  .faq-tabs {
    gap: 8px;
  }

  .faq-tab {
    padding: 6px 14px;
    font-size: 13px;
  }

  .faq-question {
    padding: 14px 16px;
    font-size: 14px;
  }

  .faq-answer > * {
    padding: 0 16px;
  }

  .faq-images {
    padding: 12px 16px 16px !important;
  }

  .faq-image {
    max-width: 100%;
    max-height: 300px;
  }

  .wechat-box {
    flex-direction: column;
    gap: 12px;
    padding: 20px;
  }

  .wechat-id {
    font-size: 24px;
  }

  .contact-section {
    padding: 30px 16px;
  }
}
