/* ============================================================
   密码库 · KeyVault
   与 start（我的导航）同一套设计语言：浅色渐变壁纸 + 清透玻璃卡片
   ============================================================ */

:root {
    color-scheme: light;
    --font-sans: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

    --bg: #f7fbfa;
    --text: #162824;
    --text-soft: #5c726c;
    --text-faint: #748a83;

    --accent: #0f9b86;
    --accent-strong: #0b8270;
    --accent-contrast: #ffffff;
    --accent-soft: rgba(15, 155, 134, 0.10);
    --accent-soft-hover: rgba(15, 155, 134, 0.15);
    --accent-border: rgba(15, 155, 134, 0.24);
    --accent-count-bg: rgba(255, 255, 255, 0.20);
    --accent-count-color: #ffffff;

    --danger: #d14b4b;
    --danger-text: #a95050;
    --danger-solid: #d14b4b;
    --danger-contrast: #ffffff;
    --danger-soft: rgba(209, 75, 75, 0.09);

    --warn: #b7791f;
    --warn-soft: rgba(183, 121, 31, 0.10);

    --surface: rgba(255, 255, 255, 0.74);
    --surface-strong: rgba(255, 255, 255, 0.90);
    --surface-solid: #ffffff;
    --border: rgba(22, 40, 36, 0.08);
    --border-strong: rgba(22, 40, 36, 0.14);

    --header-bg: rgba(249, 253, 251, 0.76);
    --header-bg-scrolled: rgba(249, 253, 251, 0.90);
    --header-shadow: 0 12px 34px -28px rgba(13, 60, 52, 0.50);
    --button-solid: #ffffff;
    --button-text: #5c726c;
    --tab-bg: rgba(255, 255, 255, 0.54);
    --tab-bg-hover: rgba(255, 255, 255, 0.82);
    --tab-border: rgba(22, 40, 36, 0.07);
    --tab-pane-1: rgba(255, 255, 255, 0.68);
    --tab-pane-2: rgba(255, 255, 255, 0.48);
    --dialog-bg: rgba(251, 254, 253, 0.98);
    --dialog-backdrop: rgba(10, 30, 25, 0.25);
    --input-bg: #ffffff;
    --input-placeholder: #a3b3ae;
    --toast-bg: rgba(22, 40, 36, 0.92);
    --toast-text: #f4fbf8;
    --toast-border: transparent;
    --hover: rgba(22, 40, 36, 0.05);
    --hover-strong: rgba(22, 40, 36, 0.065);
    --code-bg: rgba(22, 40, 36, 0.05);
    --count-bg: rgba(255, 255, 255, 0.62);
    --count-color: #748a83;
    --empty-bg: rgba(255, 255, 255, 0.65);
    --icon-bg: #ffffff;
    --icon-border: rgba(22, 40, 36, 0.055);
    --icon-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 10px -8px rgba(13, 60, 52, 0.3);
    --scroll-thumb: rgba(22, 40, 36, 0.18);
    --scroll-thumb-hover: rgba(22, 40, 36, 0.30);
    --selection: rgba(15, 155, 134, 0.20);

    --glass-pane-1: rgba(255, 255, 255, 0.34);
    --glass-pane-2: rgba(255, 255, 255, 0.12);
    --glass-sheen: rgba(255, 255, 255, 0.58);
    --glass-sheen-soft: rgba(255, 255, 255, 0.34);
    --glass-edge-light: rgba(255, 255, 255, 1);
    --glass-edge-shade: rgba(13, 60, 52, 0.10);
    --glass-border: rgba(255, 255, 255, 0.62);
    --glass-ring: rgba(255, 255, 255, 0.30);
    --glass-glow: rgba(15, 155, 134, 0.20);
    --glass-drop: rgba(13, 60, 52, 0.26);
    --glass-blur: 16px;

    --shadow-sm: 0 1px 2px rgba(13, 60, 52, 0.03), 0 6px 18px -14px rgba(13, 60, 52, 0.20);
    --shadow-md: 0 14px 34px -22px rgba(13, 60, 52, 0.34), 0 2px 6px -3px rgba(13, 60, 52, 0.06);
    --shadow-lg: 0 28px 70px -36px rgba(13, 60, 52, 0.40);

    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --content-w: 1200px;
}

