/* ============================================================
   VaultNote · 密码库 / 组件凭据
   设计语言：浅色底 + 靛紫品牌色 + 圆角卡片 + 轻盈阴影
   说明：类名与既有页面保持一致；收藏夹、便签、提醒相关样式已随模块移除。
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f4f5f9;
    --panel: #ffffff;
    --line: #e6e8f1;
    --line-2: #f0f2f8;
    --line-hover: #d7dbec;
    --text: #151823;
    --muted: #6b7285;
    --faint: #9aa1b4;
    --brand: #5b5bd6;
    --brand-2: #8b5cf6;
    --brand-soft: #ededfc;
    --brand-ring: rgba(91, 91, 214, .13);
    --hover: #f5f6fa;
    --amber: #d97706;
    --amber-bg: #fef4e5;
    --danger: #e5484d;
    --ok: #2f9e63;
    --warn: #f5a524;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(19, 23, 42, .04), 0 14px 30px -18px rgba(19, 23, 42, .35);
    --shadow-lg: 0 4px 12px rgba(19, 23, 42, .05), 0 26px 52px -18px rgba(19, 23, 42, .3);
}
[data-theme="dark"] {
    --bg: #0f1117;
    --panel: #171a21;
    --line: #262b36;
    --line-2: #1f232c;
    --line-hover: #333a49;
    --text: #e9ecf1;
    --muted: #8b93a7;
    --faint: #5c6474;
    --brand: #7c7cf0;
    --brand-2: #a78bfa;
    --brand-soft: #1e2140;
    --brand-ring: rgba(124, 124, 240, .2);
    --hover: #222733;
    --amber: #f0a33b;
    --amber-bg: #3a2c16;
    --danger: #f0565b;
    --ok: #3bb27c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 34px -20px rgba(0, 0, 0, .8);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, .5), 0 24px 48px -16px rgba(0, 0, 0, .9);
}
html[data-theme="dark"] { color-scheme: dark; }

/* ===================== 基础 ===================== */
html, body { height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    transition: background .25s, color .25s;
}
button { font: inherit; border: none; background: none; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; border: none; background: none; outline: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; }
svg { display: block; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d6dae8; border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c1c7db; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #333a48; background-clip: content-box; }

/* ===================== 工具类 ===================== */
.flex-1 { flex: 1; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.mt-10 { margin-top: 10px; }
.mb-12 { margin-bottom: 12px; }
.fs-12 { font-size: 12px; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.spacer { flex: 1; }
.mono { font-family: var(--mono); }

/* ===================== 登录页 ===================== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { background: var(--panel); padding: 44px 40px; border-radius: 20px; width: 360px; text-align: center; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.login-card .logo-mark { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 24px -6px rgba(109, 109, 242, .85); letter-spacing: .5px; }
.login-card h1 { font-size: 24px; margin-bottom: 4px; letter-spacing: .5px; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; font-size: 13px; }
.login-card input { width: 100%; padding: 13px 16px; margin-bottom: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.login-card input:focus { border-color: #c7c7f5; box-shadow: 0 0 0 3.5px var(--brand-ring); }
.login-card .btn { width: 100%; padding: 13px; font-size: 15px; font-weight: 600; letter-spacing: 4px; }
.err { color: var(--danger); font-size: 12px; margin-top: 10px; min-height: 16px; text-align: left; }

/* ===================== 布局 ===================== */
.app { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; flex: none; }
.brand .logo-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 14px -6px rgba(109, 109, 242, .85); }
.brand-text h1 { font-size: 14.5px; font-weight: 650; }
.brand-text p { font-size: 11px; color: var(--faint); margin-top: 2px; }

.side-scroll { flex: 1; overflow-y: auto; padding: 2px 12px 20px; }
.side-label { font-size: 10.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--faint); padding: 15px 10px 7px; }
.side-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: #5c6478; transition: .14s; text-align: left; position: relative; user-select: none; }
[data-theme="dark"] .side-item { color: var(--muted); }
.side-item:hover { background: var(--hover); color: var(--text); }
.side-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 620; }
/* 图标列统一 16px 槽位：圆点行与图标行的文字严格左对齐 */
.side-item .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; opacity: .6; margin: 0 4.5px; }
.side-item .ico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; opacity: .75; }
.side-item .ico svg { width: 15px; height: 15px; }
.side-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .cnt { margin-left: auto; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.side-item.active .cnt { color: var(--brand); opacity: .72; }
/* 展开/收起箭头（行尾，仅在有子文件夹时出现） */
.tree-expand { width: 18px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 6px; font-size: 10px; line-height: 1; color: var(--faint); transition: .14s; }
.tree-expand:hover { background: var(--line-2); color: var(--text); }

/* 分类末尾常驻的「+ 新建文件夹」行 */
.side-add { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; color: var(--muted); text-align: left; transition: .14s; }
.side-add:hover { background: var(--hover); color: var(--brand); }
.side-add-ico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
.side-add-ico svg { width: 11px; height: 11px; }

/* 行尾「更多」按钮：重命名/删除/新建子文件夹都收进菜单，名称只留箭头 + ⋯ 两项
   用 opacity 隐藏而不是 display:none，避免 hover 时名称宽度跳动 */
.side-op { width: 16px; height: 18px; flex: none; display: grid; place-items: center; border-radius: 5px; color: var(--faint); line-height: 1; transition: opacity .12s, background .12s, color .12s; }
.side-op.more { opacity: 0; }
.side-item:hover .side-op.more, .side-item.active .side-op.more, .side-op.more:focus-visible { opacity: 1; }
.side-op:hover { background: var(--line-2); color: var(--text); }
.side-op svg { width: 12px; height: 12px; }

/* 行尾「更多」菜单（position:fixed，挂在 body 上避免被滚动容器裁剪） */
.side-menu { position: fixed; z-index: 60; width: max-content; min-width: 136px; max-width: 220px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.side-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border-radius: 7px; font-size: 12.5px; color: var(--text); text-align: left; transition: .12s; }
.side-menu-item:hover { background: var(--hover); }
.side-menu-item.danger { color: var(--danger); }
.side-menu-item.danger:hover { background: rgba(229, 72, 77, .1); }
.side-menu-item svg { width: 12px; height: 12px; flex: none; opacity: .8; }

.side-foot { padding: 10px 18px 14px; border-top: 1px solid var(--line-2); flex: none; }
/* 底部一行放下主题切换与退出（对齐 SmartLedger 的紧凑排布），用户信息缩成小字放第二行 */
.foot-row { display: flex; align-items: center; gap: 6px; }
.foot-row .spacer { flex: 1; }
.foot-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 9px; background: none; color: var(--muted); font-size: 12px; cursor: pointer; transition: .15s; }
.foot-btn:hover { background: var(--hover); color: var(--text); border-color: var(--line-hover); }
.foot-btn .ico { display: inline-flex; }
.foot-btn .ico svg { width: 13px; height: 13px; }
.me-info { margin-top: 7px; font-size: 11.5px; color: var(--faint); padding: 0 2px; display: flex; align-items: center; gap: 7px; }
.me-info::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 7px var(--ok); flex: none; }

