/* ============================================================
   涂料实体店官网 — 全局通用样式
   移动端优先 · 原生 CSS · 无第三方依赖
   适配：手机 / 平板 / 桌面
   ============================================================ */

/* === CSS 自定义变量 === */
:root {
  /* 主色调 — 专业蓝绿，贴合建材涂料行业 */
  --primary: #1a4d5e;
  --primary-light: #276b80;
  --primary-dark: #0f3340;
  --accent: #d35400;
  --accent-hover: #a84300;
  --accent-light: #fdebd0;

  /* 中性色 */
  --text: #2c3e50;
  --text-secondary: #5d6d7e;
  --text-muted: #95a5a6;
  --white: #ffffff;
  --bg: #f7f8f9;
  --bg-alt: #edf1f5;
  --border: #dde1e6;
  --border-light: #edf1f5;

  /* 功能色 */
  --success: #27ae60;
  --warning: #f39c12;
  --error: #e74c3c;
  --info: #2980b9;

  /* 尺寸 */
  --nav-height: 60px;
  --max-width: 1200px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.15);
  --transition: 0.25s ease;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-heading: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;

  /* 过渡 */
  --transition: 0.25s ease;
}

/* === 重置 & 全局基础 === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#navPlaceholder {
  min-height: 60px;
}
@media (max-width: 767px) {
  #navPlaceholder { min-height: 84px; }
}
html {
  font-size: 16px;
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--primary); }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }

/* === 工具类 === */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.section {
  padding: 40px 0;
}
.section-white { background: var(--white); }
.section-alt  { background: var(--bg-alt); }
.section-compact { padding-top: 12px; }
/* 门店 CTA 区块 */
.cta-store {
  background: linear-gradient(135deg, #1a3a4a, #2c5f7a);
  color: #fff;
  text-align: center;
}
.cta-store h2 { color: #fff; margin-bottom: 8px; }
.cta-store p  { color: rgba(255,255,255,.85); max-width: 560px; margin: 0 auto 20px; font-size: 0.92rem; line-height: 1.7; }
.cta-store .btn-cta { display: inline-block; width: auto; padding: 13px 40px; border-radius: 24px; }

.section-title {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 12px;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-alt);
  border-color: var(--text-secondary);
}

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }

/* === 顶部导航栏 === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: var(--nav-height);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-alt);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  color: var(--primary);
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端遮罩 */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}
.nav-overlay.show { display: block; }

/* === 底部 === */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 32px 0 20px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
.footer h4 {
  color: var(--white);
  margin-bottom: 12px;
  font-size: 1.05rem;
}
.footer ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 8px;
}
.footer p,
.footer li {
  font-size: 0.88rem;
  line-height: 1.8;
  margin-bottom: 4px;
}
.footer ul a {
  color: rgba(255,255,255,0.9);
  transition: all var(--transition);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 1px;
}
.footer ul a:hover {
  color: var(--white);
  border-bottom-color: rgba(255,255,255,0.7);
}
.footer p a {
  color: rgba(255,255,255,0.9);
  transition: all var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.3);
  padding-bottom: 1px;
}
.footer p a:hover {
  color: var(--white);
  border-bottom-color: rgba(255,255,255,0.7);
}
.footer-bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* === 咨询弹窗 === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1.1rem;
  color: var(--primary);
}
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg-alt);
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--error); color: var(--white); }

.modal-body { padding: 20px; }

.modal-body .contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}
.modal-body .contact-item:last-child { border-bottom: none; }
.modal-body .contact-icon {
  width: 40px; height: 40px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* === 表单 === */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.form-group label .required {
  color: var(--error);
  margin-left: 2px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26,77,94,0.1);
}
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.1);
}
.form-textarea {
  min-height: 100px;
  resize: vertical;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.form-error-msg {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 4px;
  display: none;
}
.form-error-msg.show { display: block; }
.form-submit-row { margin-top: 20px; }

/* === 卡片 === */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg-alt);
}
.card-body { padding: 16px; }
.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.card-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* === 视频容器（外链播放器占位） === */
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--primary-dark);
  color: var(--white);
  cursor: pointer;
}
.video-placeholder .play-icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
  transition: background var(--transition);
}
.video-placeholder:hover .play-icon {
  background: var(--accent);
}

/* === 图片画廊 === */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

/* === 标签 === */
.tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--bg-alt);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}
.tag-accent {
  background: var(--accent-light);
  color: var(--accent);
}
.tag-primary {
  background: #e8f0f4;
  color: var(--primary);
}

