/* =====================================================================
   知牙 AI · Dental Buddy — Mobile-First + Desktop Dual-Layout Design System
   官方默认：光瓷流璃 (Spatial Ceramic) × 雾金香槟 (Champagne)
   原则：85% 素白玻璃 × 12% 柔和雾光 × 3% 精致点缀 · 手机端体验最高优先级
   ===================================================================== */

:root,
[data-skin="champagne"] {
  --bg-page: #faf8f4;
  --glass: rgba(255, 253, 249, 0.80);
  --glass-strong: rgba(255, 254, 251, 0.94);
  --glass-subtle: rgba(255, 252, 246, 0.60);
  --border: rgba(255, 255, 255, 0.92);
  --line: rgba(51, 42, 34, 0.08);

  --ink: #332a22;
  --ink-2: #75695d;
  --ink-3: #a4988c;

  --accent: #a78760;
  --accent-deep: #7d613e;
  --accent-soft: rgba(167, 135, 96, 0.12);
  --accent-border: rgba(167, 135, 96, 0.28);
  --mist-a: rgba(232, 206, 170, 0.34);
  --mist-b: rgba(246, 226, 204, 0.28);
  --orb-grad: linear-gradient(135deg, #b3926a 0%, #977752 100%);
  --orb-shadow: 0 14px 32px rgba(167, 135, 96, 0.34);

  --ok: #3a8b68;
  --ok-bg: rgba(58, 139, 104, 0.11);
  --warn: #b57b3c;
  --warn-bg: rgba(181, 123, 60, 0.12);
  --danger: #c65d63;
  --danger-bg: rgba(198, 93, 99, 0.11);

  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 13px;
  --shadow-card: 0 8px 26px rgba(51, 42, 34, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.94);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* 其余 5 套高定主题色系 */
[data-skin="glacier"] {
  --bg-page: #f5f7fc;
  --glass: rgba(255, 255, 255, 0.76); --glass-strong: rgba(255, 255, 255, 0.92);
  --ink: #1e2430; --ink-2: #5b6577; --ink-3: #8c96a8;
  --accent: #5b7ce6; --accent-deep: #4666cc;
  --accent-soft: rgba(91, 124, 230, 0.11); --accent-border: rgba(91, 124, 230, 0.24);
  --mist-a: rgba(154, 180, 255, 0.34); --mist-b: rgba(196, 178, 255, 0.24);
  --orb-grad: linear-gradient(140deg, #8aa5ff 0%, #5b7ce6 58%, #4b68cf 100%);
  --orb-shadow: 0 14px 32px rgba(91, 124, 230, 0.34);
}
[data-skin="wisteria"] {
  --bg-page: #f7f6fc;
  --ink: #26253b; --ink-2: #686680; --ink-3: #9997ad;
  --accent: #786fd4; --accent-deep: #5e55bb;
  --accent-soft: rgba(120, 111, 212, 0.11); --accent-border: rgba(120, 111, 212, 0.24);
  --mist-a: rgba(178, 170, 252, 0.34); --mist-b: rgba(224, 186, 235, 0.24);
  --orb-grad: linear-gradient(140deg, #a29af2 0%, #786fd4 60%, #6158bd 100%);
  --orb-shadow: 0 14px 32px rgba(120, 111, 212, 0.34);
}
[data-skin="celadon"] {
  --bg-page: #f4f9f8;
  --ink: #223331; --ink-2: #5d706d; --ink-3: #8fa19e;
  --accent: #558b84; --accent-deep: #3f736c;
  --accent-soft: rgba(85, 139, 132, 0.11); --accent-border: rgba(85, 139, 132, 0.24);
  --mist-a: rgba(154, 212, 204, 0.32); --mist-b: rgba(182, 210, 234, 0.24);
  --orb-grad: linear-gradient(140deg, #83bbb3 0%, #558b84 60%, #437670 100%);
  --orb-shadow: 0 14px 32px rgba(85, 139, 132, 0.32);
}
[data-skin="eucalyptus"] {
  --bg-page: #f5f8f5;
  --ink: #25332a; --ink-2: #617066; --ink-3: #92a096;
  --accent: #5d846c; --accent-deep: #486c56;
  --accent-soft: rgba(93, 132, 108, 0.11); --accent-border: rgba(93, 132, 108, 0.24);
  --mist-a: rgba(164, 206, 178, 0.32); --mist-b: rgba(208, 218, 190, 0.24);
  --orb-grad: linear-gradient(140deg, #89b297 0%, #5d846c 60%, #496e57 100%);
  --orb-shadow: 0 14px 32px rgba(93, 132, 108, 0.32);
}
[data-skin="blush"] {
  --bg-page: #fbf6f6;
  --ink: #352528; --ink-2: #755f63; --ink-3: #a69195;
  --accent: #b47b82; --accent-deep: #8a565d;
  --accent-soft: rgba(180, 123, 130, 0.11); --accent-border: rgba(180, 123, 130, 0.25);
  --mist-a: rgba(238, 194, 200, 0.34); --mist-b: rgba(226, 206, 232, 0.24);
  --orb-grad: linear-gradient(140deg, #d7a3aa 0%, #b47b82 60%, #9b636a 100%);
  --orb-shadow: 0 14px 32px rgba(180, 123, 130, 0.32);
}

/* 第二质感：私享画报 · Editorial Atelier */
[data-style="atelier"] {
  --bg-page: #f7f4ee;
  --glass: rgba(255, 253, 249, 0.94);
  --glass-strong: #fffdf9;
  --glass-subtle: rgba(248, 244, 236, 0.80);
  --border: rgba(118, 102, 82, 0.16);
  --line: rgba(118, 102, 82, 0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 12px rgba(60, 48, 34, 0.04);
}
[data-style="atelier"] h1,
[data-style="atelier"] h2,
[data-style="atelier"] h3,
[data-style="atelier"] .page-title,
[data-style="atelier"] .concierge-doc {
  font-family: var(--font-serif);
  letter-spacing: 0.02em;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  background: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  touch-action: manipulation;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
.hidden { display: none !important; }

.ambient-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(66% 52% at 14% 8%, var(--mist-a), transparent 72%),
    radial-gradient(60% 50% at 88% 88%, var(--mist-b), transparent 74%),
    var(--bg-page);
  transition: background 0.35s ease;
}

/* =====================================================================
   MOBILE-FIRST 基础组件（默认即按手机拇指热区与 iOS 防缩放设计）
   ===================================================================== */
.card {
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px;
}
[data-style="atelier"] .card {
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 1px solid var(--line);
}

.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--orb-grad); color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 8px 20px var(--accent-soft);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-en { font-size: 10px; letter-spacing: 0.18em; color: var(--accent); font-weight: 600; }
.brand-cn { font-size: 19px; font-weight: 600; line-height: 1.15; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass-strong); color: var(--ink);
  padding: 10px 18px; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: transform 0.12s ease, opacity 0.16s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.52; cursor: not-allowed; }
.btn-primary {
  min-height: 48px;
  background: var(--orb-grad); color: #fff; border-color: transparent;
  box-shadow: 0 10px 24px var(--accent-soft);
  font-weight: 600;
}
.btn-soft {
  background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-border);
}
.btn-danger {
  background: var(--danger-bg); color: var(--danger); border-color: rgba(198, 93, 99, 0.24);
}
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13.5px; }
.btn-full { width: 100%; }

.glass-pill-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--glass-strong);
  box-shadow: var(--shadow-card);
  font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer;
}
.glass-pill-btn:active { transform: scale(0.97); }
.dot-badge {
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--warn); display: inline-block;
}

/* 全部输入框 16px，彻底杜绝 iOS Safari / 微信浏览器点击放大 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 500; padding-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; font-size: 16px;
  background: var(--glass-strong); border: 1px solid var(--line);
  border-radius: var(--radius-sm); outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color 0.18s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-deep);
}
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-muted { background: rgba(51, 42, 34, 0.06); color: var(--ink-2); }

/* =====================================================================
   1. 手机端优先：认证 / 注册 / 待审全屏界面
   ===================================================================== */
.auth-shell {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(20px + var(--safe-top)) 18px calc(24px + var(--safe-bottom));
}
.auth-card {
  width: 100%; max-width: 440px; margin: 0 auto;
  padding: 26px 20px 22px;
}
.auth-head { margin-bottom: 20px; }
.auth-slogan { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }

.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; border-radius: 999px; background: rgba(51, 42, 34, 0.055);
  margin-bottom: 18px;
}
.seg button {
  min-height: 40px; border: none; background: transparent; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.seg button.active {
  background: var(--glass-strong); color: var(--accent-deep); font-weight: 600;
  box-shadow: 0 2px 8px rgba(51, 42, 34, 0.06);
}

.auth-err {
  margin-bottom: 14px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--danger-bg); color: var(--danger); font-size: 13.5px;
}
.auth-foot {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
.text-link {
  border: none; background: transparent; color: var(--accent-deep);
  font-size: 13.5px; font-weight: 500; cursor: pointer; padding: 4px 0; text-decoration: none;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
}
.kv-box {
  background: var(--glass-subtle); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 12px 14px; margin: 14px 0 18px;
}
.kv-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; font-size: 14px; border-bottom: 1px solid var(--line);
}
.kv-item:last-child { border-bottom: none; }
.kv-item span:first-child { color: var(--ink-3); }

