:root {
    color-scheme: light;
    --bg: #f4f6fb;
    --surface: #ffffff;
    --ink: #172033;
    --muted: #6d7587;
    --line: #e5e8f0;
    --primary: #6558e8;
    --primary-dark: #5145ce;
    --primary-soft: #eeecff;
    --mint: #20a47a;
    --danger: #d94b5b;
    --shadow: 0 18px 55px rgba(28, 35, 60, .07);
    --radius: 22px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background:
        radial-gradient(circle at 85% 5%, rgba(101, 88, 232, .09), transparent 25rem),
        radial-gradient(circle at 5% 35%, rgba(32, 164, 122, .05), transparent 23rem),
        var(--bg);
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

button:not(:disabled),
a {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: .6;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(101, 88, 232, .22);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.site-header {
    width: min(1160px, calc(100% - 48px));
    height: 88px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(215, 219, 231, .7);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -.3px;
}

.brand-mark {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    color: white;
    border-radius: 11px;
    background: linear-gradient(145deg, #7669ef, #5144c7);
    box-shadow: 0 7px 18px rgba(101, 88, 232, .25);
}

.brand-mark svg {
    width: 22px;
    height: 22px;
}

.local-badge,
.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
}

.local-badge {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .6);
}

.status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 4px rgba(32, 164, 122, .1);
}

.page-shell {
    width: min(1160px, calc(100% - 48px));
    margin: 0 auto;
    padding-top: 12px;
}

.section-kicker {
    color: var(--primary);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 1.7px;
}

.setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 24px;
    align-items: stretch;
}

@media (min-width: 901px) {
    .setup-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(310px, .85fr);
    }
}

.panel {
    border-radius: var(--radius);
}

.add-panel {
    padding: 32px;
    border: 1px solid rgba(226, 229, 239, .9);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-heading,
.label-row,
.account-top,
.account-identity,
.code-row,
.account-actions,
.dialog-actions {
    display: flex;
    align-items: center;
}

.panel-heading {
    justify-content: space-between;
}

.panel h2,
.accounts-section h2,
.guide-panel h2 {
    margin: 7px 0 0;
    font-size: 23px;
    letter-spacing: -.6px;
}

.heading-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: var(--primary);
    border-radius: 13px;
    background: var(--primary-soft);
}

#account-form {
    margin-top: 28px;
}

.field + .field {
    margin-top: 22px;
}

.field label {
    color: #313a4d;
    font-size: 14px;
    font-weight: 650;
}

.label-row {
    justify-content: space-between;
    margin-bottom: 9px;
}

.field > label {
    display: block;
    margin-bottom: 9px;
}

.field input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    color: var(--ink);
    border: 1px solid #dce0e9;
    border-radius: 11px;
    background: #fafbfc;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.field input::placeholder {
    color: #a2a8b6;
}

.field input:hover {
    border-color: #c9cddb;
}

.field input:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
    box-shadow: 0 0 0 4px rgba(101, 88, 232, .09);
}

.field-hint {
    margin: 8px 0 0;
    color: #8a91a1;
    font-size: 12px;
    line-height: 1.5;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    color: var(--primary);
    border: 0;
    background: none;
    font-size: 12px;
    font-weight: 650;
}

.text-button svg {
    width: 14px;
    height: 14px;
}

.secret-input-wrap {
    position: relative;
}

.secret-input-wrap input {
    padding-right: 88px;
}

.secret-input {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.secret-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 10px;
    color: var(--muted);
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 12px;
}

.secret-toggle:hover {
    background: #f0f1f5;
}

.secret-toggle svg {
    width: 16px;
    height: 16px;
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 11px;
    font-weight: 650;
    transition: transform .15s, background .2s, box-shadow .2s;
}