/* === 分隔线 === */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* === 面包屑 === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }

/* === 页面标题区 === */
.page-hero {
  background: var(--primary);
  color: var(--white);
  padding: 32px 0;
  text-align: center;
}
.page-hero h1 {
  color: var(--white);
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.page-hero p {
  color: rgba(255,255,255,0.8);
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* === 首页 Hero === */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: var(--white);
  padding: 48px 0;
  text-align: center;
}
.hero h1 {
  color: var(--white);
  font-size: 1.6rem;
  margin-bottom: 12px;
  line-height: 1.4;
}
.hero p {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.hero .btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* === 特性图标列表 === */
.feature-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.feature-item {
  text-align: center;
  padding: 16px 8px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}
.feature-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.feature-item .feat-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.feature-item .feat-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.feature-item .feat-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === 案例对比容器 === */
.before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.before-after .ba-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.before-after .ba-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.before-after .ba-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
}

/* === 工长合作报价表 === */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.price-table th,
.price-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
.price-table th {
  background: var(--primary);
  color: var(--white);
  font-weight: 500;
  font-size: 0.85rem;
}
.price-table tr:last-child td { border-bottom: none; }
.price-table .price-col { text-align: right; font-weight: 600; color: var(--accent); }

/* === 地图容器（预留） === */
.map-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* === 返回顶部按钮 === */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover { background: var(--primary-light); }

/* === 加载骨架屏 === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, #e8ecf0 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === 用户反馈消息 === */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: var(--white);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 3000;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--error); }

/* ============================================================
   响应式断点
   ============================================================ */

/* 平板及以上 (≥768px) */
@media (min-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.3rem; }

  .section { padding: 56px 0; }
  .section-title { margin-bottom: 32px; }

  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }

  .gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; }

  .feature-row { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  .hero { padding: 64px 0; }
  .hero h1 { font-size: 2rem; }
  .hero .btn-row { flex-direction: row; justify-content: center; }

  .page-hero { padding: 48px 0; }
  .page-hero h1 { font-size: 1.75rem; }

  .before-after { gap: 8px; }

  .nav-links a { padding: 8px 16px; }
}

/* 桌面 (≥1024px) */
@media (min-width: 1024px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }

  .hero h1 { font-size: 2.4rem; }

  .gallery { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: repeat(4, 1fr); gap: 32px; }

  .container { padding: 0 24px; }

  .hero { padding: 80px 0; }
}

/* 移动端菜单 (≤767px) */
@media (max-width: 767px) {
  .navbar {
    height: auto;
    padding: 6px 0 0;
  }
  .navbar-inner {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .nav-logo {
    font-size: 1rem;
    padding: 2px 0;
  }
  .nav-logo .logo-icon {
    width: 26px;
    height: 26px;
    font-size: 0.9rem;
  }
  .nav-links {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 0;
    gap: 2px;
    background: var(--white);
    white-space: nowrap;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.82rem;
    background: var(--bg-alt);
  }
  .nav-links a.active {
    background: var(--accent);
    color: #fff;
  }
  .nav-toggle { display: none; }
  .nav-overlay { display: none; }
}

/* 打印样式 */
@media print {
  .navbar, .footer, .back-to-top, .modal-overlay, .nav-toggle { display: none !important; }
  body { background: var(--white); }
}

/* ============================================================
   阶段二新增 — 产品分类 & 详情 & 后台素材
   追加于 global.css 末尾，不改动原有代码
   ============================================================ */

/* ============================================================
   1. 分类树形导航（function-list 左侧栏）
   ============================================================ */
.tree-nav {
  font-size: 0.88rem;
  user-select: none;
}
.tree-node {
  margin-bottom: 1px;
}
.tree-node--leaf {
  /* 叶子节点无子分类 */
}
.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 2px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  vertical-align: middle;
  transition: transform var(--transition);
  line-height: 1;
}
.tree-toggle.expanded {
  transform: rotate(90deg);
}
.tree-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text);
  transition: all var(--transition);
  font-size: 0.88rem;
  line-height: 1.4;
}
.tree-label:hover {
  background: var(--bg-alt);
  color: var(--primary);
}
.tree-label.active {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
}
.tree-children {
  margin-left: 18px;
  display: none;
}
.tree-children.open {
  display: block;
}
.tree-node--leaf .tree-toggle {
  visibility: hidden;
}

