/* ═══════════════════════════════════════════════════════════
   VaultZero — Style
   ═══════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #F5F7FA;
  --bg-alt: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-hover: #F0F3F7;
  --border: #E5EAF0;
  --text: #1B2733;
  --text-muted: #5D6B7D;
  --text-dim: #8A94A6;
  --accent: #10B981;
  --accent-hover: #0FA368;
  --accent-dim: #E6F7F0;
  --green: #0E8A5F;
  --green-bg: #E6F7F0;
  --red: #EF4444;
  --red-bg: #FDECEC;
  --yellow: #B45309;
  --yellow-bg: #FDF3E3;
  --orange: #E17055;
  --blue: #2B6FE0;
  --purple: #7C3AED;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 16px rgba(27, 37, 52, 0.06);
  --shadow-lg: 0 12px 32px rgba(27, 37, 52, 0.08);
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-w: 260px;
}

html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); }
input, button, textarea, select { font-family: inherit; font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ───── Loading ─────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ───── Auth 登录页（亮色主题，作用域限定 #auth-view） ─── */
#auth-view {
  /* VaultZero Light 设计令牌（与 Ardot 设计稿一致） */
  --bg: #F5F7FA;
  --bg-alt: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-hover: #F0F3F7;
  --border: #E5EAF0;
  --text: #1B2534;
  --text-muted: #5D6B7D;
  --text-dim: #98A5B4;
  --accent: #10B981;
  --accent-hover: #0FA368;
  --accent-dim: #E6F7F0;
  --green: #0E8A5F;
  --green-bg: #E6F7F0;
  --red: #EF4444;
  --red-bg: #FDECEC;
  --yellow: #B45309;
  --yellow-bg: #FDF3E3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(27, 37, 52, 0.08);
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}
.auth-shell { display: flex; min-height: 100vh; width: 100%; }

/* 左侧品牌区 */
.auth-brand {
  flex: 0 0 57%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #10B981 0%, #0E8A5F 55%, #0A6B4A 100%);
  color: #FFFFFF;
  padding: 64px;
}
.auth-brand-inner {
  max-width: 460px; width: 100%;
  display: flex; flex-direction: column;
  min-height: 480px;
}
.auth-brand-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; }
.auth-logo-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-logo-name { font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }
.auth-brand-title { font-size: 40px; line-height: 1.25; font-weight: 700; margin-bottom: 16px; }
.auth-brand-sub {
  font-size: 15px; line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 40px; max-width: 400px;
}
.auth-brand-features { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 48px; }
.auth-brand-features li {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: rgba(255, 255, 255, 0.92);
}
.auth-brand-check {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-brand-footer { margin-top: auto; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }

/* 右侧表单区 */
.auth-panel {
  flex: 1;
  background: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
}
.auth-panel-inner { width: 100%; max-width: 400px; }
.auth-mobile-logo { display: none; align-items: center; gap: 10px; justify-content: center; margin-bottom: 32px; }
.auth-mobile-logo .auth-logo-mark { background: #E6F7F0; border-color: #C9EEDF; }
.auth-mobile-logo .auth-logo-name { color: #1B2534; }

/* 表单排版 */
.auth-form-title { font-size: 24px; font-weight: 700; color: #1B2534; margin-bottom: 6px; }
.auth-form-sub { font-size: 13.5px; color: #5D6B7D; margin-bottom: 28px; }
#auth-view .form-group { margin-bottom: 18px; }
#auth-view .form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: #5D6B7D; margin-bottom: 6px;
}

/* 输入框：44px 高、10px 圆角、浅底、聚焦青绿描边 */
#auth-view input[type="text"], #auth-view input[type="url"],
#auth-view input[type="email"], #auth-view input[type="password"] {
  height: 44px; padding: 0 14px;
  background: #F8F9FC;
  border: 1px solid #E5EAF0; border-radius: 10px;
  color: #1B2534; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
#auth-view input::placeholder { color: #98A5B4; }
#auth-view input:focus {
  border-color: #10B981; background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}
#auth-view input.input-error {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 密码可见性切换按钮 */
#auth-view .password-input-wrap { display: flex; }
#auth-view .password-input-wrap input { flex: 1; border-radius: 10px 0 0 10px; }
#auth-view .password-input-wrap .btn-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border: 1px solid #E5EAF0; border-left: none;
  border-radius: 0 10px 10px 0;
  background: #F8F9FC; color: #98A5B4;
}
#auth-view .password-input-wrap .btn-icon:hover { background: #F0F3F7; color: #5D6B7D; }
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle.visible .icon-eye { display: none; }
.pw-toggle.visible .icon-eye-off { display: block; }

/* 主按钮：青绿、44px 高、加载态 */
#auth-view .btn-primary {
  height: 44px; border-radius: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.3px;
  background: #10B981;
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.28);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
#auth-view .btn-primary:hover { background: #0FA368; transform: translateY(-1px); }
#auth-view .btn-primary:active { transform: translateY(0); box-shadow: 0 3px 8px rgba(16, 185, 129, 0.24); }
#auth-view .btn-primary.is-loading {
  pointer-events: none; color: transparent; position: relative; opacity: 0.9;
}
#auth-view .btn-primary.is-loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #FFFFFF;
  animation: spin 0.8s linear infinite;
}
#auth-view .btn-secondary {
  height: 38px; border-radius: 10px;
  background: #FFFFFF; color: #1B2534; border: 1px solid #E5EAF0;
}

