/* ========== 1. 基础重置 ========== */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #f5f7fa;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  word-break: break-word;
}
:root {
  --primary: #1890ff;
  --primary-dark: #096dd9;
  --text:    #333;
  --text-2:  #666;
  --text-3:  #999;
  --bg:      #fff;
  --bg-2:    #f5f7fa;
  --border:  #eee;
  --radius:  12px;
  --shadow:  0 2px 12px rgba(0,0,0,.06);
}

/* ========== 2. 容器 ========== */
.sp-container {
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  padding: 1px;
  background: var(--bg);
  min-height: 100vh;
}
.sp-has-fixed-bottom { padding-bottom: 90px; }

/* ========== 3. 媒体自适应 ========== */
img, video, iframe, svg { max-width: 100%; height: auto; display: block; border: 0; }

/* ========== 4. 图片显示模式 ========== */
img[data-width-mode="full"] {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  display: block;
}
img[data-width-mode="auto"] {
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  display: block;
}
img[data-width-mode="custom"] {
  height: auto !important;
  max-width: 100%;
  display: block;
}
img[data-align="left"]   { margin-left: 0 !important;    margin-right: auto !important; }
img[data-align="center"] { margin-left: auto !important; margin-right: auto !important; }
img[data-align="right"]  { margin-left: auto !important; margin-right: 0 !important; }

/* 结构性图片强制全宽 */
.sp-hero img,
.sp-cover > img,
.sp-swiper-item img {
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  display: block;
}

/* ========== 5. 富文本内容区 ========== */
.sp-content { font-size: 16px; line-height: 1.75; color: var(--text); }
.sp-content h1 { font-size: 22px; margin: 24px 0 12px; line-height: 1.3; }
.sp-content h2 { font-size: 20px; margin: 20px 0 10px; line-height: 1.3; }
.sp-content h3 { font-size: 18px; margin: 16px 0 8px; }
.sp-content p  { margin: 1px 0; }
.sp-content a  { color: var(--primary); text-decoration: none; }
.sp-content ul, .sp-content ol { padding-left: 20px; margin: 12px 0; }
.sp-content li { margin: 6px 0; }
.sp-content blockquote {
  margin: 16px 0; padding: 12px 16px;
  border-left: 4px solid var(--primary);
  background: #f7f9fc; color: #555; border-radius: 4px;
}

