/* ========================================================
   PASSWORD VAULT — 密码保险库管理页样式
   ======================================================== */

/* ---- page layout ---- */
.pwPage {
    /*max-width: 1000px;*/
    margin: 0 auto;
}

/* ========================================================
   ICONS（Font Awesome）
   ======================================================== */

.pwIcon {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
    pointer-events: none;
}

.pwHeaderTitle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pwIconTitle { font-size: 20px; }
.pwIconLocked { font-size: 26px; }
.pwIconHint { font-size: 14px; flex-shrink: 0; }
.pwIconGenTitle { font-size: 18px; }

/* ========================================================
   LOCKED VIEW
   ======================================================== */

.pwLocked {
    text-align: center;
    padding: 60px 20px;
}

.pwLockedTitle {
    font-size: 24px;
    margin-bottom: 24px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pwLockedInput {
    width: 320px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
}

.pwLockedInput:focus {
    border-color: #009933;
}

.pwLockedBtn {
    display: inline-block;
    height: 40px;
    padding: 0 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 8px;
    transition: all .2s;
}

.pwLockedBtn.primary {
    background: #009933;
    color: #fff;
}

.pwLockedBtn.primary:hover {
    background: #00802b;
}

.pwLockedBtn.outline {
    background: #fff;
    color: #009933;
    border: 1px solid #009933;
}

.pwLockedBtn.outline:hover {
    background: #f0fff5;
}

.pwLockedHint {
    margin-top: 12px;
    font-size: 13px;
    color: #999;
}

.pwLockedHint.error {
    color: #c00;
}

/* ========================================================
   TOOLBAR
   ======================================================== */

.pwToolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.pwSearch {
    flex: 1;
    min-width: 180px;
    height: 34px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
}

.pwSearch:focus {
    border-color: #009933;
}

.pwTbBtn {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pwTbBtn .pwIcon {
    font-size: 15px;
}

.pwHeaderTitle .fa-lock,
.pwLockedTitle .fa-lock { color: #009933; }

.pwTbBtn .fa-folder { color: #2e7d32; }
.pwTbBtn .fa-key { color: #1565c0; }
.pwTbBtn .fa-pen { color: #1565c0; }
.pwTbBtn .fa-arrows-rotate { color: #1565c0; }
.pwTbBtn .fa-dice { color: #8e44ad; }

.pwGroupHint .fa-circle-info { color: #2196F3; }
.pwGenTitle .fa-dice { color: #8e44ad; }

.pwTbBtn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.pwTbBtn.primary {
    background: #009933;
    color: #fff;
    border-color: #00802b;
}

.pwTbBtn.primary:hover {
    background: #00802b;
}

.pwTbBtn.danger {
    color: #c00;
    border-color: #fcc;
}

.pwTbBtn.danger:hover {
    background: #fff5f5;
}

/* ========================================================
   GROUP TABS
   ======================================================== */

.pwGroups {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
}

.pwGroupTab {
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    background: #f0f0f0;
    color: #666;
    border: none;
    transition: all .15s;
}

.pwGroupTab:hover {
    background: #e0e0e0;
    color: #333;
}

.pwGroupTab.active {
    background: #009933;
    color: #fff;
}

.pwGroupCount {
    font-size: 10px;
    opacity: .7;
    margin-left: 3px;
}

/* ========================================================
   ENTRY LIST & COLUMN HEADERS
   ======================================================== */

.pwList {
    margin-bottom: 16px;
}

.pwEntry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    transition: background .15s;
}

.pwEntry:hover {
    background: #fafafa;
}

.pwEntry:last-child {
    border-bottom: none;
}

.pwCol {
    flex-shrink: 0;
}

.pwColGroup {
    width: 60px;
}

.pwColPurpose {
    width: 110px;
    font-weight: 500;
    color: #333;
}

.pwColUser {
    width: 150px;
    color: #555;
}

.pwColPw {
    width: 150px;
    text-align: left;
    font-family: monospace;
    color: #999;
    letter-spacing: 1px;
}

.pwPwText.visible {
    letter-spacing: 0;
    color: #333;
    word-break: break-all;
    padding-right: 56px; /* 预留“显示 + 复制”两个按钮的宽度，明文不会被遮住 */
}

.pwColUrl {
    flex: 1;
    width: 200px;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwColUrl a {
    color: #2196F3;
    text-decoration: none;
}

.pwColUrl a:hover {
    text-decoration: underline;
}

.pwColNotes {
    width: 200px;
    color: #999;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwColActions {
    min-width: 78px;
    display: flex;
    gap: 3px;
    justify-content: flex-end;
}

.pwGroupTag {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    max-width: 66px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* 颜色由 renderList 按分组名内联注入 */
}

/* 默认分组：保留与彩色标签相同的尺寸/内边距，仅去掉底色 */
.pwGroupTag.is-default {
    background: transparent;
    color: inherit;
}

.pwActionBtn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all .15s;
}

.pwActionBtn:hover {
    background: #e8e8e8;
    color: #333;
}

.pwActionBtn.danger:hover {
    background: #fff0f0;
    color: #c00;
}

/* 操作图标语义色：绿=查看、蓝=复制、橙=编辑、红=删除 */
.pwActionBtn[data-action="show"] { color: #2e7d32; }
.pwActionBtn[data-action="show"]:hover { background: #e8f5e9; color: #1b5e20; }

.pwActionBtn[data-action="copy"],
.pwActionBtn[data-action="copy-user"] { color: #1565c0; }
.pwActionBtn[data-action="copy"]:hover,
.pwActionBtn[data-action="copy-user"]:hover { background: #e3f2fd; color: #0d47a1; }

.pwActionBtn[data-action="edit"] { color: #1565c0; }
.pwActionBtn[data-action="edit"]:hover { background: #e3f2fd; color: #0d47a1; }

.pwActionBtn.danger { color: #b42318; }

.pwActionBtn[data-action="toggle"] { color: #1565c0; }
.pwActionBtn[data-action="toggle"]:hover { background: #e3f2fd; color: #0d47a1; }

.pwActionBtn[data-action="complete"] { color: #2e7d32; }
.pwActionBtn[data-action="complete"]:hover { background: #e8f5e9; color: #1b5e20; }

.pwEmpty {
    text-align: center;
    padding: 40px;
    color: #bbb;
    font-size: 14px;
}

/* Column headers — override data-column colors for uniform header appearance */
.pwColHeader {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 11px;
    color: #aaa;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 4px;
    font-weight: 600;
}

.pwColHeader .pwCol {
    color: #aaa;
    font-weight: 600;
}

/* ========================================================
   VAULT LIST v2 — 列宽 + 字段悬停操作
   仅密码页列表（.pwVaultList）。reminder.html 复用
   .pwEntry/.pwCol/.pwColHeader/.pwActionBtn，勿动共享基类。
   ======================================================== */

.pwVaultList .pwColGroup   { width: 70px; }
.pwVaultList .pwColUser    { width: 170px; }
.pwVaultList .pwColPw      { width: 160px; }
.pwVaultList .pwColActions { width: 55px; min-width: 55px; }

/* 网址最多 280px；剩余空间优先给备注，避免宽屏下网址列无限拉长 */
.pwVaultList .pwColUrl {
    flex: 1 1 220px;
    width: 220px;
    max-width: 280px;
    min-width: 0;
}

.pwVaultList .pwColNotes {
    flex: 1 1 180px;
    width: 180px;
    min-width: 0;
}

.pwVaultList .pwColUrl a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 斑马纹：第 2、4、6… 条数据行（表头占第 1 个 child） */
.pwVaultList .pwEntry:nth-child(odd) {
    background: #eee;
}

.pwVaultList .pwEntry:hover {
    background: #fff;
}

/* 字段单元格成为悬停操作层的定位容器；拉伸到整行内容高度 */
.pwVaultList .pwEntry .pwColUser,
.pwVaultList .pwEntry .pwColPw {
    position: relative;
    display: flex;
    align-items: center;
    align-self: stretch;
}

/* 把触发区扩展到行上下 padding（各 8px），整列高度内移动鼠标都能触发 */
.pwVaultList .pwEntry .pwColUser::before,
.pwVaultList .pwEntry .pwColPw::before,
.pwVaultList .pwEntry .pwColUser::after,
.pwVaultList .pwEntry .pwColPw::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 8px;
}

.pwVaultList .pwEntry .pwColUser::before,
.pwVaultList .pwEntry .pwColPw::before {
    top: -8px;
}

.pwVaultList .pwEntry .pwColUser::after,
.pwVaultList .pwEntry .pwColPw::after {
    bottom: -8px;
}

/* 用户名：单行省略；永久预留右侧 28px 给 👤，悬停时文字不跳动 */
.pwCellText {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 28px;
}

/* 密码文字；flex 子项会被块化，padding-right 对每一行都生效 */
.pwPwText {
    flex: 1 1 auto;
    min-width: 0;
}

/* 悬停操作层：绝对定位，不占列宽、不参与文字布局 */
.pwFieldActions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
    z-index: 2;
    /* 密码列是等宽字体 + 字距，按钮需重置 */
    font-family: "Segoe UI", "Lucida Grande", Tahoma, sans-serif;
    letter-spacing: normal;
}

.pwVaultList .pwColUser:hover .pwFieldActions,
.pwVaultList .pwColPw:hover .pwFieldActions,
.pwVaultList .pwColUser:focus-within .pwFieldActions,
.pwVaultList .pwColPw:focus-within .pwFieldActions {
    opacity: 1;
    pointer-events: auto;
}

.pwActionBtn.pwFieldBtn {
    width: 24px;
    height: 24px;
    font-size: 12px;
}

/* 触屏等无 hover 设备：按钮常显（仍绝对定位，不改变布局） */
@media (hover: none) {
    .pwFieldActions {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ========================================================
   EDIT PANEL
   ======================================================== */

.pwEditPanel {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    display: none;
}

.pwEditPanel.open {
    display: block;
}

.pwEditTitle {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.pwEditFields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pwEditField {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pwEditField.full {
    grid-column: 1 / -1;
}

.pwEditLabel {
    font-size: 11px;
    color: #888;
}

.pwEditInput {
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 13px;
    outline: none;
    transition: border-color .2s;
}

.pwEditInput:focus {
    border-color: #009933;
}

.pwEditTextarea {
    min-height: 50px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    outline: none;
    resize: vertical;
    font-family: inherit;
}

.pwEditTextarea:focus {
    border-color: #009933;
}

.pwEditActions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.pwEditBtn {
    height: 32px;
    padding: 0 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    transition: all .15s;
}

.pwEditBtn:hover {
    background: #f5f5f5;
}

.pwEditBtn.primary {
    background: #009933;
    color: #fff;
    border-color: #00802b;
}

.pwEditBtn.primary:hover {
    background: #00802b;
}

.pwEditBtn.danger {
    color: #c00;
    border-color: #fcc;
}

.pwEditBtn.danger:hover {
    background: #fff5f5;
}

/* ========================================================
   GROUP MANAGER
   ======================================================== */

.pwGroupMgr {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    display: none;
}

.pwGroupMgr.open {
    display: block;
}

.pwGroupMgrTitle {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.pwGroupRow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}

.pwGroupRow input {
    flex: 1;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 12px;
    outline: none;
}

.pwGroupRow input:focus {
    border-color: #009933;
}

.pwGroupRow .pwGroupName {
    flex: 1;
}

.pwGroupRow .pwGroupCnt {
    font-size: 11px;
    color: #999;
    width: 50px;
    text-align: right;
}

.pwGroupAdd {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

.pwGroupAdd input {
    flex: 1;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 12px;
    outline: none;
}

.pwGroupAdd input:focus {
    border-color: #009933;
}

.pwGroupHint {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========================================================
   TOAST
   ======================================================== */

.pwToast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}

.pwToast.show {
    opacity: 1;
    pointer-events: auto;
}

.pwToast.success {
    background: #f0fff5;
    color: #009933;
    border: 1px solid #b7ebc8;
}

.pwToast.error {
    background: #fff5f5;
    color: #c00;
    border: 1px solid #fcc;
}

.pwToast.info {
    background: #f8f8f8;
    color: #555;
    border: 1px solid #ddd;
}

/* ========================================================
   GENERATOR MODAL
   ======================================================== */

.pwGenOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 999;
    display: none;
}

.pwGenOverlay.open {
    display: block;
}

.pwGenPanel {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .15);
    width: 420px;
    display: none;
}

.pwGenPanel.open {
    display: block;
}

.pwGenTitle {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 14px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pwGenField {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pwGenField input[type="range"] {
    flex: 1;
    accent-color: #009933;
}

.pwGenLabel {
    font-size: 12px;
    color: #888;
    width: 30px;
}

.pwGenValue {
    font-size: 15px;
    font-weight: 600;
    color: #009933;
    width: 24px;
    text-align: center;
}

.pwGenCheck {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #555;
    padding: 3px 0;
    cursor: pointer;
    gap: 4px;
}

.pwGenCheck input[type="checkbox"] {
    accent-color: #009933;
}

.pwGenMin {
    color: #aaa;
    font-size: 10px;
    margin-left: auto;
}

.pwGenMin input[type="number"] {
    width: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1px 3px;
    font-size: 10px;
    text-align: center;
    outline: none;
}

.pwGenMin input[type="number"]:focus {
    border-color: #009933;
}

.pwGenResult {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    font-size: 15px;
    text-align: center;
    word-break: break-all;
    color: #333;
    margin-bottom: 12px;
}

.pwGenBtns {
    display: flex;
    gap: 6px;
}

.pwGenBtns button {
    flex: 1;
    height: 30px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pwGenBtns .pwIcon {
    font-size: 15px;
}

.pwGenBtns button:hover {
    background: #f5f5f5;
}

.pwGenBtns button.primary {
    background: #009933;
    color: #fff;
    border-color: #00802b;
}

.pwGenBtns button.primary:hover {
    background: #00802b;
}

.pwGenBtns button.accent {
    background: #2196F3;
    color: #fff;
    border-color: #1a7dd4;
}

.pwGenBtns button.accent:hover {
    background: #1a7dd4;
}

/* ========================================================
   WEB MODE（Cloudflare Pages 网页版）
   ======================================================== */

/* 仅网页版显示的元素；扩展中始终隐藏 */
.webOnly {
    display: none;
}

body.web-mode .pwWebSettingsBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #009933;
    border-radius: 6px;
    background: #fff;
    color: #009933;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

body.web-mode .dlNavLink,
body.web-mode .dlNavSep,
body.web-mode .dlNavCurrent {
    display: none;
}

/* 连接面板：默认关闭；仅在网页版 .open 时显示 */
.pwWebConnect {
    display: none;
    max-width: 720px;
    margin: 24px auto;
    padding: 18px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}

body.web-mode .pwWebConnect.open {
    display: block;
}

.pwWebConnectTitle {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.pwWebConnectHint {
    font-size: 12px;
    line-height: 1.6;
    color: #888;
}

.pwWebConnectGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.pwWebConnectField {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #666;
}

.pwWebConnectField.full {
    grid-column: 1 / -1;
}

.pwWebConnectField input {
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}

.pwWebConnectField input:focus {
    border-color: #009933;
}

.pwWebConnectActions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

.pwWebConnectMsg {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: #888;
}

.pwWebConnectMsg.error { color: #c00; }
.pwWebConnectMsg.success { color: #009933; }

/* 网页版尚未配置时隐藏解锁视图 */
body.web-needs-config #pwLocked {
    display: none !important;
}

/* 切后台时遮挡最近任务预览 */
body.privacy-blur .pwPage {
    filter: blur(12px);
}

/* ========================================================
   MOBILE（<= 720px）
   ======================================================== */

@media (max-width: 720px) {
    body {
        max-width: 100%;
        padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
    }

    .dlHeader {
        font-size: 17px;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .dlHeaderRight {
        margin-left: auto;
        gap: 6px;
    }

    .pwLocked {
        padding: 36px 4px;
    }

    .pwLockedInput {
        width: 100%;
        max-width: 420px;
        height: 46px;
        font-size: 16px;
    }

    .pwLockedBtn {
        width: 100%;
        max-width: 420px;
        height: 46px;
        margin-left: 0;
        margin-top: 8px;
        font-size: 15px;
    }

    .pwToolbar {
        gap: 8px;
    }

    .pwSearch {
        flex: 1 1 100%;
        min-width: 0;
        width: 100%;
        height: 44px;
        font-size: 16px;
    }

    .pwTbBtn {
        height: 44px;
        padding: 0 12px;
        font-size: 14px;
    }

    .pwGroups {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .pwGroupTab {
        flex: 0 0 auto;
        min-height: 38px;
    }

    .pwEditPanel,
    .pwGroupMgr {
        padding: 12px;
    }

    .pwEditFields {
        grid-template-columns: 1fr;
    }

    .pwEditInput {
        height: 44px;
        font-size: 16px;
    }

    .pwEditTextarea {
        min-height: 80px;
        font-size: 16px;
    }

    .pwEditActions {
        flex-direction: column-reverse;
    }

    .pwEditBtn {
        width: 100%;
        height: 44px;
        font-size: 15px;
    }

    .pwGroupRow {
        flex-wrap: wrap;
    }

    .pwGroupRow .pwTbBtn {
        height: 38px;
    }

    /* 列表：横向表格 → 堆叠卡片 */
    .pwColHeader {
        display: none;
    }

    .pwVaultList .pwEntry {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "purpose actions"
            "group group"
            "user user"
            "pw pw"
            "url url"
            "notes notes";
        gap: 6px 10px;
        align-items: start;
        padding: 12px;
        margin-bottom: 10px;
        border: 1px solid #e5e5e5;
        border-radius: 10px;
        background: #fff !important;
    }

    .pwVaultList .pwEntry:nth-child(odd) {
        background: #fff;
    }

    .pwVaultList .pwEntry .pwCol {
        width: auto !important;
        max-width: none;
        min-width: 0;
        align-self: auto;
    }

    .pwVaultList .pwEntry .pwColPurpose {
        grid-area: purpose;
        font-size: 15px;
    }

    .pwVaultList .pwEntry .pwColGroup {
        grid-area: group;
    }

    .pwVaultList .pwEntry .pwColUser {
        grid-area: user;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .pwVaultList .pwEntry .pwColPw {
        grid-area: pw;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .pwVaultList .pwEntry .pwColUrl {
        grid-area: url;
    }

    .pwVaultList .pwEntry .pwColNotes {
        grid-area: notes;
        white-space: normal;
        font-size: 12px;
    }

    .pwVaultList .pwEntry .pwColActions {
        grid-area: actions;
        justify-content: flex-end;
        align-self: start;
    }

    /* 取消桌面端的悬停触发区，改用常显按钮 */
    .pwVaultList .pwEntry .pwColUser::after,
    .pwVaultList .pwEntry .pwColPw::after {
        display: none;
    }

    .pwVaultList .pwEntry .pwColUser::before,
    .pwVaultList .pwEntry .pwColPw::before {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        height: auto;
        flex: 0 0 48px;
        font-family: "Segoe UI", "Lucida Grande", Tahoma, sans-serif;
        font-size: 11px;
        letter-spacing: normal;
        color: #999;
    }

    .pwVaultList .pwEntry .pwColUser::before { content: "用户名"; }
    .pwVaultList .pwEntry .pwColPw::before { content: "密码"; }

    .pwVaultList .pwEntry .pwColUrl::before {
        content: "网址：";
        color: #999;
        font-size: 11px;
    }

    .pwVaultList .pwEntry .pwColNotes::before {
        content: "备注：";
        color: #999;
        font-size: 11px;
    }

    .pwFieldActions {
        position: static;
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }

    .pwActionBtn,
    .pwActionBtn.pwFieldBtn {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .pwCellText {
        padding-right: 0;
    }

    .pwPwText.visible {
        padding-right: 0;
        word-break: break-all;
    }

    .pwEmpty {
        padding: 24px;
    }

    /* 生成器：底部弹层 */
    .pwGenPanel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: auto;
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
        border-radius: 14px 14px 0 0;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    }

    .pwGenBtns {
        flex-wrap: wrap;
    }

    .pwGenBtns button {
        flex: 1 1 45%;
        height: 42px;
        font-size: 13px;
    }

    .pwGenCheck {
        min-height: 40px;
    }

    .pwGenMin input[type="number"] {
        width: 38px;
        height: 30px;
        font-size: 12px;
    }

    /* 网页版连接面板 */
    .pwWebConnect {
        margin: 12px 0;
        padding: 14px;
    }

    .pwWebConnectGrid {
        grid-template-columns: 1fr;
    }

    .pwWebConnectField input {
        height: 44px;
        font-size: 16px;
    }

    .pwWebConnectActions {
        flex-direction: column-reverse;
    }

    .pwWebConnectActions .pwEditBtn {
        width: 100%;
    }

    /* Toast 放到底部，避开顶部安全区 */
    .pwToast {
        top: auto;
        bottom: calc(18px + env(safe-area-inset-bottom));
        max-width: calc(100vw - 32px);
        text-align: center;
    }
}
