/* =================================================================
   1. 全局重置与基础变量 (Variables & Reset)
   ================================================================= */
:root {
    --brand-dark: #1F2937;
    --brand-red: #e53e3e;
    --bg-gray: #f9fafb;
    --text-main: #1f2937;
    --text-muted: #4B5563;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --font-sans: 'Lato', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); color: var(--text-main); background: var(--bg-gray); line-height: 1.5; display: flex; flex-direction: column; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul, li { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
svg { width: 100%; height: 100%; fill: none; stroke: currentColor; }

.hidden { display: none !important; }

/* =================================================================
   2. 布局系统 (Layout System)
   ================================================================= */
.page-wrap { padding: 20px 0; background: var(--bg-gray); flex-grow: 1; min-height: 60vh; }
@media (min-width: 768px) { .page-wrap { padding: 40px 0; } }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 10px; }
.container-md { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 10px; }
.container-sm { width: 100%; max-width: 600px; margin: 0 auto; padding: 0 10px; }
.container-xs { width: 100%; max-width: 440px; margin: 0 auto; padding: 0 10px; }
@media (min-width: 768px) {
    .container, .container-md, .container-sm, .container-xs { padding: 0 15px; }
}

.grid-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 768px) { .grid-cols-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }

.card { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); border: 1px solid var(--border-color); }
@media (min-width: 768px) { .card { padding: 40px; } }

/* =================================================================
   3. 标题与导航 (Typography & Navigation)
   ================================================================= */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 16px; }
.page-header.no-border { border-bottom: none; padding-bottom: 0; }
.page-title { font-family: var(--font-serif); font-size: 24px; color: var(--text-main); line-height: 1.2; }
.page-subtitle { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 24px; }
@media (min-width: 768px) { 
    .page-header { margin-bottom: 24px; }
    .page-title { font-size: 32px; } 
}