.primary-button {
    width: 100%;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    border: 0;
    background: linear-gradient(110deg, #6b5de9, #584acf);
    box-shadow: 0 9px 20px rgba(101, 88, 232, .2);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(101, 88, 232, .28);
}

.primary-button:active:not(:disabled) {
    transform: translateY(0);
}

.form-message {
    margin: 16px 0 -8px;
    padding: 10px 12px;
    color: #b23b4b;
    border: 1px solid #f5d9dd;
    border-radius: 9px;
    background: #fff5f6;
    font-size: 13px;
    line-height: 1.5;
}

.guide-panel {
    position: relative;
    overflow: hidden;
    padding: 32px;
    color: #f4f3ff;
    background:
        radial-gradient(circle at 100% 0, rgba(139, 119, 239, .32), transparent 18rem),
        linear-gradient(145deg, #20223a, #171a2d);
    box-shadow: 0 18px 45px rgba(23, 26, 45, .12);
}

.guide-panel .section-kicker {
    color: #a99df7;
}

.guide-panel h2 {
    color: white;
}

.steps {
    display: grid;
    gap: 22px;
    margin: 29px 0;
    padding: 0;
    list-style: none;
}

.steps li {
    display: flex;
    gap: 14px;
}

.step-number {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    color: #bcb3fa;
    border: 1px solid rgba(181, 168, 250, .2);
    border-radius: 9px;
    background: rgba(142, 123, 236, .1);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 11px;
}

.steps strong {
    display: block;
    margin: 1px 0 5px;
    font-size: 14px;
}

.steps p {
    margin: 0;
    color: #aeb2c6;
    font-size: 12px;
    line-height: 1.65;
}

.security-note {
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.security-note svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin-top: 2px;
    color: #a99df7;
}

.security-note p {
    margin: 0;
    color: #969bb3;
    font-size: 11px;
    line-height: 1.65;
}

.security-note strong {
    display: block;
    margin-bottom: 2px;
    color: #d9dbea;
    font-size: 12px;
}

.accounts-section {
    padding: 0 0 48px;
}

.sync-status {
    transition: color .2s;
}

.sync-status.is-offline {
    color: var(--danger);
}

.sync-status.is-offline .status-dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(217, 75, 91, .1);
}

.accounts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 20px;
}

.account-card {
    min-width: 0;
    padding: 24px;
    border: 1px solid rgba(226, 229, 239, .9);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 8px 30px rgba(28, 35, 60, .045);
    transition: transform .2s, box-shadow .2s;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(28, 35, 60, .075);
}

.account-top {
    justify-content: space-between;
    gap: 12px;
}

.account-identity {
    min-width: 0;
    gap: 12px;
}

.account-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: #5b4fd0;
    border: 1px solid #e1def9;
    border-radius: 12px;
    background: linear-gradient(145deg, #f2f0ff, #e9e5ff);
    font-size: 17px;
    font-weight: 750;
    text-transform: uppercase;
}

.account-identity > div {
    min-width: 0;
}

