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

:root {
  --primary: #0EA5E9;
  --primary-dark: #0284C7;
  --accent: #38BDF8;
  --bg: #F1F5F9;
  --text: #0F172A;
  --white: #ffffff;
  --gray: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 12px;
}

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

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  font-size: 0.75rem;
  color: var(--gray);
  font-weight: 400;
}

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

.nav a {
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav a:hover, .nav a.active { color: var(--primary); }

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

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

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  padding: 8px;
}

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-info {
  font-size: 0.9rem;
  color: var(--gray);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  padding: 80px 24px;
  text-align: center;
  color: white;
}

.hero h1 {
  font-size: 2.8rem;
  margin-bottom: 16px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.95;
  margin-bottom: 32px;
}

.hero .btn {
  background: white;
  color: var(--primary);
}

.hero .btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
}

.section-title h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.section-title p {
  color: var(--gray);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.product-img-wrap {
  position: relative;
  overflow: hidden;
}

.product-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: white;
  letter-spacing: 0.5px;
}

.badge-hot {
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  box-shadow: 0 2px 8px rgba(255,65,108,0.4);
}

.badge-recommend {
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: #5a3e00;
  box-shadow: 0 2px 8px rgba(247,151,30,0.4);
}

.product-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--accent);
}

.product-info {
  padding: 16px;
}

.product-name {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.product-price small {
  font-size: 0.8rem;
  color: var(--gray);
  font-weight: 400;
}

.product-sales {
  font-size: 0.82rem;
  color: var(--gray);
  margin-bottom: 12px;
}

.product-sales strong {
  color: #f59e0b;
  font-weight: 600;
}

/* Demo account box */
.demo-box {
  background: var(--accent);
  border: 1px dashed var(--primary);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 0.88rem;
}

.demo-box p {
  margin-bottom: 8px;
  color: var(--gray);
}

.demo-box code {
  background: var(--white);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--primary);
}

.demo-box .btn {
  margin-top: 10px;
  width: 100%;
}

