/* ===== HAOLINCOM 样式 ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f59e0b;
  --danger: #ef4444;
  --bg: #ffffff;
  --bg-light: #f8fafc;
  --bg-gray: #f1f5f9;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
  --radius: 12px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color:var(--text); line-height:1.6; background:var(--bg); }

/* === Header === */
.top-bar { background:var(--text); color:#fff; text-align:center; padding:8px 16px; font-size:.85rem; display:flex; justify-content:center; gap:32px; flex-wrap:wrap; }
nav { display:flex; align-items:center; justify-content:space-between; padding:16px 40px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--bg); z-index:100; }
.logo { font-size:1.5rem; font-weight:800; text-decoration:none; color:var(--primary); letter-spacing:-0.5px; }
.nav-links { display:flex; list-style:none; gap:28px; }
.nav-links a { text-decoration:none; color:var(--text); font-weight:500; font-size:.95rem; transition:color .2s; }
.nav-links a:hover { color:var(--primary); }
.nav-actions { display:flex; align-items:center; gap:16px; }
.cart-btn { cursor:pointer; font-size:1.2rem; position:relative; padding:8px; border-radius:8px; transition:background .2s; }
.cart-btn:hover { background:var(--bg-light); }
#cart-count { position:absolute; top:0; right:0; background:var(--danger); color:#fff; font-size:.7rem; padding:1px 6px; border-radius:10px; min-width:18px; text-align:center; }

/* === Hero === */
.hero { background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #3b82f6 100%); color:#fff; padding:80px 40px; text-align:center; position:relative; overflow:hidden; }
.hero::before { content:''; position:absolute; inset:0; background:radial-gradient(circle at 30% 50%, rgba(255,255,255,.08) 0%, transparent 60%); }
.hero-content { position:relative; z-index:1; max-width:700px; margin:0 auto; }
.hero h1 { font-size:3rem; font-weight:800; line-height:1.15; margin-bottom:16px; }
.hero p { font-size:1.2rem; opacity:.85; margin-bottom:32px; }
.hero-btns { display:flex; gap:16px; justify-content:center; flex-wrap:wrap; }
.btn-primary { background:var(--accent); color:#000; text-decoration:none; padding:14px 36px; border-radius:50px; font-weight:700; font-size:1.05rem; display:inline-block; transition:transform .2s,box-shadow .2s; border:none; cursor:pointer; }
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(245,158,11,.4); }
.btn-outline { border:2px solid rgba(255,255,255,.5); color:#fff; text-decoration:none; padding:14px 36px; border-radius:50px; font-weight:700; font-size:1.05rem; transition:all .2s; }
.btn-outline:hover { border-color:#fff; background:rgba(255,255,255,.1); }

.hero-stats { display:flex; justify-content:center; gap:48px; margin-top:56px; position:relative; z-index:1; flex-wrap:wrap; }
.stat { text-align:center; }
.stat strong { display:block; font-size:1.8rem; }

/* === Categories === */
.categories { padding:72px 40px 48px; max-width:1200px; margin:0 auto; }
.categories h2, .deals h2, .products h2, .about h2 { text-align:center; font-size:2rem; margin-bottom:40px; }
.category-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:20px; }
.cat-card { background:var(--bg-light); border-radius:var(--radius); padding:28px 20px; text-align:center; cursor:pointer; transition:transform .2s,box-shadow .2s; border:2px solid transparent; }
.cat-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-md); border-color:var(--primary); }
.cat-icon { font-size:2.5rem; margin-bottom:12px; }
.cat-card h3 { font-size:1rem; margin-bottom:6px; }
.cat-card p { font-size:.8rem; color:var(--text-light); }

