/* ============================================
   CC Store - Design System
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #06b6d4;
  --accent-light: #cffafe;
  --dark: #1e293b;
  --text: #334155;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --max-width: 1100px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 { color: var(--dark); font-weight: 700; line-height: 1.3; }
h1 { font-size: 2.8rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }
p { margin-bottom: 1rem; color: var(--text-muted); }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; }

/* Header / Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.nav-logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-links { display: flex; gap: 32px; align-items: center; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 32px; border-radius: var(--radius-sm); font-size: 1rem;
  font-weight: 600; text-decoration: none; border: none; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-lg { padding: 18px 40px; font-size: 1.1rem; border-radius: var(--radius); }
.btn-cta {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 1.15rem; padding: 20px 48px;
  border-radius: 50px; box-shadow: 0 4px 20px rgba(37,99,235,0.35);
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(37,99,235,0.45); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Hero */
.hero {
  background: linear-gradient(160deg, #eff6ff 0%, #ffffff 40%, #ecfeff 100%);
  padding: 100px 0 80px; text-align: center;
}
.hero h1 { font-size: 3rem; margin-bottom: 20px; }
.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 1.2rem; max-width: 600px; margin: 0 auto 36px; }
.hero-badge {
  display: inline-block; background: var(--primary-light); color: var(--primary);
  padding: 6px 16px; border-radius: 50px; font-size: 0.9rem;
  font-weight: 600; margin-bottom: 24px;
}

/* Features */
.features { background: var(--bg); }
.features .section-title { text-align: center; margin-bottom: 56px; }
.features .section-title h2 { margin-bottom: 12px; }
.features .section-title p { max-width: 500px; margin: 0 auto; }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 28px;
  transition: box-shadow 0.3s, transform 0.3s;
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 20px;
}
.feature-icon.blue { background: var(--primary-light); color: var(--primary); }
.feature-icon.cyan { background: var(--accent-light); color: var(--accent); }
.feature-icon.green { background: var(--success-light); color: var(--success); }
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { font-size: 0.95rem; margin-bottom: 0; }

/* How it works */
.how-it-works { background: var(--bg-light); }
.how-it-works .section-title { text-align: center; margin-bottom: 56px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.step { text-align: center; }
.step-number {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700;
  margin: 0 auto 20px;
}
.step h3 { margin-bottom: 8px; }
.step p { font-size: 0.95rem; margin-bottom: 0; }

/* Pricing */
.pricing { background: var(--bg); }
.pricing .section-title { text-align: center; margin-bottom: 56px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.pricing-card {
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 40px 28px;
  text-align: center; position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.pricing-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg);
  transform: scale(1.04);
}
.pricing-card.featured::before {
  content: '推荐'; position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: 4px 18px;
  border-radius: 50px; font-size: 0.85rem; font-weight: 600;
}
.pricing-name { font-size: 1.1rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.pricing-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; }
.pricing-amount { font-size: 2.8rem; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.pricing-amount span { font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.pricing-unit { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 28px; }
.pricing-features { list-style: none; text-align: left; margin-bottom: 32px; }
.pricing-features li { padding: 8px 0; font-size: 0.93rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.pricing-features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; }
.pricing-card .btn { width: 100%; }

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; text-align: center; padding: 64px 0;
}
.cta-banner h2 { color: #fff; margin-bottom: 12px; }
.cta-banner p { color: rgba(255,255,255,0.85); margin-bottom: 32px; }
.cta-banner .btn { background: #fff; color: var(--primary); }

/* FAQ */
.faq { background: var(--bg-light); }
.faq .section-title { text-align: center; margin-bottom: 56px; }
.faq-list { max-width: 700px; margin: 0 auto; }
.faq-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 12px;
  overflow: hidden;
}
.faq-q {
  padding: 20px 24px; font-weight: 600; color: var(--dark);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.faq-q::after { content: '+'; font-size: 1.3rem; color: var(--text-muted); transition: transform 0.3s; }
.faq-item.open .faq-q::after { content: '−'; }
.faq-a { padding: 0 24px 20px; color: var(--text-muted); display: none; font-size: 0.95rem; }
.faq-item.open .faq-a { display: block; }

/* Footer */
.footer { background: var(--dark); color: rgba(255,255,255,0.7); padding: 40px 0; text-align: center; font-size: 0.9rem; }
.footer a { color: rgba(255,255,255,0.9); text-decoration: none; }
.footer a:hover { color: #fff; }

/* Purchase Page */
.purchase { padding: 60px 0; min-height: 80vh; }
.purchase .container { max-width: 600px; }
.purchase h1 { text-align: center; margin-bottom: 40px; }

.plan-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.plan-option {
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 24px 16px; text-align: center; cursor: pointer;
  transition: all 0.2s;
}
.plan-option:hover { border-color: var(--primary); }
.plan-option.selected { border-color: var(--primary); background: var(--primary-light); }
.plan-option input { display: none; }
.plan-option .plan-name { font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.plan-option .plan-price { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.plan-option .plan-price span { font-size: 0.85rem; color: var(--text-muted); }

.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-weight: 600; color: var(--dark); margin-bottom: 8px; }
.form-group input {
  width: 100%; padding: 14px 16px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 1rem; font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); }
.form-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }

/* Success Page */
.success-page { padding: 80px 0; text-align: center; min-height: 80vh; }
.success-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--success-light); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; margin: 0 auto 24px;
}
.success-page h1 { color: var(--success); margin-bottom: 12px; }

.code-display {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--bg-light); border: 2px dashed var(--primary);
  border-radius: var(--radius); padding: 20px 32px;
  font-size: 1.8rem; font-weight: 800; color: var(--primary);
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  letter-spacing: 0.05em; margin: 24px 0 12px;
}
.code-display .copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.3rem; padding: 4px;
  transition: color 0.2s;
}
.code-display .copy-btn:hover { color: var(--primary); }

.instructions {
  background: var(--bg-light); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  text-align: left; max-width: 560px; margin: 32px auto 0;
}
.instructions h3 { margin-bottom: 16px; text-align: center; }
.instructions ol { padding-left: 20px; color: var(--text-muted); }
.instructions ol li { margin-bottom: 10px; }
.instructions ol li strong { color: var(--text); }

/* Loading Spinner */
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: var(--dark); color: #fff; padding: 12px 24px;
  border-radius: 50px; font-size: 0.9rem; z-index: 1000;
  opacity: 0; transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

/* Error state */
.error-box {
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: var(--radius-sm); padding: 16px;
  color: var(--danger); text-align: center; margin-bottom: 20px;
  display: none;
}
.error-box.show { display: block; }

/* Polling indicator */
.polling-hint { font-size: 0.9rem; color: var(--text-muted); margin-top: 16px; }

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero { padding: 60px 0 50px; }
  section { padding: 48px 0; }

  .features-grid, .steps, .pricing-grid { grid-template-columns: 1fr; gap: 20px; }
  .pricing-card.featured { transform: none; }
  .plan-selector { grid-template-columns: 1fr; }

  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.85rem; }

  .btn-cta { padding: 16px 36px; font-size: 1rem; }
  .code-display { font-size: 1.3rem; padding: 16px 20px; }
}