.account-name {
    overflow: hidden;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-button {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    color: #8d94a3;
    border: 0;
    border-radius: 9px;
    background: transparent;
}

.icon-button:hover {
    color: var(--ink);
    background: #f2f3f7;
}

.delete-button:hover {
    color: var(--danger);
    background: #fff1f3;
}

.code-row {
    justify-content: space-between;
    gap: 18px;
    margin: 26px 0 22px;
}

.code-button {
    min-width: 0;
    padding: 0;
    text-align: left;
    border: 0;
    background: transparent;
}

.otp-code {
    display: block;
    color: #292146;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: clamp(29px, 3vw, 37px);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: 3px;
    white-space: nowrap;
}

.code-copy-hint {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    color: #a0a6b3;
    font-size: 10px;
    opacity: 0;
    transition: opacity .2s;
}

.code-copy-hint svg {
    width: 12px;
    height: 12px;
}

.code-button:hover .code-copy-hint {
    opacity: 1;
}

.timer {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
}

.timer svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer circle {
    fill: none;
    stroke-width: 4;
}

.timer-track {
    stroke: #eeecf8;
}

.timer-progress {
    stroke: var(--primary);
    stroke-dasharray: 100;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset .5s linear, stroke .2s;
}

.timer-value {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #686f80;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
    font-weight: 650;
}

.account-card.is-expiring .timer-progress {
    stroke: var(--danger);
}

.account-card.is-expiring .timer-value {
    color: var(--danger);
}

.account-actions {
    gap: 9px;
    padding-top: 17px;
    border-top: 1px solid #eff1f5;
}

.action-button {
    min-height: 37px;
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    color: #626a7c;
    border: 1px solid #e5e7ed;
    border-radius: 9px;
    background: #fafbfc;
    font-size: 12px;
    font-weight: 600;
    transition: color .2s, border-color .2s, background .2s;
}

.action-button svg {
    width: 15px;
    height: 15px;
}

.action-button:hover {
    color: var(--primary);
    border-color: #dcd7fa;
    background: #f6f4ff;
}

.empty-state,
.loading-state,
.load-error {
    min-height: 240px;
    border: 1px dashed #d8dce7;
    border-radius: 18px;
    background: rgba(255, 255, 255, .45);
}

.empty-state {
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    color: #8b80df;
    border-radius: 18px;
    background: var(--primary-soft);
}

.empty-icon svg {
    width: 29px;
    height: 29px;
}

.empty-state h3 {
    margin: 17px 0 7px;
    font-size: 17px;
}

.empty-state p,
.load-error p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.loading-state,
.load-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.load-error {
    flex-direction: column;
}

.spinner {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex: 0 0 auto;
    border: 2px solid #ddd9f5;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.secondary-button {
    color: #555e71;
    border: 1px solid #dce0e9;
    background: white;
}

.secondary-button:hover:not(:disabled) {
    background: #f7f8fb;
}

.danger-button {
    color: white;
    border: 1px solid var(--danger);
    background: var(--danger);
}

.danger-button:hover:not(:disabled) {
    background: #c43d4d;
}

.dialog {
    width: min(440px, calc(100% - 32px));
    padding: 34px;
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 22px;
    background: white;
    box-shadow: 0 30px 90px rgba(18, 23, 42, .25);
    text-align: center;
}

.dialog::backdrop {
    background: rgba(20, 24, 40, .58);
    backdrop-filter: blur(5px);
}

.dialog[open] {
    animation: dialog-in .2s ease-out;
}

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog > form:first-child {
    position: absolute;
    top: 12px;
    right: 12px;
}

.dialog-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin: 0 auto 18px;
    place-items: center;
    color: var(--primary);
    border-radius: 14px;
    background: var(--primary-soft);
}

.dialog-icon.danger {
    color: var(--danger);
    background: #fff0f2;
}

.dialog h2 {
    overflow-wrap: anywhere;
    margin: 7px 0 8px;
    font-size: 22px;
    letter-spacing: -.5px;
}

.dialog-description {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.qr-frame {
    width: 268px;
    height: 268px;
    margin: 24px auto 18px;
    display: grid;
    place-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
}

.qr-frame img {
    display: block;
    width: 240px;
    height: 240px;
}

#qr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.qr-warning {
    margin: 0;
    color: #969cab;
    font-size: 11px;
    line-height: 1.6;
}

.dialog-actions {
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
}

.delete-dialog .form-message {
    margin: 16px 0 0;
    text-align: left;
}

.toast {
    position: fixed;
    z-index: 10;
    bottom: 28px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    color: white;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: #242a3b;
    box-shadow: 0 12px 35px rgba(24, 29, 46, .25);
    font-size: 13px;
    transform: translateX(-50%);
    animation: toast-in .2s ease-out;
}

.toast svg {
    width: 16px;
    height: 16px;
    color: #7ee0b9;
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 900px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }

    .guide-panel {
        display: grid;
        grid-template-columns: 1fr 1.5fr;
        column-gap: 30px;
    }

    .guide-panel h2,
    .guide-panel .section-kicker {
        grid-column: 1;
    }

    .steps {
        grid-column: 2;
        grid-row: 1 / span 3;
        margin: 0;
    }

    .security-note {
        grid-column: 1;
        align-self: end;
    }
}

@media (max-width: 700px) {
    .accounts-list {
        grid-template-columns: 1fr;
    }

    .guide-panel {
        display: block;
    }

    .steps {
        margin: 26px 0;
    }
}