/* ============================================================
   2. 目录页整体布局（侧栏 + 主内容区）
   ============================================================ */
.catalog-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.catalog-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  max-height: calc(100vh - var(--nav-height) - 32px);
  overflow-y: auto;
}
.catalog-sidebar::-webkit-scrollbar {
  width: 4px;
}
.catalog-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
.catalog-main {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   3. 筛选标签栏
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.filter-bar-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
}
.filter-tag {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}
.filter-tag:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.filter-tag.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  font-weight: 500;
}

/* ============================================================
   4. 产品卡片网格（响应式：1列 / 2列 / 3列）
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.product-grid .card {
  display: flex;
  flex-direction: column;
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
  overflow: hidden;
}
.product-grid .card-img {
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: var(--bg-alt);
}
.product-grid .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
}
.product-grid .card-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-grid .card-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}
.product-grid .card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.product-grid .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
}
.product-grid .card .btn-sm {
  font-size: 0.75rem;
  padding: 4px 8px;
}
.product-grid .card-img-wrap {
  position: relative;
  overflow: hidden;
}
.product-grid .card-img-wrap .card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--white);
  z-index: 1;
}
.card-badge-new {
  background: var(--success);
}
.card-badge-hot {
  background: var(--accent);
}

/* ============================================================
   5. 移动端分类横向滚动标签
   ============================================================ */
.mobile-cat-tabs {
  display: none;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 12px;
  gap: 6px;
  scrollbar-width: none;          /* Firefox */
}
.mobile-cat-tabs::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}
.mobile-cat-tab {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
  user-select: none;
}
.mobile-cat-tab.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  font-weight: 500;
}
.mobile-cat-tab:hover {
  border-color: var(--primary-light);
}

/* ============================================================
   6. 商品详情页布局（PC 左右分栏 / 移动端上下）
   ============================================================ */
.product-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
.product-gallery {
  position: relative;
  min-width: 0;
}

/* --- 多图轮播组件 --- */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
  user-select: none;
}
.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
  will-change: transform;
}
.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
}
.carousel-slide img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.carousel-prev:hover,
.carousel-next:hover {
  background: var(--white);
  box-shadow: var(--shadow);
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0 0;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition);
}
.carousel-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: 4px;
}

/* --- 产品信息区（详情页右侧） --- */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.product-info .product-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.product-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.product-desc {
  color: var(--text-secondary);
  line-height: 1.75;
  font-size: 0.92rem;
}
.product-cta-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.product-cta-buttons .btn {
  flex: 1;
  min-width: 140px;
}

/* --- 灯箱（点击图片全屏查看） --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.show {
  display: flex;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 2;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.35);
}
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.35);
}

/* --- 底部固定 CTA 栏（移动端） --- */
.sticky-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 10px 16px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  z-index: 950;
  gap: 10px;
}
.sticky-bottom-bar.show {
  display: flex;
}
.sticky-bottom-bar .btn,
.sticky-bottom-bar .pdp-btn-buy {
  flex: 1;
}

/* ============================================================
   7. 无限滚动 & 加载指示器
   ============================================================ */
.load-more-sentinel {
  height: 1px;
  width: 100%;
}
.loading-spinner {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.loading-spinner .spinner-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--primary-light);
  animation: spinnerBounce 1.2s infinite ease-in-out;
}
.loading-spinner .spinner-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-spinner .spinner-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes spinnerBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   8. 空状态提示
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.empty-state .empty-text {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================================
   9. 后台素材上传组件
   ============================================================ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 24px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary-light);
  background: #eef3f5;
}
.upload-area .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.upload-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 6px;
}
.upload-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  justify-content: center;
}
.upload-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.upload-progress {
  width: 100%;
  max-width: 300px;
  height: 6px;
  background: var(--bg-alt);
  border-radius: 3px;
  margin-top: 12px;
  overflow: hidden;
  display: none;
}
.upload-progress.show { display: block; }
.upload-progress-bar {
  height: 100%;
  background: var(--primary-light);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* 素材图片库网格 */
.upload-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.upload-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.upload-card:hover {
  box-shadow: var(--shadow);
}
.upload-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-alt);
}
.upload-card .upload-info {
  padding: 8px 10px;
  font-size: 0.75rem;
}
.upload-card .upload-info .filename {
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-bottom: 2px;
}
.upload-card .upload-info .file-meta {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.upload-card .upload-actions {
  display: flex;
  gap: 4px;
  padding: 0 10px 10px;
}
.upload-card .upload-actions button {
  flex: 1;
  padding: 5px 0;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--white);
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.upload-card .upload-actions button:hover {
  background: var(--bg-alt);
  border-color: var(--text-secondary);
}
.upload-card .upload-actions button.btn-danger {
  color: var(--error);
  border-color: var(--error);
}
.upload-card .upload-actions button.btn-danger:hover {
  background: var(--error);
  color: var(--white);
}

/* ============================================================
   10. 后台商品管理辅助样式
   ============================================================ */
.admin-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.admin-toolbar .form-input,
.admin-toolbar .form-select {
  width: auto;
  min-width: 140px;
}
.admin-toolbar .spacer {
  flex: 1;
}
.checkbox-label {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-right: 16px;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.admin-form-row .form-group {
  margin-bottom: 0;
}

/* 图片选择器迷你网格（后台商品表单中选图用） */
.image-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-height: 160px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.image-picker-item {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition);
  flex-shrink: 0;
}
.image-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-picker-item:hover {
  border-color: var(--primary-light);
}
.image-picker-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

/* ============================================================
   产品详情页 — 内容分区统一样式
   ============================================================ */
.product-section {
  padding: 32px 0;
}
.product-section-alt {
  padding: 32px 0;
  background: var(--white);
}
.product-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  color: var(--text);
}

