@import url('https://fonts.loli.net/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
    --auth-bg: #eef2ff;
    --auth-card: #ffffff;
    --auth-text: #1e293b;
    --auth-muted: #64748b;
    --auth-accent: #4f46e5;
    --auth-accent-dark: #4338ca;
    --auth-border: #e2e8f0;
    --auth-danger: #dc2626;
    --auth-success: #059669;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #ede9fe 100%);
    min-height: 100vh;
    color: var(--auth-text);
    line-height: 1.6;
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: 18px;
    padding: 36px 32px 32px;
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.12);
}

.auth-card-wide {
    max-width: 960px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}
.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--auth-accent-dark);
    margin-bottom: 6px;
}
.auth-logo p {
    font-size: 14px;
    color: var(--auth-muted);
}

.auth-field {
    margin-bottom: 18px;
}
.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--auth-text);
}
.auth-field input,
.auth-field select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input:focus,
.auth-field select:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 22px;
    font-size: 13px;
    color: var(--auth-muted);
}
.auth-check input { width: auto; margin-top: 3px; }

.auth-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}
.auth-btn:hover { opacity: 0.95; transform: translateY(-1px); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.auth-btn-secondary {
    background: #f1f5f9;
    color: var(--auth-text);
    border: 1px solid var(--auth-border);
}
.auth-btn-danger {
    background: #fef2f2;
    color: var(--auth-danger);
    border: 1px solid #fecaca;
}

.auth-msg {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}
.auth-msg.error {
    display: block;
    background: #fef2f2;
    color: var(--auth-danger);
    border: 1px solid #fecaca;
}
.auth-msg.success {
    display: block;
    background: #ecfdf5;
    color: var(--auth-success);
    border: 1px solid #a7f3d0;
}

.auth-foot {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--auth-muted);
}
.auth-foot a { color: var(--auth-accent-dark); text-decoration: none; font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }

.auth-tip {
    margin-top: 16px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 12px;
    color: var(--auth-muted);
    line-height: 1.55;
}

/* ── 管理后台 ── */
.auth-admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.auth-admin-top h1 { font-size: 22px; }
.auth-admin-user { font-size: 14px; color: var(--auth-muted); }

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--auth-border);
    padding-bottom: 12px;
}
.auth-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-muted);
}
.auth-tab.active {
    background: #eef2ff;
    color: var(--auth-accent-dark);
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.auth-toolbar .auth-btn { width: auto; padding: 8px 16px; font-size: 14px; }

.auth-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
}
.auth-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.auth-table th,
.auth-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--auth-border);
    vertical-align: top;
}
.auth-table th {
    background: #f8fafc;
    font-weight: 700;
    white-space: nowrap;
}
.auth-table tr:last-child td { border-bottom: none; }
.auth-table code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.auth-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.auth-badge.admin { background: #ede9fe; color: #6d28d9; }
.auth-badge.user { background: #e0f2fe; color: #0369a1; }
.auth-badge.off { background: #fef2f2; color: #dc2626; }

.auth-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.auth-actions button {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--auth-border);
    background: #fff;
    cursor: pointer;
}
.auth-actions button:hover { border-color: var(--auth-accent); color: var(--auth-accent); }

.auth-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .auth-card { padding: 28px 20px 24px; }
    .auth-card-wide { padding: 24px 16px; }
}
