:root {
    --bg-color: #0a0a0a;
    --card-bg: #141414;
    --card-border: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent-blue: #2979ff;
    --accent-cyan: #00e5ff;
    --accent-purple: #d500f9;
    --accent-green: #00e676;
    --accent-orange: #ff9100;
    --accent-red: #ff1744;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 40px;
}

/* Header Styles */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left .logo-icon {
    width: 48px;
    height: 48px;
    background: var(--text-primary);
    color: var(--bg-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-title p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.header-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 100px;
    color: var(--accent-cyan);
    font-size: 14px;
    font-weight: 600;
}

.status-pill .pill-icon {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-cyan);
}

.notif {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.notif:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.notif .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-red);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.avatar {
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid var(--card-border);
}

.avatar .avatar-circle {
    width: 36px;
    height: 36px;
    background: var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.avatar .role {
    font-size: 14px;
    font-weight: 500;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: #333;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-icon {
    display: none;
    /* Minimalist style removes heavy icons */
}

/* Metric Styles */
.metric-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.metric-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Specific Card Adjustments */
.card.stat-card {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card.alerts-card,
.card.services-card {
    min-height: 400px;
    grid-column: span 2;
}

/* Colors for Metrics */
.text-blue {
    color: var(--accent-blue);
}

.text-cyan {
    color: var(--accent-cyan);
}

.text-purple {
    color: var(--accent-purple);
}

.text-green {
    color: var(--accent-green);
}

.text-orange {
    color: var(--accent-orange);
}

.text-red {
    color: var(--accent-red);
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--card-border);
    border-radius: 2px;
    margin-top: 16px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
}

.progress-good {
    background: var(--accent-green);
}

.progress-warning {
    background: var(--accent-orange);
}

.progress-critical {
    background: var(--accent-red);
}

/* Lists */
.user-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
}

.user-item:last-child {
    border-bottom: none;
}

.user-item .avatar,
.user-item .avatar-initial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0; /* 防止头像被压缩 */
}

.user-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证图片不变形 */
}

.user-details {
    flex-grow: 1; /* 让用户信息部分占据多余空间 */
}

.user-role {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 16px;
    margin-left: 16px;
    white-space: nowrap;
}

.user-role.student {
    background-color: rgba(41, 121, 255, 0.1);
    color: var(--accent-blue);
}

.user-role.teacher {
    background-color: rgba(255, 145, 0, 0.1);
    color: var(--accent-orange);
}

.user-item .avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-border);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.user-details {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Service Items */
.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-bottom: 12px;
}

.service-name {
    font-size: 14px;
    font-weight: 500;
}

.service-score {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

/* Alerts */
.alert-item {
    padding: 16px;
    border-left: 2px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 12px;
    border-radius: 0 4px 4px 0;
}

.alert-critical {
    border-left-color: var(--accent-red);
}

.alert-warning {
    border-left-color: var(--accent-orange);
}

.alert-info {
    border-left-color: var(--accent-blue);
}

.alert-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.alert-message {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Charts */
.chart-container {
    margin-top: 24px;
    height: 240px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.01);
}

/* Buttons */
.time-range-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.time-range-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.time-range-btn.active {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.pending-order-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: #10b981;
    margin: 0 16px;
}

.pending-order-time {
    font-size: 0.9rem;
    color: #ef4444;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 12px;
    border-radius: 8px;
    margin: 0 16px;
}

.close-order-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.close-order-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

.close-order-btn:active {
    transform: translateY(0);
}

.close-order-btn:disabled {
    background: #4b5563;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Tab导航栏样式 */
.tab-navigation {
    display: flex;
    gap: 8px;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab-navigation::-webkit-scrollbar {
    height: 4px;
}

.tab-navigation::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.tab-btn {
    padding: 12px 28px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #8b97ab;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e8edf5;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.tab-btn .tab-icon {
    font-size: 1.2rem;
}

/* 页面容器 */
.page-container {
    display: none;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.page-container.active {
    display: block;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.pagination-controls button {
    background: var(--card-border);
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-controls button:hover:not(:disabled) {
    background: #333;
    color: var(--text-primary);
}

.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-controls .page-info {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: center;
}

/* School Ranking Styles */
.school-rank-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.school-rank-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.rank-badge {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--card-border);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 14px;
    margin-right: 16px;
}

.rank-badge.top-1, .rank-badge.top-2, .rank-badge.top-3 {
    color: #000;
    background: var(--rank-color);
    box-shadow: 0 0 10px 0 var(--rank-color);
}

.school-rank-item .school-name {
    flex-grow: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.school-rank-item .online-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-green);
    font-family: 'JetBrains Mono', monospace;
}