/* 管理后台样式 */

:root {
    --primary: #0B4F6C;
    --primary-light: #14919A;
    --accent: #00B4D8;
    --danger: #E53E3E;
    --success: #38A169;
    --warning: #D69E2E;
    --dark: #1A2B3C;
    --text: #2D3748;
    --text-muted: #718096;
    --bg: #F7FAFC;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --radius: 10px;
    --sidebar-width: 260px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

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

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
}

.admin-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.logo-sub {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
    margin-left: 44px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.sidebar-nav a.active {
    background: var(--primary);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.sidebar-footer a {
    color: var(--accent);
    display: inline-block;
    margin-top: 6px;
}

/* Main */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-header {
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    display: none;
    width: 28px;
    height: 20px;
    flex-direction: column;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
}

.sidebar-toggle span {
    display: block;
    height: 3px;
    background: var(--dark);
    border-radius: 2px;
}

.admin-header-actions {
    display: flex;
    gap: 10px;
}

.admin-content {
    padding: 28px;
    flex: 1;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 24px;
}

/* Cards */
.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

/* Stats */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(11, 79, 108, 0.08);
}

.stat-card-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

.stat-card-info p {
    color: var(--text-muted);
    font-size: 13px;
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

.admin-table tr:hover td {
    background: rgba(0,0,0,0.01);
}

.admin-table img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: #09425a; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c53030; }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #2f855a; }

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

.admin-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark);
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.admin-form textarea {
    min-height: 120px;
    resize: vertical;
}

.admin-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.admin-form .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-form .form-check input {
    width: auto;
    margin: 0;
}

.admin-form .form-check label {
    display: inline;
    margin-bottom: 0;
    cursor: pointer;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.image-preview {
    max-width: 200px;
    max-height: 120px;
    border-radius: 6px;
    margin-top: 10px;
    border: 1px solid var(--border);
}

/* Settings groups */
.settings-group {
    margin-bottom: 32px;
}

.settings-group h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Flashes */
.admin-flashes {
    margin-bottom: 20px;
}

.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
}

.flash-success { background: #C6F6D5; color: #22543D; }
.flash-danger { background: #FED7D7; color: #742A2A; }
.flash-warning { background: #FEEBC8; color: #744210; }
.flash-info { background: #BEE3F8; color: #2A4365; }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-box .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.login-box .admin-logo-img {
    height: 46px;
    width: auto;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #C6F6D5; color: #22543D; }
.badge-danger { background: #FED7D7; color: #742A2A; }
.badge-info { background: #BEE3F8; color: #2A4365; }
.badge-warning { background: #FEEBC8; color: #744210; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 13px;
}

.pagination a:hover,
.pagination .current {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Settings image uploader */
.setting-image-uploader {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-image-preview {
    width: fit-content;
    max-width: 240px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    background: var(--bg);
}

.setting-image-preview img {
    max-width: 220px;
    max-height: 140px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.setting-image-uploader input[type="file"] {
    padding: 8px 0;
    border: none;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-form .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.active {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: flex;
    }
    .stats-cards {
        grid-template-columns: 1fr;
    }
    .admin-table {
        display: block;
        overflow-x: auto;
    }
    .admin-content {
        padding: 16px;
    }
}
