/* ============================================================================
   好评助手 · 液态玻璃设计系统 (base.css)
   —— 全站共用：token / 玻璃材质 / 按钮 / 表单 / 提示 / 弹层
   颜色纪律：只有 3 种颜色 —— 蓝(#0A5CFF)、橙(#FF6A1A)、中性墨(#0B1220)+白。
   性能纪律：
     1) backdrop-filter 只用在「顶栏 / 底部操作条 / 弹层」三处，绝不平铺到每张卡片；
     2) 只对 transform / opacity 做动画，不动画 blur、shadow、filter；
     3) 背景光斑默认静止，仅在设备性能足够且用户未开启「减少动态」时才轻微漂移。
   ========================================================================== */

:root {
  /* —— 三种颜色（唯一色源，其余全部由它们派生）—— */
  --blue: #0a5cff;
  --amber: #ff6a1a;
  --ink: #0b1220;

  /* —— 派生 —— */
  --ink-2: rgba(11, 18, 32, 0.62);
  --ink-3: rgba(11, 18, 32, 0.42);
  --hair: rgba(11, 18, 32, 0.08);
  --hair-strong: rgba(11, 18, 32, 0.14);
  --blue-soft: rgba(10, 92, 255, 0.1);
  --amber-soft: rgba(255, 106, 26, 0.12);

  /* —— 玻璃 —— */
  --glass-1: rgba(255, 255, 255, 0.9);
  --glass-2: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-tint: rgba(255, 255, 255, 0.55);

  /* —— 圆角 / 阴影 —— */
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --sh-1: 0 1px 2px rgba(11, 18, 32, 0.04), 0 10px 26px -16px rgba(11, 18, 32, 0.22);
  --sh-2: 0 2px 6px rgba(11, 18, 32, 0.06), 0 22px 48px -26px rgba(11, 18, 32, 0.3);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.92);

  /* —— 动效 —— */
  --ease: cubic-bezier(0.22, 0.9, 0.24, 1);
  --fast: 0.14s;
  --norm: 0.22s;

  /* —— 自适应缩放（由 js/fit.js 依据视口写入，保证一屏放下）—— */
  --fit: 1;
}

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

/* 元素自带 display（如 .auth{display:flex}）会盖过浏览器默认的 [hidden]{display:none}，
   这里统一兜底：hidden 就是彻底隐藏（登录页/控制台/面板的切换全靠它）。 */
[hidden] { display: none !important; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC",
    "MiSans", "Segoe UI", Roboto, "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #eef2f9;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 背景：静止的三层淡光斑（蓝 / 橙 / 白），零动画成本 */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 42% at 12% 4%, rgba(10, 92, 255, 0.16) 0%, rgba(10, 92, 255, 0) 62%),
    radial-gradient(52% 40% at 92% 100%, rgba(255, 106, 26, 0.16) 0%, rgba(255, 106, 26, 0) 64%),
    radial-gradient(90% 70% at 50% 45%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, #f4f7fc 0%, #eaeff8 100%);
}
/* 可选：性能充裕时才启用极慢漂移（见 js/fx.js），只改 transform */
html[data-fx="on"] .bg {
  animation: drift 34s var(--ease) infinite alternate;
  will-change: transform;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1.02); }
  to { transform: translate3d(0, -1.6%, 0) scale(1.06); }
}

/* ---------------------------------------------------------------- 玻璃材质 */
.glass {
  position: relative;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--glass-1) 0%, var(--glass-2) 100%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--sh-1), var(--sh-inset);
}
/* 只在顶栏/底部操作条/弹层使用真实模糊 */
.glass--blur {
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .glass--blur { background: rgba(255, 255, 255, 0.94); }
}
/* 高光：静态斜向渐变，不做 mix-blend-mode（省一次合成） */
.sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 42%);
  opacity: 0.7;
}
/* iOS 26/27 的连续圆角（支持的浏览器自动升级，不支持则保持普通圆角） */
@supports (corner-shape: squircle) {
  .glass, .btn, .tile, .thumb, .sheet { corner-shape: squircle; }
}

