/* ==========================================================================
   Phone Film Customizer — CSS Framework
   手机膜定制商城 · 完整样式框架
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables (Theme)
   -------------------------------------------------------------------------- */
:root {
  /* -- Colors: Brand -- */
  --clr-bg:                #0a0a0f;
  --clr-bg-alt:            #12121a;
  --clr-bg-card:           #1a1a26;
  --clr-bg-card-hover:     #222233;
  --clr-bg-elevated:       #252538;
  --clr-surface:           #1e1e2e;
  --clr-surface-light:     #2a2a40;

  --clr-primary:           #4A90D9;
  --clr-primary-light:     #6ba7e6;
  --clr-primary-dark:      #3670b3;
  --clr-accent:            #8B5CF6;
  --clr-accent-light:      #a78bfa;
  --clr-accent-dark:       #7c3aed;

  --clr-gradient-brand:    linear-gradient(135deg, #4A90D9, #8B5CF6);
  --clr-gradient-brand-hover: linear-gradient(135deg, #5ba0e9, #9d6cfc);
  --clr-gradient-bg:       linear-gradient(180deg, #0a0a0f 0%, #12121a 100%);

  /* -- Colors: Neutrals -- */
  --clr-text:              #f0f0f5;
  --clr-text-secondary:    #9090a8;
  --clr-text-muted:        #6b6b80;
  --clr-border:            #2a2a3e;
  --clr-border-light:      #3a3a50;
  --clr-white:             #ffffff;
  --clr-black:             #000000;

  /* -- Colors: Semantic -- */
  --clr-success:           #22c55e;
  --clr-warning:           #f59e0b;
  --clr-error:             #ef4444;
  --clr-info:              #3b82f6;
  --clr-star:              #fbbf24;

  /* -- Colors: Brand tags -- */
  --clr-tag-new:           #22c55e;
  --clr-tag-hot:           #ef4444;
  --clr-tag-limited:       #f59e0b;

  /* -- Typography -- */
  --ff-sans:               -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  --ff-mono:               'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  --fs-xs:                 0.75rem;    /* 12px */
  --fs-sm:                 0.8125rem;  /* 13px */
  --fs-base:               0.9375rem;  /* 15px */
  --fs-md:                 1rem;       /* 16px */
  --fs-lg:                 1.125rem;   /* 18px */
  --fs-xl:                 1.375rem;   /* 22px */
  --fs-2xl:                1.75rem;    /* 28px */
  --fs-3xl:                2.25rem;    /* 36px */
  --fs-4xl:                3rem;       /* 48px */

  --fw-normal:             400;
  --fw-medium:             500;
  --fw-semibold:           600;
  --fw-bold:               700;

  --lh-tight:              1.2;
  --lh-base:               1.6;
  --lh-relaxed:            1.8;

  /* -- Spacing -- */
  --space-2xs:             0.25rem;  /*  4px */
  --space-xs:              0.5rem;   /*  8px */
  --space-sm:              0.75rem;  /* 12px */
  --space-md:              1rem;     /* 16px */
  --space-lg:              1.5rem;   /* 24px */
  --space-xl:              2rem;     /* 32px */
  --space-2xl:             3rem;     /* 48px */
  --space-3xl:             4rem;     /* 64px */

  /* -- Layout -- */
  --max-width:             1180px;
  --max-width-narrow:      960px;
  --header-height:         64px;
  --header-height-mobile:  56px;

  /* -- Border Radius -- */
  --radius-sm:             6px;
  --radius-md:             10px;
  --radius-lg:             16px;
  --radius-xl:             24px;
  --radius-full:           9999px;

  /* -- Shadows -- */
  --shadow-sm:             0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:             0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:             0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow:           0 0 20px rgba(74, 144, 217, 0.15);
  --shadow-glow-accent:    0 0 20px rgba(139, 92, 246, 0.15);

  /* -- Transitions -- */
  --transition-fast:       150ms ease;
  --transition-base:       250ms ease;
  --transition-slow:       400ms ease;

  /* -- Z-index layers -- */
  --z-dropdown:            100;
  --z-sticky:              200;
  --z-header:              300;
  --z-overlay:             400;
  --z-modal:               500;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-normal);
  line-height: var(--lh-base);
  color: var(--clr-text);
  background: var(--clr-bg);
  background-image: var(--clr-gradient-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--clr-primary-light);
}

ul, ol {
  list-style: none;
}

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

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--clr-text);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: var(--space-xs) var(--space-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

::selection {
  background: var(--clr-primary);
  color: var(--clr-white);
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--clr-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--clr-border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--clr-text-muted);
}

/* --------------------------------------------------------------------------
   3. Typography Utility Classes
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--clr-white);
}

.text-gradient {
  background: var(--clr-gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-muted  { color: var(--clr-text-muted); }
.text-secondary { color: var(--clr-text-secondary); }

/* --------------------------------------------------------------------------
   4. Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
}

/* --------------------------------------------------------------------------
   5. Header / Navigation
   -------------------------------------------------------------------------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--clr-border);
  transition: background var(--transition-base);
}

.header.scrolled {
  background: rgba(10, 10, 15, 0.98);
  box-shadow: var(--shadow-md);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.header__left {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

/* -- Logo -- */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  text-decoration: none;
}
.logo:hover {
  color: var(--clr-white);
}
.logo__icon {
  width: 32px;
  height: 32px;
  background: var(--clr-gradient-brand);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
}