/* =====================================================================
   2. 手机端主工作台（原生 100dvh App 壳，零双顶栏，零遮挡）
   ===================================================================== */
.app-shell {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}
.desktop-sidebar { display: none; }

.main-col {
  flex: 1; min-width: 0;
  min-height: 100dvh;
  display: flex; flex-direction: column;
}

/* AI 助理页采用原生全高弹性结构：顶部固定，中间对话流独立滚，底部语音球 + 导航岛零重叠 */
.main-col.is-ai-tab {
  height: 100dvh;
  overflow: hidden;
}
.main-col.is-ai-tab .main-view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 18px;
}

.main-view {
  flex: 1; width: 100%;
  padding: calc(16px + var(--safe-top)) 16px calc(92px + var(--safe-bottom));
}

/* 单层极简页头（彻底消除手机端双顶栏） */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.page-title { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.page-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); }
.back-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 36px; padding: 0 12px 0 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--glass-strong);
  font-size: 13.5px; color: var(--ink); cursor: pointer;
}

/* 今日 AI 简报卡 */
.brief-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.brief-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--glass); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); cursor: pointer;
}
.brief-row:active { transform: scale(0.99); }
.brief-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.brief-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.45; }
.brief-arrow { color: var(--ink-3); font-size: 16px; flex-shrink: 0; }

