:root {
  --primary: #1f5fb0;
  --primary-dark: #174a8a;
  --primary-light: #eaf2fb;
  --text: #1f2733;
  --text-soft: #5a6675;
  --line: #e3e8ef;
  --bg: #f5f7fa;
  --white: #ffffff;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(31, 39, 51, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { width: min(1180px, 92%); margin: 0 auto; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: background .2s, border-color .2s;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline {
  background: transparent;
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-disabled { background: #b9c2cf; border-color: #b9c2cf; cursor: not-allowed; }
.btn-text {
  background: none; border: none; color: var(--text-soft); cursor: pointer; font-size: 14px;
}
.btn-text:hover { color: var(--primary); }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.brand-text { font-size: 17px; color: var(--text); }
.main-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link {
  padding: 8px 14px; border-radius: 8px; color: var(--text-soft); font-size: 15px;
}
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-light); }
.cart-link { position: relative; }
.cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 4px;
}
.auth-area { display: flex; align-items: center; gap: 8px; margin-left: 14px; }
.btn-login, .btn-register { padding: 7px 16px; border-radius: 8px; font-size: 14px; }
.btn-login { color: var(--primary); border: 1px solid var(--primary); }
.btn-register { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-btn { color: var(--primary); font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, #1f5fb0, #2f74c4);
  color: #fff; padding: 64px 0;
}
.hero h1 { font-size: 34px; margin-bottom: 14px; }
.hero p { font-size: 17px; opacity: .92; max-width: 640px; }
.hero .hero-actions { margin-top: 26px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.7); }
.hero .btn-outline:hover { background: rgba(255,255,255,.12); }

/* ---------- 通用区块 ---------- */
.section { padding: 54px 0; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: 26px; color: var(--text); }
.section-head p { color: var(--text-soft); margin-top: 8px; }