/* -- Nav Links -- */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__link {
  color: var(--clr-text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  padding: var(--space-2xs) 0;
  position: relative;
  transition: color var(--transition-fast);
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--clr-gradient-brand);
  transition: width var(--transition-base);
  border-radius: 1px;
}
.nav__link:hover,
.nav__link.active {
  color: var(--clr-white);
}
.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

/* -- Header Right (actions) -- */
.header__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__action {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--clr-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
}
.header__action:hover {
  background: var(--clr-surface);
  color: var(--clr-white);
}

/* -- Cart Badge -- */
.cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--clr-error);
  color: var(--clr-white);
  font-size: 11px;
  font-weight: var(--fw-bold);
  line-height: 18px;
  text-align: center;
  border-radius: var(--radius-full);
  transform: scale(0);
  transition: transform var(--transition-base);
}
.cart-badge.show {
  transform: scale(1);
}

/* -- Login Button -- */
.btn-login {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--clr-border-light);
  color: var(--clr-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  transition: all var(--transition-fast);
}
.btn-login:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: rgba(74, 144, 217, 0.08);
}

/* -- Hamburger (mobile) -- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-xs);
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: all var(--transition-base);
  transform-origin: center;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* -- Mobile Nav -- */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.98);
  backdrop-filter: blur(20px);
  z-index: var(--z-overlay);
  padding: var(--space-xl);
  flex-direction: column;
  gap: var(--space-lg);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}
.mobile-nav.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav__link {
  color: var(--clr-text-secondary);
  font-size: var(--fs-xl);
  font-weight: var(--fw-medium);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--clr-border);
  transition: color var(--transition-fast);
}
.mobile-nav__link:hover,
.mobile-nav__link.active {
  color: var(--clr-white);
}

/* -- Search Overlay -- */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.search-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.search-overlay__inner {
  width: 100%;
  max-width: 600px;
  padding: 0 var(--space-lg);
}

.search-overlay__input {
  width: 100%;
  font-size: var(--fs-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--clr-surface);
  border: 2px solid var(--clr-primary);
  border-radius: var(--radius-lg);
  color: var(--clr-text);
}
.search-overlay__input::placeholder {
  color: var(--clr-text-muted);
}

.search-overlay__close {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--clr-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text);
  font-size: var(--fs-xl);
  transition: background var(--transition-fast);
}
.search-overlay__close:hover {
  background: var(--clr-surface-light);
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  transition: all var(--transition-base);
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: var(--clr-gradient-brand);
  color: var(--clr-white);
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover {
  background: var(--clr-gradient-brand-hover);
  box-shadow: var(--shadow-glow), 0 0 30px rgba(74, 144, 217, 0.25);
  color: var(--clr-white);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--clr-white);
  border: 1px solid var(--clr-border-light);
}
.btn--outline:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: rgba(74, 144, 217, 0.08);
}

.btn--ghost {
  background: transparent;
  color: var(--clr-text-secondary);
}
.btn--ghost:hover {
  background: var(--clr-surface);
  color: var(--clr-text);
}

.btn--sm {
  padding: var(--space-2xs) var(--space-sm);
  font-size: var(--fs-xs);
}

.btn--lg {
  padding: var(--space-md) var(--space-2xl);
  font-size: var(--fs-md);
}

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

.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}
.card:hover {
  background: var(--clr-bg-card-hover);
  border-color: var(--clr-border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card__image {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--clr-surface);
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.card:hover .card__image img {
  transform: scale(1.05);
}

.card__badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--clr-white);
  z-index: 1;
}
.card__badge--new     { background: var(--clr-tag-new); }
.card__badge--hot     { background: var(--clr-tag-hot); }
.card__badge--limited { background: var(--clr-tag-limited); }

.card__body {
  padding: var(--space-md);
}