/* AI 对话流 */
.ai-empty { padding: 18px 2px 8px; }
.ai-empty h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; line-height: 1.45; }
.ai-empty p { margin: 0 0 16px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.prompt-pills { display: flex; flex-direction: column; gap: 10px; }
.prompt-pill {
  text-align: left; padding: 13px 16px; border-radius: var(--radius-md);
  background: var(--glass); border: 1px solid var(--border);
  font-size: 14px; color: var(--ink-2); line-height: 1.5; cursor: pointer;
}
.prompt-pill:active { background: var(--glass-strong); border-color: var(--accent-border); color: var(--accent-deep); }

.chat-stream { display: flex; flex-direction: column; gap: 12px; }
.msg-user {
  align-self: flex-end; max-width: 86%;
  padding: 11px 15px; border-radius: 18px 18px 6px 18px;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: var(--ink); font-size: 14.5px; line-height: 1.55;
}
.msg-ai { align-self: flex-start; width: 100%; }
.msg-ai .card { padding: 16px; }
.msg-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.msg-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.msg-kv-cell {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--glass-subtle); border: 1px solid var(--line);
}
.msg-kv-cell small { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; }
.msg-kv-cell strong { font-size: 14px; font-weight: 600; }

/* 底部输入区：自然停在底部 5-Tab 导航栏正上方，永不遮挡 */
.composer-wrap {
  flex-shrink: 0;
  padding: 10px 16px calc(74px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg-page) 78%, transparent);
}
.composer-inner { width: 100%; max-width: 720px; margin: 0 auto; }
.orb-dock {
  display: flex; align-items: center; justify-content: center; gap: 20px;
}
.orb-side {
  width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--glass-strong);
  box-shadow: var(--shadow-card); color: var(--ink-2);
  display: grid; place-items: center; font-size: 17px; cursor: pointer;
}
.voice-orb {
  width: 62px; height: 62px; border-radius: 999px; border: none;
  background: var(--orb-grad); color: #fff;
  box-shadow: var(--orb-shadow);
  display: grid; place-items: center; font-size: 22px; cursor: pointer;
  transition: transform 0.14s ease;
}
.voice-orb:active, .voice-orb.recording { transform: scale(1.07); }
.voice-orb.recording { animation: pulse-ring 1.3s infinite; }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 var(--accent-border), var(--orb-shadow); }
  70% { box-shadow: 0 0 0 18px rgba(167, 135, 96, 0), var(--orb-shadow); }
  100% { box-shadow: 0 0 0 0 rgba(167, 135, 96, 0), var(--orb-shadow); }
}
.orb-hint { text-align: center; font-size: 11.5px; color: var(--ink-3); margin-top: 7px; }
[data-style="atelier"] .voice-orb {
  width: auto; min-width: 210px; height: 48px; padding: 0 22px;
  font-size: 14.5px; gap: 8px; display: inline-flex;
}

