/* ==========================================================================
   主题基座 —— 移动端国风 H5
   配色与圆角取自 pic/ 设计图：红金 + 米黄
   ========================================================================== */

:root {
  /* 主色 */
  --red-900: #7E1F19;
  --red-800: #8E2119;
  --red-700: #A82A22;
  --red-600: #C0392B;
  --red-500: #D9534A;
  --red-400: #E8705F;
  --red-300: #E98B7C;

  /* 金 */
  --gold-700: #A8823C;
  --gold-600: #B88E43;
  --gold-500: #C9A063;
  --gold-400: #D9B36A;
  --gold-300: #E2C489;
  --gold-200: #E8D5A8;
  --gold-100: #F3E6C8;
  --gold-050: #F8EFDA;

  /* 中性 */
  --cream: #FDF6EA;
  --cream-2: #F7EAD3;
  --card: #FFFDF8;
  --line: #EDE0C6;
  --line-2: #F2E8D8;

  /* 文字 */
  --ink: #8C2B22;
  --text: #4A3A2E;
  --text-2: #8A7563;
  --text-3: #B5A392;

  /* 功能 */
  --green: #2BA471;
  --green-dark: #1E8A5C;
  --blue: #1677FF;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-card: 0 2px 10px rgba(140, 43, 34, 0.07);
  --shadow-btn: 0 4px 14px rgba(192, 57, 43, 0.32);

  --topbar-h: 46px;
  --font-serif: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", "SimSun", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
input, select { font-family: inherit; font-size: 15px; }

/* 内联小图标 */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; fill: currentColor; }