/* 错误/警告横幅（01a 解锁失败 / 01b 安全警告样式） */
.auth-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500; line-height: 1.5;
  margin-bottom: 16px;
}
.auth-alert::before {
  content: ''; width: 18px; height: 18px; flex-shrink: 0;
  background: no-repeat center / contain;
}
.auth-alert.error { background: #FDECEC; color: #DC2626; }
.auth-alert.error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23EF4444' stroke-width='2'/%3E%3Cpath d='M12 8v4' stroke='%23EF4444' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M12 16h.01' stroke='%23EF4444' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.auth-alert.warn { background: #FDF3E3; color: #B45309; }
.auth-alert.warn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z' stroke='%23B45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 8v4' stroke='%23B45309' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M12 15.5h.01' stroke='%23B45309' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
/* 剩余次数 / 锁定提示小字 */
.auth-hint { font-size: 12px; color: #EF4444; margin: -6px 2px 16px; }
.auth-hint.warn { color: #B45309; }

/* 注册 / 激活表单的错误提示同样用横幅样式 */
#auth-view .form-error {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  background: #FDECEC; color: #DC2626; font-size: 13px; font-weight: 500;
}
#auth-view .form-error::before {
  content: ''; width: 18px; height: 18px; flex-shrink: 0;
  background: no-repeat center / contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Ccircle cx='12' cy='12' r='9' stroke='%23EF4444' stroke-width='2'/%3E%3Cpath d='M12 8v4' stroke='%23EF4444' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M12 16h.01' stroke='%23EF4444' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* 底部切换链接 */
#auth-view .auth-toggle { margin-top: 20px; font-size: 13px; color: #98A5B4; text-align: center; }
#auth-view .auth-toggle a { color: #0E8A5F; font-weight: 500; }
#auth-view .auth-toggle a:hover { color: #0FA368; }

/* 强度条适配亮色 */
#auth-view .strength-bar { background: #E5EAF0; }

/* 响应式：≤960px 隐藏品牌区，表单全宽居中 */
@media (max-width: 960px) {
  .auth-brand { display: none; }
  .auth-panel { padding: 40px 24px; }
  .auth-mobile-logo { display: flex; }
  #auth-view { min-height: 100vh; }
}
@media (max-width: 480px) {
  .auth-panel { padding: 28px 16px; }
  .auth-form-title { font-size: 22px; }
}

/* ───── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
input[type="text"], input[type="url"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; padding: 10px 14px;
  background: #F8F9FC; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent); background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
input::placeholder { color: var(--text-dim); }
textarea { resize: vertical; }
.password-input-wrap { display: flex; gap: 4px; }
.password-input-wrap input { flex: 1; }
.password-input-wrap .btn-icon { flex-shrink: 0; }

.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 8px;
  border: none; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--accent); color: white; justify-content: center; width: 100%;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-dim); }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-muted); cursor: pointer;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }

.form-error { color: var(--red); font-size: 13px; margin-top: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.form-actions .btn-primary { width: auto; }

/* ───── Sidebar ─────────────────────────────────────────── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: #FFFFFF; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100;
}

/* Header: logo + name */
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 16px;
}
.sidebar-logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-header h2 {
  font-size: 18px; font-weight: 600; color: var(--text);
}

/* Search */
.sidebar-search { padding: 4px 16px 8px; }
.sidebar-search input {
  height: 36px; padding: 0 12px;
  background: #F5F7F9; border-radius: 10px;
  border: 1px solid transparent;
}
.sidebar-search input:focus {
  background: #FFFFFF; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Nav menu */
.sidebar-menu { flex: 1; overflow-y: auto; padding: 4px 8px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 40px; padding: 0 12px;
  background: transparent; border: none; border-radius: 10px;
  color: var(--text-muted); font-size: 14px; cursor: pointer;
  transition: all 0.15s; text-align: left;
}
.menu-item:hover { background: var(--bg-hover); color: var(--text); }
.menu-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 500; }
.menu-item.active svg { color: var(--accent); }

/* Admin section label */
.sidebar-admin-label {
  font-size: 11px; color: var(--text-dim); font-weight: 500;
  padding: 16px 16px 4px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* Sidebar footer */
.sidebar-footer { padding: 12px 8px; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* User info row */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s;
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.role-badge {
  display: inline-block;
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-dim); color: var(--green); font-weight: 600;
  margin-top: 2px;
}
.sidebar-admin-links { padding: 0 8px; }
.sidebar-admin-links .menu-item { height: 36px; font-size: 13px; border-radius: 8px; }
.logout-btn { color: var(--red); }
.logout-btn:hover { background: var(--red-bg) !important; color: var(--red) !important; }

/* ───── Main Content ────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w); min-height: 100vh;
  display: flex;
}
.content-view {
  flex: 1; padding: 32px 32px 32px 32px;
}
.content-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.content-header h2 { font-size: 24px; font-weight: 700; }
.content-header .btn-primary { width: auto; }

/* ───── Section Header（板块标题：绿竖条 + 标题 + 副标题） ── */
.section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.section-header::before {
  content: ''; width: 3px; height: 18px;
  background: var(--accent); border-radius: 2px; flex-shrink: 0;
}
.section-header h3 {
  font-size: 15px; font-weight: 600; color: var(--text);
}
.section-header .section-sub {
  font-size: 13px; color: var(--text-muted); margin-left: 4px;
}
.section-header .section-spacer { flex: 1; }

/* ───── Stat Cards（统计卡） ────────────────────────────── */
.stat-cards {
  display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 180px;
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon.green { background: var(--accent-dim); color: var(--green); }
.stat-card-icon.red { background: var(--red-bg); color: var(--red); }
.stat-card-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-card-icon.blue { background: rgba(43, 111, 224, 0.1); color: var(--blue); }
.stat-card-icon.purple { background: rgba(124, 58, 237, 0.1); color: var(--purple); }
.stat-card-num {
  font-size: 20px; font-weight: 600; color: var(--text);
  line-height: 1.2;
}
.stat-card-label {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

/* ───── Card Wrapper（通用卡片容器） ────────────────────── */
.vz-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  margin-bottom: 16px;
}
.vz-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.vz-card-header h3 {
  font-size: 15px; font-weight: 600; color: var(--text);
}

/* ───── Profile View（用户信息页） ─────────────────────── */
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-size: 24px; font-weight: 600;
  flex-shrink: 0;
}
.profile-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.profile-header h2 { font-size: 20px; font-weight: 600; }
.profile-header p { font-size: 13px; color: var(--text-muted); }
.profile-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-row .profile-label { font-size: 13px; color: var(--text-muted); }
.profile-row .profile-value { font-size: 14px; color: var(--text); font-weight: 500; }

/* ───── Page Title Block（页面标题 + 副标题） ──────────── */
.page-title-block { display: flex; flex-direction: column; gap: 4px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); font-weight: 400; }

/* ───── Teams（对齐设计稿 05-团队） ─────────────────────── */
/* Tab 切换栏 */
.teams-tab-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.team-tab {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border);
  background: #FFFFFF; color: var(--text-muted);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.team-tab:hover { border-color: var(--text-dim); }
.team-tab.active {
  background: var(--accent-dim); border-color: transparent;
  color: var(--green); font-weight: 600;
}
.team-tab-count {
  min-width: 15px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--bg); color: var(--text-muted);
  font-size: 11px; font-weight: 500;
}
.team-tab.active .team-tab-count { background: var(--green); color: #FFFFFF; }
.teams-tab-spacer { flex: 1; }
.teams-tab-hint { font-size: 12px; color: var(--text-dim); }

/* 板块标题行：17px SemiBold 标题 + 右侧说明 */
.team-block-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 12px;
}
.team-block-header:first-child { margin-top: 0; }
.team-block-header h3 {
  font-size: 17px; font-weight: 600; color: var(--text);
}
.team-block-desc { font-size: 13px; color: var(--text-dim); }

/* 卡片行：大卡两列 / 小卡三列 */
.team-card-row {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.team-card-row.three-col { grid-template-columns: repeat(3, 1fr); }

/* 大团队卡（我创建/我所在）548×180 */
.team-card-lg {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  display: flex; align-items: center; gap: 20px;
  min-height: 180px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.team-card-lg:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.team-icon-lg {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #FFFFFF;
}
.team-card-lg .team-info { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.team-name-row { display: flex; align-items: center; gap: 10px; }
.team-name-row h4 {
  font-size: 17px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-role-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  font-weight: 500; flex-shrink: 0;
}
.team-role-badge.green { background: var(--accent-dim); color: var(--green); }
.team-role-badge.blue { background: #EBF1FF; color: var(--blue); }
.team-role-badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.team-role-badge.gray { background: var(--bg); color: var(--text-muted); }
.team-card-meta {
  font-size: 13px; color: var(--text-dim); margin-top: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-card-bottom {
  margin-top: auto; padding-top: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
/* 成员头像堆叠 */
.team-avatar-stack { display: flex; align-items: center; }
.team-avatar-stack .stack-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-size: 11px; font-weight: 600;
  margin-left: -8px;
}
.team-avatar-stack .stack-avatar:first-child { margin-left: 0; }
.team-avatar-stack .stack-more {
  background: var(--bg-hover); color: var(--text-muted); font-size: 11px;
}
/* 管理按钮（绿色实心 110×32 r8） */
.team-manage-btn {
  width: 110px; height: 32px; border: none; border-radius: 8px;
  background: var(--accent); color: #FFFFFF;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s; flex-shrink: 0;
}
.team-manage-btn:hover { background: var(--accent-hover); }
.team-manage-btn.ghost {
  background: #FFFFFF; color: var(--accent);
  border: 1px solid var(--accent);
}
.team-manage-btn.ghost:hover { background: var(--accent-dim); }

/* 小团队卡（全部团队）358×150 */
.team-card-sm {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px;
  display: flex; align-items: center; gap: 14px;
  min-height: 150px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.team-card-sm:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.team-card-sm.no-click { cursor: default; }
.team-card-sm.no-click:hover { border-color: var(--border); box-shadow: none; }
.team-icon-sm {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #FFFFFF;
}
.team-card-sm .team-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.team-card-sm .team-info h4 {
  font-size: 15px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-card-sm .team-desc {
  font-size: 12px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-card-sm .team-stats { font-size: 12px; color: var(--text-muted); }
.team-join-btn {
  align-self: flex-start;
  height: 29px; padding: 0 10px; border-radius: 8px;
  background: #FFFFFF; border: 1px solid var(--accent);
  color: var(--accent); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.team-join-btn:hover { background: var(--accent-dim); }
.team-status-text { font-size: 12px; font-weight: 500; }

/* 待审批申请列表卡 */
.team-pending-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.team-pending-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 68px; padding: 12px 24px;
}
.team-pending-row + .team-pending-row { border-top: 1px solid var(--border); }
.pending-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-size: 14px; font-weight: 500; flex-shrink: 0;
}
.pending-info { flex: 1; min-width: 0; }
.pending-info .pending-name {
  font-size: 15px; font-weight: 600; color: var(--text);
}
.pending-info .pending-sub {
  font-size: 13px; color: var(--text-muted); margin-top: 3px;
}
.pending-badge {
  font-size: 12px; font-weight: 500; padding: 4px 10px;
  border-radius: 6px; background: var(--yellow-bg); color: var(--yellow);
  flex-shrink: 0;
}
.pending-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pending-approve-btn {
  width: 54px; height: 32px; border: none; border-radius: 8px;
  background: var(--accent); color: #FFFFFF;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s;
}
.pending-approve-btn:hover { background: var(--accent-hover); }
.pending-reject-btn {
  width: 54px; height: 32px; border: 1px solid var(--border); border-radius: 8px;
  background: #FFFFFF; color: var(--text-muted);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.pending-reject-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ───── Team Detail（对齐设计稿 05-团队详情） ─────────── */
.team-back-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.team-back-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: #FFFFFF; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.team-back-btn:hover { background: var(--bg-hover); color: var(--text); }
.team-back-text { font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; }
.team-back-text:hover { color: var(--text); }

/* 团队头部卡 */
.team-header-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.team-header-card .team-info { flex: 1; min-width: 0; }
.team-header-name-row { display: flex; align-items: center; gap: 8px; }
.team-header-name {
  font-size: 20px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-header-stats { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* 双栏内容 */
.team-detail-cols { display: flex; gap: 16px; align-items: flex-start; }
.team-side-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px;
  margin-bottom: 16px;
}
.team-side-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.team-side-card-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; margin-bottom: 12px; }
.team-members-col { flex: 0 0 400px; }
.team-main-col { flex: 1; min-width: 0; }

/* 成员行 */
.team-member-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 6px 0;
}
.team-member-row + .team-member-row { border-top: 1px solid var(--bg-hover); }
.member-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.team-member-row .member-info { flex: 1; min-width: 60px; }
.team-member-row .member-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-member-row .member-email {
  font-size: 11px; color: var(--text-dim); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member-role-badge {
  font-size: 11px; font-weight: 500; padding: 4px 8px;
  border-radius: 999px; flex-shrink: 0;
}
.member-role-badge.green { background: var(--accent-dim); color: var(--green); }
.member-role-badge.blue { background: #EBF1FF; color: var(--blue); }
.member-role-badge.gray { background: var(--bg); color: var(--text-muted); }

/* 成员角色下拉框 */
.member-role-select {
  font-size: 12px; padding: 3px 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text);
  flex-shrink: 0; cursor: pointer;
  max-width: 72px; width: 72px;
}
.member-remove-btn {
  width: auto !important; padding: 0 10px !important;
  color: var(--red) !important; border-color: var(--red) !important;
  flex-shrink: 0;
}

/* 共享条目行 */
.team-entry-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 6px 0;
  cursor: pointer; border-radius: 6px; margin: 0 -4px; padding-left: 4px; padding-right: 4px;
  transition: background 0.15s;
}
.team-entry-row:hover { background: var(--bg-hover); }
.team-entry-row + .team-entry-row { border-top: 1px solid var(--bg-hover); }
.team-entry-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--text); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.team-entry-row .entry-info { flex: 1; min-width: 0; }
.team-entry-row .entry-title {
  font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-entry-row .entry-sub {
  font-size: 11px; color: var(--text-dim); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 邀请行 / 危险操作 */
.team-invite-row { display: flex; gap: 8px; margin-top: 12px; }
.team-invite-row select { flex: 1; }
.team-disband-btn {
  width: auto; padding: 0 16px;
  background: #FFFFFF; color: var(--red); border: 1px solid var(--red);
}
.team-disband-btn:hover { background: var(--red-bg); }

/* 响应式补充 */
@media (max-width: 1100px) {
  .team-card-row { grid-template-columns: 1fr; }
  .team-card-row.three-col { grid-template-columns: repeat(2, 1fr); }
  .team-detail-cols { flex-direction: column; }
  .team-members-col { flex: none; width: 100%; }
}
@media (max-width: 768px) {
  .team-card-row.three-col { grid-template-columns: 1fr; }
  .team-block-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .teams-tab-hint { display: none; }
  .team-card-lg, .team-card-sm { flex-direction: column; align-items: flex-start; }
  .pending-actions { flex-direction: column; }
}

/* ───── Entry List ──────────────────────────────────────── */
.entry-list { display: flex; flex-direction: column; gap: 8px; }
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; }
.empty-state p { font-size: 15px; }
.empty-sub { font-size: 13px; color: var(--text-dim); margin-top: 8px; }

.entry-item {
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px; border-radius: 14px;
  cursor: pointer; transition: all 0.15s;
  background: var(--bg-card); border: 1px solid transparent;
  min-height: 68px;
}
.entry-item:hover { border-color: var(--border); box-shadow: var(--shadow); }
/* 回收站条目：点不开详情，去掉手型光标与 hover 反馈，避免误导 */
.trash-item { cursor: default; }
.trash-item:hover { border-color: transparent; box-shadow: none; }
.entry-item.selected { border-color: var(--accent); background: var(--accent-dim); }
.entry-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--accent); flex-shrink: 0;
}
.entry-item.selected .entry-icon { background: #FFFFFF; }
.entry-info { flex: 1; min-width: 0; }
.entry-info h4 { font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-info p { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 副标题行：账号 + 网址。列表不再展示备注（备注只出现在详情页）。
   刻意拆成两个独立 span：窄屏可以只隐藏账号而不影响网址。 */
.entry-sub-line { display: flex; align-items: center; min-width: 0; }
.entry-sub-line .entry-sub-user,
.entry-sub-line .entry-sub-url {
  font-size: 12px; color: var(--text-muted);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 16px;
}
.entry-sub-line .entry-sub-user { flex: 0 1 auto; max-width: 45%; }
.entry-sub-line .entry-sub-user[hidden] { display: none; }
.entry-sub-line .entry-sub-url { flex: 1 1 auto; }
.entry-sub-line .entry-sub-user:not([hidden]) + .entry-sub-url::before { content: ' · '; }
.entry-sub-line .entry-sub-url:empty { display: none; }
/* 右侧元信息行：备注在左、标签靠右，整体右对齐，间隔均匀
   注意 flex-shrink 必须是 1 —— 曾经写成 0，备注一长就把左侧标题挤到看不见 */
.entry-meta {
  display: flex; flex-direction: row; align-items: center;
  gap: 8px; flex-shrink: 1; min-width: 0;
}
.entry-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-dim); color: var(--green);
}

/* ───── Side Panel (Entry Detail) ───────────────────────── */
.main-content.panel-open .content-view { max-width: none; flex: 1; min-width: 0; }
.side-panel {
  width: 380px; border-left: 1px solid var(--border);
  background: var(--bg-alt); display: flex; flex-direction: column;
}

/* ───── Detail Panel（宽版条目详情，卡片堆叠，对齐设计稿 03） ── */
.detail-panel {
  flex: 1; min-width: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
}
.detail-panel-scroll {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
/* 详情打开时，保险库列表收缩为 320px 独立列（设计稿 40:2） */
.main-content:has(.detail-panel:not(.hidden)) #vault-view {
  flex: 0 0 320px;
  background: #FFFFFF;
  border-right: 1px solid var(--border);
  padding: 0 20px;
}
.main-content:has(.detail-panel:not(.hidden)) #vault-view .vault-actions { display: none; }
.main-content:has(.detail-panel:not(.hidden)) #vault-view .content-header {
  margin-bottom: 12px; padding-top: 20px;
}
.main-content:has(.detail-panel:not(.hidden)) #vault-view .content-header h2 { font-size: 18px; }

/* 详情卡片 */
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.detail-card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
}
/* 头部卡：图标 + 标题 + 收藏 */
.detail-header-row {
  display: flex; align-items: center; gap: 12px;
}
.detail-back-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-hover); color: var(--text-muted); flex-shrink: 0;
}
.detail-back-btn:hover { background: var(--border); color: var(--text); }
/* 图标：改为浅色底 + 稍小尺寸，与标题的视觉重量更均衡（原来深色方块过于抢眼） */
.detail-entry-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; flex-shrink: 0;
}
.detail-title-block { flex: 1; min-width: 0; }
.detail-title-block h3 {
  font-size: 17px; font-weight: 600; color: var(--text);
  line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 标签行 */
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tag {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: var(--accent-dim); color: var(--green);
}
.detail-tag:nth-child(2) { background: #EBF0FE; color: var(--blue); }
.detail-tag:nth-child(3) { background: #FEF3E2; color: var(--yellow); }
/* 操作按钮行 */
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-action-btn { padding: 9px 14px; font-size: 13px; border-radius: 10px; }
.detail-danger-btn {
  padding: 9px 14px; border-radius: 10px; border: none;
  background: #FDE9E9; color: var(--red);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.detail-danger-btn:hover { background: #FBD5D5; }
/* 字段行（登录信息卡内） */
.detail-field-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 32px;
}
.detail-field-row + .detail-field-row { margin-top: 12px; }
.detail-field-row .field-label {
  flex: 0 0 72px;
  font-size: 12px; font-weight: 500; color: #98A6B4;
}
.detail-field-row .field-value {
  flex: 1; min-width: 0;
  font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
}
.detail-field-row .field-value.password-masked { font-family: inherit; letter-spacing: 2px; }
.field-icon-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-hover); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.field-icon-btn:hover { background: var(--border); color: var(--text); }
/* 描述 */
.detail-notes { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0; word-break: break-word; }
.detail-perm-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 28px; font-size: 13px;
}
.detail-perm-name { flex: 1; min-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 权限级别下拉：覆盖全局 select 的 width:100%，避免挤占名称空间 */
.perm-level-select {
  width: 92px; max-width: 92px; flex-shrink: 0;
  font-size: 12px; padding: 3px 6px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text);
}
.detail-perm-badge {
  font-size: 10px; padding: 1px 8px; border-radius: 999px;
  background: var(--accent-dim); color: var(--green); font-weight: 600;
  flex-shrink: 0;
}
.detail-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; min-height: 17px;
}
.detail-meta-row .meta-label { color: var(--text-muted); }
.detail-meta-row .meta-value { color: var(--text); }

.panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px; border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 15px; font-weight: 600; flex: 1; color: var(--text); }
.panel-actions { display: flex; gap: 4px; }
.panel-content { flex: 1; overflow-y: auto; padding: 20px 16px; }
.detail-field { margin-bottom: 20px; }
.detail-field label { display: block; font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.detail-field .detail-value {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
}
.detail-field .detail-value span {
  font-size: 14px; font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; color: var(--text);
}
.password-masked { font-family: inherit !important; letter-spacing: 2px; }
.detail-permissions { margin-top: 24px; }
.detail-permissions h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.perm-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px;
}
.perm-item:hover { background: var(--bg-hover); }
.perm-item .perm-badge {
  font-size: 11px; padding: 1px 6px; border-radius: 6px;
  background: var(--accent-dim); color: var(--accent-hover);
}

/* ───── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(27, 37, 52, 0.3);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  width: 100%; max-width: 460px; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 600px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 16px; }
.close-modal { margin: -8px; }

/* ───── Generator ───────────────────────────────────────── */
.generator-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; max-width: 500px;
  box-shadow: var(--shadow);
}
.generator-output {
  display: flex; gap: 8px; margin-bottom: 20px;
}
.generator-output input {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 16px; letter-spacing: 1px;
}
.generator-options .form-group { margin-bottom: 20px; }
.gen-checkboxes { display: flex; flex-wrap: wrap; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.checkbox-label input { width: auto; }

/* ───── Strength Meter ──────────────────────────────────── */
.strength-bar {
  height: 4px; background: var(--bg); border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.strength-fill { height: 100%; width: 0; border-radius: 2px; transition: all 0.3s; }
.strength-fill.very-weak { width: 20%; background: var(--red); }
.strength-fill.weak { width: 40%; background: var(--orange); }
.strength-fill.fair { width: 60%; background: var(--yellow); }
.strength-fill.strong { width: 80%; background: var(--green); }
.strength-fill.very-strong { width: 100%; background: var(--green); }

/* ───── Share Type Toggle ───────────────────────────────── */
.share-type-toggle { display: flex; gap: 0; }
.share-type-toggle .toggle-btn {
  padding: 8px 16px; background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  transition: all 0.15s;
}
.share-type-toggle .toggle-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.share-type-toggle .toggle-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.share-type-toggle .toggle-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ───── Admin Tables ────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.admin-table th { color: var(--text-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.admin-table tr:hover td { background: var(--bg-hover); }
.status-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500;
}
.status-badge.active { background: var(--green-bg); color: var(--green); }
.status-badge.disabled { background: var(--red-bg); color: var(--red); }

/* ───── Health Report ───────────────────────────────────── */
.health-summary { margin-bottom: 24px; }
.health-score {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 20px 28px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.health-score .score-number { font-size: 36px; font-weight: 700; }
.health-score .score-label { font-size: 14px; color: var(--text-muted); }
.health-item {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border); margin-bottom: 8px;
  box-shadow: var(--shadow); transition: all 0.15s; cursor: pointer;
}
.health-item:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
.health-item .health-icon { font-size: 20px; }
.health-item .health-info { flex: 1; }
.health-item .health-info h4 { font-size: 14px; font-weight: 500; color: var(--text); }
.health-item .health-info p { font-size: 12px; color: var(--text-muted); }
.health-item .health-action { font-size: 12px; font-weight: 500; }

/* ───── Audit Log ───────────────────────────────────────── */
.audit-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.audit-item .audit-action { color: var(--accent); font-weight: 500; }
.audit-item .audit-time { color: var(--text-dim); font-size: 12px; }

/* ───── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ───── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  padding: 12px 20px; border-radius: 10px;
  font-size: 14px; animation: slideUp 0.3s ease;
  max-width: 360px; box-shadow: var(--shadow-lg); font-weight: 500;
}
.toast-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--accent); }
.toast-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.toast-info { background: var(--accent-dim); color: var(--accent-hover); border: 1px solid var(--accent); }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ───── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 56px; }
  .sidebar-header { padding: 20px 0 16px; justify-content: center; }
  .sidebar-header h2, .sidebar-user-info, .sidebar-search, .sidebar-admin-label,
  .menu-item span, .role-badge, .sidebar-admin-links span,
  .sidebar-divider, .sidebar-admin-label { display: none; }
  .sidebar-menu { padding: 4px; }
  .menu-item { justify-content: center; padding: 0; height: 40px; }
  .sidebar-user { justify-content: center; padding: 8px 4px; }
  .sidebar-footer { padding: 8px 0; }
  .main-content { margin-left: 56px; }
  .content-view { padding: 16px; }
  .side-panel { width: 100%; position: fixed; inset: 0; z-index: 200; }
  .detail-panel { position: fixed; inset: 0 0 0 56px; z-index: 200; background: var(--bg); }
  .main-content:has(.detail-panel:not(.hidden)) #vault-view { flex: 0 0 56px; padding: 0 8px; }
  .main-content:has(.detail-panel:not(.hidden)) #vault-view .content-header { display: none; }
  .detail-actions { flex-wrap: wrap; }
  .stat-cards { flex-direction: column; }
  .stat-card { min-width: auto; }
  .content-header h2 { font-size: 20px; }
  .entry-item { padding: 0 12px; min-height: 60px; }
  .entry-icon { width: 36px; height: 36px; }
}

/* ───── Inline Password Generator ───────────────────────── */
.pw-gen-settings {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.pw-gen-settings .gen-row { margin-bottom: 8px; }
.pw-gen-settings .gen-row:last-child { margin-bottom: 0; }
.pw-gen-settings .gen-row label {
  font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 4px;
}
.pw-gen-settings .gen-chars {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
}
.pw-gen-settings .gen-chars .checkbox-label { font-size: 12px; }
.pw-gen-settings input[type="range"] {
  width: 100%; height: 4px; -webkit-appearance: none;
  background: var(--border); border-radius: 2px; outline: none;
}
.pw-gen-settings input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   防横向溢出 —— 保证移动端只纵向滚动
   ───────────────────────────────────────────────────────────
   flex 子项的 min-width 默认是 auto（= min-content），
   所以内部的超长文本（URL / 密码 / 备注 / 标题）会把整个
   flex 容器连同子元素一起撑宽，页面就出现横向滚动条。
   下面的规则只改布局约束，不影响任何业务逻辑。
   ═══════════════════════════════════════════════════════════ */
html, body { overflow-x: hidden; }

/* 允许收缩的 flex / grid 子项 */
.content-view,
.auth-panel,
.auth-panel-inner,
.health-info,
.page-title-block,
.team-detail-cols,
.team-members-col,
.stat-card { min-width: 0; }

/* 无法截断、又可能很长的文本：允许在任意位置断行
   注意：已有 ellipsis 的元素（.entry-info h4/p、.field-value 等）保持单行省略号，
   这里的规则只作用于当前会溢出容器的那批元素。 */
h1, h2, h3, h4,
.content-header h2,
.page-title-block h2,
.page-subtitle,
.section-header h3,
.section-sub,
.empty-state p,
.empty-sub,
.team-block-desc,
.team-tab { overflow-wrap: anywhere; }

@media (max-width: 768px) {
  /* 抽屉式面板与弹窗必须严格贴合视口宽度 */
  .side-panel,
  .detail-panel,
  .detail-panel-scroll,
  .modal { max-width: 100vw; }
  /* 条目行在窄屏下允许纵向堆叠，避免挤压文字 */
  .entry-item { gap: 10px; }
  /* 窄屏：标题 + 网址占第一行，标签整体移到第二行。
     行高与内边距同步放大 —— 两行布局下沿用 60px 高度会显得局促。 */
  .entry-item {
    gap: 10px; flex-wrap: wrap; row-gap: 10px;
    min-height: 86px; padding: 14px; align-content: center;
  }
  .entry-icon { order: 1; }
  .entry-info { order: 2; flex: 1 1 0; min-width: 0; }
  .entry-meta {
    order: 3; flex: 1 1 100%;
    flex-wrap: wrap; justify-content: flex-start; row-gap: 6px;
  }
  /* 窄屏只保留网址，不显示账号 */
  .entry-sub-line .entry-sub-user { display: none; }
  .entry-sub-line .entry-sub-user:not([hidden]) + .entry-sub-url::before { content: none; }
}

/* 单个标签名过长时省略，而不是把整行撑宽 */
.entry-tag {
  max-width: 120px; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 行内文本节点（品牌名、跳转链接、设置项标签）默认不可收缩，
   块级化后同样允许收缩与断行 */
.auth-logo-name,
.auth-panel a,
.profile-label { min-width: 0; overflow-wrap: anywhere; }

/* ═══════════════════════════════════════════════════════════
   详情面板：长内容的完整展示
   ───────────────────────────────────────────────────────────
   密码 / 网址 / 团队名这类内容不允许被截断。
   方案：每行右侧的 ⛶ 按钮打开大窗浮层，完整展示并支持一键复制。
   刻意不做「就地展开」—— 展开会让下方内容整体下移，视觉跳动明显。
   ═══════════════════════════════════════════════════════════ */

/* 字段行顶部对齐；label 与值统一 24px 行高，保证首行文字基线一致
   （之前用 padding-top 硬凑，label 与值实际差了约 6px，肉眼可见错位） */
.detail-field-row { align-items: flex-start; }
.detail-field-row .field-label { line-height: 24px; }
.detail-field-row .field-value { line-height: 24px; }

/* 标题独占一行，行尾放查看按钮 */
.detail-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.detail-title-row h3 { flex: 1; min-width: 0; }

/* 「大窗查看」按钮 */
.field-viewer-btn {
  width: 26px; height: 26px; border-radius: 7px;
  background: transparent; color: var(--text-dim);
  border: none; flex-shrink: 0; cursor: pointer;
  font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.field-viewer-btn:hover { background: var(--accent-dim); color: var(--green); }
.field-viewer-btn[hidden] { display: none; }

/* 共享行：名称可省略，查看按钮固定在行尾 */
.detail-perm-name .detail-perm-badge { vertical-align: middle; }

/* ── 大窗浮层 ── */
.field-viewer-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(27, 37, 51, 0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fvFade .15s ease;
}
@keyframes fvFade { from { opacity: 0; } to { opacity: 1; } }
.field-viewer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  max-height: 82vh;
  display: flex; flex-direction: column;
  animation: fvPop .18s ease;
}
@keyframes fvPop {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.field-viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.field-viewer-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.field-viewer-title .fv-chip {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-dim); color: var(--green);
}
.field-viewer-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg-hover); color: var(--text-muted);
  border: none; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.field-viewer-close:hover { background: var(--border); color: var(--text); }
.field-viewer-body {
  padding: 18px; overflow-y: auto; flex: 1;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 14px; line-height: 1.8; color: var(--text);
  white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere;
  -webkit-user-select: all; user-select: all;
}
.field-viewer-foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}
.field-viewer-foot .btn-secondary,
.field-viewer-foot .btn-primary {
  width: auto; flex-shrink: 0; white-space: nowrap;
}

@media (max-width: 768px) {
  .detail-field-row { gap: 8px; }
  .detail-field-row .field-label { flex: 0 0 48px; }
  .detail-header-row { gap: 10px; }
  .detail-entry-icon { width: 42px; height: 42px; font-size: 21px; border-radius: 12px; }
  .detail-actions { gap: 6px; }
  .detail-action-btn { font-size: 12px; padding: 7px 11px; }
  .detail-action-btn { white-space: nowrap; }

  /* 必须显式指定 order：未设 order 的元素默认 order:0，会跳到最前面，
     造成「标签被挤到后面、值跑前面」的错位。 */
  .detail-field-row .field-label { order: 1; }
  .detail-field-row .field-value { order: 2; }
  .detail-field-row .field-icon-btn { order: 3; }

  .field-viewer { max-width: 100%; max-height: 88vh; border-radius: 14px; }
  .field-viewer-body { font-size: 13px; padding: 14px; }
}
