/* 后台管理样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f6fa;
}

a {
    color: #667eea;
    text-decoration: none;
}

a:hover {
    color: #5a6fd6;
}

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

.sidebar {
    width: 220px;
    background: #2c3e50;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .logo {
    padding: 20px;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar nav {
    padding: 10px 0;
}

.sidebar nav a {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* 导航分组样式 */
.sidebar .nav-group {
    margin-bottom: 5px;
}

.sidebar .nav-group-title {
    padding: 10px 20px 5px;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar .nav-group a {
    padding-left: 25px;
}

.main-content {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
}

.topbar {
    background: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content {
    padding: 25px;
}

.content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.content h3 {
    margin: 20px 0 15px;
    color: #34495e;
}

/* 统计卡片 */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-card .number {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-card .label {
    color: #7f8c8d;
    font-size: 14px;
}

/* 面板 */
.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table .empty {
    text-align: center;
    color: #999;
    padding: 30px;
}

/* 表单 */
.form-table {
    width: 100%;
    max-width: 800px;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

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

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: #5a6fd6;
    color: #fff;
}

.btn-sm {
    display: inline-block;
    padding: 5px 12px;
    background: #667eea;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 5px;
}

.btn-sm:hover {
    background: #5a6fd6;
    color: #fff;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219a52;
}

/* 搜索栏 */
.search-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-bar input,
.search-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 消息提示 */
.message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 标签 */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* 分页 */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    .main-content {
        margin-left: 0;
    }
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .data-table {
        font-size: 12px;
    }
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}