[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0b1417;
    --text: #e8f1ee;
    --text-soft: #a1b4af;
    --text-faint: #829792;

    --accent: #5ee0c8;
    --accent-strong: #8af0dd;
    --accent-contrast: #06231f;
    --accent-soft: rgba(94, 224, 200, 0.12);
    --accent-soft-hover: rgba(94, 224, 200, 0.18);
    --accent-border: rgba(94, 224, 200, 0.30);
    --accent-count-bg: rgba(6, 35, 31, 0.14);
    --accent-count-color: #06231f;

    --danger: #ff9a9a;
    --danger-text: #ff9a9a;
    --danger-solid: #c94a4a;
    --danger-contrast: #ffffff;
    --danger-soft: rgba(255, 120, 120, 0.12);

    --warn: #e7b96a;
    --warn-soft: rgba(231, 185, 106, 0.12);

    --surface: rgba(17, 29, 32, 0.74);
    --surface-strong: rgba(18, 33, 36, 0.94);
    --surface-solid: #111d20;
    --border: rgba(232, 241, 238, 0.10);
    --border-strong: rgba(232, 241, 238, 0.18);

    --header-bg: rgba(10, 20, 23, 0.76);
    --header-bg-scrolled: rgba(10, 20, 23, 0.92);
    --header-shadow: 0 12px 34px -28px rgba(0, 0, 0, 0.80);
    --button-solid: #17272a;
    --button-text: #c2d3ce;
    --tab-bg: rgba(20, 34, 37, 0.66);
    --tab-bg-hover: rgba(29, 48, 51, 0.92);
    --tab-border: rgba(232, 241, 238, 0.09);
    --tab-pane-1: rgba(255, 255, 255, 0.105);
    --tab-pane-2: rgba(255, 255, 255, 0.035);
    --dialog-bg: rgba(13, 25, 28, 0.98);
    --dialog-backdrop: rgba(0, 0, 0, 0.58);
    --input-bg: #0d191c;
    --input-placeholder: #758b85;
    --toast-bg: rgba(29, 48, 52, 0.96);
    --toast-text: #eef9f5;
    --toast-border: rgba(232, 241, 238, 0.12);
    --hover: rgba(232, 241, 238, 0.06);
    --hover-strong: rgba(232, 241, 238, 0.09);
    --code-bg: rgba(232, 241, 238, 0.07);
    --count-bg: rgba(255, 255, 255, 0.06);
    --count-color: #a1b4af;
    --empty-bg: rgba(17, 30, 33, 0.66);
    --icon-bg: #f5faf8;
    --icon-border: rgba(255, 255, 255, 0.10);
    --icon-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 4px 12px -8px rgba(0, 0, 0, 0.75);
    --scroll-thumb: rgba(232, 241, 238, 0.18);
    --scroll-thumb-hover: rgba(232, 241, 238, 0.30);
    --selection: rgba(94, 224, 200, 0.24);

    --glass-pane-1: rgba(255, 255, 255, 0.075);
    --glass-pane-2: rgba(255, 255, 255, 0.015);
    --glass-sheen: rgba(255, 255, 255, 0.15);
    --glass-sheen-soft: rgba(255, 255, 255, 0.09);
    --glass-edge-light: rgba(255, 255, 255, 0.18);
    --glass-edge-shade: rgba(0, 0, 0, 0.45);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-ring: rgba(255, 255, 255, 0.07);
    --glass-glow: rgba(94, 224, 200, 0.14);
    --glass-drop: rgba(0, 0, 0, 0.55);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 20px -16px rgba(0, 0, 0, 0.60);
    --shadow-md: 0 16px 40px -26px rgba(0, 0, 0, 0.75), 0 2px 8px -4px rgba(0, 0, 0, 0.40);
    --shadow-lg: 0 30px 80px -40px rgba(0, 0, 0, 0.85);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.7s ease, color 0.4s ease;
}

body.no-scroll {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--selection);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--scroll-thumb);
    background-clip: padding-box;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   背景
   ============================================================ */

.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.page-bg::before,
.page-bg::after {
    content: "";
    position: absolute;
    inset: -12vmax;
    opacity: 0;
    transition: opacity 0.8s ease;
    animation: bg-drift 48s ease-in-out infinite alternate;
}

