/* ==================== 河南大学明伦校区 - 文明停车系统 v2.0 样式 ==================== */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2128;
    --bg-card: rgba(22, 27, 34, 0.95);
    --border-color: #30363d;
    --border-light: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-red: #f85149;
    --accent-yellow: #d29922;
    --accent-purple: #a371f7;
    --accent-orange: #db6d28;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: #484f58; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #5e6673; }

/* ========== 导航栏 ========== */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 30px; background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000;
    box-shadow: var(--shadow-md);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 26px; }
.brand-text { font-size: 18px; font-weight: 700; letter-spacing: 1px; color: var(--text-primary); }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-link {
    padding: 8px 20px; border-radius: var(--radius-sm);
    text-decoration: none; color: var(--text-secondary); font-size: 14px; font-weight: 500;
    transition: all 0.2s ease; border: 1px solid transparent;
}
.nav-link:hover { color: var(--accent-blue); background: rgba(88,166,255,0.08); }
.nav-link.active {
    color: var(--accent-blue); background: rgba(88,166,255,0.12);
    border-color: rgba(88,166,255,0.25); font-weight: 600;
}

/* ========== 主容器 ========== */
.main-container { max-width: 1300px; margin: 0 auto; padding: 20px; }

/* ========== 页面切换 ========== */
.page { display: none; animation: fadeIn 0.3s ease; min-height: calc(100vh - 200px); }
.page.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px);} to{opacity:1;transform:translateY(0);} }

/* ========== 页脚闪烁修复 ========== */
body:not(.page-loaded) .main-container ~ footer,
body:not(.page-loaded) .main-container ~ div {
    opacity: 0 !important;
    visibility: hidden;
}

/* ========== 页头 ========== */
.page-header {
    text-align: center; padding: 35px 20px 25px;
    background: linear-gradient(135deg, rgba(88,166,255,0.06), rgba(163,113,247,0.04));
    border-radius: var(--radius-lg); margin-bottom: 25px; border: 1px solid var(--border-light);
}
.page-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 10px; letter-spacing: 1px; }
.page-header p { color: var(--text-secondary); font-size: 14px; }
.system-status-bar {
    display: flex; gap: 15px; margin-top: 15px; flex-wrap: wrap; justify-content: center;
    font-size: 13px; color: var(--text-secondary);
}
.status-item { padding: 4px 12px; background: rgba(63,185,80,0.08); border-radius: 12px; }
.status-item.online { color: var(--accent-green); }
.status-divider { color: var(--border-color); }
.current-time {
    display: inline-block; padding: 8px 20px; background: rgba(88,166,255,0.1);
    border-radius: 20px; font-family: monospace; font-size: 14px; color: var(--accent-blue);
    margin-top: 10px;
}

/* ========== 统计卡片 ========== */
.container { max-width: 1240px; margin: 0 auto; }
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px; margin-bottom: 25px;
}
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 22px; text-align: center;
    transition: transform 0.2s, box-shadow 0.2s; position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple)); opacity: 0.6;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon { font-size: 32px; margin-bottom: 8px; }
.stat-number { font-size: 36px; font-weight: 800; color: var(--accent-blue); font-family: 'Courier New', monospace; }
.stat-label { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.stat-trend { font-size: 12px; margin-top: 8px; font-weight: 600; }
.stat-trend.positive { color: var(--accent-green); }
.stat-trend.negative { color: var(--accent-red); }
.stat-trend.neutral { color: var(--text-muted); }

/* ========== 卡片通用 ========== */
.card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 22px; margin-bottom: 20px;
}
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; color: var(--text-primary); }
.card-header { margin-bottom: 15px; }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border: none; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 14px; font-weight: 600; transition: all 0.2s; font-family: inherit;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 3px 10px; font-size: 11px; }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); }

