/* ============================================
   渡仓 · iOS 26 风格弹窗组件（Liquid Glass）
   全局统一：alert / confirm / prompt / actionSheet / toast
   设计依据（WWDC25 新设计系统）：
     - 标题/正文左对齐、字重加粗
     - 按钮一律胶囊形（圆角 = 高度一半），GlassButtonStyle
     - 去 hairline 分割线，间距替代
     - 更深玻璃：高模糊 + 高饱和 + 镜面内高光
     - 弹窗从内容中"浮起"，柔和弥散阴影
   ============================================ */

.ui-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 26, 32, 0.3);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.ui-mask.show {
  opacity: 1;
}

/* ===== 对话框（液态玻璃：低不透明度 + 不均匀边框） ===== */
.ui-dialog {
  width: 100%;
  max-width: 310px;
  border-radius: 26px;
  background: rgba(252, 253, 255, 0.38);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-right-color: rgba(148, 166, 194, 0.24);
  border-bottom-color: rgba(148, 166, 194, 0.24);
  box-shadow:
    0 30px 80px rgba(22, 26, 32, 0.26),
    0 4px 16px rgba(22, 26, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  /* v=ia：起手从 0.88 提到 0.94 —— 0.88 缩得过小，弹窗像凭空冒出来。
     曲线从 Material 默认的对称曲线换成强 ease-out：手指还在按钮上就能看到它出来。 */
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  transition:
    transform 0.26s var(--ease-spring, cubic-bezier(0.22, 1, 0.36, 1)),
    opacity 0.2s ease;
}

.ui-mask.show .ui-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.ui-dialog-body {
  padding: 22px 20px 16px;
  text-align: left;
}

.ui-dialog-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.2px;
  line-height: 1.35;
}

