/* ===== 患者端登录后外壳：左侧边栏 + 顶部条（fixed 布局，内容区让出边距）=====
   配套 patient-shell.js。页面 body 会被加上 .pt-shell。
   仅登录后内页（My Cases / Messages / 申请 / 订单详情 / 支付 / 就诊人 / 个人中心）使用；
   公开首页保持营销横向顶栏，不用本外壳。与管理端 admin-shell 解耦。*/
:root { --pt-sidebar-w: 244px; --pt-topbar-h: 56px; }

body.pt-shell { padding-inline-start: var(--pt-sidebar-w); padding-top: var(--pt-topbar-h); }

/* ---------- 侧边栏（用逻辑属性，dir=rtl 时整栏自动镜像到右）---------- */
.pt-sidebar { position: fixed; inset-inline-start: 0; top: 0; bottom: 0; width: var(--pt-sidebar-w);
  background: #fff; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 18px 14px; z-index: 50; }
.pt-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
/* 官方院徽 logo（浅色侧栏/顶栏用彩色版，替换 S 占位）*/
.pt-logo-img { height: 32px; width: auto; display: block; }
.pt-flow-logo .pt-logo-img { height: 30px; }
.pt-logo .mark { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: 'Source Serif 4', serif; font-weight: 700; font-size: 17px; }
.pt-logo .name { font-family: 'Source Serif 4', serif; font-weight: 700; font-size: 15px; color: var(--brand-deep); line-height: 1.15; display: block; }
.pt-logo .sub { font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.3px; display: block; }

.pt-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.pt-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; }
.pt-nav a [data-lucide] { width: 18px; height: 18px; color: var(--text-muted); }
.pt-nav a:hover { background: var(--bg-muted); }
.pt-nav a.active { background: var(--brand-light); color: var(--brand-deep); font-weight: 600; }
.pt-nav a.active [data-lucide] { color: var(--brand-deep); }
.pt-nav a .badge { margin-inline-start: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }

/* ---------- 侧边栏底部账户区（参照 Twitter/Claude：账户/登出在此，主导航保持纯任务）---------- */
.pt-account { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.pt-account-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border: none;
  background: transparent; border-radius: 9px; cursor: pointer; text-align: start; font-family: inherit; }
