*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1a1a2e;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

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

.logo {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.main {
    flex: 1;
    padding: 2rem 1rem;
}

.footer {
    padding: 1rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.auth-card {
    max-width: 400px;
    margin: 2rem auto;
}

h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
}

h2 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
}

.form label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.form input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.form input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 0;
}

.btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg);
}

.logout-form {
    margin: 0;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
}

.muted {
    color: var(--muted);
    font-size: 0.875rem;
}

a {
    color: var(--primary);
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

.stats {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.stats dt {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stats dd {
    margin: 0.125rem 0 0;
    font-size: 1rem;
}

.stats .highlight {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.table th {
    color: var(--muted);
    font-weight: 500;
}

code {
    font-family: "Consolas", "Monaco", monospace;
    font-size: 0.8125rem;
    background: var(--bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

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

.api-list {
    padding-left: 1.25rem;
    margin: 0.75rem 0;
}

.api-list li {
    margin-bottom: 0.375rem;
}

.api-info {
    background: #f8fafc;
}
