:root {
    --bg: #0f172a;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #1f6e9c;
    --primary-hover: #155a82;
    --border: #e2e8f0;
    --ok: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --radius: 16px;
}

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

body {
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: white;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    background: #020617;
    border-bottom: 1px solid #1e293b;
}

.brand h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

.domain {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

nav a {
    color: #38bdf8;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover {
    color: #7dd3fc;
}

main {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
}

.login-card {
    background: var(--card);
    color: var(--text);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: fadeIn 0.6s ease;
}

.cloud-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.login-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.system-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: #f0fdf4;
    color: #166534;
    padding: 0.35rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    70% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #334155;
}

.input-field {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text);
    font-size: 1rem;
    transition: 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.15);
}

.btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(145deg, #1f6e9c, #0f5480);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn:hover:not(:disabled) {
    background: linear-gradient(145deg, #2383b4, #13618b);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
}

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

.message {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    display: none;
}

.message.visible {
    display: block;
}

.message.error {
    background: #fee2e2;
    color: #b91c1c;
    border-left: 4px solid #b91c1c;
}

.message.warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.footer-links {
    margin-top: 1.8rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

.footer-links a:hover {
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 100;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    color: #1e293b;
    padding: 2rem;
    border-radius: 12px;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-close {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    font-weight: 600;
}

.status-page h2, .api-page h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.status-item {
    background: #1e293b;
    padding: 1.2rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label {
    color: #cbd5e1;
}

.value.ok { color: var(--ok); font-weight: 600; }
.value.warn { color: var(--warn); font-weight: 600; }

.update-time {
    margin-top: 2rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.api-page .endpoint {
    background: #1e293b;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.api-page pre {
    color: #38bdf8;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.api-page p {
    color: #cbd5e1;
}

.note {
    margin-top: 2rem;
    font-style: italic;
    color: #94a3b8;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}