@media (max-width: 520px) {
    .site-header,
    .page-shell {
        width: min(100% - 28px, 1160px);
    }

    .site-header {
        height: auto;
        min-height: 56px;
    }

    .brand {
        font-size: 16px;
    }

    .local-badge {
        padding: 7px 9px;
        font-size: 11px;
    }

    .add-panel,
    .guide-panel {
        padding: 24px 20px;
    }

    .panel h2,
    .accounts-section h2,
    .guide-panel h2 {
        font-size: 21px;
    }

    .accounts-section {
        padding: 0 0 36px;
    }

    .sync-status {
        font-size: 11px;
    }

    .account-card {
        padding: 20px;
    }

    .otp-code {
        font-size: 31px;
        letter-spacing: 2px;
    }

    .code-copy-hint {
        opacity: 1;
    }

    .dialog {
        padding: 30px 22px 24px;
    }

    .qr-frame {
        width: 248px;
        height: 248px;
        padding: 4px;
    }
}

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

/* ---------- 首页锁屏玻璃层 ---------- */
body.is-locked {
    overflow: hidden;
}

.lock-screen {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(244, 246, 251, .55);
    -webkit-backdrop-filter: blur(28px) saturate(130%);
    backdrop-filter: blur(28px) saturate(130%);
}

.lock-screen[hidden] {
    display: none;
}

.lock-panel {
    width: min(340px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.lock-wordmark {
    color: var(--ink);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1.2px;
}

.lock-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    color: var(--primary);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 15px;
    background: rgba(255, 255, 255, .55);
    box-shadow: 0 10px 30px rgba(28, 35, 60, .08);
}

.lock-icon svg {
    width: 26px;
    height: 26px;
}

.lock-form {
    width: 100%;
    margin-top: 4px;
}

.lock-input {
    width: 100%;
    height: 50px;
    padding: 0 88px 0 18px;
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 12px;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 8px 30px rgba(28, 35, 60, .08);
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s;
}

.lock-input::placeholder {
    color: #a2a8b6;
}

.lock-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(101, 88, 232, .1);
}

.lock-input:disabled {
    opacity: .55;
}

.lock-form .primary-button {
    margin-top: 14px;
}

.lock-form .form-message {
    margin: 14px 0 0;
    text-align: center;
}

/* ---------- 顶栏 ---------- */
.site-header {
    height: auto;
    min-height: 64px;
    gap: 14px;
    padding: 0;
}

/* ---------- 添加方式切换与二维码上传 ---------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.segmented {
    display: flex;
    gap: 4px;
    margin-top: 24px;
    padding: 4px;
    border-radius: 11px;
    background: #f2f3f7;
}

.segmented-button {
    flex: 1;
    min-height: 36px;
    padding: 0 8px;
    color: #747c8d;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    transition: color .2s, background .2s, box-shadow .2s;
}

.segmented-button.is-active {
    color: var(--primary);
    background: white;
    box-shadow: 0 2px 8px rgba(28, 35, 60, .07);
}

.tab-panel {
    margin-top: 22px;
}

.upload-zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 34px 20px;
    color: #7b8292;
    border: 1.5px dashed #d8dce7;
    border-radius: 13px;
    background: #fafbfc;
    text-align: center;
    transition: border-color .2s, background .2s, color .2s;
}

.upload-zone:hover,
.upload-zone.is-dragging {
    color: var(--primary);
    border-color: var(--primary);
    background: #f7f5ff;
}

.upload-zone.has-file {
    color: #5b4fd0;
    border-style: solid;
    border-color: #cfc9f7;
    background: #f8f6ff;
}

.upload-zone svg {
    width: 26px;
    height: 26px;
}

.upload-zone strong {
    font-size: 13px;
    word-break: break-all;
}

.upload-zone span {
    font-size: 11px;
    line-height: 1.6;
}

#import-submit {
    margin-top: 16px;
}

/* ---------- 密钥分享与密码弹窗 ---------- */
.secret-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
    text-align: left;
}

.secret-box code {
    flex: 1;
    min-width: 0;
    color: #3a3157;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
}