/* Forms */
.form-page {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.form-card {
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
}

.form-card h2 {
  text-align: center;
  margin-bottom: 32px;
  color: var(--primary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--gray);
  font-size: 0.9rem;
}

.form-footer a {
  color: var(--primary);
  font-weight: 500;
}

/* Cart */
.cart-table {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto auto auto;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.cart-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-control button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
}

.qty-control span {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

.cart-summary {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-total {
  font-size: 1.5rem;
  font-weight: 700;
}

.cart-total span {
  color: var(--primary);
}

.remove-btn {
  color: #ef4444;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.empty-cart {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray);
}

.empty-cart .icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

/* Checkout */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

.checkout-form {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.checkout-form h3 {
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

.order-summary {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: sticky;
  top: 90px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--border);
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  font-size: 1.2rem;
  font-weight: 700;
}

.order-total span:last-child {
  color: var(--primary);
}

/* Payment */
.payment-methods {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.payment-option:hover, .payment-option.selected {
  border-color: var(--primary);
  background: var(--accent);
}

.payment-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.alipay-icon {
  width: 52px;
  height: 52px;
  background: #1677ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(22,119,255,0.3);
}

.alipay-icon svg {
  width: 32px;
  height: 32px;
}

.payment-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.payment-desc {
  color: var(--gray);
  font-size: 0.85rem;
}

.success-page {
  text-align: center;
  padding: 80px 24px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 24px;
}

/* Product Detail */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 1;
  object-fit: cover;
}

.detail-price {
  font-size: 2rem;
  color: var(--primary);
  font-weight: 700;
  margin: 16px 0;
}

.detail-desc {
  color: var(--gray);
  margin: 24px 0;
  line-height: 1.8;
}

.detail-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

/* Footer */
.footer {
  background: var(--text);
  color: #9ca3af;
  padding: 48px 24px 24px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer h4 {
  color: white;
  margin-bottom: 16px;
}

.footer p, .footer li {
  font-size: 0.9rem;
  line-height: 2;
}

.footer-bottom {
  max-width: 1280px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid #374151;
  text-align: center;
  font-size: 0.85rem;
}

/* Toast */
.toast {
  position: fixed;
  top: 90px;
  right: 24px;
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 200;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Filter */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

@media (max-width: 768px) {
  .nav { display: none; }
  .hero h1 { font-size: 1.8rem; }
  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: 12px;
  }
  .checkout-layout, .detail-layout {
    grid-template-columns: 1fr;
  }
  .footer-inner { grid-template-columns: 1fr; }
  .cart-summary { flex-direction: column; gap: 16px; }
}

/* === 模板专属样式: mall_slate === */

.carousel-wrap { position: relative; }
.flash-section { max-width: 1280px; margin: 0 auto 32px; padding: 0 24px; }
.flash-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.flash-header h3 { font-size: 1.3rem; color: var(--primary); margin: 0; }
.flash-tag { background: var(--primary); color: white; padding: 4px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.flash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flash-item { background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: transform 0.2s; text-decoration: none; color: inherit; display: block; }
.flash-item:hover { transform: translateY(-4px); }
.flash-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.flash-item .fi-info { padding: 10px; }
.flash-item .fi-info > div:first-child { color: var(--text); line-height: 1.4; }
.flash-item .fi-price { color: var(--primary); font-weight: 700; font-size: 1.1rem; margin-top: 4px; }
@media(max-width:768px) { .flash-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.top-bar { background: #0F172A; color: #94A3B8; text-align: center; padding: 8px; font-size: 0.8rem; letter-spacing: 1px; }
.mall-header { background: #1E293B; position: sticky; top: 0; z-index: 200; box-shadow: 0 4px 24px rgba(0,0,0,0.2); }
.mall-header-inner { max-width: 1280px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 24px; }
.mall-logo { font-size: 1.5rem; font-weight: 700; color: #38BDF8; letter-spacing: 1px; }
.mall-logo span { color: #64748B; font-size: 0.65rem; display: block; letter-spacing: 0; }
.search-box { flex: 1; display: flex; background: #0F172A; border: 1px solid #334155; border-radius: 8px; overflow: hidden; max-width: 540px; }
.search-box input { flex: 1; border: none; padding: 11px 16px; background: transparent; color: white; outline: none; }
.search-box input::placeholder { color: #64748B; }
.search-box button { background: #0EA5E9; color: white; border: none; padding: 0 24px; cursor: pointer; font-weight: 600; }
.mall-nav { background: #0F172A; border-top: 1px solid #334155; }
.mall-nav a { color: #94A3B8; padding: 12px 26px; font-size: 0.9rem; }
.mall-nav a.active { color: #38BDF8; border-bottom: 2px solid #38BDF8; }
.hero-slate { background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%); padding: 0 24px 40px; }
.hero-slate-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: center; padding-top: 32px; }
.hero-slate-text h1 { font-size: 2.6rem; color: white; font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
.hero-slate-text p { color: #94A3B8; margin-bottom: 24px; font-size: 1.05rem; }
.hero-slate-text .btn { background: #0EA5E9; color: white; font-weight: 700; padding: 14px 36px; border-radius: 8px; }
.hero-slate .carousel-wrap { height: 340px; border-radius: 12px; overflow: hidden; border: 1px solid #334155; }
.carousel-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: mallFade 12s infinite; }
.carousel-wrap img:nth-child(1) { animation-delay: 0s; }
.carousel-wrap img:nth-child(2) { animation-delay: 4s; }
.carousel-wrap img:nth-child(3) { animation-delay: 8s; }
@keyframes mallFade { 0%,28% { opacity:1; } 33%,100% { opacity:0; } }
.service-row { max-width: 1280px; margin: -24px auto 32px; padding: 0 24px; display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; position: relative; z-index: 2; }
.service-item { background: white; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,0.1); }
.service-item h4 { color: #0F172A; }
.flash-tag { background: #0EA5E9; color: white; }
.flash-header h3 { color: #0F172A; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 16px; }
.product-card { border-radius: 12px; background: white; box-shadow: 0 1px 8px rgba(0,0,0,0.06); }
.product-card:hover { box-shadow: 0 8px 30px rgba(14,165,233,0.15); transform: translateY(-3px); }
.product-price { color: #0EA5E9; font-size: 1.3rem; font-weight: 800; }
.cart-btn, .user-display a { color: #38BDF8 !important; }
.user-info { color: #94A3B8 !important; }
.footer { background: #0F172A; color: #64748B; border-top: 1px solid #334155; }
.footer h4 { color: #38BDF8; }
@media(max-width:768px) { .hero-slate-inner { grid-template-columns: 1fr; } .hero-slate-text h1 { font-size: 1.8rem; } .service-row,.flash-grid { grid-template-columns: repeat(2,1fr); } }