.text-dock {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 10px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.text-dock input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-size: 16px; padding: 6px 4px;
}

/* 手机端全宽贴边毛玻璃 5-Tab 底部导航栏 */
.mobile-island {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  padding: 6px 6px calc(6px + var(--safe-bottom));
  border-radius: 0;
  background: var(--glass-strong);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: none;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(51, 42, 34, 0.05);
}
.mi-tab {
  border: none; background: transparent;
  min-height: 46px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; color: var(--ink-3); cursor: pointer;
}
.mi-tab svg { width: 19px; height: 19px; }
.mi-tab.active {
  color: var(--accent-deep); background: var(--accent-soft); font-weight: 600;
}

/* 私客 / 排班 / 经营 / 工作室（手机优先节奏） */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.search-input {
  width: 100%; min-height: 44px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--glass-strong);
  font-size: 16px; outline: none;
}
.search-input:focus { border-color: var(--accent); }
.filter-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line); background: var(--glass);
  color: var(--ink-2); cursor: pointer;
}
.chip.active {
  background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-border); font-weight: 600;
}

.list-stack { display: flex; flex-direction: column; gap: 10px; }
.patient-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--glass); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); cursor: pointer;
}
.patient-row:active { transform: scale(0.99); }
.pr-main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.pr-av {
  width: 42px; height: 42px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center; font-weight: 600; font-size: 16px; flex-shrink: 0;
}
.pr-name { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pr-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.pr-right { text-align: right; flex-shrink: 0; }
.pr-amt { font-size: 15px; font-weight: 600; }

.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.metric-card { padding: 16px; }
.metric-label { font-size: 12.5px; color: var(--ink-2); }
.metric-val { font-size: 22px; font-weight: 650; margin-top: 6px; font-variant-numeric: tabular-nums; }

.date-beads {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px;
  scrollbar-width: none;
}
.date-beads::-webkit-scrollbar { display: none; }
.bead {
  min-width: 62px; min-height: 44px; padding: 8px 12px; border-radius: 16px;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--glass); font-size: 13.5px; cursor: pointer; flex-shrink: 0;
}
.bead.active {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-deep); font-weight: 600;
}
.slot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.slot-pill {
  min-height: 48px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--glass-strong);
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 13.5px; cursor: pointer;
}
.slot-pill.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.slot-pill.booked { opacity: 0.55; cursor: default; }

