/* ========== DZS 电子书商城 — 精美风格 ========== */

/* Reset & variables */
:root {
  --color-brand: #2563eb;
  --color-brand-hover: #1d4ed8;
  --color-brand-light: #eff6ff;
  --color-accent: #059669;
  --color-text: #0f172a;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-card-bg: #ffffff;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-shadow: 0 10px 40px -12px rgba(15, 23, 42, 0.08);
  --color-shadow-hover: 0 20px 60px -16px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.bg-alt {
  background: var(--color-bg-alt);
}

/* Typography */
.gradient-text {
  background: linear-gradient(135deg, var(--color-brand) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-brand);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--color-brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-outline:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-border-hover);
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
}

.nav-logo span {
  color: var(--color-brand);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--color-brand);
}

.nav-link-active {
  color: var(--color-brand);
}

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
}

.nav-mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: var(--transition);
}

/* Hero */
.hero {
  position: relative;
  padding: 120px 0;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 60%);
  z-index: -1;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

.hero-content {
  max-width: 560px;
  z-index: 1;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--color-brand-light);
  color: var(--color-brand);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.hero-badge::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-brand);
  border-radius: 50%;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text);
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
}

.hero-visual {
  position: absolute;
  top: 50%;
  right: 10%;
  width: 520px;
  height: 520px;
  transform: translateY(-50%);
  z-index: 1;
  pointer-events: none;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.floating-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: #ffffff;
  box-shadow: var(--color-shadow);
  position: relative;
  overflow: hidden;
}

.card-1 {
  width: 240px;
  height: 340px;
  transform: rotate(-3deg);
  animation: float 6s ease-in-out infinite;
}

.card-2 {
  width: 200px;
  height: 280px;
  transform: rotate(3deg);
  margin-top: -40px;
  animation: float 5s ease-in-out infinite reverse;
  z-index: 2;
}

.card-3 {
  width: 160px;
  height: 220px;
  transform: rotate(-5deg);
  align-self: flex-start;
  animation: float 7s ease-in-out infinite;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-16px) rotate(var(--r, 0deg)); }
}

/* Books Section */
.section-books {
  background: var(--color-bg);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.book-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--color-shadow);
  display: flex;
  flex-direction: column;
  position: relative;
}

.book-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-8px);
  box-shadow: var(--color-shadow-hover);
}

.book-cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-card:hover .book-cover {
  transform: scale(1.05);
}

.book-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  box-shadow: var(--color-shadow);
  backdrop-filter: blur(4px);
}

.book-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-brand);
  margin-bottom: 8px;
}

.book-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 500;
}

.book-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}

.book-price {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
}

.book-original {
  font-size: 15px;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.book-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.book-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
}

.book-btn {
  width: 100%;
  margin-top: auto;
}

/* Features Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.feature-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
}

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

.feature-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: inline-block;
}

.feature-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-text);
}

.feature-desc {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* CTA Section */
.section-cta {
  position: relative;
  overflow: hidden;
}

.cta-card {
  position: relative;
  background: linear-gradient(135deg, var(--color-brand) 0%, #1d4ed8 100%);
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  color: #ffffff;
  text-align: center;
  overflow: hidden;
}

.cta-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-title {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 16px;
}

.cta-desc {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.cta-card .btn-primary {
  background: #ffffff;
  color: var(--color-brand);
}

.cta-card .btn-primary:hover {
  background: #f1f5f9;
}

/* Footer */
.footer {
  background: var(--color-text);
  color: #ffffff;
  padding: 64px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 280px repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  display: inline-block;
  margin-bottom: 12px;
}

.footer-logo span {
  color: var(--color-brand);
}

.footer-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.7;
  margin-top: 8px;
}

.footer-link-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
}

.footer-links a {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 10px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px -15px rgba(15, 23, 42, 0.25);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--color-text-muted);
  border-radius: 50%;
  background: var(--color-bg-alt);
  transition: var(--transition);
  z-index: 2;
}

.modal-close:hover {
  color: var(--color-text);
  background: var(--color-border);
}

.modal-body {
  padding: 32px;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.modal-book-thumb {
  width: 120px;
  height: 160px;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.modal-book-info {
  flex: 1;
  min-width: 0;
}

.modal-book-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 4px;
}

.modal-book-author {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.modal-book-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.modal-price-current {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text);
}

.modal-price-original {
  font-size: 15px;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.modal-divider {
  height: 1px;
  background: var(--color-border);
  margin: 24px 0;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-form-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  background: #ffffff;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.payment-options {
  display: flex;
  gap: 10px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.payment-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: var(--transition);
}

.payment-option input:checked + .payment-indicator {
  border-color: var(--color-brand);
  background: var(--color-brand-light);
  color: var(--color-brand);
}

.amount-currency {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-brand);
}

.amount-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-text);
}

.modal-note {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 3000;
  padding: 12px 24px;
  background: var(--color-text);
  color: #ffffff;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  box-shadow: var(--color-shadow);
}

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

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 36px;
  }

  .hero-visual {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .book-grid {
    grid-template-columns: 1fr;
  }

  .cta-card {
    padding: 48px 24px;
  }

  .cta-title {
    font-size: 26px;
  }

  .modal-header {
    flex-direction: column;
  }

  .modal-book-thumb {
    width: 100px;
    height: 135px;
  }

  .modal-content {
    max-height: 95vh;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .btn-large {
    width: 100%;
  }
}