/* ---------- 主区 ---------- */
.main { display: flex; flex-direction: column; overflow: hidden; min-width: 0; transition: padding-right .26s cubic-bezier(.3, .9, .4, 1); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 26px 10px; flex: none; }
.search { flex: 1; max-width: 430px; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); transition: .16s; }
.search:focus-within { border-color: #c7c7f5; box-shadow: 0 0 0 3.5px var(--brand-ring); }
.search svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.search input { flex: 1; min-width: 0; font-size: 13.5px; }
.search input::placeholder { color: var(--faint); }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; }

.btn { height: 40px; padding: 0 16px; border-radius: 11px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: .16s; color: var(--text); background: var(--panel); border: 1px solid var(--line); }
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--line-hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: none; box-shadow: 0 8px 18px -8px rgba(109, 109, 242, .9); }
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid rgba(229, 72, 77, .35); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 8px; font-weight: 500; }
.btn.sm svg { width: 13px; height: 13px; }

.headline { display: flex; align-items: flex-end; gap: 11px; padding: 6px 26px 16px; flex: none; }
.headline h2 { font-size: 19px; font-weight: 680; letter-spacing: -.2px; }
.headline .sub { font-size: 12.5px; color: var(--faint); padding-bottom: 2px; }

.view-toggle { margin-left: auto; display: flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.view-toggle button { width: 32px; height: 27px; border-radius: 7px; display: grid; place-items: center; color: var(--faint); transition: .14s; }
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active { background: var(--brand-soft); color: var(--brand); }
.view-toggle svg { width: 15px; height: 15px; }
.view-toggle.hidden { display: none; }

.content { flex: 1; overflow-y: auto; padding: 0 26px 50px; }

/* ===================== 图标块 ===================== */
.svc-ic {
    width: 40px; height: 40px; border-radius: 12px; flex: none;
    display: grid; place-items: center; color: #fff;
    box-shadow: 0 6px 14px -6px currentColor;
}
.svc-ic svg { width: 21px; height: 21px; }
.svc-ic.mysql { background: linear-gradient(135deg, #2f7fa8, #0b5e86); }
.svc-ic.redis { background: linear-gradient(135deg, #e0524a, #c0261d); }
.svc-ic.pg { background: linear-gradient(135deg, #4a7fad, #2c5b85); }
.svc-ic.mongo { background: linear-gradient(135deg, #3bbf6a, #12904a); }
.svc-ic.ssh { background: linear-gradient(135deg, #52525b, #27272a); }
.svc-ic.other { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }

/* ===================== 密码库 ===================== */
/* 面包屑（文件夹内导航） */
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--faint); margin-bottom: 13px; flex-wrap: wrap; }
.crumb i { font-style: normal; opacity: .55; }
.crumb-link { color: var(--muted); cursor: pointer; }
.crumb-link:hover { color: var(--brand); text-decoration: underline; }
.crumb-cur { color: var(--text); font-weight: 620; }

/* 常用网站快捷栏 */
.quick-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.site-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; font-weight: 550; color: var(--text); transition: .15s; }
.site-chip:hover { border-color: var(--line-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.chip-ico { display: grid; place-items: center; color: var(--brand); }
.chip-ico svg { width: 15px; height: 15px; }
.chip-star { display: grid; place-items: center; color: #f5a524; }
.chip-star svg { width: 13px; height: 13px; fill: currentColor; }
.chip-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 提示条（首页引导等） */
.hint-card { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.hint-ico { display: grid; place-items: center; color: var(--warn); flex: none; }
.hint-ico svg { width: 16px; height: 16px; fill: currentColor; }

/* 文件夹卡片网格 */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 12px; margin-bottom: 16px; }
.folder-card { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 12px 12px 12px 14px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.folder-card:hover { border-color: var(--line-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.fc-ico { width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--brand)) 14%, transparent); color: var(--c, var(--brand)); }
.fc-ico svg { width: 19px; height: 19px; }
.fc-main { flex: 1; min-width: 0; }
.fc-name { font-size: 13.5px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-meta { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
/* 文件夹拖拽移动 */
.folder-card.dragging { opacity: .45; }
.folder-card.drop-target { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--panel)); }
/* 拖到卡片左右两端 = 插到该卡片之前/之后，用一条 2px 插入线表示 */
.folder-card.drop-before { box-shadow: inset 2px 0 0 var(--brand); }
.folder-card.drop-after { box-shadow: inset -2px 0 0 var(--brand); }
.crumb-link.drop-target { color: var(--brand); background: var(--hover); border-radius: 6px; }
/* 左侧导航树里的文件夹行同样支持拖拽移动 / 同级排序 */
.side-item.dragging { opacity: .45; }
.side-item.drop-target { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
/* 拖到行的上沿/下沿 = 插到该行之前/之后，用一条 2px 插入线表示 */
.side-item.drop-before { box-shadow: inset 0 2px 0 var(--brand); }
.side-item.drop-after { box-shadow: inset 0 -2px 0 var(--brand); }

/* 条目卡片墙：紧凑三行——图标+名称 / 账号+密码 / 标签+操作 */
.pw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }
.bm { position: relative; display: flex; flex-direction: column; gap: 7px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 11px 9px; transition: transform .18s cubic-bezier(.3, .9, .4, 1), box-shadow .18s, border-color .18s; }
.bm:hover { transform: translateY(-2px); border-color: #dcdcf7; box-shadow: 0 2px 5px rgba(20, 25, 45, .04), 0 14px 30px -16px rgba(91, 91, 214, .45); }
/* 卡片拖动排序：拖起半透明，落点用左右插入线表示插到前/后 */
.bm.dragging, .bank-card.dragging { opacity: .45; }
.bm.drop-before, .bank-card.drop-before { box-shadow: inset 2px 0 0 var(--brand); }
.bm.drop-after, .bank-card.drop-after { box-shadow: inset -2px 0 0 var(--brand); }
.fav-ic { position: relative; overflow: hidden; width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase; background: var(--c, #6d6df2); box-shadow: 0 5px 12px -5px var(--c, #6d6df2); user-select: none; }
/* 站点图标：盖在首字色块上；加载失败时 onerror 自行移除，露出底下的首字 */
.fav-ic-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; }

/* 第一行：图标 + 名称（星标收到行尾） */
.bm-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bm-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 620; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-title.link { cursor: pointer; }
.bm-title.link:hover { color: var(--brand); text-decoration: underline; }
.bm-star { width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #ccd1de; transition: .14s; }
[data-theme="dark"] .bm-star { color: var(--faint); }
.bm-star svg { width: 14px; height: 14px; }
.bm-star:hover { background: var(--hover); color: #f59e0b; }
.bm-star.on { color: #f59e0b; }
.bm-star.on svg { fill: currentColor; }

/* 第二行：账号（+复制账号） | 间隙 | 密码（+显示/复制） */
.bm-line { display: flex; align-items: center; gap: 1px; min-height: 28px; padding: 2px 2px 2px 7px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; }
[data-theme="dark"] .bm-line { background: rgba(255, 255, 255, .03); }
.bm-user { flex: 1 1 0; min-width: 0; max-width: 55%; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-secret { flex: 1 1 0; min-width: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .4px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 竖直间隙：把账号区和密码区分开 */
.bm-sep { flex: none; width: 1px; height: 13px; margin: 0 3px; background: var(--line-hover); }
.bm-line .mini { width: 20px; height: 20px; }
.bm-line .mini svg { width: 12px; height: 12px; }

.bm-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.bm-foot-l { display: flex; align-items: center; gap: 5px; min-width: 0; }
.bm-ops { display: flex; gap: 1px; flex: none; }
.bm-ops .mini { width: 22px; height: 22px; }
.bm-ops .mini svg { width: 12px; height: 12px; }
.tag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--line-2); padding: 3px 8px; border-radius: 6px; white-space: nowrap; max-width: 112px; overflow: hidden; text-overflow: ellipsis; }
/* 卡片上的文件夹标签：用与侧栏/文件夹卡片同一套名称哈希色 */
.tag.folder-tag { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }

/* 条目行（列表视图：网站 / 邮箱 / 其他） */
.pw-list { display: flex; flex-direction: column; }
.pw-row { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 12px 16px; margin-bottom: 8px; transition: border-color .16s, box-shadow .16s, transform .16s; }
.pw-row:hover { border-color: var(--line-hover); transform: translateY(-1px); box-shadow: 0 2px 5px rgba(20, 25, 45, .04), 0 12px 26px -16px rgba(91, 91, 214, .4); }
.pw-avatar { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; text-transform: uppercase; background: var(--c, var(--brand)); box-shadow: 0 5px 12px -5px var(--c, var(--brand)); user-select: none; }

.pw-info { flex: 1; min-width: 0; }
.pw-info h4 { font-size: 13.5px; font-weight: 620; display: flex; align-items: center; gap: 7px; min-width: 0; }
.pw-info h4 .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-info h4 .t.has-url { cursor: pointer; }
.pw-info h4 .t.has-url:hover { color: var(--brand); text-decoration: underline; }
.pw-sub { font-size: 12px; color: var(--faint); display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bar { width: 52px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; flex: none; }
.bar i { display: block; height: 100%; border-radius: 3px; }

.pw-secret { font-family: var(--mono); font-size: 13px; letter-spacing: 1px; color: var(--muted); min-width: 116px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-secret.muted { color: var(--faint); letter-spacing: 0; }

.pw-ops { display: flex; gap: 2px; flex: none; }
.mini { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; color: var(--faint); transition: .14s; }
.mini:hover { background: var(--hover); color: var(--text); }
.mini svg { width: 15px; height: 15px; }
.mini.danger:hover { color: var(--danger); }
.mini.star:hover { color: #f5a524; }
.mini.star.on { color: #f5a524; }
.mini.star.on svg { fill: currentColor; }

.badge { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 650; flex: none; }
.badge.sens { color: var(--danger); background: rgba(229, 72, 77, .12); }
.badge.ok { color: var(--ok); background: rgba(48, 164, 108, .13); }
.badge.danger { color: var(--danger); background: rgba(229, 72, 77, .12); }
.badge.cat { color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent); }
.badge.link { color: var(--brand); background: var(--brand-soft); cursor: pointer; }
.badge.link:hover { background: rgba(91, 91, 214, .2); }

/* 银行卡卡片网格 */
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(304px, 1fr)); gap: 14px; }
.bank-card { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color .16s, box-shadow .16s, transform .16s; }
.bank-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c, var(--brand)), transparent 85%); }
.bank-card:hover { border-color: var(--line-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.bk-head { display: flex; align-items: center; gap: 11px; }
.bk-ico { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; background: var(--c, var(--brand)); box-shadow: 0 5px 12px -5px var(--c, var(--brand)); }
.bk-ico svg { width: 18px; height: 18px; }
.bk-head h4 { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-ops { display: flex; gap: 2px; flex: none; }
.bk-no { font-family: var(--mono); font-size: 16.5px; font-weight: 600; letter-spacing: 1.8px; color: var(--text); }
.bk-row { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 4px 6px 4px 12px; min-height: 36px; }
.bk-label { font-size: 11px; color: var(--faint); flex: none; }
.bk-pwd { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 1.1px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-remark { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 账号 / 字段弹窗行 */
.accs { padding: 4px 7px; }
/* 密码格给一个可增长的最小宽度：把行内剩余空间吃掉，避免账号名很短时中间空一大片 */
.acc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 1fr) auto; align-items: center; gap: 10px; padding: 6px 9px; border-radius: 10px; transition: background .14s; }
.acc:hover { background: var(--hover); }
.acc-main { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* 账号角色徽标：仅剩账号/字段弹窗用的默认样式（组件凭据的 root/rw/ro/bak 已下线） */
.role { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 3.5px 8px; border-radius: 6px; font-family: var(--mono); }
.role.def { background: #eef1f6; color: #626b7d; }
[data-theme="dark"] .role.def { background: var(--line-2); }

.acc-text { min-width: 0; }
.acc-name { font-size: 13.5px; font-weight: 600; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-desc { font-size: 11.5px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 没有备注/范围时不要把第二行占着，账号行能矮一截 */
.acc-desc:empty { display: none; }
.acc-desc em { font-style: normal; color: #b6bccb; }
[data-theme="dark"] .acc-desc em { color: var(--faint); }

.pwd-cell { display: flex; align-items: center; gap: 4px; background: #f8f9fd; border: 1px solid var(--line-2); border-radius: 9px; padding: 3px 4px 3px 10px; height: 34px; transition: .14s; }
[data-theme="dark"] .pwd-cell { background: var(--bg); }
.acc:hover .pwd-cell { background: var(--panel); border-color: var(--line); }
.pwd-cell code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; letter-spacing: 1.1px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwd-cell .mini { width: 26px; height: 26px; }
.pwd-cell .mini svg { width: 14px; height: 14px; }

/* ===================== 组件凭据 ===================== */
/* 卡片墙：一个服务一张卡；结构固定为「头部两行 + 一行首个账号」，所有卡片高度一致 */
.svc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }

.svc { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .18s cubic-bezier(.3, .9, .4, 1), box-shadow .18s, border-color .18s; }
.svc:hover { transform: translateY(-2px); border-color: #dcdcf7; box-shadow: 0 2px 5px rgba(20, 25, 45, .04), 0 14px 30px -16px rgba(91, 91, 214, .45); }
[data-theme="dark"] .svc:hover { border-color: var(--line-hover); }
/* 卡片拖动排序：拖起半透明，落点用左右插入线表示插到前 / 后 */
.svc.dragging { opacity: .45; }
.svc.drop-before { box-shadow: inset 2px 0 0 var(--brand); }
.svc.drop-after { box-shadow: inset -2px 0 0 var(--brand); }

/* 类型主题色：只作用在图标上，卡片本体保持统一的白色卡片语言 */
.svc[data-type="MYSQL"] { --c: #2f7fa8; }
.svc[data-type="REDIS"] { --c: #e0524a; }
.svc[data-type="PG"] { --c: #4a7fad; }
.svc[data-type="MONGO"] { --c: #3bbf6a; }
.svc[data-type="SSH"] { --c: #6b7280; }
.svc[data-type="OTHER"] { --c: var(--brand); }
.svc[data-type="KAFKA"], .svc[data-type="RABBITMQ"], .svc[data-type="NACOS"],
.svc[data-type="MINIO"], .svc[data-type="ES"] { --c: var(--brand); }

.svc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 8px; }
.svc-head .svc-ic { width: 34px; height: 34px; border-radius: 10px; }
.svc-head .svc-ic svg { width: 17px; height: 17px; }
.svc-meta { flex: 1; min-width: 0; }
.svc-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.svc-title h3 { font-size: 13.5px; font-weight: 650; letter-spacing: -.1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-sub { font-size: 11.5px; color: var(--faint); font-family: var(--mono); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-sub .sep { margin: 0 5px; opacity: .6; }

/* 卡片操作常淡显、悬浮加深，避免每张卡都抢视线 */
.svc-ops { display: flex; gap: 0; flex: none; opacity: .45; transition: opacity .15s; }
.svc:hover .svc-ops { opacity: 1; }
.svc-ops .mini { width: 24px; height: 24px; color: var(--muted); }
.svc-ops .mini svg { width: 13px; height: 13px; }
.svc-ops .mini:hover { background: var(--hover); color: var(--brand); }

.env { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 6px; flex: none; }
.env::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.env.prod { background: #fdecec; color: #d93a3a; }
.env.stage { background: #fef3e5; color: #c2721a; }
.env.dev { background: #e7f6ee; color: #1f8a52; }
.env.other { background: var(--line-2); color: var(--muted); }
[data-theme="dark"] .env.prod { background: rgba(217, 58, 58, .18); }
[data-theme="dark"] .env.stage { background: rgba(194, 114, 26, .18); }
[data-theme="dark"] .env.dev { background: rgba(31, 138, 82, .18); }

/* 卡内账号行：账号名（+N） / 密码格 / 复制账号，三列固定宽度，行高统一 */
.accs { padding: 0 7px 8px; }
.accs .acc { display: grid; grid-template-columns: minmax(0, 1fr) 132px auto; align-items: center; gap: 6px; padding: 2px 5px; }
.accs .acc-main { gap: 6px; }
.accs .acc-name { font-size: 12.5px; }
.accs .pwd-cell { height: 30px; padding: 2px 2px 2px 9px; }
.accs .pwd-cell code { font-size: 12px; }
.accs .pwd-cell .mini { width: 24px; height: 24px; }
.accs .pwd-cell .mini svg { width: 13px; height: 13px; }
.acc-ops { display: flex; gap: 1px; flex: none; }
.accs .acc-ops .mini { width: 24px; height: 24px; }
.accs .acc-ops .mini svg { width: 13px; height: 13px; }

/* 多账号收口：+N 小药丸，点开看全部账号 */
.acc-more { flex: none; height: 18px; padding: 0 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 10.5px; font-weight: 700; line-height: 18px; transition: .14s; }
.acc-more:hover { background: rgba(91, 91, 214, .2); }

.acc-empty { padding: 6px 6px 8px; font-size: 12px; color: var(--faint); }

/* 表格（组件表格视图 / 环境 / 用户 / 通知） */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--faint); padding: 13px 16px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
[data-theme="dark"] thead th { background: rgba(255, 255, 255, .02); }
tbody tr { border-bottom: 1px solid var(--line-2); transition: background .14s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--hover); }
tbody td { padding: 11px 16px; vertical-align: middle; }
.td-svc { display: flex; align-items: center; gap: 9px; min-width: 0; }
.td-svc .svc-ic { width: 26px; height: 26px; border-radius: 8px; box-shadow: none; }
.td-svc .svc-ic svg { width: 14px; height: 14px; }
.td-svc span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-host { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.td-acc { display: flex; align-items: center; gap: 9px; }
.tbl-wrap .pwd-cell { width: 172px; height: 32px; background: transparent; border-color: transparent; }
.tbl-wrap tr:hover .pwd-cell { background: var(--bg); border-color: var(--line-2); }
.row-ops { display: flex; gap: 2px; justify-content: flex-end; }
.act-cell { text-align: right; white-space: nowrap; }
.env-count { color: var(--muted); font-size: 12.5px; }
.locked { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--faint); }
.locked svg { width: 15px; height: 15px; }

/* ===================== 表单 ===================== */
.form-row { margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: #c7c7f5; box-shadow: 0 0 0 3.5px var(--brand-ring); }
.form-row textarea { resize: vertical; min-height: 80px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* 网址输入 + 获取图标按钮 + 图标预览 */
.url-field { display: flex; align-items: center; gap: 8px; }
.url-field input { flex: 1; min-width: 0; width: auto; }
.url-field .btn { flex: none; }
.icon-preview { position: relative; overflow: hidden; width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--faint); font-size: 14px; font-weight: 700; text-transform: uppercase; }
.icon-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; }
/* 表单校验：非法字段红框 + 字段下方红字（见 app.js checkForm） */
.form-row input.invalid, .form-row select.invalid, .form-row textarea.invalid { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: 12px; margin-top: 6px; }
/* 表单级错误提示（弹窗内顶部红条） */
.form-alert { display: block; padding: 10px 12px; border-radius: 10px; background: rgba(229, 72, 77, .1); color: var(--danger); font-size: 12.5px; line-height: 1.6; margin-bottom: 14px; }
/* 密码输入框：显隐 / 随机生成按钮放在输入框右侧（框外，不再压在框内），强度条在下方 */
.pwd-wrap { display: flex; align-items: center; gap: 6px; }
.pwd-wrap input { flex: 1; min-width: 0; }
.pwd-tools { display: flex; gap: 2px; flex: none; }
.pwd-tools .mini { width: 28px; height: 28px; }
.pwd-strength { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.pwd-strength .bar { flex: 1; width: auto; height: 4px; }
.pwd-strength-label { flex: none; min-width: 30px; }
/* 明文倒计时：显示密码后 N 秒自动收起 */
.reveal-cd { font-family: var(--mono); font-size: 11.5px; color: var(--amber); margin-left: 6px; white-space: nowrap; }
/* 账号动态行里的密码输入框：按钮已在框外，这里只把小尺寸按钮收窄以适配窄行 */
.acc-input-row .pwd-wrap { flex: 1; min-width: 0; }
/* 横向排列里的密码输入框（如口令页）：撑满剩余空间 */
.flex > .pwd-wrap { flex: 1; min-width: 0; }
.acc-input-row .pwd-wrap input { padding: 8px 10px; font-size: 13px; }
.acc-input-row .pwd-tools { gap: 1px; }
.acc-input-row .pwd-tools .mini { width: 22px; height: 22px; }
.acc-input-row .pwd-tools .mini svg { width: 13px; height: 13px; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; }
.check-row label { margin-bottom: 0; }
.inline-input { flex: 1; padding: 9px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.text-input { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.acc-input-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.acc-input-row input, .acc-input-row select { flex: 1; width: auto; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.acc-input-row .icon-btn { flex: none; }
/* 「其他」分类自定义字段行：字段名 / 值 / 敏感 / 删除 */
.field-edit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.field-edit-row input { width: 100%; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.field-edit-row input:focus { border-color: #c7c7f5; box-shadow: 0 0 0 3px var(--brand-ring); }
.fd-secret { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.fd-secret input { width: auto; }
/* 表格单元格内输入框（环境管理等行内编辑） */
.cell-input { width: 100%; padding: 7px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.cell-input:focus { outline: none; border-color: #c7c7f5; box-shadow: 0 0 0 3px var(--brand-ring); }

/* ===================== 首页 / 口令 ===================== */
.banner { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-radius: var(--radius); padding: 22px 24px; display: flex; align-items: center; gap: 16px; margin-bottom: 16px; box-shadow: 0 8px 24px -8px rgba(109, 109, 242, .9); }
.banner-icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.banner-icon svg { width: 28px; height: 28px; }
.banner-text { flex: 1; }
.banner-text h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.banner-text p { opacity: .85; font-size: 13px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 14px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.stat-card:hover { border-color: var(--line-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: rgba(91, 140, 255, .15); color: #5b8cff; }
.stat-icon.cyan { background: rgba(18, 165, 148, .15); color: #12a594; }
.stat-icon.gold { background: rgba(245, 165, 36, .15); color: var(--warn); }
.stat-icon.orange { background: rgba(229, 72, 77, .13); color: var(--danger); }
.stat-info { flex: 1; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 2px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h3 { font-size: 15px; font-weight: 680; }

.private-card { max-width: 560px; }
.private-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.private-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(91, 140, 255, .15); color: var(--brand); }
.private-icon svg { width: 24px; height: 24px; }
.private-head-text { flex: 1; }
.private-head-text h3 { font-size: 16px; margin-bottom: 3px; }
.private-body { padding-top: 20px; border-top: 1px solid var(--line); }
.pv-badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; flex: none; }
.pv-badge.ok { background: rgba(48, 163, 108, .14); color: var(--ok); border-color: rgba(48, 163, 108, .35); }
.pv-badge.warn { background: rgba(245, 165, 36, .14); color: var(--warn); border-color: rgba(245, 165, 36, .35); }
.pv-badge.danger { background: rgba(229, 72, 77, .13); color: var(--danger); border-color: rgba(229, 72, 77, .35); }
.pv-tip { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); line-height: 1.6; font-size: 13px; }
.pv-tip > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--warn); margin-top: 2px; }
.pv-unlock-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: rgba(91, 140, 255, .15); color: var(--brand); }
.pv-unlock-icon svg { width: 26px; height: 26px; }
.pv-unlock-tip { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 18px; }

/* ===================== 空状态 / Toast ===================== */
.empty { padding: 90px 20px; text-align: center; color: var(--faint); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 16px; opacity: .32; }
.empty h3 { font-size: 15px; font-weight: 620; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 36px; z-index: 400; transform: translate(-50%, 14px); background: #1e2130; color: #fff; padding: 10px 18px; border-radius: 11px; font-size: 13px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: .22s; box-shadow: 0 14px 32px -14px rgba(0, 0, 0, .65); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 成功/失败用色区分，避免所有提示都一个样 */
.toast.ok { background: #167c4c; }
.toast.err { background: #b02a2e; }

/* ===================== 弹窗 ===================== */
.modal-mask { position: fixed; inset: 0; background: rgba(4, 7, 15, .6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 350; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 520px; max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal.sm, .modal.modal-sm { width: 400px; }
/* 紧凑弹窗：字段较少的小表单（如新建文件夹/文本输入），整体尺寸与内边距一起收小 */
.modal.compact { width: 440px; }
.modal.compact .modal-head { padding: 13px 16px; }
.modal.compact .modal-body { padding: 14px 16px; }
.modal.compact .modal-foot { padding: 12px 16px; }
.modal.compact .form-row { margin-bottom: 12px; }
.modal.compact .form-row input, .modal.compact .form-row select { padding: 8px 10px; }
.modal.compact .form-2col { gap: 10px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
/* 点遮罩不关闭弹窗，改为轻微晃动提示「请用取消/× 显式关闭」 */
@keyframes maskNudge { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.modal.mask-nudge { animation: maskNudge .4s ease; }
.icon-btn { width: 32px; height: 32px; border-radius: 9px; border: none; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; transition: .15s; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.modal-head .icon-btn { font-size: 18px; }
/* 确认弹窗：图标 + 文案横排，替代原生 confirm，风格与整体统一 */
.cf-body { display: flex; gap: 14px; align-items: flex-start; }
.cf-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: rgba(229, 72, 77, .12); color: var(--danger); }
.cf-icon svg { width: 19px; height: 19px; }
.cf-msg { color: var(--muted); font-size: 13px; line-height: 1.7; }
/* 口令弹窗顶部的警示条（危险操作说明） */
.pwd-warn { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: rgba(217, 119, 6, .1); color: var(--amber); font-size: 12.5px; line-height: 1.6; text-align: left; }
.pwd-warn svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
/* 24 词恢复码：网格展示，可整段选中复制 */
.recovery-words { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; user-select: text; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.recovery-words span { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--hover); font-size: 12px; }
.recovery-words i { font-style: normal; color: var(--faint); font-size: 10px; min-width: 14px; text-align: right; }

/* ===================== 响应式 ===================== */
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .sidebar { flex-direction: row; align-items: center; border-right: none; border-bottom: 1px solid var(--line); overflow-x: auto; padding: 0 10px; }
    .brand { padding: 12px 10px; flex: none; }
    .brand-text { display: none; }
    .side-scroll { display: flex; gap: 4px; padding: 8px 0; overflow: visible; flex: 1; }
    .side-label, .side-foot, .me-info { display: none; }
    .side-item { white-space: nowrap; width: auto; padding: 7px 12px; }
    .side-item .cnt, .tree-expand, .side-op, .side-add { display: none; }
    .topbar { padding: 14px 16px 8px; flex-wrap: wrap; }
    .search { order: 2; flex-basis: 100%; max-width: none; }
    .topbar-actions { margin-left: auto; }
    .headline { padding: 8px 16px 14px; }
    .content { padding: 0 16px 40px; }
    .folder-grid { grid-template-columns: 1fr; }
    .pw-grid { grid-template-columns: 1fr; }
    .bank-grid { grid-template-columns: 1fr; }
    .pw-secret { display: none; }
    .acc { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
    .pwd-cell { grid-column: 1 / -1; justify-self: stretch; }
    .tbl-wrap { overflow-x: auto; }
    /* 窄屏隐藏次要列（创建时间/备注等），表格仍保留横向滚动兜底 */
    .col-opt { display: none; }
    table { min-width: 460px; }
    .form-2col { grid-template-columns: 1fr; }
    .field-edit-row { grid-template-columns: 1fr 1fr; }
}