.page-bg::before {
    opacity: 1;
    background:
        radial-gradient(40vmax 34vmax at 6% 0%, rgba(48, 214, 176, 0.72), transparent 60%),
        radial-gradient(34vmax 30vmax at 96% 2%, rgba(96, 158, 255, 0.62), transparent 62%),
        radial-gradient(28vmax 26vmax at 74% 38%, rgba(156, 124, 255, 0.34), transparent 64%),
        radial-gradient(26vmax 24vmax at 14% 70%, rgba(255, 136, 186, 0.26), transparent 64%),
        radial-gradient(38vmax 32vmax at 58% 106%, rgba(255, 168, 104, 0.40), transparent 64%),
        linear-gradient(180deg, #fbfefd 0%, #effaf6 46%, #e8f4f1 100%);
}

.page-bg::after {
    background:
        radial-gradient(42vmax 36vmax at 8% 0%, rgba(52, 210, 180, 0.46), transparent 58%),
        radial-gradient(38vmax 34vmax at 100% 2%, rgba(96, 150, 255, 0.42), transparent 60%),
        radial-gradient(32vmax 30vmax at 74% 40%, rgba(150, 120, 255, 0.30), transparent 62%),
        radial-gradient(28vmax 26vmax at 12% 74%, rgba(255, 120, 160, 0.16), transparent 64%),
        radial-gradient(44vmax 34vmax at 56% 108%, rgba(255, 156, 90, 0.20), transparent 62%),
        linear-gradient(180deg, #101b1f 0%, #0b1518 46%, #081114 100%);
}

[data-theme="dark"] .page-bg::before {
    opacity: 0;
}

[data-theme="dark"] .page-bg::after {
    opacity: 1;
}

@keyframes bg-drift {
    from {
        transform: translate3d(-1.5vmax, 1vmax, 0) scale(1);
    }
    to {
        transform: translate3d(2vmax, -1.5vmax, 0) scale(1.06);
    }
}

/* ============================================================
   顶栏
   ============================================================ */

.app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    backdrop-filter: blur(18px) saturate(1.15);
    transition: box-shadow 0.25s ease, background-color 0.7s ease, border-color 0.5s ease;
}

.topbar.is-scrolled {
    background: var(--header-bg-scrolled);
    box-shadow: var(--header-shadow);
}

.topbar__inner {
    width: 100%;
    max-width: var(--content-w);
    min-height: 72px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    text-decoration: none;
    border-radius: 12px;
}

.brand__mark {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #23c69f 0%, #0d9488 100%);
    box-shadow: 0 8px 22px -12px rgba(13, 148, 136, 0.65);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.brand__mark .icon {
    width: 19px;
    height: 19px;
}

.brand:hover .brand__mark {
    transform: translateY(-1px) rotate(-5deg);
    box-shadow: 0 12px 26px -12px rgba(13, 148, 136, 0.75);
}

.brand__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.brand__title {
    overflow: hidden;
    color: var(--text);
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    line-height: 1.25;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.brand__sub {
    overflow: hidden;
    color: var(--text-faint);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.btn-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background-image:
        linear-gradient(180deg, var(--glass-sheen-soft) 0%, rgba(255, 255, 255, 0) 60%),
        linear-gradient(165deg, var(--glass-pane-1) 0%, var(--glass-pane-2) 100%);
    background-color: transparent;
    color: var(--text-soft);
    cursor: pointer;
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
    box-shadow: inset 0 1px 0 var(--glass-edge-light), 0 8px 18px -16px var(--glass-drop);
    transition: color 0.18s ease, transform 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.btn-icon:hover {
    color: var(--accent);
    border-color: var(--accent-border);
    transform: translateY(-1px);
}

.btn-icon:active {
    transform: scale(0.94);
}

.btn-icon .icon {
    width: 17px;
    height: 17px;
}

.theme-toggle .icon--moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon--sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon--moon {
    display: block;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 9px;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-pill .icon {
    width: 12px;
    height: 12px;
}

.sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px 0 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--chip-bg, var(--surface));
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 620;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.sync-pill__dot {
    width: 6px;
    height: 6px;
    flex: none;
    border-radius: 50%;
    background: currentColor;
}

.sync-pill[data-tone="busy"] {
    color: var(--accent);
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.sync-pill[data-tone="busy"] .sync-pill__dot {
    animation: sync-pulse 1.2s ease-in-out infinite;
}

.sync-pill[data-tone="warn"] {
    color: var(--warn, #b4651c);
    border-color: rgba(180, 101, 28, 0.35);
    background: rgba(180, 101, 28, 0.1);
}

@keyframes sync-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}

@media (max-width: 620px) {
    .sync-pill span {
        display: none;
    }

    .sync-pill {
        padding: 0 8px;
    }
}

.btn--unlock {
    box-shadow: 0 10px 22px -14px rgba(15, 155, 134, 0.8);
}

/* 菜单 */

.menu-wrap {
    position: relative;
}

.menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 60;
    width: 246px;
    padding: 7px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    /* 实色打底：不支持 backdrop-filter 的环境（部分内嵌浏览器、无 GPU 渲染）也能看清 */
    background-color: var(--surface-solid);
    background-image: linear-gradient(180deg, var(--glass-sheen-soft) 0%, rgba(255, 255, 255, 0) 40%),
        linear-gradient(165deg, var(--surface-strong) 0%, var(--surface) 100%);
    -webkit-backdrop-filter: blur(26px) saturate(1.6);
    backdrop-filter: blur(26px) saturate(1.6);
    box-shadow: inset 0 1px 0 var(--glass-edge-light), var(--shadow-md);
    animation: menu-in 0.16s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px 8px;
    color: var(--text-faint);
    font-size: 0.66rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mode-pill {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    text-transform: none;
}

.menu__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.14s ease, color 0.14s ease;
}

.menu__item:hover {
    background: var(--hover-strong);
    color: var(--text);
}

.menu__item .icon {
    width: 15px;
    height: 15px;
    color: var(--text-faint);
}

.menu__item:hover .icon {
    color: var(--accent);
}

.menu__item--danger {
    color: var(--danger-text);
}

.menu__item--danger .icon,
.menu__item--danger:hover .icon {
    color: var(--danger);
}

.menu__item--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.menu__divider {
    height: 1px;
    margin: 5px 6px;
    background: var(--border);
}

.menu__note {
    margin: 6px 4px 2px;
    padding: 7px 8px;
    border-radius: 8px;
    background: var(--code-bg);
    color: var(--text-faint);
    font-size: 0.68rem;
    line-height: 1.6;
}

/* ============================================================
   主区域
   ============================================================ */

.page {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 24px 90px;
}

.dock {
    position: sticky;
    top: 72px;
    z-index: 40;
    padding-top: 22px;
    padding-bottom: 12px;
    background: linear-gradient(180deg, var(--bg) 0%, rgba(247, 251, 250, 0) 92%);
    transition: background-color 0.7s ease;
}

[data-theme="dark"] .dock {
    background: linear-gradient(180deg, var(--bg) 0%, rgba(11, 20, 23, 0) 92%);
}

.searchbar {
    margin-bottom: 14px;
}

.search {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    padding: 0 10px 0 15px;
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    background-image:
        linear-gradient(180deg, var(--glass-sheen-soft) 0%, rgba(255, 255, 255, 0) 34%),
        linear-gradient(165deg, var(--glass-pane-1) 0%, var(--glass-pane-2) 100%);
    -webkit-backdrop-filter: blur(20px) saturate(1.7);
    backdrop-filter: blur(20px) saturate(1.7);
    box-shadow:
        inset 0 1px 0 var(--glass-edge-light),
        inset 0 -8px 16px -14px var(--glass-edge-shade),
        0 16px 34px -28px var(--glass-drop);
    transition: border-color 0.2s ease, box-shadow 0.3s ease;
}

.search:focus-within {
    border-color: var(--accent-border);
    box-shadow:
        inset 0 1px 0 var(--glass-edge-light),
        0 0 0 4px var(--accent-soft),
        0 16px 34px -28px var(--glass-drop);
}

.search__icon {
    display: grid;
    place-items: center;
    color: var(--text-faint);
}

.search__icon .icon {
    width: 17px;
    height: 17px;
}

.search__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}

.search__input::placeholder {
    color: var(--input-placeholder);
}

.search__input::-webkit-search-cancel-button {
    display: none;
}

.search__clear {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--hover-strong);
    color: var(--text-soft);
    cursor: pointer;
}

.search__clear .icon {
    width: 13px;
    height: 13px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 36px;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow-x: auto;
    padding: 2px 11px;
    margin-inline: -11px;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    position: relative;
    height: 34px;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background-image:
        linear-gradient(180deg, var(--glass-sheen-soft) 0%, rgba(255, 255, 255, 0) 58%),
        linear-gradient(165deg, var(--tab-pane-1) 0%, var(--tab-pane-2) 100%);
    background-color: transparent;
    color: var(--text);
    font-size: 0.79rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
    box-shadow: inset 0 1px 0 var(--glass-edge-light), 0 7px 14px -12px var(--glass-drop);
    transition: color 0.18s ease, border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.5s ease;
}

.tab:hover {
    color: var(--accent);
    border-color: var(--accent-border);
}

.tab.is-active {
    color: var(--accent-contrast);
    border-color: rgba(255, 255, 255, 0.30);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0) 58%),
        linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 12px 22px -14px var(--accent-border);
}