/* ============================================================
   11. 响应式 — 阶段二新增组件断点适配
   ============================================================ */

/* 平板及以上 (≥768px) — 2列产品网格, 详情页左右双栏, 轮播更大 */
@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-detail {
    grid-template-columns: 1fr 1fr;
  }
  .carousel-slide img {
    aspect-ratio: 4 / 3;
  }
  .catalog-sidebar {
    width: 220px;
  }
  .sticky-bottom-bar {
    display: none !important;  /* 桌面端不显示底部固定栏 */
  }
  .admin-form-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* 桌面 (≥1024px) — 3列产品网格, 侧栏稍宽 */
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .catalog-sidebar {
    width: 240px;
  }
  .upload-gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* 移动端 (≤767px) — 隐藏侧栏, 2列网格, 显示底部固定栏, 顶部横向标签 */
@media (max-width: 767px) {
  .catalog-sidebar {
    display: none;
  }
  .catalog-layout {
    flex-direction: column;
    gap: 0;
  }
  .mobile-cat-tabs {
    display: flex;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .product-detail {
    grid-template-columns: 1fr;
  }
  .product-cta-buttons {
    position: static;
  }
  .lightbox-prev,
  .lightbox-next {
    width: 36px;
    height: 36px;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-toolbar .form-input,
  .admin-toolbar .form-select {
    width: 100%;
  }
  .admin-form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   11. 天猫风格产品详情页 v3
   组件: 轮播图 | 规格选择 | 参数表格 | 详情分段 | 购买栏
   适配: PC官网 + 微信小程序内嵌
   ============================================================ */

/* --- 11.1 两栏布局（PC端左右分栏） --- */
.pdp-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 768px) {
  .pdp-layout {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* --- 11.2 轮播图组件增强 --- */
.pdp-gallery {
  position: sticky;
  top: 80px;
  align-self: start;
}
.pdp-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 8px;
  height: 420px;
  contain: layout style paint;
}
.pdp-carousel-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* 移除 will-change，避免移动端 GPU 合成层绕过 overflow:hidden 导致页面撑宽 */
}
.pdp-carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdp-carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.pdp-carousel-prev,
.pdp-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: all 0.2s;
  opacity: 0;
}
.pdp-carousel:hover .pdp-carousel-prev,
.pdp-carousel:hover .pdp-carousel-next { opacity: 1; }
.pdp-carousel-prev:hover,
.pdp-carousel-next:hover { background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.18); }
.pdp-carousel-prev { left: 8px; }
.pdp-carousel-next { right: 8px; }

