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

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f7fa;
    color: #374151;
    min-height: 100vh;
}

/* 加载状态 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #FF6B35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 登录页 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.login-card {
    background: white;
    padding: 48px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-card h1 {
    font-size: 28px;
    margin-bottom: 12px;
}

.login-card p {
    color: #6b7280;
    margin-bottom: 24px;
}

.login-btn {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #FF6B35, #FF8F5A);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

/* 主布局 */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1f2937, #111827);
    color: white;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.logo {
    padding: 0 20px 20px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    font-size: 24px;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: rgba(255, 107, 53, 0.15);
    color: #FF6B35;
    border-left: 3px solid #FF6B35;
}

.user-info {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #FF6B35, #FF8F5A);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-info span {
    flex: 1;
    font-size: 14px;
}

.logout-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 内容区 */
.content {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    margin-bottom: 24px;
    font-size: 22px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    color: #FF6B35;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
}

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.toolbar input,
.toolbar select {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.toolbar input:focus,
.toolbar select:focus {
    border-color: #FF6B35;
}

.toolbar button {
    padding: 10px 16px;
    background: linear-gradient(135deg, #FF6B35, #FF8F5A);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar button:hover {
    transform: scale(1.02);
}

/* 数据表格 */
.data-table {
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
}

.data-table td {
    font-size: 14px;
}

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

/* 操作按钮 */
.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn.delete:hover {
    background: #fecaca;
}

/* 图表容器 */
.chart-container {
    background: white;
    padding: 24px;
    border-radius: 16px;
    margin-top: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-container h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

#regions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.region-item {
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.region-item .count {
    color: #FF6B35;
    font-weight: 600;
    margin-left: 8px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag.bot {
    background: #fef3c7;
    color: #d97706;
}

.tag.user {
    background: #dbeafe;
    color: #2563eb;
}

.tag.high {
    background: #fee2e2;
    color: #dc2626;
}

.tag.medium {
    background: #fef3c7;
    color: #d97706;
}

.tag.low {
    background: #d1fae5;
    color: #059669;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 10px 0;
    }

    .sidebar .logo span:last-child,
    .sidebar .nav-item span,
    .sidebar .user-info span,
    .sidebar .logout-btn {
        display: none;
    }

    .content {
        margin-left: 60px;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}