.tab__dot {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--dot, var(--accent));
}

.tab.is-active .tab__dot {
    background: rgba(255, 255, 255, 0.85);
}

.tab__count {
    min-width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--hover-strong);
    color: var(--text-faint);
    font-size: 0.63rem;
    font-weight: 600;
    line-height: 1;
}

.tab.is-active .tab__count {
    background: var(--accent-count-bg);
    color: var(--accent-count-color);
}

.tab--add {
    color: var(--accent);
    border-style: dashed;
    border-color: var(--accent-border);
    background-image: none;
    background-color: var(--accent-soft);
}

.tab--add:hover {
    background-color: var(--accent-soft-hover);
}

.tab--add .icon {
    width: 13px;
    height: 13px;
}

.stats {
    margin: 0 0 0 auto;
    color: var(--text-faint);
    font-size: 0.72rem;
    white-space: nowrap;
}

/* ============================================================
   账户卡片
   ============================================================ */

.vault {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(308px, 1fr));
    gap: 13px;
    padding-top: 6px;
}

@media (max-width: 760px) {
    /* 窄屏时给悬浮的「新建账户」留出空间，最后一张卡片不会被盖住 */
    .vault {
        padding-bottom: 84px;
    }
}

.vault-card {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px 14px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background-image:
        linear-gradient(180deg, var(--glass-sheen-soft) 0%, rgba(255, 255, 255, 0) 26%),
        linear-gradient(165deg, var(--glass-pane-1) 0%, var(--glass-pane-2) 100%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.7);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.7);
    box-shadow:
        inset 0 1px 0 var(--glass-edge-light),
        inset 0 0 0 1px var(--glass-ring),
        0 16px 32px -24px var(--glass-drop);
    transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease,
        border-color 0.4s ease;
}

