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

:root {
  --primary: #f97316;
  --primary-dark: #ea580c;
  --primary-light: #ffedd5;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --green: #07c160;
  --radius: 8px;
  --max-w: 1200px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

#site-header { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.brand-text { font-size: 22px; font-weight: 700; color: var(--primary); }
.nav { display: flex; gap: 8px; flex: 1; }
.nav-link { padding: 8px 14px; border-radius: 6px; color: var(--text-muted); font-size: 14px; text-decoration: none; }
.nav-link:hover, .nav-link.is-active { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.cart-link { color: var(--text); text-decoration: none; position: relative; }
.cart-link:hover { color: var(--primary); text-decoration: none; }
.cart-badge { background: #ef4444; color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; margin-left: 4px; }
.header-user { color: var(--text-muted); }
.logout-link { color: var(--text-muted); font-size: 13px; margin-left: 8px; }

.site-main { flex: 1; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.page-header { padding: 32px 0 20px; }
.page-header h1 { font-size: 28px; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 24px; border-radius: 6px; font-size: 15px; font-weight: 600; border: none; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.banner-slider { position: relative; height: 360px; overflow: hidden; border-radius: var(--radius); margin-bottom: 24px; }
.banner-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.5s; }
.banner-slide.active { opacity: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 32px; background: linear-gradient(transparent, rgba(0,0,0,0.6)); color: #fff; }
.banner-caption h2 { font-size: 28px; margin-bottom: 4px; }

.cat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 32px; }
.cat-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); color: inherit; text-decoration: none; transition: transform 0.15s; }
.cat-card:hover { transform: translateY(-2px); text-decoration: none; }
.cat-card img { width: 100%; height: 100px; object-fit: cover; }
.cat-card span { display: block; padding: 10px; text-align: center; font-size: 14px; font-weight: 600; }

.section-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.product-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); color: inherit; text-decoration: none; transition: transform 0.15s; }
.product-card:hover { transform: translateY(-2px); text-decoration: none; }
.product-card img { width: 100%; height: 220px; object-fit: cover; }
.product-card-body { padding: 14px; }
.product-card h3 { font-size: 14px; margin-bottom: 8px; line-height: 1.4; height: 40px; overflow: hidden; color: var(--text); }
.product-price { color: var(--primary); font-size: 18px; font-weight: 700; }
.product-price del { color: var(--text-muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
.product-sales { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.product-detail { display: grid; grid-template-columns: 420px 1fr; gap: 40px; background: var(--card); border-radius: var(--radius); padding: 32px; margin-bottom: 40px; }
.product-detail-img img { width: 100%; border-radius: var(--radius); }
.product-detail-info h1 { font-size: 24px; margin-bottom: 12px; }
.product-detail-price { font-size: 32px; color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.product-detail-price del { font-size: 16px; color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.product-meta { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.product-desc { font-size: 15px; line-height: 1.8; color: #374151; margin-bottom: 24px; padding: 16px; background: var(--bg); border-radius: var(--radius); }
.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty-btn { width: 32px; height: 32px; border: 1px solid var(--border); background: var(--card); border-radius: 4px; font-size: 18px; cursor: pointer; }
.qty-num { font-size: 16px; font-weight: 600; min-width: 24px; text-align: center; }
.action-btns { display: flex; gap: 12px; }

.cart-table { width: 100%; background: var(--card); border-radius: var(--radius); border-collapse: collapse; margin-bottom: 20px; }
.cart-table th, .cart-table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--border); }
.cart-table th { background: var(--bg); font-size: 14px; color: var(--text-muted); }
.cart-product { display: flex; align-items: center; gap: 12px; }
.cart-product img { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; }
.cart-summary { background: var(--card); border-radius: var(--radius); padding: 24px; max-width: 360px; margin-left: auto; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--text-muted); }
.summary-row.total { font-size: 18px; font-weight: 700; color: var(--text); border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.summary-row.total span:last-child { color: var(--primary); }

.checkout-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; margin-bottom: 40px; }
.checkout-panel { background: var(--card); border-radius: var(--radius); padding: 24px; }
.checkout-panel h2 { font-size: 18px; margin-bottom: 16px; }
.address-box { padding: 16px; background: var(--primary-light); border-radius: var(--radius); margin-bottom: 16px; }
.order-item-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }

.pay-wrap { max-width: 480px; margin: 60px auto; background: var(--card); border-radius: var(--radius); padding: 40px; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.pay-amount { font-size: 42px; font-weight: 700; margin: 20px 0; }
.pay-method { display: flex; align-items: center; gap: 12px; padding: 16px; border: 2px solid var(--green); border-radius: var(--radius); margin: 24px 0; text-align: left; }
.pay-icon { width: 40px; height: 40px; background: var(--green); color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

.order-tabs { display: flex; background: var(--card); border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--border); }
.order-tab { flex: 1; text-align: center; padding: 14px; font-size: 14px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.order-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.order-list { background: var(--card); border-radius: 0 0 var(--radius) var(--radius); padding: 16px; margin-bottom: 40px; }
.order-card { display: block; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; color: inherit; text-decoration: none; }
.order-card:hover { border-color: var(--primary); text-decoration: none; }
.order-card-head { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 13px; color: var(--text-muted); }
.order-status { color: var(--primary); font-weight: 600; }

.timeline { padding: 24px 0; }
.timeline-item { display: flex; gap: 16px; padding-bottom: 28px; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 11px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--border); flex-shrink: 0; z-index: 1; }
.timeline-item.is-done .timeline-dot, .timeline-item.is-current .timeline-dot { background: var(--primary); }
.timeline-item.is-current .timeline-dot { box-shadow: 0 0 0 4px var(--primary-light); }

.form-card { max-width: 640px; margin: 0 auto 40px; background: var(--card); border-radius: var(--radius); padding: 32px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px; outline: none; font-family: inherit; }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 16px; }

.prose-block { background: var(--card); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.prose-block h2 { font-size: 18px; color: var(--primary); margin-bottom: 12px; }
.prose-block p { font-size: 14px; line-height: 1.8; color: #374151; margin-bottom: 8px; }
.prose-block h3 { font-size: 15px; margin: 16px 0 8px; color: #1f2937; }
.prose-block ol { padding-left: 24px; margin-bottom: 10px; }
.prose-block li { font-size: 14px; line-height: 1.8; color: #374151; margin-bottom: 6px; }
.prose { background: var(--card); border-radius: var(--radius); padding: 36px; border: 1px solid var(--border); }
.prose h2 { font-size: 20px; margin: 28px 0 12px; color: var(--primary); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 16px; margin: 20px 0 8px; color: #1f2937; }
.prose p, .prose li { font-size: 15px; color: #374151; margin-bottom: 10px; line-height: 1.8; }
.prose ol { padding-left: 24px; margin-bottom: 12px; }
.prose .legal-meta { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.prose .legal-toc { background: #fff7ed; border-radius: 8px; padding: 16px 20px; margin-bottom: 24px; }
.prose .legal-toc a { color: var(--primary); font-size: 14px; display: block; margin-bottom: 6px; }

#site-footer { background: #1f2937; color: #9ca3af; padding: 40px 0 24px; margin-top: auto; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; text-align: center; }
.footer-brand strong { color: #f9fafb; font-size: 18px; display: block; margin-bottom: 4px; }
.footer-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin: 12px 0; }
.footer-meta a { color: #d1d5db; }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 12px; }
.footer-links a { color: #9ca3af; font-size: 14px; }
.footer-copy { font-size: 12px; color: #6b7280; }
.empty-state { text-align: center; padding: 60px; color: var(--text-muted); }

.m-header { max-width: var(--max-w); margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; background: var(--card); border-bottom: 1px solid var(--border); }
.m-brand { font-size: 22px; font-weight: 700; color: var(--primary); }
.m-nav { display: flex; gap: 20px; font-size: 14px; }

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .cat-row { grid-template-columns: repeat(3, 1fr); }
  .checkout-grid { grid-template-columns: 1fr; }
}