.skin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.skin-pill {
  display: flex; align-items: center; gap: 8px; min-height: 42px;
  padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass-strong);
  font-size: 13.5px; color: var(--ink-2); cursor: pointer;
}
.skin-pill i { width: 11px; height: 11px; border-radius: 999px; display: inline-block; flex-shrink: 0; }
.skin-pill.active {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); font-weight: 600;
}

/* =====================================================================
   3. VIP 患者专属端（手机优先）
   ===================================================================== */
.patient-shell {
  position: relative; z-index: 1;
  min-height: 100dvh; max-width: 620px; margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 16px calc(40px + var(--safe-bottom));
}
.concierge-card {
  position: relative; overflow: hidden;
  padding: 22px 20px; margin-bottom: 16px;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.concierge-card::after {
  content: ""; position: absolute; right: -36px; top: -36px;
  width: 170px; height: 170px; border-radius: 999px;
  background: radial-gradient(circle, var(--mist-a) 0%, transparent 72%);
  pointer-events: none;
}
[data-style="atelier"] .concierge-card { outline: 1px solid var(--line); outline-offset: -6px; }
.concierge-eyebrow { font-size: 12px; color: var(--accent-deep); letter-spacing: 0.08em; }
.concierge-doc { font-size: 22px; font-weight: 600; margin: 6px 0 4px; }
.concierge-sub { font-size: 13.5px; color: var(--ink-2); }

/* =====================================================================
   手机端原生底部上滑抽屉 (Bottom Sheet)
   ===================================================================== */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(34, 28, 22, 0.30);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-card {
  width: 100%; max-height: 88dvh;
  display: flex; flex-direction: column;
  background: var(--glass-strong); border-top: 1px solid var(--border);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -16px 48px rgba(34, 28, 22, 0.14);
  padding-bottom: var(--safe-bottom);
  animation: sheet-up 0.22s ease-out;
}
@keyframes sheet-up {
  from { transform: translateY(28px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 38px; height: 4px; border-radius: 999px;
  background: rgba(51, 42, 34, 0.16);
  margin: 10px auto 2px; flex-shrink: 0;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 14px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.icon-close {
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass-subtle); cursor: pointer; font-size: 14px; color: var(--ink-2);
}
.modal-body {
  padding: 18px 20px 26px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}

.toast {
  position: fixed; left: 50%; top: calc(18px + var(--safe-top)); transform: translateX(-50%);
  z-index: 90; max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: 999px;
  background: var(--glass-strong); color: var(--ink);
  border: 1px solid var(--accent-border);
  box-shadow: 0 12px 30px rgba(51, 42, 34, 0.14);
  font-size: 13.5px; font-weight: 500; text-align: center;
}

.empty-box {
  text-align: center; padding: 36px 18px; color: var(--ink-2);
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: var(--glass-subtle);
}
.empty-box h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.empty-box p { margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; }

/* 抽屉内轻量快捷栏、AI 一句话速填条与项目价目胶囊 */
.quick-actions {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px;
  scrollbar-width: none;
}
.quick-actions::-webkit-scrollbar { display: none; }
.quick-actions .btn { flex-shrink: 0; }

.ai-fill-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px 6px 12px; margin-bottom: 14px;
  border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
}
.ai-fill-bar input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-size: 15px; color: var(--ink);
}
.ai-fill-mic {
  width: 34px; height: 34px; border-radius: 999px; border: none;
  background: var(--glass-strong); color: var(--accent-deep);
  display: grid; place-items: center; flex-shrink: 0; cursor: pointer;
}
.ai-fill-mic.recording { background: var(--orb-grad); color: #fff; }

.service-chips {
  display: flex; gap: 7px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px;
  scrollbar-width: none;
}
.service-chips::-webkit-scrollbar { display: none; }
.svc-chip {
  flex-shrink: 0; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass-subtle);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.svc-chip b { color: var(--accent-deep); font-weight: 600; }
.svc-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }

.service-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--glass-subtle);
}
.service-price { font-size: 15px; font-weight: 600; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.entry-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; transition: transform 0.14s ease;
}
.entry-card:active { transform: scale(0.99); }

