/* 
 * assets/css/style.css 
 * 版本: V14 - 首页简述显示版
 */

:root {
    --primary-color: #0f4c81; 
    --primary-dark: #0a355c;
    --accent-color: #d4af37; 
    --secondary-color: #e74c3c; 
    --text-main: #2c3e50;
    --text-light: #95a5a6;
    --bg-body: #f8f9fa;
    --card-bg: #ffffff;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 30px rgba(0,0,0,0.08);
    --font-logo: 'Playfair Display', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

a, button, input { -webkit-tap-highlight-color: transparent; outline: none; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* --- 顶部导航 --- */
.main-header {
    background: #fff;
    height: 80px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.logo {
    font-family: var(--font-logo);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
    white-space: nowrap;
}
.main-nav { flex-grow: 1; display: flex; justify-content: flex-end; }
.main-nav ul { display: flex; gap: 30px; align-items: center; }
.main-nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
    position: relative;
    padding: 5px 0;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.main-nav a:hover { color: var(--primary-color); }
#cart-count {
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    position: relative;
    top: -8px;
    left: -2px;
}

/* --- 搜索栏 --- */
.search-section { background: #fff; padding: 20px 0; border-bottom: 1px solid #eee; }
.search-box { max-width: 700px; margin: 0 auto; position: relative; display: flex; }
.search-input { width: 100%; padding: 14px 20px; border: 2px solid #eee; border-right: none; border-radius: 4px 0 0 4px; font-size: 1rem; transition: border-color 0.3s; }
.search-input:focus { border-color: var(--primary-color); }
.search-btn { width: 100px; background: var(--primary-color); color: #fff; border: none; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 1rem; transition: background 0.2s; }
.search-btn:hover { background: var(--primary-dark); }

/* --- 首页 Hero Banner --- */
.hero-banner {
    position: relative;
    background: linear-gradient(135deg, #0f4c81 0%, #1a252f 100%);
    padding: 80px 0;
    color: #fff;
    margin-bottom: 40px;
    overflow: hidden;
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 800px; margin: 0 auto; }
.hero-banner h1 { font-family: var(--font-logo); font-size: 3.5rem; margin: 0 0 20px; letter-spacing: 2px; }
.hero-desc { font-size: 1.2rem; opacity: 0.9; line-height: 1.8; font-weight: 300; }

/* --- 信任背书模块 --- */
.trust-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 50px; }
.trust-item { background: #fff; padding: 25px 15px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: transform 0.3s, box-shadow 0.3s; border: 1px solid rgba(0,0,0,0.02); }
.trust-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.trust-icon-box { width: 60px; height: 60px; background: rgba(15, 76, 129, 0.08); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 5px; color: var(--primary-color); }
.trust-icon-box svg { width: 32px; height: 32px; stroke-width: 1.5; }
.trust-title { font-weight: 700; font-size: 1.05rem; color: var(--text-main); }
.trust-text { font-size: 0.85rem; color: var(--text-light); }

/* --- 商品网格 --- */
.products-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; padding-bottom: 60px; }
.product-card { background: #fff; border-radius: var(--radius-md); overflow: hidden; transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); border: 1px solid #eee; display: flex; flex-direction: column; position: relative; }
.product-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); border-color: transparent; }
.product-image-wrapper { position: relative; width: 100%; padding-top: 120%; overflow: hidden; background: #f4f4f4; }
.product-image-wrapper img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.product-card:hover .product-image-wrapper img { transform: scale(1.05); }
.card-badges { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.badge { font-size: 0.75rem; padding: 4px 10px; border-radius: 2px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-discount { background: var(--secondary-color); color: #fff; }
.badge-rating { background: #fff; color: var(--text-main); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.card-content { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }

.card-title { font-size: 1.1rem; font-weight: 600; margin: 0 0 5px; color: var(--text-main); line-height: 1.4; height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 关键修改：恢复并优化简述样式 */
.card-desc { 
    font-size: 0.85rem; 
    color: var(--secondary-color); /* 使用醒目的颜色 */
    margin-bottom: 10px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: block !important; /* 强制显示 */
    height: 1.5em;
}

.price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.price-current { font-size: 1.4rem; font-weight: 700; color: var(--text-main); }
.price-current::before { content: '¥'; font-size: 0.9rem; margin-right: 2px; }
.price-original { font-size: 0.9rem; color: #ccc; text-decoration: line-through; }
.sold-count { margin-left: auto; font-size: 0.8rem; color: var(--text-light); white-space: nowrap; }

.progress-wrapper { margin-bottom: 15px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-light); margin-bottom: 5px; }
.progress-bar-bg { width: 100%; height: 4px; background: #eee; border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary-color); border-radius: 2px; }

.card-actions { display: flex; gap: 10px; margin-top: auto; }
.btn-detail { flex: 1; padding: 10px; border: 1px solid #ddd; background: transparent; color: var(--text-main); text-align: center; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; border-radius: var(--radius-sm); white-space: nowrap; }
.btn-detail:hover { border-color: var(--text-main); }
.btn-add { flex: 1; padding: 10px; background: var(--text-main); color: #fff; border: none; font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.2s; border-radius: var(--radius-sm); white-space: nowrap; }
.btn-add:hover { background: var(--primary-color); }

/* --- 页脚 --- */
.main-footer { background-color: #1a252f; color: #95a5a6; text-align: center; padding: 40px 0; margin-top: 60px; font-size: 0.9rem; }

/* --- 移动端适配 --- */
@media (max-width: 992px) {
    .products-container { grid-template-columns: repeat(3, 1fr); }
    .trust-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-header { height: 60px; padding: 0; }
    .main-header .container { padding: 0 15px; }
    .logo { font-size: 1.4rem; }
    
    .main-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #eee; padding: 10px 0; z-index: 1001; justify-content: center; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
    .main-nav ul { gap: 25px; }
    .main-nav a { font-size: 0.8rem; flex-direction: column; gap: 4px; padding: 0; }
    .main-nav a::after { display: none; }
    
    .search-section { padding: 10px 15px; background: #f8f9fa; }
    .search-input { padding: 10px 15px; font-size: 0.9rem; }
    .search-btn { width: 60px; font-size: 0.9rem; }

    .hero-banner { padding: 40px 20px; text-align: left; }
    .hero-banner h1 { font-size: 2rem; }
    .hero-desc { font-size: 1rem; }

    .trust-bar { grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 30px; padding: 0; background: transparent; box-shadow: none; }
    .trust-item { padding: 15px 10px; gap: 8px; }
    .trust-icon-box { width: 45px; height: 45px; }
    .trust-icon-box svg { width: 24px; height: 24px; }
    .trust-title { font-size: 0.95rem; }
    .trust-text { font-size: 0.75rem; }

    .products-container { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 8px 80px; }
    .card-content { padding: 10px; }
    .card-title { font-size: 0.9rem; height: 2.8em; margin-bottom: 5px; }
    .price-current { font-size: 1.1rem; }
    
    /* 移动端也显示简述 */
    .card-desc { display: block !important; font-size: 0.75rem; margin-bottom: 8px; }
    
    .card-actions { flex-direction: column; gap: 5px; }
    .btn-detail, .btn-add { padding: 6px; font-size: 0.8rem; width: 100%; }
    
    .sold-count { font-size: 0.7rem; }
}