.card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2xs);
  color: var(--clr-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__subtitle {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-sm);
}

.card__price {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.card__price-current {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
}
.card__price-original {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  text-decoration: line-through;
}

.card__footer {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-top: 1px solid var(--clr-border);
}

/* -- Card grid -- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }
}

@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* --------------------------------------------------------------------------
   8. Section Headers
   -------------------------------------------------------------------------- */
.section {
  padding: var(--space-3xl) 0;
}

.section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
}
.section__header--center {
  text-align: center;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.section__title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  margin-bottom: var(--space-xs);
}

.section__subtitle {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
}

.section__more {
  font-size: var(--fs-sm);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  transition: gap var(--transition-fast);
}
.section__more:hover {
  gap: var(--space-xs);
  color: var(--clr-primary-light);
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-2xl) 0;
  }
  .section__title {
    font-size: var(--fs-xl);
  }
}

/* --------------------------------------------------------------------------
   9. Banner / Hero Carousel
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  margin-top: var(--header-height);
  overflow: hidden;
}

.hero__carousel {
  position: relative;
  height: 520px;
  overflow: hidden;
}

.hero__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--transition-slow);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__slide.active {
  opacity: 1;
  z-index: 1;
}

.hero__slide-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.hero__slide-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 700px;
  padding: 0 var(--space-lg);
}

.hero__slide-title {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  margin-bottom: var(--space-md);
  line-height: var(--lh-tight);
}

.hero__slide-desc {
  font-size: var(--fs-lg);
  color: var(--clr-text-secondary);
  margin-bottom: var(--space-xl);
  line-height: var(--lh-relaxed);
}

.hero__slide-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* -- Carousel Controls -- */
.hero__control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-white);
  font-size: var(--fs-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}
.hero__control:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: var(--clr-primary);
}
.hero__control--prev { left: var(--space-lg); }
.hero__control--next { right: var(--space-lg); }

/* -- Carousel Dots -- */
.hero__dots {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: var(--space-sm);
}

.hero__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.hero__dot.active {
  background: var(--clr-primary);
  width: 28px;
  border-radius: 5px;
}

@media (max-width: 768px) {
  .hero__carousel {
    height: 400px;
  }
  .hero__slide-title {
    font-size: var(--fs-2xl);
  }
  .hero__slide-desc {
    font-size: var(--fs-base);
  }
  .hero__control {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero__carousel {
    height: 340px;
  }
  .hero__slide-title {
    font-size: var(--fs-xl);
  }
}

/* --------------------------------------------------------------------------
   10. Brand Channel Nav (圆形icon分类导航)
   -------------------------------------------------------------------------- */
.brand-nav {
  padding: var(--space-2xl) 0;
}

.brand-nav__grid {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.brand-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.brand-nav__item:hover {
  transform: translateY(-4px);
}

.brand-nav__icon {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: var(--clr-bg-card);
  border: 2px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all var(--transition-base);
  overflow: hidden;
}
.brand-nav__item:hover .brand-nav__icon {
  border-color: var(--clr-primary);
  background: var(--clr-bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.brand-nav__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--clr-text-secondary);
  transition: color var(--transition-fast);
}
.brand-nav__item:hover .brand-nav__label {
  color: var(--clr-text);
}

@media (max-width: 480px) {
  .brand-nav__grid {
    gap: var(--space-md);
  }
  .brand-nav__icon {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
}

/* --------------------------------------------------------------------------
   11. Template Preview Cards (定制模板)
   -------------------------------------------------------------------------- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

.template-card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  position: relative;
}
.template-card:hover {
  transform: translateY(-4px);
  border-color: var(--clr-border-light);
  box-shadow: var(--shadow-lg), var(--shadow-glow-accent);
}

.template-card__preview {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--clr-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.template-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.template-card:hover .template-card__preview img {
  transform: scale(1.05);
}

.template-card__body {
  padding: var(--space-md);
  text-align: center;
}

.template-card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--clr-white);
  margin-bottom: var(--space-2xs);
}

.template-card__desc {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  margin-bottom: var(--space-md);
}

.template-card__action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-lg);
  background: var(--clr-gradient-brand);
  color: var(--clr-white);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  transition: all var(--transition-fast);
}
.template-card__action:hover {
  background: var(--clr-gradient-brand-hover);
  box-shadow: var(--shadow-glow);
  color: var(--clr-white);
}

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

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

@media (max-width: 480px) {
  .template-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
  }
}

/* --------------------------------------------------------------------------
   12. Reviews / Testimonials
   -------------------------------------------------------------------------- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.review-card {
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}
.review-card:hover {
  border-color: var(--clr-border-light);
  box-shadow: var(--shadow-md);
}

.review-card__stars {
  display: flex;
  gap: 2px;
  margin-bottom: var(--space-md);
  color: var(--clr-star);
  font-size: var(--fs-base);
}

.review-card__text {
  font-size: var(--fs-sm);
  color: var(--clr-text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-lg);
  font-style: italic;
}

.review-card__author {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.review-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--clr-gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-white);
  font-weight: var(--fw-bold);
  font-size: var(--fs-md);
  flex-shrink: 0;
}

.review-card__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--clr-white);
}

.review-card__meta {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
}

@media (max-width: 768px) {
  .reviews-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  .review-card {
    padding: var(--space-md);
  }
}

/* --------------------------------------------------------------------------
   13. Brand Story Section
   -------------------------------------------------------------------------- */
.brand-story {
  background: var(--clr-bg-alt);
  position: relative;
  overflow: hidden;
}
.brand-story::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(74, 144, 217, 0.08), transparent 70%);
  pointer-events: none;
}
.brand-story::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06), transparent 70%);
  pointer-events: none;
}