/* --------------------------------------------------------------------------
   应用外壳
   -------------------------------------------------------------------------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-bottom: 1px solid #F0F0F0;
}
.topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #2B2B2B;
  letter-spacing: 0.5px;
}
.topbar .back {
  position: absolute;
  left: 4px;
  top: 0;
  width: 44px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #333;
  line-height: 1;
}
.topbar .back:active { opacity: 0.5; }

.page { flex: 1; padding-bottom: 24px; }
.page.has-bottom-bar { padding-bottom: 84px; }

/* 右侧悬浮客服 / 投诉 */
.side-float {
  position: fixed;
  right: 0;
  top: 52%;
  transform: translateY(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.side-float a {
  display: block;
  width: 46px;
  padding: 11px 4px;
  background: #4A4A4A;
  color: #fff;
  font-size: 11.5px;
  line-height: 1.3;
  text-align: center;
  border-radius: 6px 0 0 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  word-break: break-all;
}
.side-float a:active { background: #2E2E2E; }

/* 底部固定操作栏 */
.bottom-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 640px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #FDF1E2 0%, #F8E2C8 100%);
  border-top: 1px solid var(--gold-200);
  box-shadow: 0 -2px 12px rgba(140, 43, 34, 0.08);
}
.bottom-bar .bb-service {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.bottom-bar .bb-main { flex: 1; min-width: 0; }

/* --------------------------------------------------------------------------
   按钮
   -------------------------------------------------------------------------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  border-radius: var(--radius-pill);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(180deg, var(--red-500) 0%, var(--red-600) 100%);
  border: 1px solid var(--gold-400);
  box-shadow: var(--shadow-btn);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: scale(0.985); filter: brightness(0.95); }
.btn[disabled] { opacity: 0.55; box-shadow: none; }
.btn-lg { height: 54px; font-size: 19px; }
.btn-sm { height: 36px; font-size: 14px; width: auto; padding: 0 18px; }

.btn-gold {
  background: linear-gradient(180deg, #E7C67F 0%, #C9A063 100%);
  border-color: #F0DFB6;
  color: #5A3E14;
  box-shadow: 0 4px 14px rgba(184, 142, 67, 0.3);
}
.btn-ghost {
  background: #fff;
  color: var(--red-600);
  border: 1px solid var(--red-400);
  box-shadow: none;
}

/* 主 CTA（红底金环 + 右侧双箭头）—— 报告页 / 解锁页底部 */
.btn-cta {
  position: relative;
  height: 54px;
  padding-right: 34px;
  border-radius: var(--radius-pill);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #FFF6E2;
  background: linear-gradient(180deg, #E0594A 0%, #C0392B 46%, #9E2119 100%);
  border: 2px solid #F0D08E;
  box-shadow: 0 5px 16px rgba(158, 33, 25, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
.btn-cta::after {
  content: "\00BB";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -3px;
  color: rgba(255, 240, 210, 0.92);
}
.btn-cta .lock { width: 19px; height: 19px; fill: #F6DCA6; }

/* 金色 CTA（金底红字 + 两侧小箭头）—— 表单页 / 订单报告页底部 */
.btn-gold-cta {
  height: 52px;
  border-radius: var(--radius-pill);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  text-indent: 3px;
  color: #8A3A1E;
  background: linear-gradient(180deg, #F6E5C0 0%, #E3C68C 46%, #CFA963 100%);
  border: 1px solid #EFD9A8;
  box-shadow: 0 4px 14px rgba(170, 130, 70, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.btn-gold-cta::before,
.btn-gold-cta::after {
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.8);
}
.btn-gold-cta::before { content: "\276E"; }
.btn-gold-cta::after { content: "\276F"; }

/* 领结果专用：红底金边 + 双线描边 */
.btn-claim {
  position: relative;
  height: 58px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  border-radius: 8px;
  border: 2px solid #F2D08A;
  background: linear-gradient(180deg, #D9503F 0%, #A8231C 100%);
  box-shadow: 0 6px 18px rgba(168, 35, 28, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-claim::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 240, 210, 0.55);
  border-radius: 5px;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   卡片 / 区块
   -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--gold-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin: 12px 14px;
}

.card-red {
  background: linear-gradient(180deg, #C9453A 0%, #B0342B 100%);
  border: 1px solid #E3B87C;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  margin: 12px 14px;
  position: relative;
  box-shadow: 0 4px 16px rgba(168, 42, 34, 0.22);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 14px 12px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1px;
}
.section-title::before,
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
}
.section-title.on-red { color: #FFF3D6; }
.section-title.on-red::before,
.section-title.on-red::after {
  background: linear-gradient(90deg, transparent, #E8C98A, transparent);
}

.muted { color: var(--text-2); font-size: 12.5px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   表单
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.28);
}
.field:last-child { border-bottom: none; }

.field-label {
  flex: 0 0 auto;
  width: 74px;
  font-size: 15px;
  font-weight: 500;
}
.card .field-label { color: var(--ink); }

.field-body { flex: 1; min-width: 0; }

.text-input {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 15px;
  outline: none;
}
.text-input::placeholder { color: rgba(255, 255, 255, 0.6); }
.text-input:focus { border-color: #FFF1D8; background: rgba(255, 255, 255, 0.24); }
.card .text-input {
  border-color: var(--gold-200);
  background: #fff;
  color: var(--text);
}
.card .text-input::placeholder { color: var(--text-3); }

/* 胶囊选项组 */
.pill-group { display: flex; gap: 8px; }
.pill {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #FFF1D8;
  font-size: 14px;
  transition: all 0.15s ease;
}
.pill.active {
  background: linear-gradient(180deg, #F6DCA6 0%, #E4BE7C 100%);
  color: #7A3A16;
  font-weight: 600;
  border-color: #F6E4BC;
}
.card .pill { border-color: var(--gold-200); color: var(--text-2); }
.card .pill.active {
  background: linear-gradient(180deg, var(--red-500), var(--red-600));
  color: #fff;
  border-color: var(--red-600);
}

/* 圆形性别选择 */
.radio-row { display: flex; gap: 14px; }
.radio-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #FFF1D8;
  transition: all 0.15s ease;
}
.radio-circle.active {
  background: linear-gradient(180deg, #F6DCA6 0%, #E4BE7C 100%);
  color: #7A3A16;
  font-weight: 700;
  border-color: #F6E4BC;
}

/* 协议勾选 */
.agree {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-2);
}
.agree .box {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  background: #fff;
  flex: 0 0 auto;
}
.agree.checked .box {
  background: var(--red-600);
  border-color: var(--red-600);
  color: #fff;
}
.agree a { color: var(--red-600); }

/* --------------------------------------------------------------------------
   通用小件
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  background: #FDEBEA;
  color: var(--red-600);
  border: 1px solid #F6CFCB;
}
.tag-gold { background: #FBF0D8; color: #8A6A24; border-color: var(--gold-200); }
.tag-green { background: #E8F6EF; color: var(--green-dark); border-color: #BFE5D4; }

.divider-dashed { height: 1px; background: var(--line); margin: 12px 0; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 5px;
  border: 1.5px solid #7A7A7A;
  color: #2B2B2B;
  font-size: 13px;
  background: #fff;
  flex: 0 0 auto;
}
.copy-btn:active { background: #F2F2F2; }

/* 认证徽章条 */
.cert-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px;
  margin: 14px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.cert-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); line-height: 1.35; }
.cert-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
}
.cert-green { background: var(--green); }
.cert-gold { background: #6BAF4A; }
.cert-blue { background: #E8B21E; color: #4A3A0A; font-size: 10px; }

/* --------------------------------------------------------------------------
   弹窗
   -------------------------------------------------------------------------- */
.mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(30, 12, 8, 0.58);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}
.mask.bottom { align-items: flex-end; padding: 0; }

.modal {
  width: 100%;
  max-width: 360px;
  background: #FFFDF8;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-200);
  box-shadow: 0 12px 40px rgba(60, 20, 14, 0.32);
  overflow: hidden;
  animation: popIn 0.22s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.modal-head {
  padding: 20px 20px 0;
  text-align: center;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  color: var(--red-700);
  letter-spacing: 1px;
  margin: 0;
}
.modal-sub { margin: 8px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.modal-body { padding: 16px 20px; }
.modal-foot { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #B9A38C;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-wrap { position: relative; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  z-index: 300;
  max-width: 78%;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(40, 20, 16, 0.88);
  color: #fff;
  font-size: 13.5px;
  text-align: center;
  animation: fadeIn 0.15s ease;
}

/* loading */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 古风边框角花 */
.ornament-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold-400);
  opacity: 0.75;
  pointer-events: none;
}
.ornament-corner.tl { top: 7px; left: 7px; border-right: none; border-bottom: none; border-radius: 7px 0 0 0; }
.ornament-corner.tr { top: 7px; right: 7px; border-left: none; border-bottom: none; border-radius: 0 7px 0 0; }
.ornament-corner.bl { bottom: 7px; left: 7px; border-right: none; border-top: none; border-radius: 0 0 0 7px; }
.ornament-corner.br { bottom: 7px; right: 7px; border-left: none; border-top: none; border-radius: 0 0 7px 0; }