/* 模块卡片 */
.module-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.module-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.module-card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(31,39,51,.1); }
.module-card .mc-icon {
  width: 52px; height: 52px; border-radius: 12px; background: var(--primary-light);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; margin-bottom: 16px;
}
.module-card h3 { font-size: 20px; margin-bottom: 10px; }
.module-card p { color: var(--text-soft); margin-bottom: 18px; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(31,39,51,.1); }
.card-img { aspect-ratio: 1 / 1; overflow: hidden; background: #f0f2f5; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 15px; font-weight: 600; line-height: 1.45; min-height: 44px; color: var(--text); }
.card-meta { color: var(--text-soft); font-size: 13px; }
.card-price { color: var(--danger); font-weight: 700; font-size: 18px; }
.card-price .ori { color: #9aa4b1; font-weight: 400; font-size: 13px; text-decoration: line-through; margin-left: 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 6px; }

/* ---------- 筛选/搜索栏 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 26px; }
.search-box { flex: 1; min-width: 240px; }
.search-box input {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none;
}
.search-box input:focus { border-color: var(--primary); }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 20px; background: #fff;
  cursor: pointer; font-size: 14px; color: var(--text-soft);
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 商品详情 ---------- */
.detail-layout { display: grid; grid-template-columns: 1fr 1.05fr 280px; gap: 30px; align-items: start; }
.gallery-main { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.gallery-main img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.gallery-slider { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; user-select: none; cursor: grab; }
.gallery-slider img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; pointer-events: none; }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border: none; border-radius: 50%;
  background: rgba(28,39,51,.45); color: #fff; font-size: 16px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.slider-arrow:hover { background: rgba(28,39,51,.75); }
.slider-prev { right: 12px; top: 38%; }
.slider-next { right: 12px; top: 62%; }
.slider-counter {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(28,39,51,.55); color: #fff;
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
}
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 72px; height: 72px; object-fit: cover; border: 2px solid transparent; border-radius: 8px; cursor: pointer; background: #f0f2f5;
}
.gallery-thumbs img.active { border-color: var(--primary); }
.detail-info h1 { font-size: 24px; margin-bottom: 12px; }
.detail-price { color: var(--danger); font-size: 28px; font-weight: 700; margin: 10px 0; }
.detail-price .ori { color: #9aa4b1; font-weight: 400; font-size: 16px; text-decoration: line-through; margin-left: 10px; }
.spec-list { margin: 16px 0; border-top: 1px dashed var(--line); }
.spec-list li { display: flex; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.spec-list .sl-label { width: 90px; color: var(--text-soft); }
.merchant-box { background: var(--primary-light); border-radius: 8px; padding: 12px 14px; margin: 16px 0; font-size: 14px; }
.merchant-box b { color: var(--primary); }
.qty-row { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.qty-ctrl { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty-ctrl button { width: 38px; height: 38px; background: #f3f5f8; border: none; font-size: 18px; cursor: pointer; }
.qty-ctrl input { width: 54px; height: 38px; text-align: center; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-size: 15px; }
.detail-actions { display: flex; gap: 12px; }
.detail-desc { margin-top: 36px; }
.detail-desc h3 { font-size: 18px; margin-bottom: 10px; }
.detail-desc p { color: var(--text-soft); }
.detail-images { margin-top: 28px; padding: 24px; }
.detail-images h3 { font-size: 18px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.detail-images img { width: 100%; max-width: 760px; margin: 0 auto 14px; display: block; border-radius: 8px; border: 1px solid var(--line); background: #fafbfc; }

/* ---------- 商家侧栏 ---------- */
.merchant-side { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 18px; position: sticky; top: 80px; }
.merchant-side h3 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ms-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ms-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ms-title { display: flex; flex-direction: column; }
.ms-title b { font-size: 15px; color: var(--text); }
.ms-region { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.ms-meta { border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 6px 0; margin-bottom: 14px; }
.ms-meta li { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.ms-meta li span { color: var(--text-soft); }
.ms-meta li b { color: var(--text); font-weight: 500; }
.ms-ok { color: #1f9c5a; }
.ms-phone { display: flex; justify-content: space-between; align-items: center; background: #f7f9fc; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.ms-phone span { color: var(--text-soft); }
.ms-phone b { color: var(--text); font-family: Consolas, monospace; letter-spacing: 0.5px; }
.ms-phone-show { color: var(--primary) !important; }
.merchant-side .btn-block { display: block; width: 100%; margin-top: 8px; }

/* ---------- 购物车 ---------- */
.cart-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cart-table th, .cart-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.cart-table th { background: #f7f9fc; color: var(--text-soft); font-weight: 600; }
.cart-product { display: flex; align-items: center; gap: 12px; }
.cart-product img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.cart-summary { margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.cart-summary .row { display: flex; justify-content: space-between; padding: 6px 0; }
.cart-summary .total { font-size: 22px; font-weight: 700; color: var(--danger); }
.cart-summary .actions { margin-top: 16px; }
.empty-box { text-align: center; padding: 70px 20px; color: var(--text-soft); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.empty-box a { color: var(--primary); font-weight: 600; }

/* ---------- 信息发布 ---------- */
.info-card .card-body { gap: 6px; }
.info-card .card-title { min-height: auto; }
.pub-line { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-soft); }
.pub-line .pub-name { color: var(--primary); font-weight: 600; }
.pub-line .pub-phone { letter-spacing: 1px; }
.info-time { font-size: 12px; color: #9aa4b1; }

/* 信息详情 */
.info-detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 36px; align-items: start; }
.info-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.info-cover img { width: 100%; }
.info-content h1 { font-size: 26px; margin-bottom: 10px; }
.info-content .meta-line { color: var(--text-soft); font-size: 14px; margin-bottom: 18px; }
.info-content .article { color: var(--text); line-height: 1.9; }
.contact-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  position: sticky; top: 84px;
}
.contact-card h4 { font-size: 16px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.contact-card .cc-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.contact-card .cc-row .k { color: var(--text-soft); }
.contact-card .cc-row .v { font-weight: 600; text-align: right; }
.phone-masked { color: var(--danger); letter-spacing: 1px; }

/* ---------- 表单 / 认证 ---------- */
.auth-wrap { max-width: 440px; margin: 50px auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; box-shadow: var(--shadow); }
.auth-wrap h2 { font-size: 22px; margin-bottom: 6px; }
.auth-wrap .sub { color: var(--text-soft); font-size: 14px; margin-bottom: 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; outline: none; font-family: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { resize: vertical; min-height: 120px; }
.agree-row { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 18px; font-size: 13px; color: var(--text-soft); }
.agree-row input { margin-top: 3px; }
.agree-row a { color: var(--primary); }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-soft); }
.auth-switch a { color: var(--primary); font-weight: 600; }
.form-msg { padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; display: none; }
.form-msg.error { display: block; background: #fdecea; color: var(--danger); }
.form-msg.success { display: block; background: #e9f7ef; color: #1e7e45; }

/* ---------- 关于 / 账户 ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.about-grid h3 { font-size: 18px; margin: 18px 0 10px; }
.about-grid p, .about-grid li { color: var(--text-soft); }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
.info-table th { width: 130px; color: var(--text-soft); font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-footer { background: #1c2733; color: #c5cdd8; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; padding: 44px 0 30px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col p { font-size: 14px; }
.footer-col ul li { font-size: 14px; padding: 4px 0; }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 16px 0; text-align: center; }
.footer-bottom p { font-size: 13px; color: #8b96a3; }
.footer-bottom .beian { color: #8b96a3; text-decoration: none; }
.footer-bottom .beian:hover { color: #fff; text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .detail-layout, .info-detail-layout, .about-grid { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .menu-toggle { display: block; }
  .main-nav {
    position: absolute; top: 64px; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 10px 4%; gap: 2px;
    border-bottom: 1px solid var(--line); display: none; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .nav-link { padding: 12px 10px; }
  .auth-area { margin-left: auto; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
}
