/* 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f2f5; }

.text-small { font-size: 12px; color: #666; }

/* ===== Header 第一行样式 ===== */
.header { display: flex; flex-direction: column; background: linear-gradient(135deg, #1890ff, #0050b3); color: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.header-row-1 { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; background: rgba(0,0,0,0.1); }
.header-left { display: flex; align-items: center; gap: 15px; }
.header-right { display: flex; align-items: center; gap: 15px; }
#headerWelcome { font-size: 15px; font-weight: bold; margin-right: 10px; color: #fff; }
.btn-login { background: transparent; color: #fff; border: 1px solid #fff; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.btn-login:hover { background: rgba(255,255,255,0.15); }
.btn-logout { background: transparent; color: #fff; border: 1px solid #fff; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 13px; font-weight: bold; }
.btn-link { background: transparent; color: #fff; border: none; cursor: pointer; font-size: 13px; padding: 6px 10px; text-decoration: none; white-space: nowrap; }
.btn-link:hover { text-decoration: underline; }

/* ===== Header 第二行布局（4等分：Logo 1份，搜索 2份，空1份） ===== */
.header-row-2 { 
  display: flex; 
  align-items: center; 
  padding: 12px 20px; 
}
.header-logo { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  flex: 1;  /* 占1份 */
}
.logo-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.logo-text { font-size: 20px; font-weight: bold; color: #ffd700; }
.header-center-box { 
  display: flex; 
  align-items: center; 
  gap: 0; 
  flex: 2;  /* 占2份 */
  justify-content: center; 
}
.header-right-space { 
  flex: 1;  /* 占1份，空白的 */
}
.search-input { padding: 10px 14px; border: none; border-radius: 6px 0 0 6px; font-size: 14px; width: 280px; }
.search-btn { padding: 10px 20px; background: #1890ff; color: #fff; border: none; border-radius: 0; cursor: pointer; font-size: 14px; }
.quick-link-btn { padding: 10px 14px; background: rgba(255,255,255,0.15); color: #ff4444; border: none; cursor: pointer; font-size: 14px; font-weight: bold; }
.quick-link-btn.active { background: rgba(255,255,255,0.4); color: #fff; }
.quick-link-btn:first-of-type { border-radius: 0; }
.view-toggle { display: flex; background: rgba(255,255,255,0.15); border-radius: 4px; overflow: hidden; }
.view-toggle button { padding: 10px 14px; border: none; background: transparent; cursor: pointer; font-size: 14px; font-weight: bold; color: #000; }
.view-toggle button.active { background: rgba(255,255,255,0.3); color: #fff; }

/* ===== 公告栏（滚动） ===== */
.notice-bar { background: #fff7cc; padding: 8px 0; overflow: hidden; position: relative; }
.notice-inner { display: inline-flex; white-space: nowrap; animation: noticeScroll 20s linear infinite; }
.notice-text { color: #d48806; font-size: 13px; padding: 0 30px; }
.notice-text::before { content: '📢 '; }
@keyframes noticeScroll {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ===== 主内容区 ===== */
.main-layout { display: flex; min-height: calc(100vh - 60px); }

/* 左侧分类栏 */
.sidebar { width: 180px; background: #fff; padding: 15px 0; flex-shrink: 0; border-right: 1px solid #eee; }
.sidebar-title { font-size: 14px; font-weight: bold; color: #333; padding: 10px 15px; border-bottom: 1px solid #eee; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.sidebar-title:hover { background: #f5f5f5; }
.sidebar-content { }
.sidebar-item { padding: 8px 15px; font-size: 13px; color: #555; cursor: pointer; transition: all 0.2s; }
.sidebar-item:hover { background: #e6f7ff; color: #1890ff; }
.sidebar-item.active { background: #1890ff; color: #fff; border-radius: 4px; margin: 2px 8px; }

/* 右侧内容 */
.content-area { flex: 1; padding: 15px; overflow: hidden; }

/* 品牌/价格行 */
.filter-rows { background: #fff; border-radius: 8px; padding: 12px 15px; margin-bottom: 12px; }
.filter-row { display: flex; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-label { font-size: 13px; color: #888; margin-right: 4px; white-space: nowrap; }
.filter-label { font-size: 13px; color: #999; min-width: 50px; font-weight: bold; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.filter-tag { padding: 4px 12px; background: #f5f5f5; color: #555; font-size: 12px; border-radius: 20px; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; }
.filter-tag:hover { background: #e6f7ff; color: #1890ff; }
.filter-tag.active { background: #1890ff; color: #fff; }
.filter-tag.more { color: #1890ff; background: #e6f7ff; }

/* 商品详情弹窗 按钮样式（PC 端，两个按钮都是蓝色） */
.product-modal-actions { display: flex; flex-direction: row; gap: 10px; margin-top: 12px; }
.btn-add-cart {
  flex: 1; padding: 12px; background: #1890ff; color: #fff;
  border: none; border-radius: 6px; font-size: 15px; font-weight: bold; cursor: pointer;
}
.btn-add-cart:hover { background: #40a9ff; }
.btn-direct-buy {
  flex: 1; padding: 12px; background: #ff7a00; color: #fff;
  border: none; border-radius: 6px; font-size: 15px; font-weight: bold; cursor: pointer;
}
.btn-direct-buy:hover { background: #ff9528; }
.btn-direct-buy:disabled { background: #ccc; cursor: not-allowed; }

/* 商品详情弹窗 价格样式（PC 端） */
.product-modal-price-item .label { font-size: 11px; color: #999; margin-bottom: 4px; }
.product-modal-price-item .value { font-size: 15px; font-weight: normal; color: #333; }
.product-modal-price-item .value.red { color: #e4393c; font-weight: normal; }
.product-modal-price-item .value.del { color: #999; text-decoration: line-through; font-weight: normal; font-size: 13px; }
.product-modal-price-item .value.green { color: #52c41a; }

/* 搜索行 */
.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.search-input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.search-input:focus { outline: none; border-color: #1890ff; }
.search-btn { padding: 8px 16px; background: #1890ff; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; }
.search-btn:hover { background: #40a9ff; }

/* ===== 商品展示区（6列 3x2） ===== */
.product-grid-outer { background: #fff; border-radius: 8px; padding: 12px; min-width: 0; }
.date-row { font-size: 14px; font-weight: bold; color: #333; padding: 10px 0 12px; text-align: center; border-bottom: 1px solid #eee; margin-bottom: 10px; }
.date-row strong { color: #1890ff; }
#currentDate { margin-right: 6px; }
.date-row span { font-weight: normal; color: #666; }
.view-toggle { margin-left: auto; display: flex; background: rgba(255,255,255,0.3); border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.view-toggle button { padding: 6px 14px; border: none; background: transparent; cursor: pointer; font-size: 13px; font-weight: bold; color: #555; border-right: 1px solid #ddd; }
.view-toggle button:last-child { border-right: none; }
.view-toggle button.active { background: #1890ff; color: #fff; }
.view-toggle button:not(.active):hover { background: #e6f0ff; }
.product-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 1400px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }

.product-card { background: #fff; border-radius: 8px; padding: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); border: 1px solid #f0f0f0; transition: all 0.2s; }
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); border-color: #1890ff; transform: translateY(-2px); }
.product-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 4px; }
.no-image { width: 100%; height: 130px; background: #f0f2f5; display: flex; align-items: center; justify-content: center; color: #bbb; border-radius: 4px; font-size: 12px; }
.product-name { font-size: 13px; margin: 8px 0 4px; word-break: break-all; color: #333; }
.product-price { font-size: 13px; color: #ff4d4f; font-weight: bold; line-height: 1.5; }
.product-price del { font-size: 11px; color: #bbb; font-weight: normal; margin-left: 4px; }
.price-yunnan { display: block; font-size: 11px; color: #fa8c16; font-weight: normal; }
.price-retail { font-size: 11px; color: #bbb; font-weight: normal; }
.price-retail del { text-decoration: line-through; }
.price-item { display: inline-block; font-size: 11px; color: #333; font-weight: bold; margin-right: 4px; white-space: nowrap; }
.price-grp { display: flex; align-items: center; gap: 0; margin-bottom: 2px; }
.price-key { font-size: 10px; color: #888; width: 28px; flex-shrink: 0; }
.price-val { font-size: 12px; color: #333; font-weight: bold; margin-right: 6px; }
.price-grp-main .price-key { color: #e4393c; }
.price-val-main { font-size: 14px; color: #e4393c; font-weight: bold; }
.product-extra { font-size: 11px; color: #999; margin-top: 2px; }
.product-actions { display: flex; gap: 4px; margin-top: 8px; align-items: center; }
.quantity-input { width: 45px; padding: 4px; text-align: center; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; }
.btn-buy { flex: 1; padding: 6px; background: #1890ff; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; }
.btn-buy:hover { background: #40a9ff; }
.btn-buy:disabled { background: #ccc; cursor: not-allowed; }

/* ===== 弹窗（保持不变） ===== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; }
.modal-content { background: #fff; margin: 5% auto; padding: 20px; border-radius: 8px; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.close { float: right; font-size: 28px; cursor: pointer; }
.modal-content input, .modal-content textarea { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; border-radius: 4px; }
.modal-content textarea { min-height: 60px; }
.modal-content h2 { margin-bottom: 15px; }
.modal-content select { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; border-radius: 4px; }

/* ===== 购物车/订单宽弹窗 ===== */
#cartModal .modal-content,
#orderModal .modal-content { max-width: 1000px; width: 95%; min-height: 200px; }
#cartModal .modal-content { padding-bottom: 16px; }
#orderModal .modal-content { padding-bottom: 16px; }
#cartItems table, #orderList table { table-layout: auto; }
#cartItems { margin-bottom: 0; min-height: 60px; }
#orderList { margin-bottom: 0; min-height: 60px; }

/* ===== 按钮 ===== */
.btn-primary { padding: 10px 20px; background: #1890ff; color: #fff; border: none; border-radius: 4px; cursor: pointer; margin-right: 10px; }
.btn-secondary { padding: 10px 20px; background: #ddd; color: #333; border: none; border-radius: 4px; cursor: pointer; }
.btn-danger { padding: 10px 20px; background: #ff4d4f; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.btn-primary:hover { background: #40a9ff; }

/* ===== 表单 ===== */
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { flex: 1; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 13px; }
.form-group input[type="file"] { padding: 8px; border: 1px solid #ddd; border-radius: 4px; width: 100%; }

/* ===== 用户中心 ===== */
.user-detail { padding: 15px 0; }
.user-detail p { margin: 8px 0; font-size: 14px; }
.order-item { padding: 15px; border: 1px solid #eee; border-radius: 4px; margin-bottom: 10px; }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 40px; color: #999; }

/* ===== 咨询页 ===== */
.consult-page { max-width: 600px; margin: 30px auto; background: #fff; padding: 30px; border-radius: 12px; }
.consult-page h2 { color: #333; margin-bottom: 20px; }
.consult-page p { line-height: 1.8; color: #555; font-size: 14px; margin-bottom: 15px; }
.consult-page .contact-box { background: #e6f7ff; padding: 15px; border-radius: 8px; margin: 15px 0; }
.consult-page .contact-item { font-size: 16px; color: #1890ff; font-weight: bold; margin: 5px 0; }

/* ===== 图文版商品卡片 ===== */
.product-card-image { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.product-card-image .product-img-wrap { position: relative; }
.product-card-image img { width: 100%; height: 180px; object-fit: cover; }
.img-count { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.5); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 10px; }
.product-card-image .product-info { padding: 10px; }
.product-card-image .product-name { font-size: 13px; color: #333; margin-bottom: 6px; }
.product-card-image .product-price { font-size: 15px; color: #ff4d4f; font-weight: bold; }
.product-card-image .product-price del { font-size: 11px; color: #bbb; margin-left: 4px; }

/* ===== 响应式 ===== */


/* PC style - no mobile rules needed (mobile elements removed from HTML)

/* 图片画廊 */
.img-gallery-wrap { position:relative;cursor:pointer;overflow:hidden; }
.img-gallery-wrap:hover .img-gallery-hint { display:flex; }
.img-gallery-hint { display:none;position:absolute;bottom:4px;right:4px;background:rgba(0,0,0,0.5);color:#fff;font-size:10px;padding:2px 5px;border-radius:4px;align-items:center;gap:2px }