.vault-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-border);
    box-shadow:
        inset 0 1px 0 var(--glass-edge-light),
        inset 0 0 0 1px var(--glass-ring),
        0 26px 46px -26px var(--glass-drop);
}

.vault-card__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.vault-card__mark {
    width: 38px;
    height: 38px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--tile-1, #d1fae5), var(--tile-2, #a7f3d0));
    color: var(--tile-fg, #047857);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.vault-card__titles {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 1px;
}

.vault-card__name {
    overflow: hidden;
    margin: 0;
    color: var(--text);
    font-size: 0.93rem;
    font-weight: 640;
    letter-spacing: 0.005em;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.vault-card__account {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: var(--text-soft);
    font-size: 0.76rem;
    line-height: 1.4;
}

.vault-card__account span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.vault-card__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.vault-card:hover .vault-card__actions,
.vault-card:focus-within .vault-card__actions {
    opacity: 1;
    transform: none;
}

.mini-btn {
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 0.14s ease, background-color 0.14s ease;
}

.mini-btn:hover {
    color: var(--accent);
    background: var(--hover-strong);
}

.mini-btn--danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.mini-btn .icon {
    width: 14px;
    height: 14px;
}

.pwd-row {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 38px;
    padding: 0 5px 0 11px;
    border-radius: 10px;
    background: var(--code-bg);
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.pwd-row:focus-within {
    border-color: var(--accent-border);
}

.pwd-row__value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    white-space: nowrap;
    text-overflow: ellipsis;
    user-select: none;
}

.pwd-row__value.is-plain {
    letter-spacing: 0.01em;
    user-select: text;
}

.pwd-row__value.is-masked {
    color: var(--text-faint);
}

.pwd-row__empty {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-faint);
    font-size: 0.76rem;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.pwd-row__empty .icon {
    width: 13px;
    height: 13px;
}

.pwd-row__empty:hover {
    color: var(--accent);
}

.vault-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 22px;
}

.code-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 62%;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    background: var(--code-bg);
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 620;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-chip i {
    width: 6px;
    height: 6px;
    flex: none;
    border-radius: 50%;
    background: var(--dot, currentColor);
}

.site-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: 52%;
    color: var(--text-faint);
    font-size: 0.7rem;
    text-decoration: none;
    transition: color 0.16s ease;
}

