/* ====================================================================
   克莱福专科护理商城 · 移动端现代 UI 样式表
   配色：温暖母婴与严谨医疗风格 (#e26a6a, #f78d8d, #fbfbfd, #2c3e50)
   ==================================================================== */

:root {
  --primary: #e26a6a;
  --primary-light: #fcebeb;
  --primary-active: #c95454;
  --text-main: #2d3748;
  --text-sub: #718096;
  --text-light: #a0aec0;
  --bg-page: #f7f8fa;
  --bg-card: #ffffff;
  --border-color: #edf2f7;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 500px;
  margin: 0 auto;
  background-color: var(--bg-page);
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* 顶栏 */
.app-header {
  background: linear-gradient(135deg, #e26a6a 0%, #f78d8d 100%);
  color: #fff;
  padding: 16px 16px 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-tag {
  font-size: 11px;
  opacity: 0.9;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 10px;
}

.search-bar {
  display: flex;
  gap: 8px;
}

.search-bar input {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0 16px;
  font-size: 13px;
  background: rgba(255,255,255,0.95);
  color: var(--text-main);
  outline: none;
}

.search-bar button {
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

/* 主展示区 */
.app-body {
  flex: 1;
  padding-bottom: 70px;
}

/* 底栏 Tabbar */
.app-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 500px;
  margin: 0 auto;
  height: 56px;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 11px;
}

.tab-item.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-icon {
  font-size: 18px;
  line-height: 1;
  margin-bottom: 2px;
}

.badge-wrap {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

/* 分类标签栏 */
.category-tabs {
  display: flex;
  background: #fff;
  padding: 10px 16px;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
}

.category-tab-btn {
  padding: 6px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-sub);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.category-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 商品卡片列表 */
.product-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  cursor: pointer;
}

.product-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #edf2f7;
  flex-shrink: 0;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
}

.product-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.product-subtitle {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

.product-market {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 4px;
}

.btn-select-sku {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* 临床提示小条 */
.clinical-tip-banner {
  margin: 12px 12px 0;
  padding: 10px 14px;
  background: #fffaf0;
  border-left: 4px solid #ed8936;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #7b341e;
  line-height: 1.4;
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 16px 16px 12px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 8px;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  gap: 12px;
  position: relative;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #edf2f7;
}

.modal-meta {
  flex: 1;
}

.modal-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.modal-stock, .modal-selected {
  font-size: 12px;
  color: var(--text-sub);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.sku-section-title {
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 8px;
}

.sku-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sku-tag {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #f7f8fa;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
}

.sku-tag.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.sku-qty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.qty-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-stepper button {
  width: 32px;
  height: 30px;
  background: #f7f8fa;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.qty-stepper input {
  width: 40px;
  height: 30px;
  border: none;
  text-align: center;
  font-size: 13px;
}

.clinical-notice {
  margin-top: 14px;
  padding: 8px 12px;
  background: #fff5f5;
  border-left: 3px solid #e53e3e;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: #c53030;
  line-height: 1.4;
}

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-shrink: 0;
}

.btn-cart, .btn-buy, .btn-pay {
  flex: 1;
  height: 40px;
  border-radius: var(--radius-lg);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-cart {
  background: #fed7d7;
  color: #c53030;
}

.btn-buy, .btn-pay {
  background: var(--primary);
  color: #fff;
}

/* 面诊预约表单样式 */
.consult-container {
  padding: 14px;
}

.consult-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.form-item {
  margin-bottom: 14px;
}

.form-item label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-item input, .form-item select, .form-item textarea {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #fbfbfd;
  font-size: 13px;
  outline: none;
}

.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.gender-toggle {
  display: flex;
  gap: 10px;
}

.toggle-pill {
  flex: 1;
  text-align: center;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fbfbfd;
}

.toggle-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 患处照片上传框 */
.upload-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-box {
  width: 72px;
  height: 72px;
  border: 1px dashed #cbd5e0;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 11px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: #fbfbfd;
}

.upload-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* 购物车视图 */
.cart-list {
  padding: 12px;
}

.cart-item {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.cart-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.cart-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-footer-bar {
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 99;
}

/* 个人中心 */
.user-panel {
  padding: 16px;
}

.user-card {
  background: linear-gradient(135deg, #e26a6a 0%, #f78d8d 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.user-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.order-tabs-row {
  display: flex;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px 0;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.order-tab-item {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
}

.order-tab-item div:first-child {
  font-size: 18px;
  margin-bottom: 4px;
}


/* 物流时间线样式 */
.timeline-wrap {
  position: relative;
  padding: 16px 0 16px 20px;
  border-left: 2px solid #e2e8f0;
  margin-left: 10px;
}

.timeline-node {
  position: relative;
  margin-bottom: 20px;
}

.timeline-node:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -27px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e0;
  border: 2px solid #fff;
}

.timeline-node.active .timeline-dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(226, 106, 106, 0.2);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 2px;
}

.timeline-text {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.4;
}

.timeline-node.active .timeline-text {
  color: var(--primary);
  font-weight: 600;
}

/* 图文详情样式 */
.rich-desc-wrap h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin: 12px 0 6px;
}

.rich-desc-wrap p {
  margin-bottom: 8px;
  line-height: 1.6;
}

.rich-desc-wrap ul, .rich-desc-wrap ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.rich-desc-wrap li {
  margin-bottom: 4px;
}

.rich-desc-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 10px 0;
}

.rich-desc-wrap th, .rich-desc-wrap td {
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
}

.ph-thumb {
  background: #edf2f7;
  display: block;
}

.rich-detail img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
  margin: 10px 0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: block;
}

/* ---- checkout / pay / orders ---- */
.address-form { display: grid; gap: 8px; margin-bottom: 12px; }
.address-form input, .address-form textarea { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; font: inherit; font-size: 14px; }
.chk-lines { display: grid; gap: 6px; margin-bottom: 10px; font-size: 13px; }
.chk-line { display: flex; justify-content: space-between; gap: 8px; }
.chk-line span:first-child { color: #2d3748; }
.sum-row { display: flex; justify-content: space-between; font-size: 13px; margin: 4px 0; }
.sum-row small { color: var(--text-sub); }
.form-error { color: #c53030; font-size: 13px; min-height: 1em; margin-top: 6px; }
.mock-tag { font-size: 11px; background: #fefcbf; color: #975a16; padding: 2px 6px; border-radius: 6px; vertical-align: middle; }
.pay-body { text-align: center; }
.pay-merchant { color: var(--text-sub); margin-top: 8px; }
.pay-amount { font-size: 36px; font-weight: 700; margin: 8px 0; }
.pay-order { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.btn-pay.wx-pay { background: #07c160; }
.order-page { padding: 14px 14px 90px; display: grid; gap: 12px; }
.order-card { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.order-card h3 { font-size: 15px; margin-bottom: 8px; }
.status-hero { background: linear-gradient(135deg, var(--primary) 0%, #f29a9a 100%); color: #fff; }
.status-hero .big { font-size: 22px; font-weight: 700; }
.status-hero .sub { font-size: 12px; opacity: .9; margin-top: 4px; }
.success-icon { font-size: 44px; text-align: center; }
.steps { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11px; }
.steps div { flex: 1; text-align: center; opacity: .55; }
.steps div.on { opacity: 1; font-weight: 700; }
.kv { display: grid; grid-template-columns: 72px 1fr; gap: 4px 8px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--text-sub); }
.trace { border-left: 2px solid #e2e8f0; margin-left: 6px; padding-left: 12px; display: grid; gap: 10px; font-size: 13px; }
.trace .t { position: relative; }
.trace .t::before { content: ""; position: absolute; left: -18px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e0; }
.trace .t:first-child::before { background: var(--primary); }
.trace .t:first-child { color: #2d3748; font-weight: 600; }
.trace .time { font-size: 11px; color: var(--text-sub); font-weight: 400; }
.order-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-actions button { flex: 1; height: 38px; border-radius: 19px; border: 1px solid var(--primary); background: #fff; color: var(--primary); font: inherit; }
.order-actions button.primary { background: var(--primary); color: #fff; }
.my-order { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #edf2f7; font-size: 13px; cursor: pointer; }
.my-order:last-child { border-bottom: 0; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--primary-light); color: var(--primary); }
.lookup-form { display: grid; gap: 8px; }
.lookup-form input { padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; font: inherit; }
.lookup-form button { height: 38px; border: 0; border-radius: 19px; background: var(--primary); color: #fff; font: inherit; }

/* 商品相册：横向滑动 + 缩略图 */
.gallery {
  position: relative;
  margin: 12px 0 8px;
  border-radius: var(--radius-sm, 10px);
  overflow: hidden;
  background: #f7fafc;
}
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  outline: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.gal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  font-size: 22px;
  line-height: 32px;
  color: #2d3748;
  cursor: pointer;
}
.gal-prev { left: 8px; }
.gal-next { right: 8px; }
.gal-nav[disabled] { opacity: 0.3; cursor: default; }
.gal-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
}
.gallery.single .gal-nav, .gallery.single .gal-count { display: none; }
.gallery-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}
.gallery-thumbs:empty { display: none; }
.gallery-thumbs button {
  flex: 0 0 52px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: #edf2f7;
  cursor: pointer;
}
.gallery-thumbs button.on { border-color: var(--primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: none) { .gal-nav { display: none; } }

/* product editor fields on the product page */
.product-price small { font-size: 12px; font-weight: 400; }
.modal-market { font-size: 13px; color: #a0aec0; font-weight: 400; margin-left: 6px; }
.modal-title { font-size: 16px; margin: 0 0 4px; line-height: 1.4; }
.modal-subtitle { font-size: 13px; color: #718096; margin: 0 0 10px; }
.modal-subtitle:empty { display: none; }
.attr-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.attr-table th, .attr-table td { border: 1px solid #edf2f7; padding: 6px 8px; text-align: left; vertical-align: top; }
.attr-table th { width: 34%; background: #f7fafc; color: #4a5568; font-weight: 500; }
.attr-table.qual th { background: #f0f7ff; }
.rich-detail table { border-collapse: collapse; width: 100%; }
.rich-detail td, .rich-detail th { border: 1px solid #edf2f7; padding: 4px 6px; }

/* stock */
.thumb-wrap { position: relative; flex-shrink: 0; }
.stock-flag { position: absolute; left: 4px; top: 4px; font-size: 11px; padding: 1px 6px; border-radius: 6px; color: #fff; }
.stock-flag.out { background: rgba(26, 32, 44, 0.78); }
.stock-flag.low { background: #dd6b20; }
.product-card.sold-out .product-thumb { filter: grayscale(0.9); opacity: 0.7; }
.product-card.sold-out .btn-select-sku { background: #a0aec0; }
.sku-tag.disabled { color: #a0aec0; background: #f1f3f5; border-style: dashed; cursor: not-allowed; text-decoration: line-through; }
.modal-stock.stock-low { color: #dd6b20; font-weight: 600; }
.modal-stock.stock-out { color: #c53030; font-weight: 700; }
.modal-footer button:disabled { background: #cbd5e0 !important; color: #fff !important; cursor: not-allowed; }

/* customer-service chat widget */
.chat-fab { position: fixed; right: max(12px, calc(50vw - 238px)); bottom: 76px; z-index: 900; border: 0; border-radius: 22px;
  background: var(--primary); color: #fff; padding: 9px 14px; font-size: 14px; display: flex; gap: 4px; align-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: left .2s ease, top .2s ease; }
.chat-fab.dragging { transition: none; cursor: grabbing; opacity: .85; }
.chat-bubble.rich { white-space: normal; }
.chat-bubble.rich .rich-p { margin: 0 0 6px; }
.chat-bubble.rich .rich-p:last-child { margin-bottom: 0; }
.chat-bubble.rich .rich-h { font-weight: 600; margin-top: 4px; }
.chat-bubble.rich .rich-list { margin: 0 0 6px; }
.chat-bubble.rich .rich-li { display: flex; gap: 6px; margin: 3px 0; }
.chat-bubble.rich .rich-mark { flex: none; min-width: 1.4em; color: var(--primary); font-weight: 600; }
.chat-bubble.rich .rich-tx { flex: 1; }
.chat-badge { background: #e53e3e; border: 2px solid #fff; border-radius: 10px; font-size: 11px; min-width: 18px; padding: 0 4px; line-height: 16px; }
.chat-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none; justify-content: center; align-items: flex-end; z-index: 1000; }
.chat-overlay.active { display: flex; }
.chat-sheet { width: 100%; max-width: 500px; height: min(86vh, 720px); background: #fff; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #edf2f7; }
.chat-status { font-size: 12px; color: #718096; margin-top: 2px; }
.chat-status.on::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #38a169; margin-right: 5px; }
.chat-offline { background: #fffaf0; color: #9c4221; font-size: 12px; padding: 8px 14px; border-bottom: 1px solid #feebc8; line-height: 1.5; }
.chat-order { background: #ebf8ff; color: #2c5282; font-size: 12px; padding: 6px 14px; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 12px 4px; background: #f7f8fa; display: flex; flex-direction: column; gap: 8px; }
.chat-empty { color: #a0aec0; font-size: 13px; text-align: center; padding: 30px 16px; line-height: 1.6; }
.chat-msg { display: flex; flex-direction: column; max-width: 80%; }
.chat-msg.customer { align-self: flex-end; align-items: flex-end; }
.chat-msg.staff { align-self: flex-start; align-items: flex-start; }
.chat-msg.system { align-self: center; align-items: center; max-width: 92%; }
.chat-bubble { padding: 8px 11px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; background: #fff; border: 1px solid #edf2f7; }
.chat-msg.customer .chat-bubble { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-msg.system .chat-bubble { background: #edf2f7; color: #4a5568; font-size: 12px; }
.chat-bubble img { max-width: 200px; max-height: 220px; border-radius: 8px; display: block; cursor: zoom-in; }
.chat-meta { font-size: 10px; color: #a0aec0; margin-top: 2px; }
.chat-err { color: #c53030; font-size: 12px; margin: 0; padding: 0 14px; min-height: 0; }
.chat-err:empty { display: none; }
.chat-tools { padding: 0 12px; }
.chat-tools select { width: 100%; margin: 6px 0 0; font-size: 12px; padding: 5px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
.chat-input { display: flex; gap: 6px; padding: 8px 12px; align-items: flex-end; border-top: 1px solid #edf2f7; }
.chat-input textarea { flex: 1; resize: none; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; max-height: 90px; }
.chat-input button { background: var(--primary); color: #fff; border: 0; border-radius: 10px; padding: 9px 14px; font-size: 14px; }
.chat-img-btn { font-size: 20px; padding: 4px; cursor: pointer; }
.chat-foot { font-size: 10px; color: #a0aec0; text-align: center; padding: 0 12px 8px; }

/* ---- after-sales / notices / tracking ---- */
.pill.ok { background: #dcfce7; color: #166534; }
.pill.red { background: #ffe4e6; color: #be123c; }
.hint-box { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 6px 0 10px; }
.muted-s { font-size: 12px; color: var(--text-sub); }
.notice-list { display: grid; gap: 8px; }
.notice { display: grid; gap: 2px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: #f8fafc; }
.notice.unread { background: #fff1f2; }
.notice small { color: var(--text-sub); font-size: 11px; }
.as-item { border: 1px solid #edf2f7; border-radius: 12px; padding: 10px; margin-bottom: 10px; display: grid; gap: 6px; }
.as-head { display: flex; justify-content: space-between; align-items: center; }
.as-meta { font-size: 12px; color: var(--text-sub); }
.as-steps { font-size: 11px; }
.as-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.as-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.as-item details summary { font-size: 12px; color: var(--text-sub); cursor: pointer; margin-bottom: 6px; }
.as-ship { display: flex; gap: 6px; flex-wrap: wrap; }
.as-ship input { flex: 1; min-width: 160px; }
.as-form { display: grid; gap: 10px; font-size: 13px; }
.as-form label { display: grid; gap: 4px; }
.as-form select, .as-form input, .as-form textarea, .as-ship select, .as-ship input { padding: 8px; border: 1px solid #e2e8f0; border-radius: 8px; font: inherit; }
.as-types { display: flex; gap: 12px; flex-wrap: wrap; }
.as-types label { display: flex; align-items: center; gap: 4px; }
.as-line { display: grid; gap: 4px; padding: 8px; background: #f8fafc; border-radius: 10px; }
.as-line label { display: flex; gap: 6px; align-items: center; }
.as-line .ex-only { display: none; }
.as-form.is-exchange .ex-only { display: inline; }
.as-form.is-exchange .refund-only { display: none; }

/* ===================== product list: grid / list view ===================== */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 0; min-height: 44px; }
.list-count { font-size: 12px; color: var(--text-sub); }
.view-toggle { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-color);
  border-radius: 10px; background: #fff; color: var(--text-main); cursor: pointer; flex-shrink: 0; transition: background-color .15s, color .15s; }
.view-toggle:hover { color: var(--primary); border-color: var(--primary-light); }
.view-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.view-toggle svg { display: block; }

.product-grid { transition: opacity .14s ease, transform .14s ease; will-change: opacity, transform; }
.product-grid.view-leave { opacity: 0; transform: translateY(4px); }
.product-grid.view-enter { opacity: 0; transform: translateY(-4px); transition: none; }
@media (prefers-reduced-motion: reduce) {
  .product-grid, .product-grid.view-leave, .product-grid.view-enter { transition: none !important; transform: none !important; opacity: 1 !important; }
  .toast { transition: none !important; }
}
.product-card { min-width: 0; }
.empty-products { grid-column: 1 / -1; text-align: center; padding: 40px; color: #a0aec0; }
.product-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.product-tag.hosp { color: #2b6cb0; background: #ebf4ff; }
.product-specs { font-size: 12px; color: var(--text-sub); line-height: 1.35; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-rating { font-size: 11px; color: #d69e2e; }
.card-rating small { color: var(--text-light); }
.price-box { min-width: 0; overflow: hidden; }
.sale-flag { display: inline-block; font-size: 10px; font-style: normal; color: #fff; background: #e53e3e; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 2px; }
.sale-corner { position: absolute; right: 4px; top: 4px; font-size: 10px; padding: 1px 6px; border-radius: 6px; color: #fff; background: #e53e3e; }
.btn-quick { white-space: nowrap; flex-shrink: 0; min-height: 28px; }
.btn-quick:disabled { background: #a0aec0; cursor: not-allowed; }

/* grid (default): two columns, image first, price prominent */
html:not([data-view="list"]) .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px 12px 12px; }
html:not([data-view="list"]) .product-card { flex-direction: column; padding: 0; gap: 0; overflow: hidden; }
html:not([data-view="list"]) .thumb-wrap { width: 100%; aspect-ratio: 1 / 1; }
html:not([data-view="list"]) .product-thumb { width: 100%; height: 100%; border-radius: 0; display: block; }
html:not([data-view="list"]) .product-info { padding: 8px 10px 10px; gap: 6px; }
html:not([data-view="list"]) .product-title { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
html:not([data-view="list"]) .product-subtitle,
html:not([data-view="list"]) .product-specs,
html:not([data-view="list"]) .product-tags,
html:not([data-view="list"]) .card-rating { display: none; }
html:not([data-view="list"]) .product-price-row { gap: 6px; }
html:not([data-view="list"]) .product-price { font-size: 16px; }
html:not([data-view="list"]) .product-price small { font-size: 11px; }
html:not([data-view="list"]) .product-market { display: none; }
html:not([data-view="list"]) .btn-quick { padding: 4px 10px; }

/* list: one column, image left, text right */
html[data-view="list"] .product-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px 12px 12px; }
html[data-view="list"] .product-card { flex-direction: row; padding: 10px; gap: 12px; }
html[data-view="list"] .thumb-wrap { width: 104px; height: 104px; }
html[data-view="list"] .product-thumb { width: 104px; height: 104px; }
html[data-view="list"] .product-info { min-width: 0; gap: 6px; }
html[data-view="list"] .product-title { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[data-view="list"] .product-subtitle { -webkit-line-clamp: 1; margin-bottom: 2px; }
html[data-view="list"] .product-price-row { gap: 8px; }
@media (max-width: 360px) {
  html[data-view="list"] .thumb-wrap, html[data-view="list"] .product-thumb { width: 84px; height: 84px; }
  html:not([data-view="list"]) .product-grid { gap: 8px; padding: 8px; }
  html:not([data-view="list"]) .product-price-row { flex-direction: column; align-items: stretch; }
  html:not([data-view="list"]) .btn-quick { width: 100%; }
  .product-price { font-size: 15px; }
}

.toast { position: fixed; left: 50%; bottom: 76px; transform: translate(-50%, 8px); background: rgba(26, 32, 44, .9); color: #fff; font-size: 13px;
  padding: 8px 14px; border-radius: 18px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 400; max-width: 86vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ===================== coupons ===================== */
.coupon-strip { margin: 10px 12px 0; padding: 8px 12px; border-radius: var(--radius-sm); background: #fff5f5; border: 1px dashed var(--primary);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--primary-active); }
.coupon-strip[hidden] { display: none; }
.coupon-strip button, .cc-claim, .code-row button { border: none; background: var(--primary); color: #fff; border-radius: 14px; padding: 4px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.cc-claim:disabled { background: #cbd5e0; cursor: default; }
.coupon-list { display: grid; gap: 8px; margin-bottom: 8px; }
.coupon-card { display: flex; align-items: stretch; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid #fed7d7; }
.coupon-card.dim { filter: grayscale(1); opacity: .65; }
.cp-left { background: linear-gradient(135deg, #e26a6a, #f78d8d); color: #fff; padding: 8px 10px; display: flex; flex-direction: column; justify-content: center; min-width: 96px; max-width: 40%; }
.cp-left b { font-size: 14px; line-height: 1.25; }
.cp-left small { font-size: 10px; opacity: .9; }
.cp-mid { flex: 1; padding: 8px; font-size: 13px; min-width: 0; }
.cp-mid small { display: block; font-size: 11px; color: var(--text-sub); }
.cp-right { display: flex; align-items: center; padding: 0 8px; }
.code-row { display: flex; gap: 6px; margin-top: 6px; }
.code-row input { flex: 1; min-width: 0; height: 32px; border: 1px solid var(--border-color); border-radius: 8px; padding: 0 10px; text-transform: uppercase; }
.coupon-pick select { width: 100%; height: 36px; border: 1px solid var(--border-color); border-radius: 8px; padding: 0 8px; background: #fff; }
.sum-row.disc span:last-child { color: #e53e3e; }
.sale-box { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: #fff5f5; color: var(--primary-active); font-size: 12px; }

/* ===================== invoices ===================== */
.invoice-form { display: grid; gap: 8px; }
.invoice-form .inv-fields { display: grid; gap: 8px; }
.invoice-form [hidden] { display: none !important; }
.invoice-form input:not([type=radio]):not([type=checkbox]) { height: 36px; border: 1px solid var(--border-color); border-radius: 8px; padding: 0 10px; width: 100%; }
.invoice-form .sp { display: grid; gap: 8px; }
.invoice-form .seg { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.invoice-form .seg.locked { opacity: .6; pointer-events: none; }
label.inline { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.btn-link { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 16px; border: 1px solid var(--primary); color: var(--primary); text-decoration: none; font-size: 13px; }
.btn-link.primary { background: var(--primary); color: #fff; }

/* ===================== reviews ===================== */
.stars { color: #ecc94b; letter-spacing: 1px; font-size: 13px; }
.stars .off { color: #e2e8f0; }
.reviews-wrap { margin-top: 12px; }
.rv-summary { display: flex; gap: 14px; align-items: center; padding: 8px 0; flex-wrap: wrap; }
.rv-avg { display: flex; flex-direction: column; align-items: flex-start; }
.rv-avg b { font-size: 26px; color: var(--primary); line-height: 1; }
.rv-avg small { font-size: 11px; color: var(--text-sub); }
.rv-dist { flex: 1; min-width: 150px; display: grid; gap: 2px; font-size: 11px; color: var(--text-sub); }
.rv-dist div { display: grid; grid-template-columns: 28px 1fr 24px; align-items: center; gap: 6px; }
.rv-dist i { display: block; height: 6px; border-radius: 3px; background: #ecc94b; min-width: 2px; }
.rv-item, .rv-order-item { border-top: 1px solid var(--border-color); padding: 10px 0; font-size: 13px; }
.rv-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rv-top small { color: var(--text-light); font-size: 11px; }
.rv-item p, .rv-mine p { margin: 4px 0; white-space: pre-wrap; word-break: break-word; }
.rv-photos { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.rv-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #edf2f7; }
.rv-reply { background: #f7fafc; border-radius: 6px; padding: 6px 8px; font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.rv-follow { margin-top: 6px; padding-left: 8px; border-left: 2px solid #fed7d7; }
.rv-pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 8px 0; font-size: 12px; }
.rv-pager button { border: 1px solid var(--border-color); background: #fff; border-radius: 14px; padding: 4px 12px; cursor: pointer; }
.rv-prod { font-weight: 600; margin-bottom: 4px; }
.rv-form { display: grid; gap: 8px; margin-top: 6px; }
.rv-form textarea { width: 100%; border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; font: inherit; }
.star-pick { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.star-pick input { position: absolute; opacity: 0; pointer-events: none; }
.star-pick span { font-size: 26px; color: #e2e8f0; cursor: pointer; line-height: 1; }
.star-pick label:has(input:checked) span, .star-pick label:has(input:checked) ~ label span { color: #ecc94b; }
.star-pick input:focus-visible + span { outline: 2px solid var(--primary); border-radius: 4px; }

/* real WeChat Pay: Native QR + WeChat login card */
.pay-qr { display: flex; justify-content: center; margin: 12px auto 4px; }
.pay-qr svg, .pay-qr img { width: 200px; height: 200px; image-rendering: pixelated; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border, #e2e8f0); }
.pay-hint { font-size: 12px; color: var(--text-sub); text-align: center; margin-top: 6px; }
.wx-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wx-card img.wx-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.wx-card .wx-name { font-weight: 700; font-size: 14px; }
.wx-card .wx-sub { font-size: 12px; color: var(--text-sub); }
.wx-card .wx-actions { margin-left: auto; display: flex; gap: 6px; }
.wx-btn { border: none; background: #07c160; color: #fff; border-radius: 16px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.wx-btn.ghost { background: transparent; color: #07c160; border: 1px solid #07c160; }

/* ---------------- v1.1 ---------------- */
.link-btn { background: none; border: 0; color: var(--primary); font-size: 12px; float: right; padding: 0; cursor: pointer; }
.addr-pick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.addr-opt { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 10px; font-size: 13px; background: #fff; }
.addr-opt.on { border-color: var(--primary); background: var(--primary-light); }
.addr-opt small { color: var(--text-sub); }
.addr-opt input { margin-top: 3px; accent-color: var(--primary); }
.addr-fields[hidden] { display: none !important; }
.sum-row.benefit { cursor: pointer; user-select: none; }
.sum-row.benefit .benefit-hint { font-style: normal; color: var(--primary); font-size: 12px; }
.sum-row.benefit b { color: var(--primary); }
.sum-row.benefit .chev { display: inline-block; font-style: normal; color: var(--text-light); transition: transform .15s; }
.sum-row.benefit.open .chev, details[open] > summary .chev { transform: rotate(90deg); }
.benefit-panel { background: #fafafa; border-radius: 10px; padding: 6px 10px; margin: 4px 0 8px; }
.sum-row.sub { font-size: 12px; color: var(--text-sub); }
.coupon-radio { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.coupon-radio .cr { display: flex; gap: 8px; align-items: flex-start; background: #fff; border: 1px dashed #f2b8b8; border-radius: 8px; padding: 6px 8px; font-size: 13px; }
.coupon-radio .cr small { display: block; color: var(--text-sub); font-size: 11px; }
.coupon-radio .cr.off { opacity: .5; }
.coupon-radio input { accent-color: var(--primary); margin-top: 3px; }
details.benefit-fold > summary { list-style: none; }
details.benefit-fold > summary::-webkit-details-marker { display: none; }
.page-back { display: flex; align-items: center; gap: 10px; padding: 10px 12px 4px; }
.page-back b { font-size: 15px; }
.back-btn { border: 1px solid var(--border-color); background: #fff; border-radius: 16px; padding: 4px 12px; font-size: 13px; color: var(--text-main); }
.order-actions.center { justify-content: center; margin-top: 10px; }
.menu-row { display: flex; justify-content: space-between; align-items: center; width: calc(100% - 24px); border: 0; font-size: 14px; text-align: left; cursor: pointer; }
.addr-row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.addr-row small { color: var(--text-sub); }
.addr-acts { display: flex; flex-direction: column; gap: 4px; }
.addr-acts button { font-size: 12px; border: 1px solid var(--border-color); background: #fff; border-radius: 12px; padding: 2px 10px; }
.as-form.is-negotiate .refund-only { display: none; }
.gallery-slide video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vthumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: #222; color: #fff; font-size: 11px; }
/* 资料库 */
.kb-page { padding-bottom: 16px; }
.kb-hero { background: linear-gradient(120deg, #ff8fa3, #ffb3c1); color: #fff; padding: 16px 14px 26px; }
.kb-hero b { font-size: 19px; letter-spacing: 1px; display: block; }
.kb-hero small { font-size: 12px; opacity: .9; }
.kb-search { display: flex; gap: 6px; margin: -16px 12px 6px; background: #fff; border-radius: 20px; padding: 4px 4px 4px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.kb-search input { flex: 1; border: 0; outline: 0; font-size: 13px; background: transparent; }
.kb-search button { border: 0; background: var(--primary); color: #fff; border-radius: 16px; padding: 5px 14px; font-size: 13px; }
.kb-sec { background: #fff; margin: 10px 12px; border-radius: 14px; padding: 12px; }
.kb-sec h3 { font-size: 15px; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.kb-sec h3 i { width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.kb-sec h3 .more { margin-left: auto; border: 0; background: none; color: var(--text-sub); font-size: 12px; }
.kb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; }
.kb-grid button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--text-main); }
.kb-ic { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd1dc, #ff8fa3); display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 2px 6px rgba(255,120,150,.3); }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-news { display: flex; gap: 10px; border: 0; background: #fff; text-align: left; padding: 8px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.kb-thumb { width: 92px; height: 66px; flex: none; border-radius: 8px; overflow: hidden; background: #fdeef2; display: flex; align-items: center; justify-content: center; }
.kb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kb-ph { font-size: 26px; }
.kb-txt b { display: block; font-size: 14px; margin-bottom: 4px; }
.kb-txt small { color: var(--text-sub); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kb-vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kb-video { border: 0; background: #fff; padding: 0; text-align: left; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.kb-vthumb { position: relative; display: block; aspect-ratio: 16/10; background: linear-gradient(135deg, #cfd9df, #e2ebf0); }
.kb-vthumb img { width: 100%; height: 100%; object-fit: cover; }
.kb-vthumb .play { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-style: normal; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.kb-vthumb em { position: absolute; right: 6px; bottom: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; font-style: normal; padding: 0 4px; border-radius: 4px; }
.kb-vt { display: block; font-size: 12px; padding: 6px 8px; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 12px 0; }
.kb-sec .kb-tags { margin: 10px 0 0; }
.kb-tags button { border: 0; background: #ffe4ea; color: #d6456b; border-radius: 12px; padding: 3px 10px; font-size: 12px; }
.kb-tags button.on { background: var(--primary); color: #fff; }
.kb-pad { padding: 16px; }
.kb-article h2 { font-size: 18px; margin-bottom: 4px; }
.kb-player, .kb-cover { width: 100%; border-radius: 10px; margin: 8px 0; background: #000; }
/* rich text formatting classes (allowed by the server sanitiser) */
.fs-s { font-size: 12px; } .fs-m { font-size: 14px; } .fs-l { font-size: 17px; } .fs-xl { font-size: 20px; } .fs-xxl { font-size: 24px; }
.c-red { color: #e03131; } .c-orange { color: #f08c00; } .c-green { color: #2f9e44; } .c-blue { color: #1c7ed6; } .c-purple { color: #7048e8; }
.c-gray { color: #868e96; } .c-black { color: #212529; } .c-brand { color: var(--primary); } .bg-yellow { background: #fff3bf; }
.ta-center { text-align: center; } .ta-right { text-align: right; }
.detail-html video, .detail-html img { max-width: 100%; height: auto; border-radius: 8px; }
/* chat cards */
.chat-bubble.card { padding: 0; overflow: hidden; background: #fff; }
.chat-card { display: flex; gap: 8px; align-items: center; padding: 8px; color: inherit; text-decoration: none; min-width: 200px; }
.chat-card img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; flex: none; }
.chat-card b { display: block; font-size: 13px; }
.chat-card small { color: #888; font-size: 11px; }

.chat-fb{display:flex;gap:6px;margin-top:4px;font-size:12px;color:#888}
.chat-fb button{font-size:12px;padding:2px 8px;border:1px solid #ddd;border-radius:12px;background:#fff;cursor:pointer}
.chat-msg.ai .chat-bubble{white-space:pre-wrap;background:#f1f7ff}
.chat-human{padding:4px 12px;border-radius:14px;border:1px solid #e67e22;color:#e67e22;background:#fff;cursor:pointer}
.chat-msg.ai { align-self: flex-start; align-items: flex-start; }

/* 首页轮播 banner（后台：首页 Banner） */
.hero-carousel { position: relative; margin: 12px 12px 0; border-radius: var(--radius-sm, 8px); overflow: hidden; background: #f3f4f6; aspect-ratio: 2.17 / 1; touch-action: pan-y; }
.hero-carousel[hidden] { display: none; }
.hero-track { display: flex; height: 100%; transition: transform .45s ease; will-change: transform; }
.hero-track.dragging { transition: none; }
.hero-slide { flex: 0 0 100%; height: 100%; }
.hero-slide a, .hero-slide picture { display: block; height: 100%; }
.hero-slide img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
.hero-dots button { width: 8px; height: 8px; padding: 0; border: none; border-radius: 4px; background: rgba(255,255,255,.6); box-shadow: 0 0 2px rgba(0,0,0,.35); cursor: pointer; transition: width .2s; }
.hero-dots button[aria-current="true"] { width: 18px; background: #fff; }
@media (prefers-reduced-motion: reduce) { .hero-track { transition: none; } }
