:root {
    --yellow: #ffd429;
    --yellow-dark: #efb900;
    --black: #191919;
    --text: #20242c;
    --muted: #707682;
    --border: #e8eaf0;
    --background: #f5f6f8;
    --white: #fff;
    --green: #19a463;
    --red: #d94343;
    --shadow: 0 16px 45px rgba(23, 28, 38, .10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Microsoft YaHei", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, #fff4aa 0, transparent 30%),
        linear-gradient(135deg, #ffd42a 0%, #fff7cf 55%, #fff 100%);
}

.login-card {
    width: min(430px, 100%);
    padding: 38px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.brand-mark, .small-logo {
    display: grid;
    place-items: center;
    color: var(--yellow);
    background: var(--black);
    font-weight: 900;
}

.brand-mark {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    border-radius: 18px;
    font-size: 30px;
}

.login-card h1 { margin: 0; font-size: 28px; }
.login-subtitle { margin: 8px 0 28px; color: var(--muted); }

label {
    display: block;
    margin: 17px 0 8px;
    font-size: 14px;
    font-weight: 650;
}

input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    color: var(--text);
    background: var(--white);
    border: 1px solid #d8dce5;
    border-radius: 11px;
    outline: none;
}

input:focus {
    border-color: var(--yellow-dark);
    box-shadow: 0 0 0 3px rgba(255,212,41,.2);
}

.password-field { position: relative; }
.password-field input { padding-right: 65px; }

.text-button {
    position: absolute;
    right: 9px;
    top: 8px;
    padding: 6px 8px;
    border: 0;
    color: #776000;
    background: transparent;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    font-weight: 400;
    color: var(--muted);
}

.remember-row input { width: 17px; height: 17px; }

.primary-button, .secondary-button, .danger-button {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    border: 0;
    font-weight: 700;
}

.primary-button {
    color: #171717;
    background: var(--yellow);
}

.login-card .primary-button { width: 100%; min-height: 48px; }

.secondary-button { background: #eef0f4; color: #343943; }
.danger-button { background: #fff0f0; color: var(--red); }

.message {
    margin: 12px 0;
    padding: 11px 13px;
    border-radius: 9px;
    font-size: 14px;
}

.message.error { background: #fff0f0; color: #b53030; }
.message.success { background: #eaf9f1; color: #147846; }

.login-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--muted);
    font-size: 13px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #a8adb7;
}

.status-dot.online { background: var(--green); }
.status-dot.offline { background: var(--red); }

.app-view { min-height: 100vh; display: flex; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 245px;
    display: flex;
    flex-direction: column;
    padding: 22px 15px;
    color: #fff;
    background: #1c1d20;
    z-index: 20;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 8px 20px;
}

.small-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 21px;
}

.sidebar-brand strong,
.sidebar-brand span { display: block; }
.sidebar-brand span { margin-top: 3px; color: #9297a1; font-size: 12px; }

nav { display: grid; gap: 5px; overflow-y: auto; }

.nav-item {
    padding: 12px 14px;
    text-align: left;
    color: #c5c8cf;
    background: transparent;
    border: 0;
    border-radius: 10px;
}

.nav-item:hover { color: #fff; background: #2a2c31; }
.nav-item.active { color: #181818; background: var(--yellow); font-weight: 800; }

.sidebar-version {
    margin-top: auto;
    padding: 15px 9px 0;
    color: #777d87;
    font-size: 12px;
}

.main { width: calc(100% - 245px); margin-left: 245px; }

.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 28px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.topbar h2, .topbar p { margin: 0; }
.topbar h2 { font-size: 21px; }
.topbar p { margin-top: 4px; color: var(--muted); font-size: 13px; }

.user-menu {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    font-size: 23px;
}

.page { padding: 28px; }

.welcome-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px;
    border-radius: 18px;
    background: linear-gradient(120deg, #fff0a0, var(--yellow));
}

.eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.welcome-card h3 { margin: 7px 0; font-size: 25px; }
.welcome-card p { margin: 0; color: #61551e; }

.online-badge {
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    font-weight: 700;
    white-space: nowrap;
}

.status-grid, .module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.status-card, .module-grid article, .feature-card {
    padding: 21px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
}

.status-card span, .status-card small {
    display: block;
    color: var(--muted);
}

.status-card strong {
    display: block;
    margin: 9px 0;
    font-size: 21px;
}

.status-card strong.ok { color: var(--green); }
.status-card strong.bad { color: var(--red); }

.module-grid article h4 { margin: 0; }
.module-grid article strong {
    display: block;
    margin: 12px 0 5px;
    font-size: 29px;
}
.module-grid article p { margin: 0; color: var(--muted); line-height: 1.6; }

.feature-card {
    min-height: 360px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.feature-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--yellow);
    font-weight: 900;
}

.feature-card h3 { margin: 18px 0 7px; }
.feature-card p { color: var(--muted); }

.pending-label {
    padding: 6px 10px;
    color: #7a6200;
    background: #fff6c5;
    border-radius: 999px;
    font-size: 12px;
}

.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(10,12,16,.55);
    z-index: 100;
}

.modal-panel {
    width: min(460px, 100%);
    padding: 24px;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { margin: 0; }

.close-button {
    border: 0;
    background: transparent;
    font-size: 26px;
}

.modal-panel small { color: var(--muted); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

@media (max-width: 1050px) {
    .status-grid, .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .sidebar.open { transform: translateX(0); }

    .main {
        width: 100%;
        margin-left: 0;
    }

    .menu-button { display: block; }
    .topbar { padding: 14px 16px; }
    .topbar p { display: none; }
    .user-menu span { display: none; }
    .page { padding: 16px; }

    .welcome-card {
        align-items: flex-start;
        gap: 14px;
        flex-direction: column;
    }

    .status-grid, .module-grid {
        grid-template-columns: 1fr;
    }

    .secondary-button, .danger-button {
        padding: 0 10px;
        font-size: 13px;
    }
}

/* 闲鱼账号管理 v0.3.0 */
.account-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.account-toolbar h3,
.account-toolbar p {
    margin: 0;
}

.account-toolbar p {
    margin-top: 6px;
    color: var(--muted);
}

.account-notice {
    margin-bottom: 16px;
    padding: 13px 16px;
    color: #6d5700;
    background: #fff7cc;
    border: 1px solid #f1dd73;
    border-radius: 11px;
}

.account-empty {
    padding: 75px 20px;
    text-align: center;
    color: var(--muted);
    background: #fff;
    border: 1px dashed #d9dde5;
    border-radius: 15px;
}

.account-empty strong {
    display: block;
    color: var(--text);
    font-size: 18px;
}

.account-empty p {
    margin-bottom: 0;
}

.accounts-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.account-card {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
}

.account-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: var(--yellow);
    background: var(--black);
    border-radius: 13px;
    font-size: 21px;
    font-weight: 900;
}

.account-title {
    min-width: 0;
}

.account-title h4,
.account-title p {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-title p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.account-badges {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.account-current,
.account-disabled,
.login-badge {
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    white-space: nowrap;
}

.account-current {
    color: #6b5600;
    background: #fff1a4;
}

.account-disabled,
.login-badge.offline {
    color: #606671;
    background: #eef0f3;
}

.login-badge.online {
    color: #08713d;
    background: #dcf7e9;
}

.login-badge.expired {
    color: #a12929;
    background: #ffe4e4;
}

.login-badge.checking {
    color: #805f00;
    background: #fff4c2;
}

.account-settings {
    display: flex;
    gap: 20px;
    margin-top: 17px;
    padding: 12px;
    color: var(--muted);
    background: #f7f8fa;
    border-radius: 10px;
    font-size: 13px;
}

.account-settings b {
    color: var(--text);
}

.account-note {
    min-height: 22px;
    margin: 14px 0;
    color: var(--muted);
    font-size: 13px;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.small-action {
    min-height: 34px;
    padding: 0 11px;
    color: #3c414a;
    background: #f1f2f5;
    border: 0;
    border-radius: 8px;
}

.small-action.primary {
    color: #171717;
    background: var(--yellow);
    font-weight: 700;
}

.small-action.delete {
    color: var(--red);
    background: #fff0f0;
}

.small-action:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.account-modal-panel textarea {
    width: 100%;
    padding: 12px 14px;
    resize: vertical;
    color: var(--text);
    background: #fff;
    border: 1px solid #d8dce5;
    border-radius: 11px;
    outline: none;
    font: inherit;
}

.account-modal-panel textarea:focus {
    border-color: var(--yellow-dark);
    box-shadow: 0 0 0 3px rgba(255,212,41,.2);
}

.account-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 11px;
    background: #f7f8fa;
    border-radius: 9px;
    font-weight: 500;
}

.option-row input {
    width: 17px;
    height: 17px;
}

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

@media (max-width: 600px) {
    .account-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .account-toolbar .primary-button {
        width: 100%;
    }

    .account-options {
        grid-template-columns: 1fr;
    }

    .account-card-head {
        align-items: flex-start;
    }
}