.btn-primary { background: linear-gradient(135deg, #238636, #2ea043); color: white; }
.btn-primary:hover { background: linear-gradient(135deg, #2ea043, #3fb950); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-danger { background: linear-gradient(135deg, #da3633, #f85149); color: white; }
.btn-warning { background: linear-gradient(135deg, #9e6a03, #d29922); color: white; }
.btn-success { background: linear-gradient(135deg, #238636, #3fb950); color: white; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.required-mark { color: var(--accent-red); }
.form-control {
    width: 100%; padding: 10px 14px; background: var(--bg-primary);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    color: var(--text-primary); font-size: 14px; font-family: inherit;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(88,166,255,0.15); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* ========== 进度条 ========== */
.progress-bar { height: 8px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent-green), var(--accent-blue)); border-radius: 4px; transition: width 0.5s ease; }
.progress-bar-lg { height: 12px; }
.progress-fill-lg { height: 100%; background: linear-gradient(90deg, var(--accent-green), #58a6ff); border-radius: 6px; }

/* ========== 徽章 ========== */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
}
.badge-success { background: rgba(63,185,80,0.15); color: var(--accent-green); }
.badge-warning { background: rgba(210,153,34,0.15); color: var(--accent-yellow); }
.badge-danger { background: rgba(248,81,73,0.15); color: var(--accent-red); }
.badge-info { background: rgba(88,166,255,0.15); color: var(--accent-blue); }

/* ========== 模态框 ========== */
.modal {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.75); backdrop-filter: blur(6px);
    z-index: 9999; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal.show { display: flex; animation: modalIn 0.25s ease; }
@keyframes modalIn { from{opacity:0;} to{opacity:1;} }
.modal-content {
    background: var(--bg-secondary); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg); max-width: 650px; width: 100%; max-height: 85vh;
    overflow-y: auto; position: relative; animation: slideUp 0.3s ease; box-shadow: var(--shadow-lg);
}
.modal-content.modal-lg { max-width: 900px; }
@keyframes slideUp { from{transform:translateY(30px);opacity:0;} to{transform:translateY(0);opacity:1;} }
.modal-close {
    position: absolute; top: 14px; right: 16px; width: 32px; height: 32px;
    border: none; background: var(--bg-tertiary); color: var(--text-secondary);
    border-radius: 50%; font-size: 20px; cursor: pointer; transition: all 0.2s;
}
.modal-close:hover { background: var(--accent-red); color: white; }
.modal-title-custom { font-size: 20px; font-weight: 700; margin-bottom: 20px; padding-right: 40px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ========== 加载动画 ========== */
.loading-spinner {
    width: 40px; height: 40px; border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 60px auto;
}
@keyframes spin { to{transform:rotate(360deg);} }
.spinner-inline {
    display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 6px;
}

/* ========== 筛选器 ========== */
.filter-select {
    padding: 8px 14px; background: var(--bg-primary); border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); color: var(--text-primary); cursor: pointer; font-size: 13px;
}

/* ========== 紧急程度选择器 ========== */
.urgency-selector { display: flex; gap: 10px; margin-top: 6px; }
.urgency-option input { display: none; }
.urgency-btn {
    display: block; padding: 10px 20px; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; font-weight: 600; border: 2px solid var(--border-color); transition: all 0.2s;
    text-align: center;
}
.urgency-btn.low { background: rgba(63,185,80,0.1); color: var(--accent-green); border-color: rgba(63,185,80,0.3); }
.urgency-btn.medium { background: rgba(210,153,34,0.1); color: var(--accent-yellow); border-color: rgba(210,153,34,0.3); }
.urgency-btn.high { background: rgba(248,81,73,0.1); color: var(--accent-red); border-color: rgba(248,81,73,0.3); }
.urgency-option input:checked + .urgency-btn { opacity: 1; transform: scale(1.05); box-shadow: 0 0 0 2px currentColor; }

.checkbox-label {
    display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary);
}
.checkbox-label input[type=checkbox] { accent-color: var(--accent-blue); }

/* ========== 规则表格 ========== */
.rule-section { margin-bottom: 20px; }
.rule-section h3 { font-size: 15px; color: var(--accent-blue); margin-bottom: 10px; }
.rules-table-modern { width: 100%; border-collapse: collapse; font-size: 13px; }
.rules-table-modern th, .rules-table-modern td {
    padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-light);
}
.rules-table-modern th { background: var(--bg-tertiary); color: var(--text-secondary); font-weight: 600; font-size: 12px; }
.points-positive { color: var(--accent-green); font-weight: 700; }
.points-negative { color: var(--accent-red); font-weight: 700; font-size: 14px; }
.highlight-green { color: var(--accent-green); }

/* ========== 级别网格 ========== */
.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 12px; }
.level-card { padding: 18px; border-radius: var(--radius-md); border: 1px solid; }
.level-card.excellent { background: rgba(63,185,80,0.08); border-color: rgba(63,185,80,0.25); }
.level-card.good { background: rgba(88,166,255,0.08); border-color: rgba(88,166,255,0.25); }
.level-card.normal { background: rgba(210,153,34,0.08); border-color: rgba(210,153,34,0.25); }
.level-card.poor { background: rgba(248,81,73,0.08); border-color: rgba(248,81,73,0.25); }
.level-icon { font-size: 22px; margin-bottom: 6px; }
.level-name { font-weight: 700; margin-bottom: 8px; font-size: 14px; }
.level-benefits, .level-restrictions { font-size: 12px; color: var(--text-secondary); list-style: none; }
.level-benefits li, .level-restrictions li { padding: 3px 0; }

/* ========== 排名相关 ========== */
.medal { font-size: 20px; }
.medal-1 { color: #ffd700; } .medal-2 { color: #c0c0c0; } .medal-3 { color: #cd7f32; }
.me-badge { background: var(--accent-purple); color: white; padding: 2px 8px; border-radius: 8px; font-size: 10px; margin-left: 6px; font-weight: 600; }
.trend-up { color: var(--accent-green) !important; } .trend-down { color: var(--accent-red) !important; }
.trend-same { color: var(--text-muted); }

/* ========== 预警通知 ========== */
.system-notification {
    position: fixed; top: 70px; right: 20px; width: 400px; max-width: calc(100vw - 40px);
    background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); z-index: 10000; display: flex; gap: 14px; padding: 16px;
    animation: notifSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes notifSlideIn { from{transform:translateX(120%);opacity:0;} to{transform:translateX(0);opacity:1;} }
.notification-critical { border-left: 4px solid var(--accent-red); }
.notification-warning { border-left: 4px solid var(--accent-yellow); }
.notification-info { border-left: 4px solid var(--accent-blue); }
.notification-close-x {
    position: absolute; top: 8px; right: 10px; background: none; border: none;
    color: var(--text-muted); font-size: 20px; cursor: pointer; line-height: 1;
}
.notification-close-x:hover { color: var(--accent-red); }
.notification-btn-primary, .notification-btn-close {
    padding: 5px 14px; border-radius: var(--radius-sm); border: none; cursor: pointer; font-size: 12px; font-weight: 600;
}
.notification-btn-primary { background: var(--accent-blue); color: white; margin-right: 6px; }
.notification-btn-close { background: var(--bg-tertiary); color: var(--text-secondary); }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .navbar { flex-direction: column; gap: 12px; padding: 12px 16px; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .main-container { padding: 12px; }
    .dual-screen-layout { flex-direction: column !important; }
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 20px; }
}