.site-link span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.site-link .icon {
    width: 11px;
    height: 11px;
    flex: none;
}

.site-link:hover {
    color: var(--accent);
}

.site-link--none {
    color: var(--input-placeholder);
}

/* ============================================================
   空状态 / 悬浮按钮
   ============================================================ */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 460px;
    margin: 9vh auto 0;
    padding: 40px 28px;
    border: 1px solid var(--card-border, var(--glass-border));
    border-radius: var(--radius-xl);
    background: var(--empty-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.empty__icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
}

.empty__icon .icon {
    width: 22px;
    height: 22px;
}

.empty h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
}

.empty p {
    margin: 0 0 8px;
    color: var(--text-faint);
    font-size: 0.8rem;
    line-height: 1.7;
}

.add-fab {
    position: fixed;
    right: max(24px, calc(50vw - var(--content-w) / 2 + 24px));
    bottom: 28px;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 46px;
    padding: 0 19px 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: linear-gradient(140deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: var(--accent-contrast);
    font-size: 0.84rem;
    font-weight: 620;
    cursor: pointer;
    box-shadow: 0 16px 34px -16px rgba(11, 130, 112, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.22s cubic-bezier(0.32, 1.4, 0.5, 1), box-shadow 0.3s ease, opacity 0.2s ease;
}

.add-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px -16px rgba(11, 130, 112, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.add-fab:active {
    transform: scale(0.97);
}

.add-fab .icon {
    width: 17px;
    height: 17px;
}

/* ============================================================
   页脚 / 回到顶部 / Toast
   ============================================================ */

.footer {
    position: relative;
    z-index: 1;
}

.footer__inner {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 8px 24px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-faint);
    font-size: 0.72rem;
}

.footer__inner p {
    margin: 0;
}

.footer__note {
    letter-spacing: 0.02em;
}

.back-top {
    position: fixed;
    right: max(24px, calc(50vw - var(--content-w) / 2 + 24px));
    bottom: 84px;
    z-index: 44;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background-image: linear-gradient(165deg, var(--glass-pane-1), var(--glass-pane-2));
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    color: var(--text-soft);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    box-shadow: inset 0 1px 0 var(--glass-edge-light), var(--shadow-sm);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, color 0.16s ease;
}

.back-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-top:hover {
    color: var(--accent);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 200;
    max-width: min(420px, calc(100vw - 32px));
    padding: 10px 16px;
    border: 1px solid var(--toast-border);
    border-radius: 12px;
    background: var(--toast-bg);
    color: var(--toast-text);
    font-size: 0.79rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 10px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.toast--warn {
    background: var(--warn);
    color: #fff;
}

.noscript {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 200;
    transform: translateX(-50%);
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--toast-bg);
    color: var(--toast-text);
    font-size: 0.8rem;
}

/* ============================================================
   对话框
   ============================================================ */

.dialog {
    width: min(560px, calc(100vw - 32px));
    max-width: 560px;
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    overflow: visible;
}

.dialog--sm {
    width: min(430px, calc(100vw - 32px));
    max-width: 430px;
}

.dialog::backdrop {
    background: var(--dialog-backdrop);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.dialog-card {
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    background: var(--dialog-bg);
    box-shadow: var(--shadow-lg);
    animation: dialog-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.dialog-card:focus {
    outline: none;
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.dialog-card.shake {
    animation: shake 0.34s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--border);
}

.dialog__kicker {
    margin: 0 0 3px;
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 650;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.dialog__head h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

.dialog__close {
    width: 32px;
    height: 32px;
    flex: none;
    display: grid;
    place-items: center;
    margin-top: 1px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.dialog__close:hover {
    color: var(--text);
    background: var(--hover);
}

.dialog__close .icon {
    width: 16px;
    height: 16px;
}

.dialog__body {
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 18px 22px;
    overflow-y: auto;
}

.dialog__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border);
}

.dialog__foot-left,
.dialog__foot-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field__label {
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 600;
}

.field__label em {
    color: var(--accent);
    font-style: normal;
}

.field__label small {
    margin-left: 3px;
    color: var(--text-faint);
    font-size: 0.65rem;
    font-weight: 400;
}

.input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.84rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.6s ease;
}

.input::placeholder {
    color: var(--input-placeholder);
}

.input:focus {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.input.is-error {
    border-color: rgba(209, 75, 75, 0.55);
    box-shadow: 0 0 0 4px var(--danger-soft);
}

.select {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237f948e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.input-group {
    position: relative;
    display: block;
}

.input-group .input {
    padding-right: 42px;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.input-group__btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.input-group__btn:hover {
    color: var(--accent);
    background: var(--hover);
}

.input-group__btn .icon {
    width: 16px;
    height: 16px;
}

.icon--eye-off,
.input-group__btn.is-plain .icon--eye,
.auth-eye.is-plain .icon--eye {
    display: none;
}

.input-group__btn.is-plain .icon--eye-off,
.auth-eye.is-plain .icon--eye-off {
    display: block;
}

.code-new {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
    padding: 9px;
    border: 1px dashed var(--accent-border);
    border-radius: 11px;
    background: var(--accent-soft);
}

.form-error {
    margin: 0;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 0.74rem;
    line-height: 1.6;
}

.form-note {
    margin: 0;
    color: var(--text-faint);
    font-size: 0.74rem;
    line-height: 1.7;
}

.callout {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--text-soft);
    font-size: 0.75rem;
    line-height: 1.65;
}

.callout .icon {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    flex: none;
    color: var(--accent);
}

.callout p {
    margin: 0;
}

.callout--warn {
    background: var(--warn-soft);
    color: var(--text-soft);
}

.callout--warn .icon {
    color: var(--warn);
}

.confirm-message {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.84rem;
    line-height: 1.7;
}

.confirm-message strong {
    color: var(--text);
    font-weight: 650;
}

/* 密码强度 */

.pwd-meter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
}

.pwd-meter--inline {
    margin-top: 8px;
}

.pwd-meter--inline em {
    min-width: 28px;
    text-align: right;
}

.pwd-meter__track {
    position: relative;
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: var(--code-bg);
    overflow: hidden;
}

.pwd-meter__track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--danger);
    transition: width 0.28s ease, background-color 0.28s ease;
}

.pwd-meter em {
    flex: none;
    color: var(--text-faint);
    font-size: 0.66rem;
    font-style: normal;
}

.pwd-meter[data-score="2"] .pwd-meter__track i {
    background: #d99a2b;
}

.pwd-meter[data-score="3"] .pwd-meter__track i {
    background: #4bb464;
}

.pwd-meter[data-score="4"] .pwd-meter__track i {
    background: var(--accent);
}

/* ============================================================
   密码代号 / 设备列表
   ============================================================ */

.code-list,
.device-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.code-row,
.device-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--code-bg);
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.code-row:hover,
.device-row:hover {
    border-color: var(--accent-border);
}

.code-row__dot {
    width: 9px;
    height: 9px;
    flex: none;
    border-radius: 50%;
    background: var(--dot, var(--accent));
    box-shadow: 0 0 0 3px var(--dot-soft, var(--accent-soft));
}

.code-row__body,
.device-row__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.code-row__name,
.device-row__name {
    overflow: hidden;
    color: var(--text);
    font-size: 0.83rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.code-row__meta,
.device-row__meta {
    color: var(--text-faint);
    font-size: 0.69rem;
}

.code-row__warn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 0.64rem;
    font-weight: 600;
    white-space: nowrap;
}

.code-row__warn .icon {
    width: 11px;
    height: 11px;
}

.device-now {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--accent-border);
    border-radius: 14px;
    background: var(--accent-soft);
}