/* === Deals === */
.deals { padding:48px 40px; background:var(--bg-gray); }
.deals h2 { margin-bottom:32px; }
.deals-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:24px; max-width:1200px; margin:0 auto; }
.deal-card { background:#fff; border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); transition:transform .2s; position:relative; }
.deal-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.deal-badge { position:absolute; top:12px; left:12px; background:var(--danger); color:#fff; padding:4px 12px; border-radius:20px; font-size:.8rem; font-weight:700; }
.deal-img { width:100%; height:200px; object-fit:contain; background:var(--bg-light); padding:20px; }
.deal-info { padding:16px 20px 20px; }
.deal-info h3 { font-size:1.05rem; margin-bottom:6px; }
.deal-info .desc { color:var(--text-light); font-size:.85rem; margin-bottom:12px; }
.deal-info .price-row { display:flex; align-items:baseline; gap:8px; }
.deal-info .price { font-size:1.3rem; font-weight:800; color:var(--danger); }
.deal-info .old-price { font-size:.85rem; color:var(--text-light); text-decoration:line-through; }
.deal-info .add-btn { margin-top:12px; width:100%; padding:10px; background:var(--primary); color:#fff; border:none; border-radius:8px; font-weight:600; cursor:pointer; transition:background .2s; }
.deal-info .add-btn:hover { background:var(--primary-dark); }

/* === Products === */
.products { padding:72px 40px; max-width:1200px; margin:0 auto; }
.filter-bar { display:flex; justify-content:center; gap:10px; margin-bottom:36px; flex-wrap:wrap; }
.filter-btn { padding:8px 20px; border:1.5px solid var(--border); background:#fff; border-radius:50px; cursor:pointer; font-size:.9rem; transition:all .2s; }
.filter-btn:hover { border-color:var(--primary); color:var(--primary); }
.filter-btn.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.product-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:24px; }
.product-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; transition:transform .2s,box-shadow .2s; }
.product-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.product-img { width:100%; height:220px; object-fit:contain; background:var(--bg-light); padding:16px; }
.product-body { padding:16px 20px 20px; }
.product-body h3 { font-size:1rem; margin-bottom:4px; }
.product-body .brand { color:var(--text-light); font-size:.8rem; margin-bottom:8px; }
.product-body .rating { color:var(--accent); font-size:.85rem; margin-bottom:6px; }
.product-body .price-row { display:flex; align-items:baseline; gap:8px; }
.product-body .price { font-size:1.2rem; font-weight:800; color:var(--primary); }
.product-body .add-btn { margin-top:12px; width:100%; padding:10px; background:var(--primary); color:#fff; border:none; border-radius:8px; font-weight:600; cursor:pointer; transition:background .2s; }
.product-body .add-btn:hover { background:var(--primary-dark); }

/* === About === */
.about { padding:72px 40px; background:var(--bg-gray); }
.about-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:28px; max-width:1000px; margin:0 auto; }
.about-item { background:#fff; padding:32px; border-radius:var(--radius); text-align:center; box-shadow:var(--shadow); }
.about-icon { font-size:2.5rem; margin-bottom:12px; }
.about-item h3 { font-size:1.1rem; margin-bottom:8px; }

/* === Contact === */
.contact { padding:64px 40px; text-align:center; max-width:600px; margin:0 auto; }
.contact-content p { margin-bottom:8px; font-size:1.05rem; }

/* === Footer === */
footer { background:var(--text); color:#fff; text-align:center; padding:32px; }
footer .domain { color:var(--accent); font-weight:600; margin-top:6px; }

/* === Cart Sidebar === */
.cart-overlay { position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:200; display:none; }
.cart-overlay.show { display:block; }
.cart-sidebar { position:fixed; right:0; top:0; bottom:0; width:380px; max-width:90vw; background:#fff; z-index:201; box-shadow:-4px 0 20px rgba(0,0,0,.15); display:flex; flex-direction:column; transform:translateX(100%); transition:transform .3s; }
.cart-sidebar.show { transform:translateX(0); }
.cart-header { display:flex; justify-content:space-between; align-items:center; padding:20px 24px; border-bottom:1px solid var(--border); }
.cart-header h3 { font-size:1.2rem; }
.cart-header button { background:none; border:none; font-size:1.2rem; cursor:pointer; padding:4px 8px; }
.cart-items { flex:1; overflow-y:auto; padding:20px 24px; }
.empty-cart { text-align:center; color:var(--text-light); margin-top:60px; }
.cart-item { display:flex; gap:14px; padding:14px 0; border-bottom:1px solid var(--border); align-items:center; }
.cart-item img { width:60px; height:60px; object-fit:contain; background:var(--bg-light); border-radius:8px; }
.cart-item .info { flex:1; }
.cart-item .name { font-weight:600; font-size:.9rem; }
.cart-item .price { color:var(--primary); font-weight:700; }
.cart-item .qty-row { display:flex; align-items:center; gap:8px; margin-top:4px; }
.cart-item .qty-btn { width:24px; height:24px; border:1px solid var(--border); background:#fff; border-radius:4px; cursor:pointer; }
.cart-item .remove { color:var(--danger); cursor:pointer; font-size:.85rem; padding:4px; }
.cart-footer { padding:20px 24px; border-top:1px solid var(--border); background:var(--bg-light); }
.cart-total { font-size:1.2rem; font-weight:800; margin-bottom:12px; }
.checkout-btn { width:100%; text-align:center; }

/* === Modal === */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.6); z-index:300; display:none; align-items:center; justify-content:center; }
.modal-overlay.show { display:flex; }
.modal { background:#fff; border-radius:var(--radius); max-width:700px; width:90vw; max-height:85vh; overflow-y:auto; padding:36px; position:relative; }
.modal-close { position:absolute; top:16px; right:16px; background:none; border:none; font-size:1.5rem; cursor:pointer; }
.modal-img { width:100%; max-height:300px; object-fit:contain; background:var(--bg-light); border-radius:8px; margin-bottom:20px; }
.modal h2 { font-size:1.5rem; margin-bottom:8px; }
.modal .brand { color:var(--text-light); margin-bottom:12px; }
.modal .price { font-size:1.6rem; font-weight:800; color:var(--primary); margin-bottom:16px; }
.modal .desc { line-height:1.8; margin-bottom:24px; color:var(--text-light); }
.modal .specs { display:grid; grid-template-columns:1fr 1fr; gap:8px 24px; margin-bottom:24px; font-size:.9rem; }
.modal .specs span { color:var(--text-light); }
.modal .action-row { display:flex; gap:12px; }
.modal .action-row .add-btn { flex:1; }

/* === Responsive === */
@media (max-width:768px) {
  nav { padding:12px 16px; flex-wrap:wrap; }
  .nav-links { display:none; }
  .hero { padding:48px 20px; }
  .hero h1 { font-size:2rem; }
  .hero-stats { gap:24px; }
  .categories, .deals, .products, .about { padding:48px 16px; }
  .category-grid { grid-template-columns:repeat(3,1fr); }
  .filter-bar { gap:6px; }
  .filter-btn { padding:6px 14px; font-size:.8rem; }
}

/* === Animations === */
@keyframes fadeIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.hero-content { animation:fadeIn .6s ease-out; }
.product-card, .deal-card { animation:fadeIn .4s ease-out both; }
.product-card:nth-child(2) { animation-delay:.05s; }
.product-card:nth-child(3) { animation-delay:.1s; }
.product-card:nth-child(4) { animation-delay:.15s; }