.breadcrumb { font-size: 12px; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.breadcrumb a:hover { color: var(--brand-red); }
.breadcrumb .current { color: var(--text-main); font-weight: bold; }
.icon-link { color: var(--text-light); transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.icon-link:hover { color: var(--brand-dark); }
.icon-link svg { width: 24px; height: 24px; }

/* =================================================================
   4. 表单与按钮组件 (Forms & Buttons)
   ================================================================= */
.form-group { margin-bottom: 20px; display: flex; flex-direction: column; position: relative; }
.form-label { font-size: 12px; font-weight: bold; color: var(--text-main); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.form-label .req { color: var(--brand-red); margin-left: 4px; }
.form-input { width: 100%; border: 1px solid var(--border-color); border-radius: 6px; padding: 14px 16px; font-size: 14px; color: var(--text-main); background: var(--bg-gray); transition: 0.3s; resize: none; }
.form-input:focus { outline: none; border-color: var(--brand-dark); background: #fff; box-shadow: 0 0 0 1px var(--brand-dark); }
.form-input.disabled { background: #f3f4f6; color: var(--text-light); cursor: not-allowed; border-color: var(--border-color); }
.error-text { color: var(--brand-red); font-size: 12px; margin-top: 6px; display: block; min-height: 18px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; padding: 14px 24px; border-radius: 6px; cursor: pointer; transition: 0.3s; border: 1px solid transparent; }
.btn-primary { background: var(--brand-dark); color: #fff; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-primary:hover { background: #000; }
.btn-outline { border-color: var(--border-color); color: var(--text-muted); background: transparent; }
.btn-outline:hover { border-color: var(--brand-dark); color: var(--brand-dark); }
.btn-block { width: 100%; }

.slider-container { position: relative; width: 100%; height: 46px; background-color: var(--bg-gray); border-radius: 6px; overflow: hidden; border: 1px solid var(--border-color); user-select: none; touch-action: none; }
.slider-bg { position: absolute; left: 0; top: 0; height: 100%; width: 0; background-color: #10B981; z-index: 1; transition: background-color 0.3s; }
.slider-text { position: absolute; width: 100%; height: 100%; text-align: center; line-height: 44px; font-size: 14px; color: var(--text-muted); z-index: 2; font-weight: bold; text-transform: uppercase; pointer-events: none; transition: 0.3s; }
.slider-text.success { color: #ffffff; }
.slider-thumb { position: absolute; left: 0; top: 0; width: 46px; height: 46px; background-color: #ffffff; border-right: 1px solid var(--border-color); box-shadow: 2px 0 5px rgba(0,0,0,0.05); z-index: 3; cursor: grab; display: flex; justify-content: center; align-items: center; color: var(--text-light); transition: 0.3s; }
.slider-thumb.success { cursor: default; color: #10B981; }
.slider-thumb svg { width: 20px; height: 20px; flex-shrink: 0; }

/* =================================================================
   5. 数据展示组件 (Data Display)
   ================================================================= */
.data-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f9fafb; font-size: 14px; }
.data-row:last-child { border-bottom: none; }
.data-label { color: var(--text-light); }
.data-val { color: var(--text-main); font-weight: 500; text-align: right; }
.data-val.highlight { color: var(--brand-red); font-weight: bold; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: 10px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.badge-dark { background: var(--brand-dark); color: #fff; }
.badge-red { background: var(--brand-red); color: #fff; }
.badge-light { background: var(--bg-gray); color: var(--text-muted); border: 1px solid var(--border-color); }

/* =================================================================
   6. 商品卡片组件 (Product Card)
   ================================================================= */
.product-card { cursor: pointer; position: relative; transition: 0.3s; display: flex; flex-direction: column; min-width: 0; height: 100%; }
.product-img { display: block; overflow: hidden; background: var(--bg-gray); position: relative; margin-bottom: 8px; border-radius: 8px; border: none; aspect-ratio: 4/5; }
.product-img.square { aspect-ratio: 1/1; }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease; }
.product-card:hover .product-img img { transform: scale(1.05); }

.product-info { text-align: center; padding: 0; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; width: 100%; }
.product-title { font-family: var(--font-serif); font-size: 13px; color: var(--text-main); margin-bottom: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-title:hover { color: var(--brand-red); }
.product-type { font-size: 11px; color: var(--text-light); font-style: italic; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.product-price-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; }
.product-price { color: var(--brand-dark); font-weight: bold; font-size: 16px; }
.product-price.red { color: var(--brand-red); }
.product-price-old { color: var(--text-light); font-size: 12px; text-decoration: line-through; }

.product-card.box-style { background: transparent; padding: 0; border-radius: 0; box-shadow: none; border: none; }
.product-card.box-style:hover { transform: translateY(-2px); }

@media (min-width: 768px) {
    .product-card.box-style { padding: 16px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid var(--border-color); }
    .product-card.box-style:hover { box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
    .product-img { margin-bottom: 16px; border: 1px solid var(--border-color); }
    .product-info { padding: 0 8px; }
    .product-title { font-size: 16px; margin-bottom: 8px; }
    .product-type { font-size: 12px; margin-bottom: 8px; }
    .product-price { font-size: 18px; }
    .product-price-old { font-size: 14px; }
}

/* =================================================================
   7. 核心业务模块 (Header / Footer / Home 特异样式)
   ================================================================= */
.icon {
    display: block;
    width: 100%;
    height: 100%;
    background-color: currentColor; /* 让图标自动继承父元素的 color (实现悬停变色) */
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.icon-search {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
}
.icon-user {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'/%3E%3C/svg%3E");
}
.icon-cart {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z'/%3E%3C/svg%3E");
}
.icon-menu {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h16'/%3E%3C/svg%3E");
}
.icon-close {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E");
}

/* Header (top.html) */
.header { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 15px; gap: 15px; }

.logo { order: 1; }
.logo a { font-family: var(--font-serif); font-size: 24px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase; color: var(--brand-dark); }

.header-actions { order: 2; display: flex; align-items: center; justify-content: flex-end; gap: 15px; }

.search-form { order: 3; position: relative; width: 100%; display: flex; align-items: center; margin-top: 5px; }
.search-form input { width: 100%; border: 1px solid var(--border-color); border-radius: 999px; padding: 12px 44px 12px 20px; font-size: 14px; outline: none; transition: all 0.3s ease; background: #fff; }
.search-form input:focus { border-color: var(--brand-dark); box-shadow: 0 0 0 1px var(--brand-dark); }
.search-btn { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; background: none; border: none; color: var(--text-light); cursor: pointer; transition: color 0.3s ease; display: flex; align-items: center; justify-content: center; }
.search-btn:hover { color: var(--brand-dark); }

.icon-btn { width: 28px; height: 28px; color: var(--brand-dark); position: relative; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s;}
.icon-btn:hover { color: var(--brand-red); }
.cart-badge { position: absolute; top: -5px; right: -8px; background: var(--brand-red); color: #fff; font-size: 10px; font-weight: bold; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.main-nav { display: none; background: #fff; border-top: 1px solid #f3f4f6; position: absolute; top: 100%; z-index: 100; width: 100%; left: 0; box-shadow: 0 10px 25px rgba(0,0,0,0.1); flex-direction: column; }
.main-nav.active { display: flex; }
.main-nav a { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid #f9fafb; font-size: 14px; font-weight: bold; text-transform: uppercase; color: #374151; }
.main-nav a:hover { background: #fff1f2; color: var(--brand-red); }

@media (min-width: 992px) {
    .header-inner { flex-wrap: nowrap; gap: 24px; }
    .logo a { font-size: 30px; }
    
    .main-nav { order: 2; margin-right: auto; display: flex !important; position: static; flex-direction: row; background: transparent; box-shadow: none; border-top: none; width: auto; gap: 24px; }
    .main-nav a { padding: 0; border-bottom: none; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #4b5563; }
    .main-nav a:hover { background: transparent; color: var(--brand-red); }

    .search-form { order: 3; width: 100%; max-width: 300px; margin-top: 0; }
    
    .header-actions { order: 4; gap: 20px; }
    
    .hidden-desktop { display: none !important; }
}
@media (max-width: 991px) {
    .hidden-mobile { display: none !important; }
}

/* Footer (bottom.html) */
.footer { background: #111827; color: #d1d5db; padding-top: 60px; margin-top: auto; }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 32px; margin-bottom: 48px; text-align: center; }
.footer h4 { color: #fff; font-weight: bold; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; font-size: 14px; }
.about-col h4 { font-family: var(--font-serif); font-size: 20px; }
.about-col p { font-size: 14px; color: #9ca3af; line-height: 1.7; }

.links-wrap { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
@media (min-width: 768px) {
    .links-wrap { text-align: left; }
}
.footer-links ul { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-links a { color: #9ca3af; }
.footer-links a:hover { color: #fff; }

.contact-col ul { display: flex; flex-direction: column; gap: 12px; font-size: 14px; color: #9ca3af; }

@media (min-width: 768px) {
    .footer-inner { grid-template-columns: 1fr 2fr 1fr; text-align: left; }
}

.footer-partners { border-top: 1px solid #1f2937; padding-top: 32px; margin-bottom: 32px; text-align: center; font-size: 14px; color: var(--text-muted); }
.footer-partners span { margin-right: 8px; }
.footer-partners a { margin-right: 12px; display: inline-block; }
.footer-partners a:hover { color: #fff; }
.footer-bottom { text-align: center; font-size: 14px; color: #4b5563; padding-bottom: 24px; }

/* Home / Ticker / Hero */
/* 首屏容器保持不变 */
.hero { 
    position: relative; 
    width: 100%; 
    height: 50vh; 
    background: #111; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
}

/* 核心修复 1：移除 display: flex，让轮播插件接管排版 */
.hero-bg { 
    position: absolute; 
    inset: 0; 
    width: 100%; 
    height: 100%; 
    display: block; /* 将原来的 flex 改为 block，解决多图轮播错乱 */
}


/* 核心修复 2：强制 slide 占满容器 */
.hero-slide { 
    width: 100% !important; /* 强制覆盖轮播插件可能算错的宽度 */
    height: 100% !important; 
    position: relative; 
}

/* 核心修复 3：强制图片无视原图尺寸，必须等比例缩放铺满 */
.hero-slide picture,
.hero-slide img { 
    width: 100% !important; 
    height: 100% !important; 
    max-width: none !important; /* 解除全局 max-width 对宽屏的限制 */
    object-fit: cover !important; /* 核心：裁剪多余边缘，保证绝对铺满不留黑边 */
    display: block; 
}

/* 遮罩层保持不变 */
.hero-overlay { 
    position: absolute; 
    inset: 0; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%); 
    pointer-events: none; 
}



.hero-slide img { width: 100%; height: 100%; object-fit: cover; }

.hero-content { position: relative; z-index: 10; padding: 0 20px; pointer-events: none; text-align: center; }
.hero-title { font-family: var(--font-serif); font-size: 36px; color: #fff; font-weight: bold; text-shadow: 0 4px 10px rgba(0,0,0,0.5); margin-bottom: 24px; }
.hero .btn-primary { pointer-events: auto; background: #fff; color: var(--brand-dark); }
.hero .btn-primary:hover { background: var(--brand-red); color: #fff; }
@media (min-width: 768px) { .hero { height: 65vh; } .hero-title { font-size: 60px; } }

.ticker-section { background: #f3f4f6; padding: 12px 0; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.ticker-wrap { display: flex; flex-direction: column; gap: 15px; }
.ticker-box { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--text-muted); }
.ticker-box strong { text-transform: uppercase; letter-spacing: 1px; color: var(--text-main); flex-shrink: 0; }
.ticker-box:first-child strong { color: var(--brand-red); }
.ticker-content { height: 20px; overflow: hidden; width: 100%; }
.ticker-content ul { display: flex; flex-direction: column; animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.ticker-content li { height: 20px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-content a:hover { color: var(--brand-red); }
@media (min-width: 768px) {
    .ticker-wrap { flex-direction: row; justify-content: space-between; align-items: center; }
    .ticker-box { width: 48%; }
    .ticker-box.align-right { justify-content: flex-end; }
    .ticker-box.align-right .ticker-content { width: auto; }
}