.brand-story__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3xl);
  position: relative;
  z-index: 1;
}

.brand-story__visual {
  flex: 1;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--clr-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--clr-border);
}

.brand-story__content {
  flex: 1;
}

.brand-story__title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-md);
}

.brand-story__text {
  font-size: var(--fs-base);
  color: var(--clr-text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-lg);
}

.brand-story__stats {
  display: flex;
  gap: var(--space-2xl);
}

.brand-story__stat-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
}

.brand-story__stat-label {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
}

@media (max-width: 768px) {
  .brand-story__inner {
    flex-direction: column;
    gap: var(--space-xl);
  }
  .brand-story__visual {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
  .brand-story__title {
    font-size: var(--fs-xl);
  }
  .brand-story__stats {
    gap: var(--space-lg);
  }
}

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--clr-bg-alt);
  border-top: 1px solid var(--clr-border);
  padding: var(--space-3xl) 0 var(--space-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.footer__brand {
  max-width: 320px;
}

.footer__brand-desc {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  line-height: var(--lh-relaxed);
  margin-top: var(--space-md);
}

.footer__heading {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--clr-white);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__link {
  font-size: var(--fs-sm);
  color: var(--clr-text-muted);
  transition: color var(--transition-fast);
}
.footer__link:hover {
  color: var(--clr-primary);
}

.footer__social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.footer__social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  font-size: var(--fs-base);
  transition: all var(--transition-fast);
}
.footer__social-link:hover {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: var(--clr-white);
}

/* -- Payment Icons -- */
.footer__payments {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

.payment-icon {
  padding: var(--space-xs) var(--space-sm);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
  font-weight: var(--fw-medium);
}

/* -- Footer Bottom -- */
.footer__bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__copyright {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
}

.footer__legal-links {
  display: flex;
  gap: var(--space-md);
}
.footer__legal-links a {
  font-size: var(--fs-xs);
  color: var(--clr-text-muted);
}
.footer__legal-links a:hover {
  color: var(--clr-primary);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
  .footer__brand {
    grid-column: span 2;
    max-width: 100%;
  }
  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
  .footer__brand {
    grid-column: span 1;
  }
}

/* --------------------------------------------------------------------------
   15. Filter Bar (筛选栏)
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.filter-bar__group {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.filter-bar__btn {
  padding: var(--space-2xs) var(--space-md);
  border-radius: var(--radius-full);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-secondary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.filter-bar__btn:hover {
  border-color: var(--clr-border-light);
  color: var(--clr-text);
}
.filter-bar__btn.active {
  background: var(--clr-gradient-brand);
  border-color: transparent;
  color: var(--clr-white);
}

.filter-bar__sort {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.filter-bar__sort select {
  padding: var(--space-2xs) var(--space-md);
  background: var(--clr-bg-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-full);
  color: var(--clr-text-secondary);
  font-size: var(--fs-xs);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   16. Animations & Utilities
   -------------------------------------------------------------------------- */

/* -- Fade in up -- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.fade-in-up--delay-1 { animation-delay: 0.1s; }
.fade-in-up--delay-2 { animation-delay: 0.2s; }
.fade-in-up--delay-3 { animation-delay: 0.3s; }
.fade-in-up--delay-4 { animation-delay: 0.4s; }

/* -- Skeleton loading -- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--clr-bg-card) 25%, var(--clr-surface) 50%, var(--clr-bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* -- Gap utilities -- */
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }
.gap-xl  { gap: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* -- Visually hidden (accessible) -- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