/* 通知图标（iOS 26 风格：居中圆形玻璃图标 + 类型色调） */
.ui-dialog-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 8px 22px rgba(22, 26, 32, 0.12);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
}
.ui-dialog-icon svg {
  width: 26px;
  height: 26px;
}
.ui-dialog-icon.tone-success { color: #4f9e72; background: rgba(106, 155, 126, 0.14); }
.ui-dialog-icon.tone-warn    { color: #b28a3d; background: rgba(194, 162, 90, 0.16); }
.ui-dialog-icon.tone-error   { color: #c05b4e; background: rgba(192, 122, 110, 0.16); }
.ui-dialog-icon.tone-info    { color: #5b7fb8; background: rgba(91, 127, 184, 0.14); }

.ui-dialog-text {
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-line;
  word-break: break-word;
  /* 长文本（服务协议 / 加入我们）要能在弹窗里滚动，
     否则整段文字把弹窗撑到超出屏幕，按钮都点不到。
     高度取「视口的一半左右」，短文本自动只有内容那么高 */
  max-height: min(54vh, 430px);
  overflow-y: auto;
  overscroll-behavior: contain;   /* 滚到底不要把整页带着滚 */
  padding-right: 2px;
}

/* 滚动条做细一点，不抢戏（Chrome / Edge / Safari） */
.ui-dialog-text::-webkit-scrollbar { width: 4px; }
.ui-dialog-text::-webkit-scrollbar-thumb {
  background: rgba(148, 166, 194, 0.4);
  border-radius: 999px;
}
.ui-dialog-text::-webkit-scrollbar-track { background: transparent; }

/* 输入框 */
.ui-input {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-right-color: rgba(148, 166, 194, 0.24);
  border-bottom-color: rgba(148, 166, 194, 0.24);
  background: rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ui-input:focus {
  border-color: rgba(91, 127, 184, 0.55);
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(91, 127, 184, 0.12);
}

/* ===== 胶囊按钮组（纵向堆叠，无分割线） ===== */
.ui-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 2px 16px 16px;
}

.ui-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-right-color: rgba(148, 166, 194, 0.24);
  border-bottom-color: rgba(148, 166, 194, 0.24);
  background: rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 20px -10px rgba(22, 26, 32, 0.18);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s var(--ease-spring), filter 0.18s ease, background 0.18s ease;
}

/* 主按钮：着色玻璃胶囊（GlassButtonStyle，替代旧 borderedProminent） */
.ui-btn.primary {
  background: linear-gradient(135deg, rgba(96, 134, 190, 0.94), rgba(74, 108, 168, 0.94));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 18px rgba(91, 127, 184, 0.32);
  font-weight: 700;
}

.ui-btn.primary:active {
  filter: brightness(1.08);
  transform: scale(0.97);
}

/* 危险主按钮 */
.ui-btn.primary.danger {
  background: linear-gradient(135deg, rgba(235, 88, 74, 0.94), rgba(214, 59, 45, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 6px 18px rgba(217, 74, 61, 0.3);
}

/* 次要危险：透明胶囊 + 红色文字 */
.ui-btn.danger:not(.primary) {
  color: var(--danger);
}

.ui-btn:active {
  transform: scale(0.97);
  filter: brightness(1.04);
}

/* ===== 表单型弹窗（v=gt：后台编辑用户信息） =====
   一张弹窗里列全部可改字段，按钮并排（纵向堆叠会把这一个弹窗撑出屏幕） */
.ui-dialog.user-edit-dialog {
  max-width: 380px;
}

.ui-dialog.user-edit-dialog .ui-dialog-actions {
  flex-direction: row;
}

.ui-dialog.user-edit-dialog .ui-btn {
  width: auto;
  flex: 1;
  min-height: var(--tap-min, 44px);
  padding: 11px 16px;
}

.user-edit-form {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(56vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.user-edit-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-edit-label {
  flex: none;
  width: 56px;
  font-size: 13px;
  color: var(--ink-2);
}

.user-edit-field .ui-input {
  margin-top: 0;
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 13px;
  font-size: 14px;
}

.user-edit-err {
  margin-top: 10px;
  min-height: 16px;
  font-size: 12px;
  color: var(--danger, #c05b4e);
  line-height: 1.5;
}

/* ===== 底部动作面板（Action Sheet） ===== */.ui-mask.ui-sheet-mask {
  align-items: flex-end;
  padding: 0 10px calc(10px + env(safe-area-inset-bottom));
}

.ui-sheet {
  width: 100%;
  max-width: 460px;
  transform: translateY(44px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.24s ease;
}

.ui-mask.show .ui-sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ui-sheet-group {
  border-radius: 24px;
  background: rgba(252, 253, 255, 0.62);
  backdrop-filter: blur(48px) saturate(210%);
  -webkit-backdrop-filter: blur(48px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 20px 56px rgba(22, 26, 32, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 22px rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

/* iOS 26：标题左对齐、弱化 */
.ui-sheet-title {
  padding: 15px 20px 9px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: left;
}

/* iOS 26：条目左对齐、去分割线，间距分区 */
.ui-sheet-item {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.18s var(--ease-spring);
}

.ui-sheet-item:active {
  background: rgba(22, 26, 32, 0.05);
  transform: scale(0.99);
}

.ui-sheet-item.danger {
  color: var(--danger);
}

.ui-sheet-cancel {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 15px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(252, 253, 255, 0.72);
  backdrop-filter: blur(40px) saturate(190%);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  box-shadow:
    0 12px 32px rgba(22, 26, 32, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s var(--ease-spring), background 0.15s ease;
}

.ui-sheet-cancel:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.92);
}

/* ===== iOS 26 液态玻璃 Toast（顶部悬浮胶囊） ===== */
.toast {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -90px) scale(0.95);
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 11px 18px 11px 12px;
  border-radius: 999px;
  background: rgba(252, 253, 255, 0.66);
  backdrop-filter: blur(44px) saturate(200%);
  -webkit-backdrop-filter: blur(44px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 18px 46px rgba(22, 26, 32, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 18px rgba(255, 255, 255, 0.22);
  opacity: 0;
  transition:
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s ease;
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}

.toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #34c77b, #1fa85e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 6px rgba(31, 168, 94, 0.35);
  flex-shrink: 0;
}

.toast.fail .toast-icon {
  background: linear-gradient(145deg, #ff7a6b, #e8492f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 6px rgba(232, 73, 47, 0.35);
  /* 叉号字形比感叹号窄小，单独放大一点，视觉重量才对得上 */
  font-size: 15px;
  font-weight: 700;
}

/* 提醒类（非营业时间「只能预约」这类）：黄色感叹号 */
.toast.warn .toast-icon {
  background: linear-gradient(145deg, #ffcb52, #eda316);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 6px rgba(237, 163, 22, 0.35);
}

.toast-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.toast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.toast-sub {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
}

/* ============================================================
   v=gy · 弹窗精修（前后台共用）
   ------------------------------------------------------------
   弹窗里经常是长文案（退款规则、封禁说明），可读性优先：
   玻璃稍微加厚一点、主按钮渐变和全站统一。
   ============================================================ */

.ui-dialog {
  background: rgba(252, 253, 255, 0.46);
  box-shadow:
    0 32px 80px -24px rgba(23, 37, 56, 0.38),
    0 4px 16px rgba(23, 37, 56, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
}

.ui-dialog-title {
  letter-spacing: 0.01em;
}

.ui-dialog-text {
  line-height: 1.72;
}

.ui-btn {
  transition:
    transform 0.16s var(--ease-press, cubic-bezier(0.4, 0, 0.2, 1)),
    filter 0.18s ease,
    background 0.18s ease;
}

.ui-btn.primary {
  background: linear-gradient(160deg, rgba(106, 143, 194, 0.96), rgba(74, 108, 168, 0.96) 60%, rgba(67, 99, 156, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(23, 37, 56, 0.1),
    0 8px 20px -10px rgba(74, 108, 168, 0.55);
}

.ui-btn:active {
  transform: scale(0.975);
  filter: brightness(1.03);
}

/* v=nu · 提示条永远在弹窗之上（原来 1200，被 9997 的商品弹窗盖住，
   弹窗里的「已保存 / 上传失败」根本看不见） */
.toast {
  z-index: 20000;
}

/* ============================================================
   v=oz · 页面跳转进度条
   ------------------------------------------------------------
   点站内链接后立刻在顶部出现，页面卸载时自然消失。
   目的不是「假装加载」，而是给一个「点上了」的反馈。
   ============================================================ */
.dc-nav-bar {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--accent, #5b7fb8);
  box-shadow: 0 0 8px rgba(91, 127, 184, 0.5);
  opacity: 0;
  z-index: 2147483000;
  pointer-events: none;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.dc-nav-bar.on {
  opacity: 1;
  width: 82%;
}