/* ========== 6. 表格 ========== */
.sp-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 14px;
}
.sp-content th,
.sp-content td {
  border: 1px solid #e5e5e5;
  padding: 4px 8px;
  text-align: left;
  line-height: 1.5;
}
.sp-content th { background: #fafafa; font-weight: 600; }
.sp-content table p,
.sp-content td p,
.sp-content th p { margin: 0; }
.sp-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ========== 7. Hero 大图区 ========== */
.sp-hero {
  position: relative;
  margin: -16px -16px 20px;
  overflow: hidden;
  background: #000;
}
.sp-hero-mask {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 20px 24px;
  background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
  color: #fff;
}
.sp-hero-title {
  margin: 0 0 6px; font-size: 24px; font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.sp-hero-sub { margin: 0; font-size: 14px; opacity: .9; }

/* ========== 8. 卡片 ========== */
.sp-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.sp-card-title {
  margin: 0 0 8px; font-size: 17px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.sp-card-title::before {
  content: ""; width: 4px; height: 16px;
  background: var(--primary); border-radius: 2px;
}
.sp-card-body { color: var(--text-2); font-size: 14px; line-height: 1.7; }

/* 卡片网格 */
.sp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.sp-grid-item {
  background: #fff; border-radius: var(--radius);
  padding: 16px; text-align: center; box-shadow: var(--shadow);
}
.sp-grid-item .num { font-size: 22px; font-weight: 700; color: var(--primary); }
.sp-grid-item .label { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* ========== 9. 按钮 ========== */
.sp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 24px; font-size: 16px; font-weight: 500;
  border: none; border-radius: 8px;
  background: var(--primary); color: #fff;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: opacity .2s, transform .1s;
}
.sp-btn:active { opacity: .85; transform: scale(.98); }
.sp-btn-block { display: flex; width: 100%; }
.sp-btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.sp-btn-warn { background: linear-gradient(90deg, #ff7a45, #ff4d4f); }

/* ========== 10. 吸底按钮 ========== */
.sp-fixed-bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
  z-index: 100;
}
.sp-fixed-bottom .sp-btn { width: 100%; }

/* ========== 11. 轮播 ========== */
.sp-swiper {
  position: relative; width: 100%; overflow: hidden;
  border-radius: var(--radius); margin-bottom: 16px; background: #000;
}
.sp-swiper-track {
  display: flex; transition: transform .35s ease;
  will-change: transform;
}
.sp-swiper-item { flex: 0 0 100%; width: 100%; }
.sp-swiper-dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 6px;
}
.sp-swiper-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.5); transition: all .3s;
}
.sp-swiper-dot.active { width: 18px; border-radius: 3px; background: #fff; }

/* ========== 12. 信息列表 ========== */
.sp-list {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.sp-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.sp-list-item:last-child { border-bottom: none; }
.sp-list-item .label { color: var(--text-2); }
.sp-list-item .value { color: var(--text); font-weight: 500; }

/* ✅ 单独一项时居中 */
.sp-list-item:only-child,
.sp-list-item[style*="text-align: center"],
.sp-list-item[style*="text-align:center"] {
  justify-content: center;
  text-align: center;
}

/* ========== 13. 图上压字 ========== */
.sp-cover {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: #333;
}
.sp-cover-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  color: #fff;
}
.sp-cover--top    .sp-cover-body { justify-content: flex-start; }
.sp-cover--bottom .sp-cover-body { justify-content: flex-end; }
.sp-cover--center .sp-cover-body { justify-content: center; align-items: center; }
.sp-cover--mask-bottom .sp-cover-body {
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
}
.sp-cover--mask-all::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,0,0,.4); pointer-events: none;
}
.sp-cover--mask-all .sp-cover-body { z-index: 1; }
.sp-cover-title {
  margin: 0 0 6px; font-size: 22px; font-weight: 700; line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.sp-cover-sub {
  margin: 0; font-size: 14px; line-height: 1.6; opacity: .95;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
/* 图上压字居中模式，强制文字居中 */
.sp-cover--center .sp-cover-title,
.sp-cover--center .sp-cover-sub,
.sp-cover--center p,
.sp-cover--center h1,
.sp-cover--center h2,
.sp-cover--center h3 {
  text-align: center;
  width: 100%;
}

/* ========== 14. 页脚版权 ========== */
.sp-footer {
  text-align: center;
  padding: 24px 16px;
  color: #999;
  font-size: 13px;
  line-height: 1.6;
}
.sp-footer a { color: #999; text-decoration: none; }

/* ========== 15. 响应式工具 ========== */
@media (max-width: 640px) { .hide-mobile { display: none !important; } }
@media (min-width: 641px) { .hide-desktop { display: none !important; } }

/* ========== 悬浮客服按钮 ========== */
.sp-float-btn {
  position: fixed;
  z-index: 999;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  cursor: pointer;
  display: block;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  background: #fff;
}
.sp-float-btn:hover  { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.sp-float-btn:active { transform: scale(.98); }

.sp-float-btn img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  margin: 0 !important;
}

/* 位置档位 */
.sp-float-btn--top    { top: 20%; }
.sp-float-btn--middle { top: 50%; transform: translateY(-50%); }
.sp-float-btn--middle:hover  { transform: translateY(-50%) scale(1.05); }
.sp-float-btn--middle:active { transform: translateY(-50%) scale(.98); }
.sp-float-btn--bottom { bottom: 80px; }