.pt-account-btn:hover { background: var(--bg-muted); }
.pt-account-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-account-meta .nm { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-account-meta .em { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-account-caret { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

/* ---------- 顶部条 ---------- */
.pt-topbar { position: fixed; top: 0; inset-inline-start: var(--pt-sidebar-w); inset-inline-end: 0; height: var(--pt-topbar-h);
  background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; z-index: 49; }
.pt-topbar .pt-title { font-family: 'Source Serif 4', serif; font-weight: 600; font-size: 16px; color: var(--text); }
.pt-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-topbar .pt-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-topbar-right { display: flex; align-items: center; gap: 6px; }

/* 顶栏 ＋New Application（移到顶栏，与公开首页登录态一致；移动端收成纯 ＋ 图标）*/
.pt-newapp-top { display: flex; align-items: center; gap: 7px; padding: 8px 14px; margin-inline-end: 4px;
  background: var(--brand-deep); color: #fff; border-radius: 8px; font-weight: 600; font-size: 13.5px; text-decoration: none; transition: background 0.15s; }
.pt-newapp-top:hover { background: #001f50; }
.pt-newapp-top [data-lucide] { width: 17px; height: 17px; }

.pt-ibtn { position: relative; background: transparent; border: none; cursor: pointer; width: 38px; height: 38px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.pt-ibtn:hover { background: var(--bg-muted); color: var(--text); }
.pt-ibtn [data-lucide] { width: 19px; height: 19px; }
.pt-ibtn .dot { position: absolute; top: 8px; inset-inline-end: 9px; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; border: 1.5px solid #fff; }

.pt-pop { position: relative; }
.pt-lang-toggle { display: flex; align-items: center; gap: 6px; background: transparent; border: none; cursor: pointer;
  padding: 7px 10px; border-radius: 8px; color: var(--text); font-family: inherit; font-size: 13px; font-weight: 600; }
.pt-lang-toggle:hover { background: var(--bg-muted); }
.pt-lang-toggle [data-lucide] { width: 17px; height: 17px; color: var(--text-muted); }

.pt-menu { position: absolute; inset-inline-end: 0; top: 46px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-card); padding: 6px; min-width: 172px; display: none; z-index: 60; }
.pt-menu.open { display: block; }
/* 侧边栏底部账户菜单：向上弹出，对齐账户按钮 */
.pt-menu-up { top: auto; bottom: 56px; inset-inline: 0; }
.pt-menu button, .pt-menu a { display: flex; align-items: center; gap: 9px; width: 100%; text-align: start;
  background: transparent; border: none; padding: 9px 12px; border-radius: 7px; font-size: 13.5px; color: var(--text);
  cursor: pointer; font-family: inherit; text-decoration: none; }
.pt-menu button:hover, .pt-menu a:hover { background: var(--bg-muted); }
.pt-menu a [data-lucide] { width: 16px; height: 16px; color: var(--text-muted); }

.pt-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; font-family: 'Source Serif 4', serif; }

/* 铃铛通知弹层样式已抽到 components.css 的 .notif-bell*（notif-bell.js 共享，2026-06-16） */

/* ---------- 移动汉堡 ---------- */
.pt-burger { display: none; background: transparent; border: none; cursor: pointer; color: var(--text); padding: 6px; }
.pt-burger [data-lucide] { width: 22px; height: 22px; }
.pt-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 45; display: none; }
.pt-backdrop.open { display: block; }

/* ---------- 专注流程模式（PT_MODE='flow'：申请表单/支付等单动作页，无侧栏极简顶栏，减少中途逃逸）---------- */
body.pt-flow { padding-inline-start: 0; }
.pt-topbar.is-flow { inset-inline-start: 0; }
.pt-flow-logo { display: flex; align-items: center; text-decoration: none; }
.pt-flow-logo .mark { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: 'Source Serif 4', serif; font-weight: 700; font-size: 17px; }
.pt-flow-exit { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  color: var(--text-muted); text-decoration: none; font-size: 13.5px; font-weight: 600; transition: background 0.15s, color 0.15s; }
.pt-flow-exit:hover { background: var(--bg-muted); color: var(--text); }
.pt-flow-exit [data-lucide] { width: 18px; height: 18px; }
@media (max-width: 900px) { .pt-flow-exit span { display: none; } }

@media (max-width: 900px) {
  body.pt-shell { padding-inline-start: 0; }
  .pt-sidebar { transform: translateX(-100%); transition: transform 0.2s; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  .pt-sidebar.open { transform: translateX(0); }
  /* RTL：侧栏从右侧滑入（translateX 是物理方向，需显式镜像）*/
  [dir="rtl"] .pt-sidebar { transform: translateX(100%); }
  [dir="rtl"] .pt-sidebar.open { transform: translateX(0); }
  .pt-topbar { inset-inline-start: 0; padding: 0 12px; }
  .pt-burger { display: flex; }
  /* 顶栏 ＋New Application 收成纯方形 ＋ 图标（移动端高频主动作仍直达，不丢入口）*/
  .pt-newapp-top { padding: 0; width: 38px; height: 38px; justify-content: center; gap: 0; margin-inline-end: 0; }
  .pt-newapp-top span { display: none; }
  .pt-newapp-top [data-lucide] { width: 19px; height: 19px; }
  /* 语言切换收掉文字，只留地球图标，给标题腾空间 */
  .pt-lang-toggle span { display: none; }
  .pt-lang-toggle [data-lucide]:last-child { display: none; }
  /* 铃铛弹层不超出视口 */
  .pt-bell-menu { min-width: 0; width: calc(100vw - 24px); max-width: 340px; position: fixed; inset-inline-end: 12px; top: 52px; }
}