/* 知牙首页：4 枚轻盈素白玻璃高频动作键（一进门即清晰，零压迫） */
.action-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: 18px;
}
.action-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: 14px 6px; border-radius: var(--radius-md);
  background: var(--glass-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  color: var(--ink); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: transform 0.14s ease, border-color 0.16s ease;
}
.action-tile:active { transform: scale(0.97); }
.action-tile:hover { border-color: var(--accent-border); color: var(--accent-deep); }
.action-tile-ic {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center;
}
.action-tile-ic svg { width: 19px; height: 19px; }

/* 有对话时，首页高频动作自动收拢为顶部单行轻量胶囊 */
.action-strip {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px;
  scrollbar-width: none;
}
.action-strip::-webkit-scrollbar { display: none; }
.action-strip button {
  flex-shrink: 0; min-height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--glass-strong);
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.action-strip button:hover { border-color: var(--accent-border); color: var(--accent-deep); }

/* 底部 Tab 预约待办微点 */
.mi-ic-wrap { position: relative; display: inline-flex; }
.mi-dot {
  position: absolute; top: -1px; right: -4px;
  width: 7px; height: 7px; border-radius: 999px;
  background: var(--warn);
}

/* 诊室页顶部通透经营概览卡 & 升级版经营洞察页 */
.biz-mini-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.biz-mini-cell small { display: block; font-size: 11.5px; color: var(--ink-3); }
.biz-mini-cell strong { display: block; font-size: 16px; font-weight: 650; margin-top: 3px; font-variant-numeric: tabular-nums; }

.biz-hero {
  position: relative; overflow: hidden; margin-bottom: 12px;
  background: var(--glass-strong);
}
.biz-hero::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px; border-radius: 999px;
  background: radial-gradient(circle, var(--mist-a) 0%, transparent 72%);
  pointer-events: none;
}
.biz-hero-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap;
}
.biz-hero-val {
  font-size: 32px; font-weight: 650; letter-spacing: -0.02em;
  margin: 8px 0 12px; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.biz-delta {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.biz-delta.up { background: rgba(63, 125, 92, 0.11); color: var(--ok); }
.biz-delta.down { background: rgba(182, 74, 68, 0.10); color: var(--danger); }

.biz-meter {
  height: 7px; border-radius: 999px; overflow: hidden;
  background: rgba(51, 42, 34, 0.07);
}
.biz-meter-fill {
  height: 100%; border-radius: 999px;
  background: var(--orb-grad);
  transition: width 0.35s ease;
}

.metric-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.35; }
.metric-card.clickable { cursor: pointer; transition: border-color 0.15s ease, transform 0.14s ease; }
.metric-card.clickable:active { transform: scale(0.98); }
.metric-card.clickable:hover { border-color: var(--accent-border); }

.biz-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.biz-card-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.biz-pills {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: rgba(51, 42, 34, 0.05); border: 1px solid var(--line);
}
.biz-pills button {
  border: none; background: transparent; color: var(--ink-2);
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer;
}
.biz-pills button.active {
  background: var(--glass-strong); color: var(--accent-deep); font-weight: 600;
  box-shadow: 0 2px 6px rgba(51, 42, 34, 0.06);
}

/* 6 柱极简轻奢趋势图 */
.biz-bars {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  align-items: end; height: 156px; padding-top: 8px;
}
.biz-bar-col {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%; gap: 6px; min-width: 0;
}
.biz-bar-num {
  font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.biz-bar-track {
  width: 100%; max-width: 30px; flex: 1; display: flex; align-items: flex-end;
  border-radius: 10px; background: rgba(51, 42, 34, 0.04); padding: 2px;
}
.biz-bar-fill {
  width: 100%; border-radius: 8px; min-height: 4px;
  background: var(--orb-grad); opacity: 0.88;
  transition: height 0.35s ease;
}
.biz-bar-fill.zero { background: rgba(51, 42, 34, 0.10); opacity: 0.5; }
.biz-bar-lbl { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* 项目 / 渠道 / 支付 排行条 */
.biz-rank-list { display: flex; flex-direction: column; gap: 12px; }
.biz-rank-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 5px;
}
.biz-rank-name {
  font-size: 14px; font-weight: 500; color: var(--ink);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.biz-rank-val {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.biz-rank-meta {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--ink-3); margin-top: 4px; font-variant-numeric: tabular-nums;
}
.biz-rank-bar {
  height: 5px; border-radius: 999px; background: rgba(51, 42, 34, 0.06); overflow: hidden;
}
.biz-rank-bar i {
  display: block; height: 100%; border-radius: 999px; background: var(--accent);
}

.biz-two-col { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }

.biz-score-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid var(--accent-border); font-size: 12px; font-weight: 600;
}

.biz-action-list { display: flex; flex-direction: column; gap: 8px; }
.biz-action-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  background: var(--glass-subtle); border: 1px solid var(--line);
  cursor: pointer; transition: border-color 0.15s ease;
}
.biz-action-row:hover { border-color: var(--accent-border); }
.biz-action-main { min-width: 0; flex: 1; }
.biz-action-title {
  font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.biz-action-sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.biz-action-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.biz-tip-foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2); line-height: 1.5;
}

