/* 后台管理样式 */

.admin-container {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
}

/* 侧边栏 */
.admin-sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0099FF 0%, #0066CC 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255,255,255,0.9);
    transition: all 0.3s;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-item.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-left: 3px solid #FFD700;
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.back-link {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    transition: color 0.3s;
}

.back-link:hover {
    color: #fff;
}

/* 主内容区 */
.admin-main {
    flex: 1;
    margin-left: 240px;
    padding: 24px 32px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-refresh {
    background: #fff;
    color: #666;
    border: 1px solid #d9d9d9;
}

.btn-refresh:hover {
    border-color: #0099FF;
    color: #0099FF;
}

.btn-export {
    background: #0099FF;
    color: #fff;
}

.btn-export:hover {
    background: #0066CC;
}

.btn-primary {
    background: #0099FF;
    color: #fff;
}

.btn-primary:hover {
    background: #0066CC;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #FF4444;
    color: #fff;
}

.btn-danger:hover {
    background: #CC0000;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 16px;
}

.stat-label {
    font-size: 14px;
    color: #999;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

/* 图表容器 */
.chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.chart-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-bar {
    display: flex;
    align-items: center;
}

.chart-label {
    width: 120px;
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
}

.chart-progress {
    flex: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 12px;
}

.chart-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.chart-count {
    font-size: 12px;
    color: #fff;
    font-weight: 600;
}

.chart-percent {
    width: 60px;
    font-size: 14px;
    color: #999;
    text-align: right;
}

/* 数据表格 */
.recent-records {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    background: #fafafa;
}

.data-table td {
    font-size: 14px;
    color: #333;
}

.data-table tr:hover td {
    background: #f5f7fa;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #FFF3E0;
    color: #FF6600;
}

.status-received {
    background: #E8F5E9;
    color: #00CC66;
}

.status-none {
    background: #F5F5F5;
    color: #999;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.page-btn:hover {
    border-color: #0099FF;
    color: #0099FF;
}

.page-btn.active {
    background: #0099FF;
    color: #fff;
    border-color: #0099FF;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.filter-input,
.filter-select {
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #0099FF;
}

.filter-input {
    width: 200px;
}

/* 设置表单 */
.settings-form {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: #0099FF;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

/* Switch开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0099FF;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Section样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.prizes-table-container,
.records-table-container,
.users-table-container {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #333;
    color: #fff;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* 响应式 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 60px;
    }
    
    .sidebar-title,
    .sidebar-subtitle,
    .nav-text,
    .back-link {
        display: none;
    }
    
    .admin-main {
        margin-left: 60px;
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-input {
        width: 100%;
    }
}
