/* ============================================
   QnMax 后台管理 - Admin CSS
   液态玻璃风格 · 蓝色调
   ============================================ */

:root {
    --bg: #0a0e1a;
    --bg-light: #111827;
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --blue-primary: #3b82f6;
    --blue-light: #60a5fa;
    --blue-glow: rgba(59, 130, 246, 0.25);
    --cyan: #22d3ee;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius-sm: 10px;
    --radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 60% 50% at 30% 10%, rgba(59, 130, 246, 0.06), transparent),
        radial-gradient(ellipse 50% 40% at 70% 80%, rgba(34, 211, 238, 0.04), transparent);
    pointer-events: none;
}

a { color: var(--blue-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--cyan); }

/* ----- Layout ----- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: rgba(17, 24, 39, 0.8);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
}

.sidebar-brand .icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--blue-primary), var(--cyan));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
}

.sidebar-nav { flex: 1; padding: 0 12px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
    transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--glass-hover);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue-light);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Main Content */
.admin-main {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Cards */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
}

.glass-sm { border-radius: var(--radius-sm); }

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--blue-light), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Table */
.table-wrap {
    overflow-x: auto;
}

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

thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--glass-hover); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-primary), #1d4ed8);
    color: #fff;
}

.btn-primary:hover { box-shadow: 0 4px 20px var(--blue-glow); color: #fff; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--blue-primary);
    background: rgba(59, 130, 246, 0.1);
    color: #fff;
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.25); color: #fca5a5; }
.btn-success { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }

.btn-group { display: flex; gap: 6px; }

/* Forms */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px var(--blue-glow);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2394a3b8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Tags Input Visual */
.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    padding: 3px 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--blue-light);
}

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--blue-light);
}

/* Modal / Sheet */
.sheet {
    padding: 32px;
    max-width: 700px;
    margin: 20px auto;
}

.sheet h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
}

/* Status Badge */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34,197,94,0.12); color: #4ade80; }
.badge-warning { background: rgba(245,158,11,0.12); color: #fbbf24; }
.badge-muted   { background: rgba(148,163,184,0.12); color: #94a3b8; }
.badge-danger  { background: rgba(239,68,68,0.12); color: #f87171; }

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
}

.login-box .logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--blue-primary), var(--cyan));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    margin: 0 auto 20px;
}

.login-box h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-box p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
    }
    .sidebar-brand { border-bottom: none; margin-bottom: 0; padding: 0; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; }
    .sidebar-nav a { padding: 8px 12px; }
    .sidebar-footer { margin-top: 0; border-top: none; flex-direction: row; }
    .admin-main { margin-left: 0; padding: 20px; }
    .admin-layout { flex-direction: column; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* Toggle Switch */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