.device-now__icon {
    width: 36px;
    height: 36px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--surface-solid);
    color: var(--accent);
    box-shadow: var(--icon-shadow);
}

.device-now__icon .icon {
    width: 17px;
    height: 17px;
}

.device-now__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.device-now__body strong {
    font-size: 0.82rem;
    font-weight: 650;
}

.device-now__body span {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 0.71rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.device-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--surface-solid);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 650;
    white-space: nowrap;
}

.device-current-tag {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 650;
}

/* 导入文件 */

.import-file {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 13px;
    background: var(--code-bg);
}

.import-file > .icon {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--text-faint);
}

.import-file > div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.import-file strong {
    overflow: hidden;
    font-size: 0.8rem;
    font-weight: 620;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.import-file span {
    color: var(--text-faint);
    font-size: 0.69rem;
}

.import-file.has-file {
    border-style: solid;
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

.import-file.has-file > .icon {
    color: var(--accent);
}

/* ============================================================
   按钮
   ============================================================ */

.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--button-solid);
    color: var(--button-text);
    font-size: 0.79rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.16s ease, background-color 0.4s ease, border-color 0.3s ease,
        box-shadow 0.3s ease, transform 0.18s ease;
}

.btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: 0 4px 10px -8px rgba(13, 60, 52, 0.3);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}