/* 缩略图条 */
.pdp-thumb-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}
.pdp-thumb {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
  opacity: 0.65;
}
.pdp-thumb.active {
  border-color: var(--accent);
  opacity: 1;
}
.pdp-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* 触摸滑动提示（移动端隐藏箭头，居中适配） */
@media (max-width: 767px) {
  .pdp-carousel-prev,
  .pdp-carousel-next { display: none; }
  /* 移动端图片占更大面积，object-fit:cover 填满画框 */
  .pdp-carousel-slide img {
    object-fit: cover;
  }
  .pdp-thumb { width: 44px; height: 44px; }
  /* 移动端取消 sticky，避免 WebView 布局偏移；裁剪溢出防止页面撑宽 */
  .pdp-gallery { position: relative; top: auto; overflow: hidden; }
  .pdp-carousel { height: 55vh; min-height: 260px; max-height: 360px; max-width: 100%; }
  .pdp-layout { max-width: 100%; margin: 0 auto; overflow: hidden; }
  .section { padding: 28px 0; }
  .pdp-detail-section { padding: 16px 0; }
  .page-hero { padding: 20px 0; }
  .page-hero h1 { font-size: 1.2rem; margin-bottom: 4px; }
  .page-hero p { font-size: 0.8rem; }
  .breadcrumb { padding: 8px 0; font-size: 0.78rem; }
}