/* =====================================================================
   PC 端独立桌面布局 (>= 900px)
   ===================================================================== */
@media (min-width: 900px) {
  .auth-card { padding: 34px 30px; }

  .app-shell { flex-direction: row; }
  .desktop-sidebar {
    display: flex; flex-direction: column; justify-content: space-between;
    width: 244px; flex-shrink: 0;
    position: sticky; top: 0; height: 100dvh;
    padding: 26px 16px 22px;
    background: var(--glass);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
  }
  .sb-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 28px; }
  .nav-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 11px 14px; border-radius: 14px; border: 1px solid transparent;
    background: transparent; color: var(--ink-2); font-size: 14.5px; font-weight: 500;
    cursor: pointer; text-align: left; transition: all 0.16s;
  }
  .nav-item:hover { background: var(--glass-subtle); color: var(--ink); }
  .nav-item.active {
    background: var(--glass-strong); color: var(--accent-deep);
    border-color: var(--accent-border);
    box-shadow: 0 4px 14px rgba(51, 42, 34, 0.04);
  }
  .nav-ic { font-size: 15px; width: 20px; text-align: center; }
  .sb-foot {
    padding-top: 14px; border-top: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 10px;
  }
  .doc-chip { display: flex; align-items: center; gap: 10px; }
  .doc-av {
    width: 36px; height: 36px; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent-deep);
    border: 1px solid var(--accent-border);
    display: grid; place-items: center; font-weight: 600; font-size: 15px; flex-shrink: 0;
  }
  .doc-name { font-size: 14px; font-weight: 600; }
  .doc-clinic { font-size: 12px; color: var(--ink-3); }

  .mobile-island { display: none; }
  .mobile-only { display: none !important; }

  .main-view {
    max-width: 880px; margin: 0 auto;
    padding: 34px 32px 60px;
  }
  .composer-wrap { padding: 14px 32px 28px; }
  .toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .search-input { max-width: 340px; font-size: 14px; }
  .metric-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .biz-two-col { grid-template-columns: 1fr 1fr; gap: 14px; }
  .slot-grid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
  .skin-grid { grid-template-columns: repeat(3, 1fr); }
  .msg-kv { grid-template-columns: repeat(3, 1fr); }
  .field input, .field select, .field textarea { font-size: 14.5px; }

  /* PC 端恢复居中玻璃弹窗 */
  .modal-mask { align-items: center; padding: 24px; }
  .modal-card {
    max-width: 580px; max-height: 84dvh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(34, 28, 22, 0.16);
  }
  .sheet-handle { display: none; }
}
