:root {
  --page: #f5f7fb; --surface: #fff; --surface-soft: #f8faff; --line: #dfe5ef; --line-strong: #ccd5e3;
  --text: #15213a; --muted: #66758f; --muted-2: #98a4b7; --blue: #245fe5; --blue-dark: #1648bd;
  --blue-soft: #edf3ff; --green: #008c72; --green-soft: #e9f8f4; --danger: #e33b43; --danger-soft: #fff1f1;
  --shadow: 0 2px 6px rgba(24,40,72,.07), 0 14px 36px rgba(24,40,72,.05);
  --sans: Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}
*{box-sizing:border-box} html{min-height:100%;background:var(--page)}
body{margin:0;min-width:320px;min-height:100vh;color:var(--text);background:var(--page);font-family:var(--sans);-webkit-font-smoothing:antialiased}
button,input,textarea{font:inherit} button{color:inherit} button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid rgba(36,95,229,.2);outline-offset:2px}
[hidden]{display:none!important} svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ambient{position:fixed;pointer-events:none;filter:blur(90px);opacity:.28;border-radius:999px}.ambient-one{width:260px;height:260px;left:-120px;bottom:5%;background:#b9d6ff}.ambient-two{width:220px;height:220px;right:4%;top:-100px;background:#d9e8ff}

/* 解锁与初始化 */
.auth-view{min-height:100vh;padding:34px 20px;display:grid;place-items:center;position:relative;background:linear-gradient(145deg,rgba(248,250,255,.74),rgba(239,245,255,.68))}
.auth-card{width:min(100%,440px);padding:42px;background:rgba(255,255,255,.9);border:1px solid rgba(207,218,234,.9);border-radius:26px;box-shadow:0 28px 80px rgba(55,80,122,.13);backdrop-filter:blur(24px)}
.brand{display:flex;align-items:center;gap:12px}.brand-large{margin-bottom:46px}.brand-mark{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;color:#fff;background:linear-gradient(145deg,#2e6bec,#1d52ce);box-shadow:0 9px 24px rgba(36,95,229,.2)}
.brand-mark svg{width:23px;height:23px;stroke-width:2.1}.brand-name,.brand-tagline{display:block}.brand-name{font-family:Georgia,"Songti SC",serif;font-size:22px;font-weight:700;letter-spacing:.12em}.brand-tagline{margin-top:2px;color:var(--muted-2);font-size:9px;letter-spacing:.2em}
.auth-heading{margin-bottom:27px}.eyebrow{margin:0 0 9px;color:var(--blue);font-size:11px;font-weight:800;letter-spacing:.17em;text-transform:uppercase}h1,h2,h3,p{margin-top:0}.auth-heading h1{margin-bottom:10px;font-family:Georgia,"Songti SC",serif;font-size:29px;letter-spacing:.03em}.auth-heading>p:last-child{margin-bottom:0;color:var(--muted);font-size:13px;line-height:1.7}
.field-label{display:block;margin:0 0 8px;color:#4b5d79;font-size:12px;font-weight:700}.field-label span{color:var(--blue)}.top-gap{margin-top:18px}.text-input,.password-input input{width:100%;border:1px solid var(--line-strong);border-radius:11px;color:var(--text);background:#fff;transition:border-color .2s,box-shadow .2s}
.text-input{height:46px;padding:0 14px;margin-bottom:18px}textarea.text-input{height:auto;min-height:108px;padding:12px 14px;resize:vertical;line-height:1.55}.text-input:focus,.password-input input:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(36,95,229,.1)}input::placeholder,textarea::placeholder{color:#a5afbf}
.password-input{position:relative}.password-input input{height:48px;padding:0 52px 0 14px}.password-toggle{position:absolute;top:6px;right:7px}.password-input:has(.generate-button) input{padding-right:124px}.password-input:has(.generate-button) .password-toggle{right:76px}
.icon-button{width:36px;height:36px;padding:0;display:inline-grid;place-items:center;border:0;border-radius:9px;color:var(--muted);background:transparent;cursor:pointer;transition:.18s}.icon-button:hover{color:var(--blue);background:var(--blue-soft)}
.generate-button{position:absolute;top:7px;right:7px;height:34px;padding:0 12px;border:0;border-left:1px solid var(--line);color:var(--blue);background:transparent;font-size:12px;font-weight:700;cursor:pointer}
.primary-button,.secondary-button,.ghost-button,.danger-button,.outline-button,.header-button{min-height:42px;border-radius:10px;padding:0 16px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-weight:700;font-size:13px;cursor:pointer;transition:transform .18s,background .18s,border-color .18s;text-decoration:none}
.primary-button{border:1px solid var(--blue);color:#fff;background:linear-gradient(145deg,#2c69ed,#1f58dd);box-shadow:0 7px 18px rgba(36,95,229,.2)}.primary-button:hover{background:var(--blue-dark);transform:translateY(-1px)}.primary-button:disabled{opacity:.55;cursor:wait;transform:none}.primary-button svg{width:17px;height:17px;stroke-width:2.3}.full-button{width:100%;margin-top:22px}
.secondary-button,.ghost-button,.outline-button,.header-button{border:1px solid var(--line-strong);color:#194bb5;background:#fff;box-shadow:0 1px 2px rgba(26,39,66,.03)}.secondary-button:hover,.ghost-button:hover,.outline-button:hover,.header-button:hover{border-color:#aebbd1;background:#f8faff}.danger-button{border:1px solid #f0a7aa;color:#fff;background:var(--danger)}
.form-error{min-height:18px;margin:10px 0 -6px;color:var(--danger);font-size:12px;line-height:1.5}.field-hint{margin:7px 0 0;color:var(--muted-2);font-size:11px}.strength-track{height:3px;margin-top:9px;overflow:hidden;border-radius:9px;background:#e8edf4}.strength-track span{display:block;width:0;height:100%;border-radius:inherit;background:var(--danger);transition:.2s}
.auth-footnote{margin:28px 0 0;padding-top:20px;display:flex;align-items:center;justify-content:center;gap:7px;border-top:1px solid var(--line);color:var(--muted-2);font-size:11px}.auth-footnote svg{width:15px;height:15px;color:var(--blue)}.auth-copyright{position:absolute;bottom:18px;color:#8b98aa;font-family:Georgia,"Songti SC",serif;font-size:11px;letter-spacing:.18em}

/* 白天主题双栏保险箱 */
.app-view{min-height:100vh;background:var(--page)}.global-header{height:72px;padding:0 26px;display:flex;align-items:center;justify-content:space-between;gap:24px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.94);position:sticky;top:0;z-index:20;backdrop-filter:blur(16px)}
.header-brand .brand-mark{width:38px;height:38px;border-radius:10px}.header-brand .brand-name{font-size:19px}.header-actions{display:flex;align-items:center;gap:10px}.online-pill,.vault-identity{height:42px;padding:0 14px;display:flex;align-items:center;gap:8px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface-soft);color:#273855;font-size:12px;font-weight:700}
.online-pill{color:var(--green);border-color:#a9d8cc;background:var(--green-soft)}.online-pill>span{width:7px;height:7px;border-radius:99px;background:#0cab8c;box-shadow:0 0 0 4px rgba(12,171,140,.11)}.vault-identity svg,.header-button svg{width:17px;height:17px}.header-button{height:42px;padding:0 13px;color:#2452b4}.header-button.strong{color:var(--blue);border-color:#b8c6df}
.vault-shell{height:calc(100vh - 72px);padding:20px 24px 24px;display:flex;flex-direction:column;gap:12px}.vault-toolbar{min-height:50px;display:flex;align-items:center;gap:10px}.search-wrap{height:50px;flex:1 1 360px;padding:0 14px;display:flex;align-items:center;gap:10px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);box-shadow:0 2px 7px rgba(37,55,89,.03)}
.search-wrap>span{display:grid;color:var(--muted-2)}.search-wrap svg{width:18px;height:18px}.search-wrap input{min-width:0;flex:1;border:0;outline:0;color:var(--text);background:transparent;font-size:13px}.search-wrap kbd{padding:3px 6px;border:1px solid var(--line);border-radius:5px;color:var(--muted-2);background:#f7f9fc;font-family:inherit;font-size:9px}
.filter-tabs{display:flex;height:50px;padding:4px;gap:3px;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface)}.nav-item{min-width:66px;padding:0 12px;border:0;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:6px;color:var(--muted);background:transparent;font-size:12px;font-weight:700;cursor:pointer}.nav-item:hover{color:var(--blue);background:#f4f7fd}.nav-item.active{color:var(--blue);background:var(--blue-soft)}
.nav-count{min-width:17px;height:17px;padding:0 4px;display:inline-grid;place-items:center;border-radius:5px;color:inherit;background:rgba(36,95,229,.08);font-size:9px}.add-button{min-width:98px;height:50px;border-radius:12px}.add-button b{font-size:13px}
.vault-split{min-height:0;flex:1;display:grid;grid-template-columns:minmax(350px,42%) minmax(460px,58%);gap:12px}.vault-list-pane,.detail-pane{min-width:0;min-height:0;overflow:auto;border:1px solid var(--line);background:var(--surface);box-shadow:var(--shadow)}.vault-list-pane{padding:18px 12px;border-radius:14px 0 0 14px}.detail-pane{padding:12px;border-radius:0 14px 14px 0}
.list-heading{padding:2px 6px 15px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border-bottom:1px solid #edf0f5}.list-heading h1{margin:0 0 4px;font-size:18px}.list-heading p{margin:0;color:var(--muted);font-size:11px}.encryption-note{height:26px;padding:0 8px;display:inline-flex;align-items:center;gap:5px;border-radius:7px;color:var(--green);background:var(--green-soft);font-size:10px;font-weight:700;white-space:nowrap}.encryption-note svg{width:13px;height:13px}
.item-grid{padding:10px 0 0;display:grid;gap:8px}.vault-card{min-width:0;min-height:80px;padding:13px 12px;display:flex;align-items:center;gap:12px;border:1px solid #e5e9f0;border-radius:11px;background:#fff;cursor:pointer;transition:.18s}.vault-card:hover{border-color:#aebfe0;box-shadow:0 4px 12px rgba(25,55,112,.07);transform:translateY(-1px)}.vault-card.selected{border-color:#5e89ec;background:#edf3ff;box-shadow:0 0 0 1px rgba(36,95,229,.08)}
.item-select{width:18px;height:18px;flex:0 0 auto;border:1px solid #b4bfce;border-radius:4px;background:#fff;pointer-events:none}.vault-card.selected .item-select{border-color:var(--blue);background:var(--blue);box-shadow:inset 0 0 0 4px #edf3ff}.item-avatar{width:39px;height:39px;flex:0 0 auto;display:grid;place-items:center;border-radius:10px;color:#fff;background:linear-gradient(145deg,#4780f0,#285fdd);font-size:15px;font-weight:800;text-transform:uppercase}.item-avatar.note-avatar{background:linear-gradient(145deg,#27ae91,#07826d)}
.card-title{min-width:0;flex:1}.card-title h2{margin:0 0 5px;overflow:hidden;color:#18233a;font-size:14px;text-overflow:ellipsis;white-space:nowrap}.card-title p{margin:0;overflow:hidden;color:var(--muted);font-size:11px;text-overflow:ellipsis;white-space:nowrap}.card-meta{flex:0 0 auto;color:var(--muted-2);font-size:9px}.favorite-indicator{width:22px;display:grid;place-items:center;color:#d7a21d}.favorite-indicator svg{width:16px;height:16px;fill:currentColor}
.empty-state{margin:12px 0 0;padding:60px 18px;border:1px dashed var(--line-strong);border-radius:12px;text-align:center}.empty-icon,.detail-empty-icon{width:58px;height:58px;margin:0 auto 18px;display:grid;place-items:center;border-radius:17px;color:var(--blue);background:var(--blue-soft)}.empty-icon svg,.detail-empty-icon svg{width:27px;height:27px}.empty-state h2,.detail-empty h2{margin-bottom:7px;font-size:18px}.empty-state p,.detail-empty p{margin-bottom:20px;color:var(--muted);font-size:12px;line-height:1.6}
.detail-empty{min-height:100%;padding:40px;display:grid;align-content:center;text-align:center}.detail-empty>*{justify-self:center}.detail-empty p{max-width:300px}.detail-hero,.detail-section{border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 2px 5px rgba(23,39,68,.04)}.detail-hero{min-height:112px;padding:20px;display:flex;align-items:center;gap:15px}
.detail-avatar{width:50px;height:50px;flex:0 0 auto;display:grid;place-items:center;border-radius:13px;color:#fff;background:linear-gradient(145deg,#4780f0,#285fdd);font-size:20px;font-weight:800;text-transform:uppercase}.detail-avatar.note-avatar{background:linear-gradient(145deg,#27ae91,#07826d)}.detail-hero>div:nth-child(2){min-width:0;flex:1}.detail-kicker{margin:0 0 3px;color:var(--blue);font-size:10px;font-weight:800;letter-spacing:.08em}.detail-hero h2{margin:0 0 4px;overflow:hidden;font-size:23px;text-overflow:ellipsis;white-space:nowrap}.detail-hero #detailHost{margin:0;color:var(--muted);font-size:11px}
.detail-star{color:#a2adbd}.detail-star.active{color:#e2a91d;background:#fff8df}.detail-star.active svg{fill:currentColor}.detail-section{margin-top:12px;padding:18px 20px}.detail-section h3{margin:0 0 10px;color:#1a2740;font-size:14px}.info-row{min-height:58px;display:grid;grid-template-columns:120px minmax(0,1fr) auto;align-items:center;gap:14px;border-top:1px solid #edf0f5}.info-row:first-of-type{border-top:0}.info-label{color:var(--muted);font-size:13px}.info-row strong{min-width:0;overflow:hidden;color:#18233a;font-size:13px;text-overflow:ellipsis;white-space:nowrap}.password-value{letter-spacing:.1em}.row-actions{display:flex;gap:7px}
.outline-button{min-height:38px;padding:0 12px;color:#2353bb}.outline-button svg{width:16px;height:16px}.notes-section p,.history-section p{margin:0;color:#4e607c;font-size:12px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.notes-section p:empty::before{content:"未填写备注";color:var(--muted-2)}.history-section p{color:var(--muted)}.detail-actions{margin-top:12px;display:flex;gap:9px}.detail-actions .danger-outline{margin-left:auto;color:var(--danger);border-color:#efb6b8;background:#fffafa}.detail-actions .danger-outline:hover{background:var(--danger-soft)}

/* 弹窗 */
.modal{width:min(calc(100% - 32px),510px);max-height:calc(100vh - 32px);padding:0;overflow:auto;border:1px solid var(--line-strong);border-radius:18px;color:var(--text);background:#fff;box-shadow:0 28px 80px rgba(32,51,87,.2)}.modal::backdrop{background:rgba(19,31,53,.38);backdrop-filter:blur(4px)}.modal>form{padding:27px}.modal-header{margin-bottom:22px;display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.modal-header h2{margin:0;font-size:22px}.close-button{margin:-6px -6px 0 0}
.type-switch{margin-bottom:23px;padding:4px;display:grid;grid-template-columns:1fr 1fr;gap:4px;border:1px solid var(--line);border-radius:11px;background:#f5f7fb}.type-switch button{height:38px;border:0;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:8px;color:var(--muted);background:transparent;font-size:12px;cursor:pointer}.type-switch button.active{color:var(--blue);background:#fff;box-shadow:0 2px 6px rgba(27,45,79,.09)}.type-switch svg{width:16px;height:16px}.favorite-check{margin:3px 0 5px;display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;cursor:pointer}.favorite-check input{accent-color:var(--blue)}.favorite-check svg{width:16px;height:16px}.modal-footer{margin-top:24px;display:flex;justify-content:flex-end;gap:10px}
.confirm-modal{padding:32px;text-align:center}.confirm-modal .modal-footer{justify-content:center}.danger-icon{width:54px;height:54px;margin:0 auto 16px;display:grid;place-items:center;border-radius:16px;color:var(--danger);background:var(--danger-soft)}.confirm-modal h2{margin-bottom:9px;font-size:21px}.confirm-modal p{color:var(--muted);font-size:12px;line-height:1.6}.toast{position:fixed;z-index:100;left:50%;bottom:24px;padding:11px 16px;display:flex;align-items:center;gap:8px;border:1px solid #b9d8d0;border-radius:10px;color:#176452;background:#effaf7;box-shadow:0 14px 40px rgba(31,60,91,.18);font-size:12px;font-weight:700;opacity:0;pointer-events:none;transform:translate(-50%,14px);transition:.24s}.toast.show{opacity:1;transform:translate(-50%,0)}.toast svg{width:16px;height:16px;color:var(--green)}

@media(max-width:1040px){.vault-identity,.online-pill{display:none}.filter-tabs .nav-item{min-width:58px;padding:0 9px}.vault-split{grid-template-columns:minmax(320px,41%) minmax(430px,59%)}.info-row{grid-template-columns:90px minmax(0,1fr);padding:10px 0}.info-row .row-actions,.info-row>.outline-button{grid-column:2;justify-self:start}}
@media(max-width:800px){.global-header{padding:0 16px}.header-actions .header-button{width:40px;padding:0;font-size:0}.header-actions .header-button svg{width:18px;height:18px}.vault-shell{height:auto;min-height:calc(100vh - 72px);padding:14px}.vault-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 50px}.search-wrap{min-width:0;width:auto;grid-column:1;grid-row:1}.add-button{width:50px;min-width:50px;padding:0;grid-column:2;grid-row:1}.add-button b{display:none}.filter-tabs{width:100%;min-width:0;grid-column:1/-1;grid-row:2}.filter-tabs .nav-item{min-width:0;flex:1;padding:0 5px}.vault-split{display:block}.vault-list-pane,.detail-pane{border-radius:13px}.vault-list-pane{max-height:470px}.detail-pane{min-height:420px;margin-top:12px}}
@media(max-width:520px){.auth-view{padding:16px}.auth-card{padding:30px 23px;border-radius:21px}.brand-large{margin-bottom:38px}.auth-heading h1{font-size:25px}.global-header{height:64px}.header-brand .brand-tagline{display:none}.header-actions{gap:6px}.header-actions .header-button:nth-of-type(1),.header-actions .header-button:nth-of-type(2){display:none}.vault-shell{min-height:calc(100vh - 64px)}.search-wrap kbd{display:none}.list-heading p{display:none}.vault-card{min-height:74px;padding:11px 10px}.card-meta{display:none}.detail-pane{padding:8px}.detail-hero{padding:16px}.detail-section{padding:16px}.info-row{grid-template-columns:74px minmax(0,1fr);gap:8px}.info-row .row-actions{width:100%;min-width:0;grid-column:1/-1;justify-self:stretch}.info-row .row-actions .outline-button{min-width:0;flex:1;padding:0 8px}.info-row>.outline-button{width:100%;min-width:0;grid-column:1/-1;justify-self:stretch}.modal>form{padding:23px 20px}.modal-footer .ghost-button,.modal-footer .primary-button,.modal-footer .danger-button{flex:1}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}}