.secret-box .action-button {
    flex: 0 0 auto;
    min-height: 34px;
}

.dialog-form {
    margin-top: 22px;
    text-align: left;
}

.dialog-form .field + .field {
    margin-top: 16px;
}

.dialog-form .field input {
    height: 46px;
}

.dialog-form .dialog-actions {
    margin-top: 22px;
}

.dialog .form-message {
    margin: 14px 0 0;
}

.primary-button.compact-button {
    width: auto;
    min-width: 116px;
    margin-top: 0;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 760px) {
    .site-header {
        min-height: 56px;
    }
}

@media (max-width: 520px) {
    .secret-box {
        flex-direction: column;
        align-items: stretch;
    }

    .secret-box .action-button {
        flex: 1;
    }

    .dialog-actions {
        flex-wrap: wrap;
    }
}

/* ---------- 顶栏操作 ---------- */
.header-tools {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-button {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    color: #5f4fd6;
    border: 1px solid #dedafb;
    border-radius: 999px;
    background: #f4f1ff;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
    transition: border-color .2s, background .2s;
}

.header-button:hover {
    border-color: #cfc8fa;
    background: #eeebff;
}

/* ---------- 卡片编辑与配色 ---------- */
.card-tools {
    display: flex;
    gap: 2px;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.account-card.is-dragging {
    opacity: .35;
    box-shadow: 0 18px 40px rgba(28, 35, 60, .16);
}

.account-card.has-color {
    border-color: color-mix(in srgb, var(--account-color) 32%, #e6e8f0);
    background: color-mix(in srgb, var(--account-color) 12%, #fff);
    box-shadow: 0 16px 38px color-mix(in srgb, var(--account-color) 13%, transparent);
}

.account-card.has-color .account-avatar {
    color: #fff;
    border-color: transparent;
    background: var(--account-color);
}

.field-label {
    display: block;
    margin-bottom: 9px;
    color: #313a4d;
    font-size: 14px;
    font-weight: 650;
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(23, 32, 51, .08);
    border-radius: 50%;
    background: var(--swatch);
    transition: transform .15s, box-shadow .15s;
}

.color-swatch:hover {
    transform: scale(1.08);
}

.color-swatch.is-default {
    background: linear-gradient(135deg, #f7f8fc 45%, #dfe3ee 55%);
}

.color-swatch.is-active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary);
}

.select-input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    color: var(--ink);
    border: 1px solid #dce0e9;
    border-radius: 11px;
    background: #fafbfc;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.select-input:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
    box-shadow: 0 0 0 4px rgba(101, 88, 232, .09);
}

@media (max-width: 520px) {
    .header-tools {
        gap: 8px;
    }

    .header-button {
        min-height: 30px;
        padding: 0 9px;
        font-size: 11px;
    }
}

/* ---------- 操作日志 ---------- */
.logs-dialog {
    width: min(720px, 100%);
}

.logs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 56vh;
    overflow-y: auto;
    margin-top: 6px;
    padding-right: 4px;
}

.log-item {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafbfd;
}

.log-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.log-action {
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.log-time {
    color: var(--muted);
    font-size: 11px;
}

.log-target {
    margin: 6px 0 8px;
    color: #4d556a;
    font-size: 12px;
}

.log-sql {
    display: block;
    padding: 10px 12px;
    color: #3c4457;
    border-radius: 10px;
    background: #eef1f7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.logs-empty {
    margin: 18px 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* ---------- 账户搜索 ---------- */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.search-bar .search-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: #8d94a6;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    height: 46px;
    padding: 0 44px;
    color: var(--ink);
    border: 1px solid #dce0e9;
    border-radius: 13px;
    background: rgba(255, 255, 255, .8);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.search-bar input::placeholder {
    color: #a2a8b6;
}

.search-bar input:focus {
    border-color: var(--primary);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(101, 88, 232, .09);
}

.search-empty {
    margin: 0 0 18px;
    padding: 22px 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.account-card.is-filtered-out {
    display: none !important;
}

.accounts-list.is-filtering .drag-handle {
    opacity: .35;
    pointer-events: none;
}