/* --- 11.3 商品信息摘要区 --- */
.pdp-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 0;
}
.pdp-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}
.pdp-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -8px;
}
.pdp-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}
.pdp-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: linear-gradient(135deg, #fff5f5, #fff0f0);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}
.pdp-price-symbol {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}
.pdp-price-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  font-family: -apple-system, 'Helvetica Neue', sans-serif;
}
.pdp-price-unit {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: 4px;
}
.pdp-price-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  padding-left: 4px;
}
.pdp-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pdp-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 600;
}
.pdp-tag-new  { background: #e8f5e9; color: #2e7d32; }
.pdp-tag-hot  { background: #fff3e0; color: #e65100; }

/* --- 11.4 规格选择组件（天猫风格圆角按钮） --- */
.pdp-spec-section { margin-top: 4px; }
.pdp-spec-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.pdp-spec-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.pdp-spec-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: #fff;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}
.pdp-spec-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pdp-spec-btn.active {
  border-color: var(--accent);
  background: #fff5f5;
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(217, 59, 49, 0.12);
}
.pdp-spec-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* 库存状态 */
.pdp-stock {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  padding: 4px 0;
}
.pdp-stock-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pdp-stock-dot.in-stock  { background: #4caf50; box-shadow: 0 0 4px rgba(76,175,80,0.5); }
.pdp-stock-dot.low-stock { background: #ff9800; box-shadow: 0 0 4px rgba(255,152,0,0.5); }
.pdp-stock-dot.out-stock { background: #f44336; }
.pdp-stock-text { color: var(--text-secondary); }
.pdp-stock-text.in-stock  { color: #2e7d32; }
.pdp-stock-text.low-stock { color: #e65100; }

/* 资质徽章 */
.pdp-cert-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.pdp-cert-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  background: #f5f7fa;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.pdp-cert-badge .cert-icon { font-size: 0.85rem; }

/* --- 11.5 购买按钮组件 --- */
.pdp-buy-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.pdp-btn-buy {
  flex: 1;
  padding: 13px 4px;
  border: none;
  border-radius: 24px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.pdp-btn-buy.pdp-btn-primary {
  flex: 2;
}
.pdp-btn-buy.pdp-btn-outline {
  flex: 0.8;
  font-size: 0.82rem;
}
.pdp-btn-primary {
  background: linear-gradient(135deg, #ff6b35, #d93b31);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 59, 49, 0.35);
}
.pdp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(217, 59, 49, 0.45);
}
.pdp-btn-primary:active {
  transform: translateY(0);
}
.pdp-btn-outline {
  background: #fff;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.pdp-btn-outline:hover {
  background: #fff5f5;
}

/* 微信咨询弹窗 */
.pdp-consult-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 4000;
  align-items: center;
  justify-content: center;
}
.pdp-consult-modal.show {
  display: flex;
}
.pdp-consult-dialog {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 90vw;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: pdpSlideUp 0.3s ease;
}
@keyframes pdpSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pdp-consult-dialog h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.pdp-consult-dialog .qr-placeholder {
  width: 160px; height: 160px;
  margin: 12px auto;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.pdp-consult-dialog .consult-phone {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin: 8px 0;
}
.pdp-consult-dialog .btn-close {
  margin-top: 12px;
  padding: 8px 32px;
  border-radius: 20px;
  background: var(--bg-alt);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

/* --- 11.6 详情分段（天猫风格锚点导航） --- */
.pdp-detail-nav {
  display: flex;
  position: sticky;
  top: 60px;
  background: #fff;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  margin: 0 -16px;
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pdp-detail-nav-item {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}
.pdp-detail-nav-item:hover { color: var(--text); }
.pdp-detail-nav-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.pdp-detail-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.pdp-detail-section:last-child { border-bottom: none; }
.pdp-detail-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.pdp-detail-section .section-body {
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--text-secondary);
}
.pdp-detail-section .section-body p {
  margin: 0 0 8px;
}

/* --- 11.7 参数规格表格 --- */
.pdp-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.pdp-specs-table tr:nth-child(even) {
  background: var(--bg-alt);
}
.pdp-specs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.pdp-specs-table .spec-key {
  color: var(--text-secondary);
  width: 35%;
  font-weight: 500;
}
.pdp-specs-table .spec-val {
  color: var(--text);
}

/* 稍宽手机屏（≥420px）规格参数双列排布，利用横向空间 */
@media (min-width: 420px) and (max-width: 767px) {
  .pdp-specs-table { display: flex; flex-wrap: wrap; }
  .pdp-specs-table tr { width: 50%; display: flex; }
  .pdp-specs-table td { flex: 1; }
}

/* --- 11.8 售后保障条 --- */
.pdp-after-sales {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 16px 0;
}
@media (min-width: 768px) {
  .pdp-after-sales { grid-template-columns: repeat(4, 1fr); }
}
.pdp-as-item {
  text-align: center;
  padding: 14px 8px;
}
.pdp-as-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.pdp-as-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.pdp-as-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- 11.8b 门店信任区 (PDP Store Trust) --- */
.pdp-trust-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 10px;
  padding: 12px 0;
}
@media (min-width: 600px) {
  .pdp-trust-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
  .pdp-trust-grid { grid-template-columns: repeat(3, 1fr); }
}
.pdp-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: #f8fafb;
  border-radius: 8px;
  border: 1px solid #e8ecf0;
}
.pdp-trust-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.pdp-trust-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.pdp-trust-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.pdp-trust-cta {
  text-align: center;
  margin-top: 18px;
  padding: 20px;
  background: #fff;
  border: 2px solid #0a3d6b;
  border-radius: 8px;
}
.pdp-trust-btn {
  display: inline-block;
  padding: 12px 32px;
  background: #0a3d6b;
  color: #fff !important;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
}
.pdp-trust-btn:hover {
  background: #0d4f85;
}

/* --- 11.9 相关推荐卡片 --- */
.pdp-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 768px) {
  .pdp-related-grid { grid-template-columns: repeat(4, 1fr); }
}
.pdp-related-card {
  display: block;
  text-decoration: none;
  background: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.pdp-related-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.pdp-related-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}
.pdp-related-card .pdp-rel-info {
  padding: 8px 10px;
}
.pdp-related-card .pdp-rel-name {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pdp-related-card .pdp-rel-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

/* --- 11.10 Toast 提示 --- */
.pdp-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 28px;
  border-radius: 24px;
  font-size: 0.9rem;
  z-index: 5000;
  animation: pdpFadeInOut 2s ease forwards;
  pointer-events: none;
}
@keyframes pdpFadeInOut {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ========== 门店位置卡片 ========== */
.map-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  border: 1px solid var(--border);
}
.map-card-info {
  max-width: 360px;
  margin: 0 auto;
}
.map-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.map-card-addr {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.map-card-tel {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ========== 首页主营材料分类网格 ========== */
.material-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 16px;
}

.material-cat {
  flex: 1 1 auto;
  min-width: 0;
}

.material-cat-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 6px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

.material-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* 产品卡片 */
.material-card {
  display: block;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.material-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.1);
}
.material-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block;
  background: #f5f5f5;
}
.material-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  padding: 6px 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.material-card-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  padding: 2px 8px 8px;
}

/* 桌面端：5列并排 */
@media (min-width: 1025px) {
  .material-cats {
    flex-wrap: nowrap;
    gap: 0;
  }
  .material-cat {
    flex: 1 1 0;
    padding: 0 10px;
    border-right: 1px dashed var(--border);
  }
  .material-cat:last-child {
    border-right: none;
    padding-right: 0;
  }
  .material-cat:first-child {
    padding-left: 0;
  }
}

/* 平板端：3+2 两行 */
@media (min-width: 769px) and (max-width: 1024px) {
  .material-cat {
    flex: 0 0 calc(33.33% - 12px);
  }
}

/* 手机端：单列堆叠，保持两列产品网格 */
@media (max-width: 768px) {
  .material-cats {
    flex-direction: column;
    gap: 20px;
  }
  .material-cat {
    flex: none;
    width: 100%;
  }
  .material-cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .material-card img {
    aspect-ratio: 1/1;
  }
}
