@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f0f2f5;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #5a6c7d;
  --text-muted: #8a9aab;
  --accent-orange: #ff6b35;
  --accent-red: #e63946;
  --accent-green: #2ec4b6;
  --accent-gold: #ffb703;
  --border-color: #e1e8ed;
  --border-light: #d1d9e0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-body: 'Noto Sans SC', 'DM Sans', sans-serif;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s ease;
  --container-max: 1280px;
  --header-height: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg-secondary); color: var(--text-primary); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }

/* Header */
.mall-header { background: #fff; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; }
.header-top { background: var(--text-primary); color: #fff; font-size: 0.75rem; padding: 6px 0; }
.header-top .container { display: flex; justify-content: space-between; }
.header-top a { color: #fff; opacity: 0.8; transition: opacity var(--transition-fast); }
.header-top a:hover { opacity: 1; }
.header-main { height: var(--header-height); display: flex; align-items: center; }
.header-main .container { display: flex; align-items: center; gap: 32px; width: 100%; }
.mall-logo { font-size: 1.5rem; font-weight: 700; color: var(--accent-orange); display: flex; align-items: center; gap: 8px; }
.mall-logo span { font-size: 0.7rem; background: var(--accent-orange); color: #fff; padding: 2px 8px; border-radius: 100px; }
.search-box { flex: 1; max-width: 500px; display: flex; border: 2px solid var(--accent-orange); border-radius: var(--radius-md); overflow: hidden; }
.search-box input { flex: 1; padding: 10px 16px; border: none; outline: none; font-size: 0.9rem; }
.search-box button { padding: 10px 24px; background: var(--accent-orange); color: #fff; border: none; cursor: pointer; font-weight: 600; transition: background var(--transition-fast); }
.search-box button:hover { background: #e55a2b; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-action { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.75rem; color: var(--text-secondary); cursor: pointer; transition: color var(--transition-fast); position: relative; }
.header-action:hover { color: var(--accent-orange); }
.header-action .icon { font-size: 1.3rem; }
.cart-badge { position: absolute; top: -4px; right: -8px; background: var(--accent-red); color: #fff; font-size: 0.65rem; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; }

/* Nav */
.mall-nav { background: #fff; border-bottom: 1px solid var(--border-color); }
.mall-nav .container { display: flex; align-items: center; gap: 0; }
.nav-category { background: var(--accent-orange); color: #fff; padding: 12px 24px; font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.nav-links { display: flex; gap: 32px; padding: 0 24px; }
.nav-links a { padding: 12px 0; font-size: 0.9rem; color: var(--text-primary); font-weight: 500; transition: color var(--transition-fast); }
.nav-links a:hover { color: var(--accent-orange); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border: none; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all var(--transition-fast); }
.btn-primary { background: var(--accent-orange); color: #fff; }
.btn-primary:hover { background: #e55a2b; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-secondary:hover { background: var(--border-color); }
.btn-outline { background: transparent; border: 1px solid var(--accent-orange); color: var(--accent-orange); }
.btn-outline:hover { background: var(--accent-orange); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* Hero Banner */
.hero-banner { padding: 24px 0; }
.banner-grid { display: grid; grid-template-columns: 240px 1fr 280px; gap: 16px; height: 400px; }
.banner-category { background: #fff; border-radius: var(--radius-md); padding: 16px; overflow-y: auto; }
.banner-category h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.category-list { list-style: none; }
.category-list li { padding: 6px 0; font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; transition: color var(--transition-fast); }
.category-list li:hover { color: var(--accent-orange); }
.banner-main { background: linear-gradient(135deg, #ff6b35, #ffb703); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; position: relative; overflow: hidden; }
.banner-main::before { content: ''; position: absolute; width: 300px; height: 300px; background: rgba(255,255,255,0.1); border-radius: 50%; top: -100px; right: -100px; }
.banner-main h2 { font-size: 2.5rem; font-weight: 700; margin-bottom: 12px; }
.banner-main p { font-size: 1.1rem; opacity: 0.9; }
.banner-side { display: flex; flex-direction: column; gap: 16px; }
.banner-card { flex: 1; background: #fff; border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; transition: all var(--transition-smooth); cursor: pointer; }
.banner-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.banner-card .icon { font-size: 2rem; margin-bottom: 8px; }
.banner-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.banner-card p { font-size: 0.75rem; color: var(--text-muted); }

/* Section */
.section { padding: 32px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 4px; height: 20px; background: var(--accent-orange); border-radius: 2px; }
.section-more { font-size: 0.85rem; color: var(--text-muted); transition: color var(--transition-fast); }
.section-more:hover { color: var(--accent-orange); }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.product-card { background: #fff; border-radius: var(--radius-md); overflow: hidden; transition: all var(--transition-smooth); cursor: pointer; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-image { aspect-ratio: 1; background: var(--bg-tertiary); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--text-muted); overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 12px; }
.product-title { font-size: 0.85rem; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-size: 1.1rem; font-weight: 700; color: var(--accent-red); }
.product-price .original { font-size: 0.75rem; color: var(--text-muted); text-decoration: line-through; margin-left: 6px; font-weight: 400; }
.product-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 0.72rem; color: var(--text-muted); }

/* Flash Sale */
.flash-sale { background: linear-gradient(135deg, #e63946, #ff6b35); border-radius: var(--radius-md); padding: 24px; color: #fff; }
.flash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.flash-title { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 12px; }
.countdown { display: flex; gap: 6px; align-items: center; }
.countdown-item { background: rgba(0,0,0,0.3); padding: 4px 8px; border-radius: 4px; font-weight: 700; font-size: 0.9rem; }
.flash-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.flash-item { background: #fff; border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.flash-item .product-image { aspect-ratio: 1; margin-bottom: 8px; border-radius: var(--radius-sm); }
.flash-item .product-price { font-size: 0.95rem; }

/* Footer */
.mall-footer { background: #fff; border-top: 1px solid var(--border-color); padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 0.82rem; color: var(--text-secondary); transition: color var(--transition-fast); }
.footer-col a:hover { color: var(--accent-orange); }
.footer-bottom { text-align: center; padding-top: 20px; border-top: 1px solid var(--border-color); font-size: 0.78rem; color: var(--text-muted); }

/* Product List Page */
.page-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 24px 0; }
.filter-panel { background: #fff; border-radius: var(--radius-md); padding: 20px; height: fit-content; position: sticky; top: calc(var(--header-height) + 60px); }
.filter-group { margin-bottom: 24px; }
.filter-group h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-tag { padding: 4px 12px; background: var(--bg-tertiary); border-radius: 100px; font-size: 0.78rem; cursor: pointer; transition: all var(--transition-fast); }
.filter-tag:hover, .filter-tag.active { background: var(--accent-orange); color: #fff; }
.product-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 12px 16px; background: #fff; border-radius: var(--radius-md); }
.sort-options { display: flex; gap: 16px; }
.sort-option { font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; padding: 4px 0; border-bottom: 2px solid transparent; transition: all var(--transition-fast); }
.sort-option:hover, .sort-option.active { color: var(--accent-orange); border-color: var(--accent-orange); }

/* Product Detail */
.detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 32px 0; }
.detail-gallery { background: #fff; border-radius: var(--radius-md); padding: 24px; }
.gallery-main { aspect-ratio: 1; background: var(--bg-tertiary); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 6rem; color: var(--text-muted); margin-bottom: 16px; overflow: hidden; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.gallery-thumb { aspect-ratio: 1; background: var(--bg-tertiary); border-radius: var(--radius-sm); border: 2px solid transparent; cursor: pointer; transition: border-color var(--transition-fast); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--text-muted); overflow: hidden; }
.gallery-thumb:hover, .gallery-thumb.active { border-color: var(--accent-orange); }
.detail-info { background: #fff; border-radius: var(--radius-md); padding: 32px; }
.detail-title { font-size: 1.3rem; font-weight: 600; line-height: 1.4; margin-bottom: 16px; }
.detail-price { background: linear-gradient(135deg, #fff5f0, #fff); padding: 16px; border-radius: var(--radius-md); margin-bottom: 24px; }
.detail-price .price { font-size: 2rem; font-weight: 700; color: var(--accent-red); }
.detail-price .price small { font-size: 1rem; }
.detail-price .original { font-size: 0.9rem; color: var(--text-muted); text-decoration: line-through; margin-left: 12px; }
.detail-meta { display: grid; gap: 16px; margin-bottom: 24px; }
.meta-item { display: flex; align-items: center; gap: 12px; font-size: 0.88rem; }
.meta-item .label { color: var(--text-muted); width: 60px; }
.meta-item .value { color: var(--text-primary); }
.sku-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.sku-option { padding: 6px 16px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer; transition: all var(--transition-fast); }
.sku-option:hover, .sku-option.active { border-color: var(--accent-orange); color: var(--accent-orange); background: #fff5f0; }
.quantity-selector { display: flex; align-items: center; gap: 0; border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; }
.quantity-btn { width: 32px; height: 32px; border: none; background: var(--bg-tertiary); cursor: pointer; font-size: 1rem; transition: background var(--transition-fast); }
.quantity-btn:hover { background: var(--border-color); }
.quantity-input { width: 50px; height: 32px; border: none; border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); text-align: center; font-size: 0.9rem; }
.detail-actions { display: flex; gap: 12px; margin-top: 32px; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 32px 0; }
.cart-items { background: #fff; border-radius: var(--radius-md); overflow: hidden; }
.cart-header { display: grid; grid-template-columns: 40px 1fr 120px 140px 80px; gap: 16px; padding: 16px 20px; background: var(--bg-tertiary); font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.cart-item { display: grid; grid-template-columns: 40px 1fr 120px 140px 80px; gap: 16px; padding: 20px; border-bottom: 1px solid var(--border-color); align-items: center; }
.cart-item:last-child { border-bottom: none; }
.cart-checkbox { width: 18px; height: 18px; accent-color: var(--accent-orange); }
.cart-product { display: flex; gap: 12px; }
.cart-product-img { width: 80px; height: 80px; background: var(--bg-tertiary); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--text-muted); overflow: hidden; }
.cart-product-info h4 { font-size: 0.88rem; font-weight: 500; margin-bottom: 4px; }
.cart-product-info p { font-size: 0.75rem; color: var(--text-muted); }
.cart-summary { background: #fff; border-radius: var(--radius-md); padding: 24px; height: fit-content; position: sticky; top: calc(var(--header-height) + 60px); }
.summary-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 0.88rem; }
.summary-row.total { font-size: 1rem; font-weight: 700; color: var(--accent-red); padding-top: 16px; border-top: 1px solid var(--border-color); margin-top: 16px; }
.summary-row .amount { font-weight: 600; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 24px; padding: 32px 0; }
.checkout-section { background: #fff; border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; }
.checkout-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.checkout-section h3 .step { width: 24px; height: 24px; background: var(--accent-orange); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; }
.address-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; cursor: pointer; transition: all var(--transition-fast); }
.address-card:hover, .address-card.active { border-color: var(--accent-orange); background: #fff5f0; }
.address-card .name { font-weight: 600; margin-bottom: 4px; }
.address-card .info { font-size: 0.85rem; color: var(--text-secondary); }
.payment-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.payment-option { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; text-align: center; cursor: pointer; transition: all var(--transition-fast); }
.payment-option:hover, .payment-option.active { border-color: var(--accent-orange); background: #fff5f0; }
.payment-option .icon { font-size: 1.5rem; margin-bottom: 6px; }
.payment-option .name { font-size: 0.85rem; font-weight: 500; }

/* Merchant Page */
.merchant-hero { background: linear-gradient(135deg, #1a1a1a, #333); color: #fff; padding: 60px 0; text-align: center; }
.merchant-hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 16px; }
.merchant-hero p { font-size: 1.1rem; opacity: 0.8; margin-bottom: 32px; }
.merchant-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 48px 0; }
.step-card { text-align: center; padding: 32px 24px; background: #fff; border-radius: var(--radius-md); transition: all var(--transition-smooth); }
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.step-card .step-num { width: 48px; height: 48px; background: var(--accent-orange); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 700; margin: 0 auto 16px; }
.step-card h4 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.step-card p { font-size: 0.85rem; color: var(--text-secondary); }
.merchant-benefits { background: #fff; border-radius: var(--radius-md); padding: 48px; margin: 32px 0; }
.benefits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.benefit-item { text-align: center; }
.benefit-item .icon { font-size: 2.5rem; margin-bottom: 16px; }
.benefit-item h4 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.benefit-item p { font-size: 0.85rem; color: var(--text-secondary); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 8px; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 0.9rem; transition: border-color var(--transition-fast); outline: none; }
.form-input:focus { border-color: var(--accent-orange); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Responsive */
@media (max-width: 1024px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .banner-grid { grid-template-columns: 1fr; height: auto; }
  .banner-category { display: none; }
  .flash-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .flash-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-layout, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .merchant-steps { grid-template-columns: repeat(2, 1fr); }
  .benefits-grid { grid-template-columns: 1fr; }
}
