/**
 * xiaoshouji — 全局设计令牌（主界面、子页面、弹窗/浮层共用）
 * 在各页面 <head> 中于本地 <style> 之前引入： <link rel="stylesheet" href="theme.css" />
 */
:root {
  /* 界面配色（与主设计稿一致） */
  --bg: #ffffff;
  --bg-card: #f8f8f8;
  --bg-elevated: #ffffff;
  --text: #121212;
  --text-muted: #666666;
  --text-tertiary: #666666;
  --border: #e5e5e5;
  --border-subtle: #e5e5e5;
  --accent: #2a2a2a;
  --danger: #b54745;

  /* 层次：极轻阴影，避免厚重 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.07);
  --shadow-popover: 0 8px 28px rgba(0, 0, 0, 0.09);
  --shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.11);

  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 13px;
  --radius-xl: 16px;

  /* 遮罩：统一弹窗底衬 */
  --overlay-scrim: rgba(15, 15, 15, 0.45);
  --overlay-scrim-light: rgba(15, 15, 15, 0.32);

  --tracking-tight: -0.025em;
  --tracking-label: 0.04em;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  /* shell.js / 美化页会在 <html> 上覆盖此项，以应用用户导入的字体 */
  --global-font-family: var(--font-ui);
}

/* 弹窗/底部抽屉：统一表面（页面可加在 .modal-card / .pick-sheet 等同构节点上） */
.xsj-surface {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}

.xsj-surface--sheet {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 0;
}

.xsj-scrim {
  background: var(--overlay-scrim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 全屏：由 shell.js 根据 localStorage 开关 body/html.xsj-fullscreen，全项目页面共用 */
html.xsj-fullscreen,
html.xsj-fullscreen body {
  margin: 0;
  min-height: 100%;
}
body.xsj-fullscreen {
  padding: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  min-height: 100vh;
  min-height: 100dvh;
}
body.xsj-fullscreen .phone,
body.xsj-fullscreen .page {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* index.html：外层 .wrap 需随全屏铺满 */
body.xsj-fullscreen .wrap {
  width: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  padding: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: stretch !important;
}

/* 统一返回按钮（线型 chevron，公开图标常见样式） */
.xsj-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.xsj-back-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.xsj-back-btn:active {
  transform: translateY(1px);
}

/*
 * 避免 iOS Safari 等聚焦 input/textarea 时自动放大视口（字号小于 16px 会触发缩放）。
 * 使用 max(16px, 1em) 在保留相对缩放的同时满足最小字号。
 */
input:not([type]),
input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea,
select,
[contenteditable="true"] {
  font-size: max(16px, 1em) !important;
}
