/* 一物一码 H5 展示页样式 —— 紫色主题 + 轮播版 */

:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #f1eafe;
  --bg: #f6f4fa;
  --card: #ffffff;
  --text: #1f1a2e;
  --muted: #6b6480;
  --light: #9c95ae;
  --border: #ebe6f4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 8px rgba(60, 30, 120, 0.06);
  --shadow-lg: 0 8px 24px rgba(60, 30, 120, 0.12);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  max-width: 750px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

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

/* 加载态 */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-ring {
  width: 42px;
  height: 42px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-screen p {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 顶部轮播横幅 */
.top-banner {
  position: relative;
  width: 100%;
  height: 200px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
}

.carousel {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.carousel-slide {
  position: relative;
  min-width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}
/* 图片上叠一层深紫渐变，保证白色文字可读 */
.carousel-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(255,255,255,0.10) 0%, transparent 35%),
    linear-gradient(180deg, rgba(46, 16, 90, 0.28) 0%, rgba(46, 16, 90, 0.42) 100%);
}
/* 品牌色兜底幻灯片（客户官网没有可用横幅图时使用，颜色随客户而变） */
.carousel-slide.brand-slide {
  background:
    radial-gradient(circle at 78% 22%, rgba(255,255,255,0.16) 0%, transparent 44%),
    radial-gradient(circle at 12% 80%, rgba(255,255,255,0.10) 0%, transparent 38%),
    linear-gradient(135deg, var(--brand-color, #7C3AED) 0%, #3B1465 100%);
}

.carousel-dots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 56px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.carousel-dot.active {
  width: 18px;
  background: #fff;
}

.banner-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
}

.banner-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.22);
  border: 2px solid rgba(255,255,255,0.6);
}
.banner-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}
.banner-logo .logo-mark {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.banner-brand {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.banner-subtitle {
  font-size: 0.78rem;
  opacity: 0.96;
  letter-spacing: 1.5px;
  background: rgba(255,255,255,0.18);
  padding: 4px 12px;
  border-radius: 20px;
  backdrop-filter: blur(2px);
}

.banner-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 48px;
  z-index: 4;
  line-height: 0;
}
.banner-wave svg { width: 100%; height: 100%; }

/* 正品核验卡 */
.verify-card {
  margin: -28px 14px 14px;
  position: relative;
  z-index: 5;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.verify-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}
.verify-icon svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}
.verify-body { flex: 1; min-width: 0; }
.verify-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.verify-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.verify-meta b { color: var(--text); font-weight: 600; }
.dot-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--light);
}

/* 页面容器 */
.trace-page {
  min-height: 100vh;
  padding-bottom: 28px;
}

/* 折叠卡片 */
.section-card {
  margin: 12px 14px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section-header {
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.section-header:active { opacity: 0.96; }

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.section-icon svg { width: 100%; height: 100%; fill: rgba(255,255,255,0.95); }

.section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.section-arrow {
  width: 20px;
  height: 20px;
  fill: #fff;
  opacity: 0.9;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.section-arrow.folded {
  transform: rotate(-90deg);
}

.section-body {
  padding: 14px 16px 16px;
  color: #333;
}

/* 信息行 */
.row {
  display: flex;
  align-items: flex-start;
  line-height: 1.65;
  font-size: 14px;
  padding: 6px 0;
}

.row .label {
  color: var(--muted);
  flex-shrink: 0;
  min-width: 5.5em;
  margin-right: 10px;
}

.row .value {
  color: var(--text);
  word-break: break-word;
  flex: 1;
  font-weight: 500;
}

.row .value.code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.row .value.status-ok {
  color: var(--primary);
  font-weight: 700;
}
.row .value.link {
  color: var(--primary);
}

/* 企业简介折叠块 */
.desc-block {
  padding: 6px 0;
}
.desc-block .label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 4px;
}
.desc-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  text-align: justify;
  word-break: break-word;
}
/* 折叠态：最多显示 4 行 + 底部渐隐 */
.desc-text.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
  background: none;
  border: none;
  padding: 4px 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.desc-toggle svg {
  width: 16px;
  height: 16px;
  fill: var(--primary);
  transition: transform 0.25s ease;
}
.desc-toggle.expanded svg {
  transform: rotate(180deg);
}
.desc-toggle:active { opacity: 0.7; }

/* 分隔 */
.divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

/* 资质徽章 */
.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cert-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: var(--primary-light);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}
.cert-badge svg {
  width: 14px;
  height: 14px;
  fill: var(--primary);
}

/* 折叠展开动画 */
.collapse {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.collapse.folded {
  grid-template-rows: 0fr;
}
.collapse-inner { overflow: hidden; }

/* 操作按钮 */
.action-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  flex: 1;
  text-align: center;
  padding: 11px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, opacity 0.1s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }

.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.28);
}

.btn.outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

/* 底部 */
.trace-footer {
  margin: 18px 16px 30px;
  text-align: center;
  color: var(--light);
  font-size: 12px;
  line-height: 1.8;
}
.trace-footer p:first-child {
  color: var(--muted);
  font-weight: 500;
}

/* 未找到 */
.not-found {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.not-found-box {
  background: #fff;
  padding: 34px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.not-found-box h2 { color: #c62828; margin-bottom: 12px; font-size: 20px; }
.not-found-box p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.not-found-box .code { margin-top: 18px; font-family: monospace; color: var(--light); font-size: 12px; }

.hidden { display: none !important; }

@media (max-width: 400px) {
  .top-banner { height: 178px; }
  .banner-brand { font-size: 1.25rem; }
  .carousel-dots { bottom: 52px; }
  .verify-card { margin: -24px 12px 12px; padding: 14px; }
  .verify-icon { width: 40px; height: 40px; }
  .verify-icon svg { width: 22px; height: 22px; }
  .verify-title { font-size: 15px; }
  .section-card { margin: 10px 12px; }
  .section-body { padding: 12px 14px 14px; }
}
