/* ============================================================
   苹果流体玻璃 · Fluid Glass  v10
   ------------------------------------------------------------
   v10 改动：
   1) 发光颜色抽成 CSS 变量 --glow-rgb，可由调色盘实时修改
   2) 右上角新增悬浮调色盘（选色 / 自定义 / 恢复默认）
   3) 背景光斑同步跟随所选颜色，整体色调保持一致
   4) 其余保持 v9：无 3D 叠层、原站弹窗原样、滚动性能优化
   ============================================================ */

/* ============================================================
   变量
   ============================================================ */
:root {
  /* ★ 发光基色（R, G, B），默认浅绿；调色盘会改写这里 */
  --glow-rgb: 72, 200, 98;

  --glass-fill:   rgba(255, 255, 255, .58);
  --glass-fill-2: rgba(255, 255, 255, .76);
  --glass-rim:    rgba(255, 255, 255, .92);

  /* 近 → 远三层光晕，全部由 --glow-rgb 派生 */
  --lamp-a: rgba(var(--glow-rgb), .62);
  --lamp-b: rgba(var(--glow-rgb), .34);
  --lamp-c: rgba(var(--glow-rgb), .18);

  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 1),
                 inset 0 -1px 0 rgba(255, 255, 255, .45);

  --depth-1: 0 5px 14px rgba(60, 66, 62, .10);
  --depth-2: 0 12px 26px rgba(60, 66, 62, .07);
}

/* ---------- 背景：纯渐变，无滤镜、无 fixed，颜色跟随发光色 ---------- */
html {
  background: #f7faf7;
  /* ★ 禁止页面横向滚动 / 横向回弹：手指拖滑杆不会把整页拖到右边 */
  overflow-x: hidden;
  overscroll-behavior-x: none;
  width: 100%;
  max-width: 100%;
}

body {
  background-color: #f7faf7;
  background-image:
    radial-gradient(42% 34% at 10% 6%,  rgba(var(--glow-rgb), .17), transparent 68%),
    radial-gradient(40% 32% at 92% 14%, rgba(var(--glow-rgb), .15), transparent 68%),
    radial-gradient(46% 36% at 50% 96%, rgba(var(--glow-rgb), .14), transparent 70%),
    radial-gradient(34% 28% at 84% 58%, rgba(var(--glow-rgb), .13), transparent 70%),
    radial-gradient(30% 24% at 18% 66%, rgba(var(--glow-rgb), .12), transparent 70%),
    linear-gradient(165deg, #fafdfa 0%, #f8fbf8 38%, #f9fcfa 68%, #f4faf5 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: scroll;   /* 关键：不能用 fixed，移动端滚动会卡 */
  overflow-x: hidden;
  overscroll-behavior-x: none;
  width: 100%;
  max-width: 100%;
}

/* 兜底：任何子元素都不许撑出横向滚动条 */
#app,
#app[data-v-d190e07f],
.home-page,
.home-page[data-v-a9961e25] {
  max-width: 100vw;
  overflow-x: hidden;
}

.home-page,
.home-page[data-v-a9961e25] {
  background: transparent !important;
  background-image: none !important;
}

#app,
#app[data-v-d190e07f] {
  background: transparent !important;
}

/* ============================================================
   ★ 轮播图区域：没配图时整块收起，不留空白
   ============================================================ */
