/* 极简版 iframe 首页样式（左侧菜单 + 右侧 iframe） */
:root {
  --sidebar-width: 260px;
  --header-height: 56px;
  --brand-color: #00bdb9;
  --text-color: #333;
  --muted-color: #777;
  --hover-bg: #e9f6f6;
}

html, body { height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #fff; color: var(--text-color); }

/* 顶部栏 */
.header { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: var(--brand-color); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.header .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .3px; }

/* 布局 */
.layout { display: grid; grid-template-columns: var(--sidebar-width) 1fr; height: calc(100vh - var(--header-height)); }

/* 品牌徽标与系统名称 */
.header .logo-badge { display: inline-flex; align-items: center; justify-content: center; height: calc(var(--header-height) * 0.8); padding: 4px 6px; background: rgba(255,255,255,0.9); border-radius: 10px; border: 1px solid rgba(255,255,255,0.85); box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 0 0 2px rgba(255,255,255,0.5); }
.header .logo-badge.strong { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.18), 0 0 0 2px rgba(255,255,255,0.7); }
.header .logo-img { max-height: 100%; height: auto; width: auto; object-fit: contain; }
.header .system-name { font-size: 16px; font-weight: 600; letter-spacing: .3px; }

/* 顶部右侧操作区域 */
.header .actions { display: flex; align-items: center; gap: 12px; }
/* 通知包装，使下拉面板能锚定在铃铛附近 */
.notify-wrap { position: relative; display: inline-flex; align-items: center; gap: 6px; }
/* 通知下拉面板样式 */
.notify-dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; color: #333; list-style: none; margin: 0; padding: 8px 0; box-shadow: 0 6px 18px rgba(0,0,0,0.12); border-radius: 8px; min-width: 260px; display: none; z-index: 100; }
.notify-dropdown.show { display: block; }
.notify-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
.notify-header .title { font-weight: 600; }
.notify-header .clear-btn { background: transparent; border: 0; color: #00bdb9; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.notify-header .clear-btn:hover { background: #e9f6f6; }
.notify-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.notify-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; font-size: 14px; }
.notify-item.unread { background: #f9fefc; }
.notify-item:hover { background: #f5f5f5; }
.notify-item .notify-text { color: #333; }
.notify-item .notify-time { color: #777; font-size: 12px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff; border: 0; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,0.25); }
.icon-btn .badge { position: absolute; top: 2px; right: 2px; background: #ff4d4f; color: #fff; font-size: 11px; border-radius: 999px; height: 16px; min-width: 16px; padding: 0 4px; display: flex; align-items: center; justify-content: center; }
.header .actions .action-text { color: #fff; font-size: 14px; opacity: .95; }
/* 新增：退出系统文字按钮 */
.text-btn { height: 34px; padding: 0 12px; border-radius: 18px; background: rgba(255,255,255,0.15); color: #fff; border: 0; cursor: pointer; font-size: 14px; }
.text-btn:hover { background: rgba(255,255,255,0.25); }
/* 新增：通知铃铛闪烁动画 */
.icon-btn.blink .icon { animation: bellBlink 1.2s ease-in-out infinite; transform-origin: 50% 0%; }
.icon-btn.blink .badge { animation: badgePulse 1.2s ease-in-out infinite; }
@keyframes bellBlink {
  0% { transform: rotate(0deg); filter: brightness(1); }
  20% { transform: rotate(-15deg); filter: brightness(1.15); }
  40% { transform: rotate(12deg); filter: brightness(1); }
  60% { transform: rotate(-10deg); filter: brightness(1.15); }
  80% { transform: rotate(8deg); filter: brightness(1); }
  100% { transform: rotate(0deg); filter: brightness(1); }
}
@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* 用户下拉菜单 */
.user-dropdown { position: relative; }
.user-trigger { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 0; color: #fff; cursor: pointer; padding: 4px 8px; border-radius: 16px; }
.user-trigger:hover { background: rgba(255,255,255,0.15); }
.user-trigger .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.6); }
.user-trigger .caret { font-size: 12px; opacity: .9; }
.menu-dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; color: #333; list-style: none; margin: 0; padding: 6px 0; box-shadow: 0 6px 18px rgba(0,0,0,0.12); border-radius: 8px; min-width: 160px; display: none; z-index: 100; }
.menu-dropdown.show { display: block; }
.menu-dropdown li { margin: 0; }
.menu-dropdown a, .menu-dropdown button { display: block; width: 100%; padding: 10px 12px; text-align: left; color: #333; text-decoration: none; background: transparent; border: 0; cursor: pointer; font-size: 14px; }
.menu-dropdown a:hover, .menu-dropdown button:hover { background: #f5f5f5; }

/* 侧栏与菜单 */
.sidebar { background: #f7f7f7; border-right: 1px solid #e5e5e5; overflow: auto; }
.sidebar h3 { display: none; }
.menu { list-style: none; margin: 0; padding: 8px 0; }
.menu li { margin: 0; }
.menu a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; color: var(--text-color); text-decoration: none; font-size: 16px; text-align: center; }
.menu a:hover { background: var(--hover-bg); }
.menu a .icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.menu a .text { flex: 0 1 auto; text-align: center; white-space: nowrap; }

/* 主区 */
.main { position: relative; }
iframe#main { width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 900px) { :root { --sidebar-width: 200px; } }

/* iframe模式嵌入的页面（业务模块）统一样式修正，可供页面内脚本注入使用 */
.embed-iframe-hide-chrome {}
.embed-iframe-hide-chrome header,
.embed-iframe-hide-chrome #sidebar,
.embed-iframe-hide-chrome #sidebar-container,
.embed-iframe-hide-chrome #top-nav,
.embed-iframe-hide-chrome nav.fixed.bottom-0 { display: none !important; }
.embed-iframe-hide-chrome body { margin: 0 !important; padding: 0 !important; }
.embed-iframe-hide-chrome .container,
.embed-iframe-hide-chrome .page-container,
.embed-iframe-hide-chrome .caregiver-management-container { margin-top: 0 !important; padding-top: 12px !important; }