:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --accent: #2563eb;
    --accent-soft: #eff6ff;
    --green: #16a34a;
    --green-soft: #ecfdf5;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --amber: #b45309;
    --amber-soft: #fffbeb;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, .mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12.5px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 28px;
    height: 60px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
}

.brand-mark-lg {
    width: 42px;
    height: 42px;
    font-size: 20px;
    border-radius: 12px;
}

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

.nav a {
    padding: 7px 14px;
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
}

.nav a:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    color: var(--muted);
}

.topbar-user form {
    margin: 0;
}

.link-button {
    border: 0;
    background: none;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.link-button:hover {
    text-decoration: underline;
}

.page {
    max-width: 1220px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-head h1 {
    margin: 0 0 4px;
    font-size: 22px;
    letter-spacing: .2px;
}

.page-head p {
    margin: 0;
    font-size: 13px;
}

.head-actions {
    display: flex;
    gap: 8px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.wrap {
    word-break: break-all;
}

.nowrap {
    white-space: nowrap;
}

.right {
    text-align: right;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .03);
}

.password-card {
    max-width: 640px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-head h2 {
    margin: 0;
    font-size: 16px;
}

.alert {
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 13.5px;
}

.alert-success {
    background: var(--green-soft);
    border-color: #bbf7d0;
    color: #166534;
}

.alert-error {
    background: var(--red-soft);
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: var(--amber-soft);
    border-color: #fde68a;
    color: #92400e;
}

.error-list {
    margin: 4px 0 0 18px;
    padding: 0;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
}

.stat:hover {
    border-color: #c7d2fe;
    text-decoration: none;
}

.stat-active {
    border-color: #bfdbfe;
    background: var(--accent-soft);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat strong {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0;
}

.tab {
    padding: 8px 14px 10px;
    color: var(--muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--ink);
    text-decoration: none;
}

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

.search {
    display: flex;
    gap: 8px;
}

.search input {
    width: 280px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font: inherit;
    background: #fff;
}

.search input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.btn:hover {
    background: #f9fafb;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-block {
    width: 100%;
    padding: 10px 16px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12.5px;
}

.table-wrap {
    padding: 0;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table th {
    background: #fafbfc;
    color: #475569;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #fcfdff;
}

.table td.empty {
    text-align: center;
    color: var(--muted);
    padding: 44px 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: #f3f4f6;
    color: #4b5563;
}

.badge-success {
    background: var(--green-soft);
    color: #15803d;
}

.badge-danger {
    background: var(--red-soft);
    color: #b91c1c;
}

.badge-warning {
    background: var(--amber-soft);
    color: var(--amber);
}

.badge-muted {
    background: #f3f4f6;
    color: #4b5563;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 18px;
}

.pagination a {
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13px;
}

.pagination a:hover {
    text-decoration: none;
    border-color: #bfdbfe;
}

.pagination a.active {
    background: var(--accent-soft);
    border-color: #bfdbfe;
    color: var(--accent);
}

.pagination a.disabled {
    pointer-events: none;
    opacity: .45;
}

.pagination .muted {
    margin-left: 8px;
    font-size: 12.5px;
}

.form {
    display: block;
}

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

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}

.field > span {
    color: #374151;
    font-weight: 500;
}

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

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.field textarea {
    resize: vertical;
    min-height: 64px;
}

.field input:disabled {
    background: #f9fafb;
    color: #9ca3af;
}

.inline-options {
    display: flex;
    gap: 18px;
    padding: 4px 0 2px;
}

.radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #374151;
    font-weight: 400;
}

.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 6px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.info-label {
    color: var(--muted);
    font-size: 12px;
}

.detail {
    max-width: 480px;
    max-height: 260px;
    overflow: auto;
    margin: 6px 0 0;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 190px);
    padding: 20px 0 40px;
}

.login-card {
    width: 380px;
    padding: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-form .field {
    gap: 8px;
}

.login-form .btn-block {
    margin-top: 2px;
}

.login-version {
    margin: 14px 0 0;
    text-align: center;
    color: #9ca3af;
}

.login-head {
    text-align: center;
    margin-bottom: 20px;
}

.login-head h1 {
    margin: 12px 0 2px;
    font-size: 20px;
}

.login-tip {
    margin: 18px 0 0;
    line-height: 1.7;
}

.foot {
    display: flex;
    justify-content: space-between;
    max-width: 1220px;
    margin: 0 auto;
    padding: 18px 24px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

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

    .form-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .search input {
        width: 100%;
    }

    .topbar {
        padding: 0 16px;
        gap: 14px;
    }

    .nav {
        display: none;
    }
}