.banner-section.fluid-empty {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* 兜底：JS 没跑到时，支持 :has 的浏览器也能收起 */
.banner-section:not(:has(img)):not(:has(video)) {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.banner-section {
  padding: 12px 16px 0 !important;
}

.function-section {
  padding: 14px 16px 4px !important;
}

/* ============================================================
   ★ 步数推荐按钮：最外面一张大卡片
   ============================================================ */
.extra-function-section {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.function-grid {
  max-width: 392px !important;
  padding: 18px 16px !important;
  background: var(--glass-fill) !important;
  border: 1px solid var(--glass-rim) !important;
  border-radius: 26px !important;
  box-shadow:
    var(--inner-light),
    0 0 7px var(--lamp-a),
    0 0 14px var(--lamp-b),
    0 0 22px var(--lamp-c),
    var(--depth-1) !important;
  box-sizing: border-box;
}

/* ============================================================
   ★ 首页卡片（单层）
   ============================================================ */
.switch-container,
.history-section {
  background: var(--glass-fill) !important;
  border: 1px solid var(--glass-rim) !important;
  border-radius: 24px !important;
  box-shadow:
    var(--inner-light),
    0 0 7px var(--lamp-a),
    0 0 14px var(--lamp-b),
    0 0 22px var(--lamp-c),
    var(--depth-1) !important;
  /* 刻意不用 backdrop-filter：卡片随页面滚动，模糊背景每帧重算会卡 */
}

.switch-item[data-v-a9961e25]:not(:last-child) {
  border-bottom-color: rgba(255, 255, 255, .6) !important;
}

/* ============================================================
   步数预设按钮
   ============================================================ */
.function-button {
  background: var(--glass-fill-2) !important;
  border: 1px solid var(--glass-rim) !important;
  border-radius: 16px !important;
  color: #2b3550 !important;
  font-weight: 700 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 6px rgba(var(--glow-rgb), .16),
    0 0 4px var(--lamp-a),
    0 0 9px var(--lamp-b),
    0 0 15px var(--lamp-c),
    0 3px 10px rgba(60, 66, 62, .10) !important;
  position: relative;
  overflow: hidden;
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1),
              box-shadow .28s ease !important;
}

.function-button::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 1px;
  height: 44%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.function-button .step-number {
  position: relative;
  z-index: 1;
  color: #26304a !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .95);
}

.function-button:active {
  transform: scale(.93) !important;
  box-shadow:
    inset 0 2px 10px rgba(var(--glow-rgb), .22),
    0 0 4px var(--lamp-a),
    0 0 8px var(--lamp-b),
    0 2px 6px rgba(60, 66, 62, .12) !important;
}

.function-button.custom-button {
  display: none !important;
}
.function-item:has(.custom-button) {
  display: none !important;
}

/* ============================================================
   顶部：步数输入条
   ============================================================ */
.fluid-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  max-width: 392px;
  margin: 0 auto 12px;
  padding: 0;
  box-sizing: border-box;
  animation: fluidIn .45s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes fluidIn {
  from { opacity: 0; transform: translateY(-10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.fluid-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  border-radius: 18px;
  background: var(--glass-fill-2);
  border: 1px solid var(--glass-rim);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 8px rgba(var(--glow-rgb), .14),
    0 0 5px var(--lamp-a),
    0 0 11px var(--lamp-b),
    0 0 18px var(--lamp-c),
    0 4px 14px rgba(60, 66, 62, .10);
  transition: box-shadow .3s ease, transform .3s ease;
}

.fluid-input-wrap:focus-within {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 0 7px var(--lamp-a),
    0 0 15px var(--lamp-b),
    0 0 24px var(--lamp-c),
    0 6px 18px rgba(60, 66, 62, .12);
}

.fluid-input {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  box-sizing: border-box;
  border: none;
  outline: none;
  background: transparent;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #26304a;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  appearance: none;
}

.fluid-input::placeholder {
  color: #8b9a92;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
}

.fluid-input::-webkit-outer-spin-button,
.fluid-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fluid-input-wrap.pulse {
  animation: fluidPulse .45s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes fluidPulse {
  0%   { box-shadow: inset 0 1px 0 #fff, 0 0 6px var(--lamp-a), 0 0 0 0 rgba(var(--glow-rgb), .55); }
  55%  { box-shadow: inset 0 1px 0 #fff, 0 0 14px var(--lamp-a), 0 0 0 10px rgba(var(--glow-rgb), 0); }
  100% { box-shadow: inset 0 1px 0 #fff, 0 0 6px var(--lamp-a), 0 0 0 0 rgba(var(--glow-rgb), 0); }
}

/* 提交按钮 */
.fluid-submit {
  flex: 0 0 auto;
  min-width: 92px;
  height: 54px;
  padding: 0 22px;
  border: 1px solid var(--glass-rim);
  border-radius: 18px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #24302a;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, .97), rgba(248, 252, 249, .92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 0 6px var(--lamp-a),
    0 0 12px var(--lamp-b),
    0 0 19px var(--lamp-c),
    0 6px 18px rgba(60, 66, 62, .12);
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
}

.fluid-submit:active {
  transform: scale(.95);
  box-shadow:
    inset 0 2px 8px rgba(var(--glow-rgb), .22),
    0 0 4px var(--lamp-a),
    0 0 9px var(--lamp-b),
    0 2px 8px rgba(60, 66, 62, .10);
}

.fluid-submit[disabled] {
  opacity: .62;
  cursor: default;
  transform: none;
}

.fluid-submit.loading {
  color: transparent !important;
}
.fluid-submit.loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2.5px solid rgba(var(--glow-rgb), .22);
  border-top-color: rgb(var(--glow-rgb));
  animation: fluidSpin .7s linear infinite;
  pointer-events: none;
}
@keyframes fluidSpin { to { transform: rotate(360deg); } }

/* ============================================================
   底部 tab 栏
   ============================================================ */
.tab-bar,
.tabbar,
[class*="tab-bar"],
[class*="tabbar"] {
  background: rgba(255, 255, 255, .78) !important;
  border-top: 1px solid rgba(255, 255, 255, .85) !important;
  box-shadow: 0 -3px 12px rgba(60, 66, 62, .07) !important;
}

/* ============================================================
   ★ 右上角悬浮调色盘
   ============================================================ */

/* 通知条的关闭按钮往左让位，避免被调色盘遮住 */
.notice-section .van-notice-bar__right-icon {
  margin-right: 42px !important;
}

.fluid-palette-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9990;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .96);
  background: rgba(255, 255, 255, .74);
  color: #3b4a40;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 6px var(--lamp-a),
    0 0 14px var(--lamp-b),
    0 4px 12px rgba(50, 62, 55, .14);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
}
.fluid-palette-btn:active { transform: scale(.9); }
.fluid-palette-btn svg { display: block; }

.fluid-palette-panel {
  position: fixed;
  top: 54px;
  /* 不贴屏幕最右边：留出安全距离，避开安卓「从屏幕边缘滑动返回」的手势区 */
  right: 20px;
  z-index: 9991;
  width: 202px;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 18px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(255, 255, 255, .96);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 10px var(--lamp-a),
    0 0 24px var(--lamp-b),
    0 14px 36px rgba(40, 60, 48, .18);
  display: none;
  animation: fluidPop .25s cubic-bezier(.22, 1, .36, 1) both;
  /* ★ 面板内只允许竖向滚动，横向手势不交给浏览器（避免带动整页 / 触发返回） */
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}
.fluid-palette-panel.show { display: block; }

@keyframes fluidPop {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.fluid-palette-title {
  font-size: 12px;
  color: #6f8477;
  margin-bottom: 9px;
  letter-spacing: .3px;
}

.fluid-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.fluid-swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, .92);
  box-shadow: 0 0 5px currentColor;
  position: relative;
  transition: transform .16s ease;
}
.fluid-swatch:active { transform: scale(.9); }
.fluid-swatch.active::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  border: 2px solid rgba(70, 82, 74, .5);
}

.fluid-palette-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.fluid-palette-row span {
  font-size: 12px;
  color: #6f8477;
  flex: 1;
}
.fluid-palette-row.range-row {
  gap: 6px;
  margin-bottom: 6px;
}
.fluid-palette-row.range-row span {
  flex: 0 0 34px;
  font-size: 11.5px;
}

/* ---- 自绘取色器：滑杆（原生 input[type=color] 在微信里点不开）---- */
.fluid-range {
  flex: 1;
  min-width: 0;
  height: 24px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  /* ★ 关键：只把竖向手势交给浏览器，横向拖动由滑杆自己接管。
     不加这句，手指往右拖会让整个页面往右滑 / 触发返回手势。 */
  touch-action: pan-y;
  -ms-touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.fluid-range::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .10);
  background: #ddd;
}
/* 轨道渐变：由 JS 写入 --track */
.fluid-range.tinted::-webkit-slider-runnable-track {
  background: var(--track, #ddd);
}
.fluid-range.tinted::-moz-range-track {
  background: var(--track, #ddd);
}
.fluid-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(70, 82, 74, .35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.fluid-range::-moz-range-track {
  height: 10px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .9);
  background: #ddd;
}
.fluid-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(70, 82, 74, .35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.fluid-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 9px;
}
.fluid-preview-row span {
  font-size: 11.5px;
  color: #6f8477;
  flex: 0 0 34px;
}
.fluid-preview {
  flex: 1;
  height: 20px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .5), 0 0 6px currentColor;
}
.fluid-preview-hex {
  font-size: 11px;
  color: #7d8f84;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}

.fluid-reset-btn {
  width: 100%;
  height: 30px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #3a4a40;
  background: rgba(0, 0, 0, .05);
  border: 1px solid rgba(255, 255, 255, .9);
  cursor: pointer;
  transition: background .2s ease;
}
.fluid-reset-btn:active { background: rgba(0, 0, 0, .10); }

/* ============================================================
   扫码绑定浮层
   ============================================================ */
.fluid-mask {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 34, 30, .42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fluidFade .25s ease both;
}
@keyframes fluidFade { from { opacity: 0 } to { opacity: 1 } }

.fluid-qr-panel {
  width: 100%;
  max-width: 340px;
  padding: 24px 20px 18px;
  border-radius: 26px;
  text-align: center;
  color: #26304a;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 0 10px var(--lamp-a),
    0 0 22px var(--lamp-b),
    0 22px 54px rgba(34, 50, 40, .24);
  animation: fluidPop .32s cubic-bezier(.22, 1, .36, 1) both;
}

.fluid-qr-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 4px;
}
.fluid-qr-sub {
  font-size: 12.5px;
  color: #6f8477;
  margin-bottom: 12px;
  line-height: 1.5;
}
.fluid-qr-imgbox {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin: 6px auto 12px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 7px rgba(var(--glow-rgb), .32), 0 4px 14px rgba(60, 66, 62, .10);
}
.fluid-qr-imgbox canvas,
.fluid-qr-imgbox img {
  display: block;
  border-radius: 8px;
}
.fluid-qr-loading {
  font-size: 13px;
  color: #74847a;
  line-height: 1.7;
  word-break: break-all;
}

.fluid-qr-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.fluid-qr-btn {
  flex: 1;
  height: 46px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, .95);
  font-size: 14.5px;
  font-weight: 700;
  color: #26304a;
  background: rgba(255, 255, 255, .82);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 6px rgba(var(--glow-rgb), .30),
    0 4px 12px rgba(60, 66, 62, .10);
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.fluid-qr-btn:active { transform: scale(.96); }
.fluid-qr-btn.primary {
  color: #22302a;
  background: linear-gradient(135deg, rgba(255, 255, 255, .99), rgba(248, 252, 249, .96));
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 9px rgba(var(--glow-rgb), .48),
    0 0 18px rgba(var(--glow-rgb), .26),
    0 6px 16px rgba(60, 66, 62, .16);
}
.fluid-qr-btn[disabled] { opacity: .6; }

/* ============================================================
   轻提示
   ============================================================ */
.fluid-tip {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -8px);
  z-index: 99999;
  padding: 12px 20px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #26304a;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(255, 255, 255, .96);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 10px rgba(var(--glow-rgb), .34),
    0 12px 32px rgba(40, 56, 46, .18);
  opacity: 0;
  transition: opacity .25s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
  white-space: nowrap;
}
.fluid-tip.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 尊重「减少动效」 ---------- */
@media (prefers-reduced-motion: reduce) {
  .fluid-bar, .fluid-input-wrap, .fluid-submit, .function-button {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 360px) {
  .fluid-submit { min-width: 78px; padding: 0 16px; font-size: 15px; }
  .fluid-input { font-size: 17px; }
  .function-grid { padding: 14px 12px !important; }
  .fluid-palette-panel { width: 196px; }
}
