/* ====================================================
   锦芳陶瓷 - 前台基础与全局样式
==================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5; 
    color: #333;
    padding-bottom: 55px; /* 为移动端底部导航留出空间 */
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* 核心内容区 */
.page-content {
    min-height: calc(100vh - 100px);
    max-width: 1200px;
    margin: 0 auto;
}

/* ====================================================
   头部导航 (PC / 移动双端切换)
==================================================== */
/* PC头部 */
.pc-header { display: none; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.05); margin-bottom: 20px; }
.pc-topbar { background: #f8f8f8; padding: 8px 0; font-size: 12px; color: #888; }
.pc-topbar .container { display: flex; justify-content: flex-end; gap: 20px; }
.pc-mainbar { padding: 20px 0; }
.pc-flex { display: flex; align-items: center; justify-content: space-between; }
.pc-logo { font-size: 26px; font-weight: bold; color: #c8102e; letter-spacing: 1px; }
.pc-search { display: flex; width: 450px; }
.pc-search input { flex: 1; border: 2px solid #c8102e; border-right: none; padding: 10px 15px; border-radius: 20px 0 0 20px; outline: none; }
.pc-search button { background: #c8102e; color: #fff; border: none; padding: 0 25px; border-radius: 0 20px 20px 0; cursor: pointer; font-size: 15px; }
.pc-nav { background: #c8102e; }
.pc-nav .container { display: flex; }
.pc-nav a { color: #fff; padding: 15px 30px; font-size: 15px; transition: background 0.2s; }
.pc-nav a:hover, .pc-nav a.active { background: rgba(0,0,0,0.15); }

/* 移动头部 */
.m-header { 
    position: fixed; top: 0; left: 0; right: 0; height: 50px; 
    background: #c8102e; z-index: 1000; 
    display: flex; align-items: center; padding: 0 15px; gap: 15px; 
}
.m-logo { color: #fff; font-size: 18px; font-weight: bold; white-space: nowrap; }
.m-search { flex: 1; display: flex; position: relative; }
.m-search input { width: 100%; height: 32px; border: none; border-radius: 16px; padding: 0 35px 0 15px; font-size: 13px; outline: none; }
.m-search button { position: absolute; right: 5px; top: 5px; background: none; border: none; font-size: 16px; cursor: pointer; }

/* 移动端主内容下移 */
.page-content { margin-top: 50px; }

/* ====================================================
   底部区域
==================================================== */
/* PC底部 */
.pc-footer { display: none; text-align: center; padding: 40px 20px; background: #222; color: #888; margin-top: 40px; font-size: 13px; }
.pc-footer .footer-brand { font-size: 18px; color: #fff; margin-bottom: 10px; }
.pc-footer .footer-copy { margin-top: 15px; color: #555; }

/* 移动底部导航 */
.m-footer {
    position: fixed; bottom: 0; left: 0; right: 0; height: 55px;
    background: #fff; border-top: 1px solid #eaeaea; display: flex; z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}
.m-footer a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11px; color: #666;
}
.m-footer a span { font-size: 20px; margin-bottom: 2px; }
.m-footer a.active { color: #c8102e; }

/* ====================================================
   首页组件
==================================================== */
/* 轮播图占位 */
.banner { width: 100%; height: 40vw; max-height: 400px; background: #ddd; overflow: hidden; }
.banner-item { display: block; width: 100%; height: 100%; background-size: cover; background-position: center; }

/* 分类网格 */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 15px; background: #fff; margin-bottom: 10px; }
.cat-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; margin-bottom: 6px; }
.cat-item span { font-size: 12px; color: #333; }

/* 首页 Tabs */
.tabs-section { background: #fff; margin-bottom: 10px; }
.tabs-head { display: flex; border-bottom: 1px solid #eee; }
.tab-link { flex: 1; text-align: center; padding: 14px 0; font-size: 15px; color: #666; position: relative; }
.tab-link.active { color: #c8102e; font-weight: bold; }
.tab-link.active::after { content: ''; position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); width: 30px; height: 2px; background: #c8102e; }
.tab-panel { display: none; padding: 10px; }
.tab-panel.show { display: block; }

/* 店铺信息 */
.shop-info { background: #fff; padding: 25px 20px; text-align: center; }
.shop-info h3 { font-size: 18px; margin-bottom: 10px; }
.shop-info p { font-size: 13px; color: #888; margin-bottom: 8px; }
.shop-info .phone { font-size: 15px; color: #c8102e; font-weight: bold; margin-top: 15px; }

/* ====================================================
   产品卡片网格 (通用)
==================================================== */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.product-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.04); display: flex; flex-direction: column; }
.product-image { width: 100%; padding-bottom: 100%; position: relative; background: #f8f8f8; }
.product-image img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 10px; flex: 1; display: flex; flex-direction: column; }
.product-name { font-size: 14px; line-height: 1.4; height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 6px; }
.product-meta { font-size: 12px; color: #999; margin-bottom: 8px; }
.product-price { color: #c8102e; font-size: 16px; font-weight: bold; margin-bottom: 4px; }
.product-views { font-size: 11px; color: #aaa; margin-bottom: 10px; }
.btn-inquiry { width: 100%; background: #fff; color: #c8102e; border: 1px solid #c8102e; padding: 6px 0; border-radius: 16px; font-size: 13px; cursor: pointer; transition: all 0.2s; margin-top: auto; }
.btn-inquiry:hover { background: #c8102e; color: #fff; }

/* ====================================================
   商品列表页与分页
==================================================== */
.list-header { background: #fff; padding: 20px; text-align: center; margin-bottom: 10px; }
.list-header h1 { font-size: 18px; margin-bottom: 5px; }
.list-header p { font-size: 12px; color: #999; }
.pagination { display: flex; justify-content: center; gap: 8px; padding: 20px 0; background: #fff; margin-bottom: 10px; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid #ddd; border-radius: 50%; color: #666; font-size: 14px; }
.pagination a.current { background: #c8102e; color: #fff; border-color: #c8102e; }
.empty { text-align: center; padding: 40px; color: #999; background: #fff; }

/* ====================================================
   全局 Toast 轻提示
==================================================== */
.toast {
    position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75); color: #fff; padding: 10px 20px; border-radius: 20px;
    font-size: 14px; z-index: 9999; opacity: 0; visibility: hidden;
    transition: all 0.3s; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; visibility: visible; }
.toast.success { background: rgba(40, 167, 69, 0.9); }
.toast.error { background: rgba(220, 53, 69, 0.9); }

/* ====================================================
   PC 端响应式布局 (768px 以上)
==================================================== */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    .m-header, .m-footer { display: none; }
    .pc-header, .pc-footer { display: block; }
    .page-content { margin-top: 0; }
    
    .product-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 20px 0; }
    .cat-grid { grid-template-columns: repeat(6, 1fr); padding: 25px 0; }
    .tab-panel { padding: 20px 0; }
    
    .product-name { font-size: 15px; }
    .product-price { font-size: 18px; }
    .btn-inquiry { padding: 8px 0; font-size: 14px; border-radius: 20px; }
}