/* ---------------------------------------------------------------- 排版 */
.t-xs { font-size: 11px; }
.t-sm { font-size: 12.5px; }
.t-md { font-size: 14px; }
.t-lg { font-size: 17px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.strong { font-weight: 600; }
.row { display: flex; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 卡片小标题 */
.card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.card-head .ico { font-size: 13px; line-height: 1; }
.card-head .mini {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  background: rgba(11, 18, 32, 0.05);
  border-radius: 99px;
  padding: 1.5px 7px;
  white-space: nowrap;
}
.card-head .mini--blue { color: var(--blue); background: var(--blue-soft); }
.card-head .mini--amber { color: var(--amber); background: var(--amber-soft); }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.78));
  box-shadow: var(--sh-1), var(--sh-inset);
  cursor: pointer;
  transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.btn:active { transform: scale(0.965); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn--primary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: linear-gradient(180deg, #ff8a3d 0%, var(--amber) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 10px 22px -12px rgba(255, 106, 26, 0.85);
}
.btn--blue {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(180deg, #3d80ff 0%, var(--blue) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 10px 22px -12px rgba(10, 92, 255, 0.8);
}
.btn--ghost { background: rgba(255, 255, 255, 0.5); box-shadow: none; color: var(--ink-2); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 11px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; height: 36px; padding: 0; }

.link {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: none;
  border: 0;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 6px;
}
.link:active { opacity: 0.6; }

/* ---------------------------------------------------------------- 平台图标
   .btile = 平台图标底板（消费者页 46px / 后台与台卡 30px，用 --tile-size 控制）
   品牌配色尽量贴近真机图标；商家在后台开「单色图标」后不会加这些色类。 */
.btile {
  width: var(--tile-size, 46px);
  height: var(--tile-size, 46px);
  border-radius: var(--tile-radius, 33%);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.84));
  border: 1px solid var(--glass-edge);
  box-shadow: var(--sh-1), var(--sh-inset);
}
.btile svg { width: 54%; height: 54%; display: block; }
/* 官方方块类图标（美团）：底图铺满整个图标，不留边框缝隙 */
.btile--bleed { position: relative; border: 0; box-shadow: var(--sh-1); }
.btile--bleed svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.btile--ink { background: #0b1220; border-color: rgba(255, 255, 255, 0.16); }
.btile--ink svg { width: 56%; height: 56%; }
.btile--red { background: linear-gradient(150deg, #ff4d3d 0%, #fe2c55 100%); border-color: rgba(255, 255, 255, 0.3); }
.btile--yellow { background: #0b1220; border-color: rgba(255, 255, 255, 0.16); }
.btile--blue { background: linear-gradient(160deg, #3d94ff 0%, #1478ff 100%); border-color: rgba(255, 255, 255, 0.3); }
.btile--xhs { background: #ff2442; border-color: rgba(255, 255, 255, 0.28); }
.btile--xhs svg { width: 62%; height: 62%; }

/* ---------------------------------------------------------------- 表单 */
.field {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--hair-strong);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.field:focus { border-color: rgba(10, 92, 255, 0.55); box-shadow: 0 0 0 3px var(--blue-soft); }
.field::placeholder { color: var(--ink-3); }
textarea.field { resize: vertical; min-height: 96px; line-height: 1.62; }

/* 密码框 + 「显示密码」按钮 */
.field-pwd { position: relative; display: block; }
.field-pwd .field { padding-right: 48px; }
.pwd-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.pwd-toggle:hover { color: var(--ink-2); }
.pwd-toggle:active { background: rgba(11, 18, 32, 0.06); }
.pwd-toggle[aria-pressed="true"] { color: var(--blue); }
.pwd-toggle svg { width: 20px; height: 20px; display: block; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; display: block; }
.form-row { margin-bottom: 14px; }

/* 开关 */
.switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 99px;
  border: 0;
  background: rgba(11, 18, 32, 0.16);
  cursor: pointer;
  transition: background var(--norm) var(--ease);
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(11, 18, 32, 0.28);
  transition: transform var(--norm) var(--ease);
}
.switch[aria-checked="true"] { background: linear-gradient(180deg, #3d80ff, var(--blue)); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* 标签页 */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: rgba(11, 18, 32, 0.05); }
.tab {
  flex: 1;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  border: 0;
  border-radius: 11px;
  padding: 8px 10px;
  background: transparent;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
  white-space: nowrap;
}
.tab[aria-selected="true"] {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.86));
  box-shadow: var(--sh-1), var(--sh-inset);
}

/* ---------------------------------------------------------------- 提示 */
#toast {
  position: fixed;
  left: 50%;
  top: calc(10px + env(safe-area-inset-top));
  z-index: 90;
  transform: translate(-50%, -18px);
  opacity: 0;
  pointer-events: none;
  max-width: 88vw;
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: #fff;
  background: rgba(11, 18, 32, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: opacity var(--norm) var(--ease), transform var(--norm) var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- 弹层 */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 18, 32, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--norm) var(--ease);
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 85;
  width: min(480px, 100%);
  max-height: 78dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  transform: translate(-50%, 102%);
  transition: transform var(--norm) var(--ease);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--sh-2);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet-grip { width: 38px; height: 4px; border-radius: 99px; background: rgba(11, 18, 32, 0.16); margin: 0 auto 12px; }

/* 隐藏但可被无障碍读到 */
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 骨架屏（首屏加载） */
.skeleton {
  background: linear-gradient(100deg, rgba(11, 18, 32, 0.06) 30%, rgba(11, 18, 32, 0.11) 50%, rgba(11, 18, 32, 0.06) 70%);
  background-size: 220% 100%;
  animation: sk 1.1s linear infinite;
  border-radius: 8px;
}
@keyframes sk { from { background-position: 120% 0; } to { background-position: -120% 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
