/* AuthShield - 后台管理样式 */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --green: #16a34a;
    --green-bg: #dcfce7;
    --red: #dc2626;
    --red-bg: #fee2e2;
    --purple: #8b5cf6;
    --purple-bg: #ede9fe;
    --yellow: #d97706;
    --yellow-bg: #fef3c7;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid var(--sidebar-hover); }
.sidebar-header h2 { font-size: 16px; margin-bottom: 4px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav .nav-item {
    display: block;
    padding: 10px 20px;
    color: #cbd5e1;
    transition: all .2s;
    text-decoration: none;
}
.sidebar-nav .nav-item:hover, .sidebar-nav .nav-item.active {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}
.sidebar-nav .nav-section { padding: 16px 20px 4px; font-size: 11px; text-transform: uppercase; color: #64748b; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--sidebar-hover); }
.admin-info { margin-bottom: 8px; font-size: 14px; }
.btn-logout { color: #f87171; font-size: 14px; }
.btn-logout:hover { color: #ef4444; text-decoration: none; }

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px 32px;
    min-width: 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; }

/* Cards */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); }
.card-header h3 { font-size: 16px; }
.card-body { padding: 20px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}
.table th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); }
.table tr:hover { background: var(--gray-50); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--gray-300); background: #fff; color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-50); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: var(--green-bg); color: var(--green); }
.badge-danger { background: var(--red-bg); color: var(--red); }
.badge-info { background: #dbeafe; color: var(--primary); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-warning { background: var(--yellow-bg); color: var(--yellow); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
    transition: border-color .2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .1);
}
textarea.form-control { resize: vertical; }
.checkbox-group { display: flex; gap: 20px; }
.checkbox-group label { display: flex; align-items: center; gap: 6px; font-weight: 400; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: var(--green-bg); color: var(--green); }
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-info { background: #dbeafe; color: var(--primary); }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon { font-size: 2rem; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--gray-500); }
.stat-blue { border-left: 4px solid var(--primary); }
.stat-green { border-left: 4px solid var(--green); }
.stat-purple { border-left: 4px solid var(--purple); }
.stat-yellow { border-left: 4px solid var(--yellow); }

/* Row layout */
.row { display: flex; gap: 20px; }
.col-8 { flex: 2; }
.col-4 { flex: 1; }
.col-6 { flex: 1; }

@media (max-width: 768px) {
    .row { flex-direction: column; }
    .col-8, .col-4 { flex: 1; }
}

/* Stat Row */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}
.stat-row:last-child { border-bottom: none; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
}
.pagination a:hover { background: var(--gray-100); text-decoration: none; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Text utilities */
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }

/* Code */
code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 13px;
    background: var(--gray-100);
    padding: 1px 4px;
    border-radius: 3px;
}
.copyable { cursor: pointer; }
.copyable:hover { background: var(--gray-200); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }
.modal-dialog {
    background: #fff;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body { padding: 20px; }
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--gray-500); }

/* Filter form */
.filter-form { margin-bottom: 16px; }
.filter-form select { width: auto; min-width: 200px; }

/* Stats mini */
.stats-mini { display: flex; gap: 20px; margin-bottom: 20px; }
.stat-mini { display: flex; align-items: center; gap: 8px; }

/* Tabs */
.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}
.tab-btn {
    padding: 8px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.tab-btn.active { color: var(--primary); border-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Login page */
.login-page { background: var(--gray-900); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-header { text-align: center; margin-bottom: 24px; }
.login-header h2 { font-size: 22px; }
.login-header p { color: var(--gray-500); font-size: 14px; }
.login-footer { text-align: center; margin-top: 16px; }

/* Slider Captcha */
.slider-captcha { user-select: none; }
.slider-bg {
    width: 100%;
    height: 40px;
    background: var(--gray-100);
    border-radius: var(--radius);
    position: relative;
    margin-bottom: 8px;
}
.slider-gap {
    position: absolute;
    top: 4px;
    width: 36px;
    height: 32px;
    background: rgba(255,255,255,.8);
    border: 2px dashed var(--primary);
    border-radius: 4px;
}
.slider-track {
    width: 100%;
    height: 40px;
    background: var(--gray-100);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}
.slider-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gray-500);
    font-size: 13px;
}
.slider-btn {
    position: absolute;
    top: 0; left: 0;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    border-radius: var(--radius);
    z-index: 2;
    font-size: 18px;
}
.slider-progress {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: var(--green-bg);
    border-radius: var(--radius);
    z-index: 1;
}

/* Pagination nav */
.pagination-nav { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
