/* 华备商城 PC 门户 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #e60012;
  --primary-dark: #c4000f;
  --text: #333;
  --text-light: #888;
  --bg: #f5f5f5;
}
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
ul { list-style: none; }
.container { width: 1200px; margin: 0 auto; }

/* ===== 顶部通栏 ===== */
.top-bar { background: #f5f5f5; border-bottom: 1px solid #eee; font-size: 12px; color: var(--text-light); }
.top-inner { display: flex; justify-content: space-between; height: 32px; align-items: center; }
.top-left a, .top-right a { margin-left: 14px; }
.top-left a:hover, .top-right a:hover { color: var(--primary); }
.top-right .hl { color: var(--primary); }
.top-right .sep { margin: 0 6px; color: #ddd; }

/* ===== 头部 ===== */
.header { background: #fff; }
.header-inner { display: flex; align-items: center; height: 100px; gap: 30px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 52px; height: 52px; border-radius: 10px; background: var(--primary);
  color: #fff; font-size: 30px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.logo-text strong { display: block; font-size: 26px; color: var(--primary); letter-spacing: 2px; }
.logo-text small { display: block; font-size: 12px; color: var(--text-light); margin-top: 2px; }

.search-box {
  flex: 1; max-width: 660px; display: flex; height: 44px;
  border: 2px solid var(--primary); border-radius: 22px; overflow: hidden; background: #fff;
}
.search-cat { position: relative; width: 130px; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border-right: 1px solid #eee; }
.search-cat .caret { border: 5px solid transparent; border-top: 6px solid #999; margin-top: 4px; }
.search-cat-menu {
  position: absolute; top: 46px; left: 0; width: 180px; background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); border-radius: 8px; display: none; z-index: 50;
  max-height: 360px; overflow-y: auto; padding: 6px 0;
}
.search-cat-menu li { padding: 8px 16px; cursor: pointer; }
.search-cat-menu li:hover { background: #fff1f1; color: var(--primary); }
.search-cat.open .search-cat-menu { display: block; }
#searchInput { flex: 1; border: none; outline: none; padding: 0 16px; font-size: 15px; }
.search-btn {
  width: 110px; border: none; background: var(--primary); color: #fff;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.search-btn:hover { background: var(--primary-dark); }

.header-actions { display: flex; gap: 26px; }
.h-action { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--text); font-size: 12px; }
.h-action:hover { color: var(--primary); }

/* ===== 主导航 ===== */
.main-nav { background: #fff; border-bottom: 2px solid var(--primary); }
.nav-inner { display: flex; align-items: stretch; height: 44px; }
.all-cats {
  width: 220px; background: var(--primary); color: #fff; display: flex;
  align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 600;
  cursor: default;
}
.nav-links { display: flex; align-items: center; }
.nav-links li a { display: block; padding: 0 24px; line-height: 44px; font-size: 15px; }
.nav-links li a:hover, .nav-links li.active a { color: var(--primary); }

/* ===== 主体三栏 ===== */
.main-section { display: flex; gap: 14px; margin-top: 14px; align-items: stretch; }

/* 分类侧栏 */
.cat-sidebar { width: 220px; background: #fff; border-radius: 6px; overflow: visible; position: relative; }
.cat-sidebar-title { display: none; }
.cat-list li {
  padding: 0 16px; height: 34px; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; font-size: 14px; position: relative;
}
.cat-list li:hover, .cat-list li.active { background: #fff1f1; color: var(--primary); }
.cat-list li .arrow { color: #ccc; }
.cat-list li:hover .arrow, .cat-list li.active .arrow { color: var(--primary); }
.cat-flyout {
  position: absolute; left: 218px; top: 0; width: 480px; min-height: 100%; background: #fff;
  box-shadow: 6px 0 20px rgba(0,0,0,.1); z-index: 40; padding: 18px 20px; display: none;
}
.cat-list li:hover .cat-flyout { display: block; }
.cat-flyout .f-title { font-weight: 600; color: var(--primary); margin-bottom: 12px; }
.cat-flyout .f-empty { color: var(--text-light); font-size: 13px; }
.cat-flyout .f-goods { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.f-good { cursor: pointer; color: inherit; text-decoration: none; }
.f-good img, .f-good .ph { width: 100%; height: 96px; border-radius: 6px; object-fit: cover; }
.f-good .f-name { font-size: 12px; margin-top: 6px; line-height: 16px; height: 32px; overflow: hidden; }
.f-good:hover .f-name { color: var(--primary); }

/* 轮播 */
.hero { flex: 1; min-width: 0; }
.carousel { position: relative; height: 380px; border-radius: 6px; overflow: hidden; background: #ddd; }
.carousel-track { display: flex; height: 100%; transition: transform .6s ease; }
.slide { min-width: 100%; height: 100%; display: flex; align-items: center; padding: 0 60px; color: #fff; position: relative; }
.slide .slide-text h3 { font-size: 40px; margin-bottom: 14px; text-shadow: 0 2px 8px rgba(0,0,0,.2); }
.slide .slide-text p { font-size: 18px; opacity: .95; margin-bottom: 24px; }
.slide .slide-btn { display: inline-block; background: #fff; color: #333; padding: 10px 28px; border-radius: 22px; font-weight: 600; cursor: pointer; }
.carousel-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.carousel-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.carousel-dots span.on { background: #fff; }

/* 服务条 */
.service-strip { background: #fff; border-radius: 6px; margin-top: 14px; display: flex; padding: 16px 0; }
.service-item { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.service-item .s-ic { font-size: 30px; }
.service-item strong { display: block; font-size: 15px; }
.service-item small { color: var(--text-light); }

/* 你可能喜欢 */
.like-panel { width: 220px; background: #fff; border-radius: 6px; padding: 14px; display: flex; flex-direction: column; }
.like-title { font-size: 16px; font-weight: 700; padding-bottom: 10px; border-bottom: 2px solid var(--primary); margin-bottom: 10px; }
.like-list { flex: 1; }
.like-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #eee; cursor: pointer; color: inherit; text-decoration: none; }
.like-item:last-child { border-bottom: none; }
.like-item img, .like-item .ph { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.like-item .lk-name { font-size: 13px; line-height: 18px; }
.like-item:hover .lk-name { color: var(--primary); }
.like-item .lk-sales { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.post-btn {
  margin-top: 12px; background: #333; color: #fff; border: none; border-radius: 22px;
  padding: 12px; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.post-btn:hover { background: var(--primary); }

/* ===== 品牌好店 ===== */
.brand-floor { background: #fff; border-radius: 6px; margin-top: 20px; padding: 20px; }
.brand-wrap { display: flex; gap: 16px; }
.brand-hero {
  flex: 0 0 280px; height: 260px; border-radius: 10px; overflow: hidden;
  position: relative; color: #fff;
  background: linear-gradient(135deg, #1a1a1a 0%, #333 60%, #555 100%);
  padding: 22px 24px; display: flex; flex-direction: column; justify-content: space-between;
  text-decoration: none;
}
.brand-hero:hover { box-shadow: 0 8px 24px rgba(26,26,26,.25); }
.bh-tag { display: inline-block; padding: 3px 10px; background: rgba(230,0,18,.9); border-radius: 4px; font-size: 12px; font-weight: 600; }
.bh-title { font-size: 24px; font-weight: 700; margin-top: 14px; display: block; }
.bh-desc { font-size: 12px; opacity: .85; margin-top: 6px; }
.bh-hero-logo { position: absolute; right: 20px; bottom: 20px; width: 110px; height: 110px; border-radius: 12px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; }
.bh-hero-logo img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; }
.bh-logo-l { font-size: 48px; font-weight: 700; color: #fff; }

.brand-grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.brand-item {
  background: #fafafa; border: 1px solid #f0f0f0; border-radius: 8px;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  transition: all .2s; color: inherit; text-decoration: none;
}
.brand-item:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(230,0,18,.1); transform: translateY(-2px); }
.b-logo { width: 54px; height: 54px; border-radius: 10px; background: #f0f0f0; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.b-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.b-logo-l { font-size: 28px; font-weight: 700; color: var(--primary); }
.b-info { flex: 1; min-width: 0; }
.b-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.b-tag { font-size: 11px; padding: 1px 6px; background: rgba(230,0,18,.1); color: var(--primary); border-radius: 3px; font-weight: 400; }
.b-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ===== 商品楼层 ===== */
.floor { background: #fff; border-radius: 6px; margin-top: 20px; padding: 20px; }
.floor-head { border-bottom: 2px solid var(--primary); padding-bottom: 12px; margin-bottom: 18px; display: flex; align-items: baseline; gap: 14px; }
.floor-head h2 { font-size: 22px; }
.floor-sub { color: #bbb; font-size: 13px; letter-spacing: 2px; }
.goods-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.goods-card { display: block; border: 1px solid #f0f0f0; border-radius: 8px; padding: 12px; cursor: pointer; transition: box-shadow .2s, transform .2s; background: #fff; color: inherit; text-decoration: none; }
.goods-card:hover { box-shadow: 0 8px 22px rgba(230,0,18,.12); transform: translateY(-3px); }
.goods-card img, .goods-card .ph { width: 100%; height: 170px; border-radius: 6px; object-fit: cover; }
.goods-card .g-name { margin: 10px 0 8px; font-size: 14px; line-height: 20px; height: 40px; overflow: hidden; }
.goods-card:hover .g-name { color: var(--primary); }
.goods-card .g-price { color: var(--primary); font-size: 18px; font-weight: 700; }
.goods-card .g-price small { font-size: 12px; font-weight: 400; }
.goods-card .g-sales { float: right; color: var(--text-light); font-size: 12px; margin-top: 6px; }
.loading-tip { text-align: center; color: var(--text-light); padding: 30px; }

/* 图片占位（无图时） */
.ph {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 15px; text-align: center; padding: 6px;
  background: linear-gradient(135deg, #ff6b6b, #e60012);
}

/* ===== 页脚 ===== */
.footer { background: #2b2b2b; color: #bbb; margin-top: 40px; padding-top: 30px; }
.footer-inner { display: flex; gap: 50px; padding-bottom: 26px; }
.footer-col { flex: 1; }
.footer-col .f-logo { color: #fff; font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.footer-col h4 { color: #fff; margin-bottom: 12px; font-size: 15px; }
.footer-col a, .footer-col p { display: block; color: #aaa; font-size: 13px; margin-bottom: 8px; }
.footer-col a:hover { color: var(--primary); }
.copyright { border-top: 1px solid #444; text-align: center; padding: 16px; font-size: 12px; color: #777; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-mask.show { display: flex; }
.modal { width: 400px; background: #fff; border-radius: 12px; padding: 30px 32px; position: relative; }
.modal-close { position: absolute; top: 14px; right: 18px; border: none; background: none; font-size: 26px; color: #999; cursor: pointer; }
.modal-tabs { display: flex; margin-bottom: 24px; border-bottom: 1px solid #eee; }
.modal-tabs .tab { flex: 1; text-align: center; padding-bottom: 12px; font-size: 18px; cursor: pointer; color: var(--text-light); }
.modal-tabs .tab.active { color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--primary); }
.form-item { margin-bottom: 16px; }
.form-item label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-item input { width: 100%; height: 42px; border: 1px solid #ddd; border-radius: 8px; padding: 0 14px; font-size: 14px; outline: none; }
.form-item input:focus { border-color: var(--primary); }
.auth-btn { width: 100%; height: 46px; background: var(--primary); color: #fff; border: none; border-radius: 23px; font-size: 16px; cursor: pointer; margin-top: 6px; }
.auth-btn:hover { background: var(--primary-dark); }
.modal-tip { text-align: center; color: var(--text-light); font-size: 12px; margin-top: 16px; }

@media (max-width: 1240px) {
  .container { width: 980px; }
  .like-panel { display: none; }
  .goods-grid { grid-template-columns: repeat(4, 1fr); }
}