.btn .icon {
    width: 15px;
    height: 15px;
}

.btn--primary {
    border-color: transparent;
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: 0 8px 18px -12px rgba(15, 155, 134, 0.8);
}

.btn--primary:hover {
    color: var(--accent-contrast);
    border-color: transparent;
    background: var(--accent-strong);
}

.btn--danger {
    border-color: transparent;
    background: var(--danger-solid);
    color: var(--danger-contrast);
}

.btn--danger:hover {
    color: var(--danger-contrast);
    background: #b83f3f;
}

.btn--ghost {
    border-color: transparent;
    background: transparent;
    color: var(--text-soft);
}

.btn--ghost:hover {
    border-color: transparent;
    background: var(--hover);
    box-shadow: none;
}

.btn--danger-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--danger-text);
}

.btn--danger-ghost:hover {
    border-color: transparent;
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: none;
}

.btn--small {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.73rem;
    border-radius: 9px;
}

.btn--small .icon {
    width: 13px;
    height: 13px;
}

.btn--block {
    width: 100%;
}

.btn--dashed {
    border: 1px dashed var(--accent-border);
    color: var(--accent);
    background: transparent;
}

.btn--dashed:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: none;
}

/* ============================================================
   只读模式
   ============================================================ */

body.is-readonly .add-fab,
body.is-readonly .vault-card__actions {
    display: none;
}

body.is-readonly .vault-card__foot {
    padding-right: 2px;
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 860px) {
    .topbar__inner {
        padding: 0 16px;
        min-height: 64px;
    }

    .page {
        padding: 0 16px 96px;
    }

    .dock {
        top: 64px;
    }

    .field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .vault {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 640px) {
    .search {
        height: 44px;
    }

    .stats {
        display: none;
    }

    .toolbar {
        gap: 8px;
    }

    .top-actions {
        gap: 6px;
    }

    .btn-icon {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }

    .brand__sub {
        display: none;
    }

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

    .vault-card__actions {
        opacity: 1;
        transform: none;
    }

    .add-fab {
        right: 16px;
        bottom: 18px;
        height: 44px;
        padding: 0 16px 0 14px;
    }

    .toast {
        bottom: 80px;
    }

    .back-top {
        display: none;
    }

    .dialog__head {
        padding: 17px 18px 13px;
    }

    .dialog__body {
        padding: 16px 18px;
    }

    .dialog__foot {
        padding: 13px 18px 16px;
    }

    .menu {
        width: min(246px, calc(100vw - 32px));
    }

    .status-pill {
        display: none;
    }

    .btn--unlock span {
        display: none;
    }

    .btn--unlock {
        width: 38px;
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
