/* ========== 全局样式 ========== */
:root {
    --primary: #e67e22;
    --primary-dark: #d35400;
    --secondary: #2c3e50;
    --light-bg: #f8f9fa;
    --card-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.02);
    --hover-shadow: 0 20px 30px -12px rgba(0,0,0,0.15);
    --border-radius: 1rem;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(145deg, #f5f7fa 0%, #e9ecef 100%);
    color: #1e293b;
    line-height: 1.5;
    min-height: 100vh;
}

/* 容器宽度优化 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========== 顶部导航栏 ========== */
.top-bar {
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-menu a {
    color: #f1f5f9;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-menu a:hover, .nav-menu a.active {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.user-info {
    margin-left: auto;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.15);
    padding: 0.4rem 1rem;
    border-radius: 2rem;
}

/* ========== 卡片样式 ========== */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.75rem;
    margin-bottom: 2rem;
    transition: all 0.25s ease;
    border: 1px solid rgba(0,0,0,0.03);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.card h2, .card h3 {
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card h2 {
    font-size: 1.75rem;
    border-left: 5px solid var(--primary);
    padding-left: 1rem;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230,126,34,0.3);
}

.btn-danger {
    background: #ef4444;
}
.btn-danger:hover {
    background: #dc2626;
}
.btn-success {
    background: #10b981;
}
.btn-success:hover {
    background: #059669;
}
.btn-warning {
    background: #f59e0b;
}
.btn-warning:hover {
    background: #d97706;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
}
.form-control, select.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,126,34,0.2);
}
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ========== 表格 ========== */
table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 1rem;
    overflow: hidden;
    background: white;
}
th, td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
th {
    background: #f1f5f9;
    font-weight: 600;
    color: #1e293b;
}
tr:hover td {
    background: #f8fafc;
}

/* ========== 聊天室 ========== */
#chat-messages {
    background: #fefce8;
    border-radius: 1rem;
    font-size: 0.9rem;
}
#chat-messages div {
    padding: 0.6rem;
    border-bottom: 1px solid #fde68a;
}

/* ========== 布局辅助 ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    padding: 1.5rem;
    border-radius: 1.5rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    .user-info {
        margin-left: 0;
        text-align: center;
        margin-top: 0.5rem;
    }
    .card {
        padding: 1.25rem;
    }
    th, td {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    .btn {
        padding: 0.5rem 1rem;
    }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}