/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: #c5e3ff;
    background: #03132a;
    user-select: none;
}

/* ===== 背景网格 ===== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 200, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 200, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
}

.bg-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, #03132a 90%);
}

.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ===== 顶部标题栏 ===== */
.header {
    position: relative;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: linear-gradient(180deg, rgba(0, 80, 160, 0.4) 0%, transparent 100%);
    border-bottom: 1px solid rgba(0, 200, 255, 0.2);
    z-index: 10;
}

.header::before,
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 30%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

.header::before { left: 10%; }
.header::after { right: 10%; }

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #00d4ff;
    width: 25%;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 10px #00ff88;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.header-title {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 6px;
    text-shadow: 0 0 20px #00aaff, 0 0 40px #0066cc;
    background: linear-gradient(180deg, #fff 0%, #5fc8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-icon {
    color: #00d4ff;
    -webkit-text-fill-color: #00d4ff;
    font-size: 20px;
    margin: 0 12px;
}

.header-right {
    width: 25%;
    text-align: right;
    font-size: 16px;
    color: #5fc8ff;
    font-family: "Consolas", monospace;
}

.divider {
    margin: 0 10px;
    color: rgba(0, 200, 255, 0.4);
}

/* ===== 主体布局 ===== */
.main-container {
    position: relative;
    z-index: 5;
    height: calc(100% - 80px);
    display: grid;
    grid-template-columns: 25% 50% 25%;
    gap: 15px;
    padding: 15px;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
}

/* ===== 面板通用样式 ===== */
.panel {
    flex: 1;
    min-height: 0;
    background: linear-gradient(135deg, rgba(0, 50, 100, 0.3) 0%, rgba(0, 20, 50, 0.5) 100%);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

/* 四角装饰 */
.panel::before,
.panel::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #00d4ff;
}

.panel::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.panel::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.panel-header {
    height: 36px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 200, 255, 0.15);
    background: linear-gradient(90deg, rgba(0, 100, 200, 0.25) 0%, transparent 100%);
}

.panel-title {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    letter-spacing: 1px;
    position: relative;
    padding-left: 12px;
}

.panel-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 14px;
    background: linear-gradient(180deg, #00d4ff, #0066cc);
    border-radius: 2px;
}

.panel-tag {
    font-size: 11px;
    color: #00d4ff;
    padding: 2px 8px;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 2px;
    background: rgba(0, 212, 255, 0.1);
}

.panel-body {
    flex: 1;
    padding: 10px;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===== KPI 指标卡 ===== */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    height: 90px;
    flex-shrink: 0;
}

.kpi-card {
    background: linear-gradient(135deg, rgba(0, 80, 160, 0.35) 0%, rgba(0, 30, 70, 0.5) 100%);
    border: 1px solid rgba(0, 200, 255, 0.25);
    border-radius: 4px;
    padding: 10px 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, transparent);
}

.kpi-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(0, 212, 255, 0.15) 0%, transparent 50%);
}

.kpi-value {
    font-size: 30px;
    font-weight: bold;
    color: #00ffe4;
    text-shadow: 0 0 10px rgba(0, 255, 228, 0.5);
    font-family: "Consolas", monospace;
    line-height: 1;
}

.kpi-label {
    font-size: 13px;
    color: #b8d8ff;
    margin-top: 4px;
}

.kpi-sub {
    font-size: 11px;
    color: #5a8ab5;
    margin-top: 2px;
}

.kpi-sub span {
    color: #00d4ff;
}

/* ===== 地图面板 ===== */
.panel-map {
    flex: 2;
}

.map-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #b8d8ff;
    background: rgba(0, 20, 50, 0.6);
    padding: 6px 12px;
    border-radius: 2px;
    border: 1px solid rgba(0, 200, 255, 0.2);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-1 { background: #ff4757; box-shadow: 0 0 8px #ff4757; }
.dot-2 { background: #ffa502; box-shadow: 0 0 8px #ffa502; }
.dot-3 { background: #00d4ff; box-shadow: 0 0 8px #00d4ff; }

/* ===== 学院排行 ===== */
.panel-rank {
    flex-shrink: 0;
    height: 200px;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    overflow: hidden;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    height: 100%;
    flex: 1;
}

.rank-num {
    width: 22px;
    height: 22px;
    text-align: center;
    line-height: 22px;
    font-weight: bold;
    color: #fff;
    background: rgba(0, 100, 200, 0.5);
    border-radius: 2px;
    flex-shrink: 0;
}

.rank-item:nth-child(1) .rank-num { background: linear-gradient(135deg, #ff4757, #ff6b81); }
.rank-item:nth-child(2) .rank-num { background: linear-gradient(135deg, #ffa502, #ff7f50); }
.rank-item:nth-child(3) .rank-num { background: linear-gradient(135deg, #00d4ff, #0066cc); }

.rank-name {
    width: 90px;
    color: #b8d8ff;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-bar {
    flex: 1;
    height: 14px;
    background: rgba(0, 50, 100, 0.4);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
}

.rank-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066cc, #00d4ff, #00ffe4);
    border-radius: 7px;
    position: relative;
    transition: width 1.5s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.rank-bar-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-30px); }
    100% { transform: translateX(30px); }
}

.rank-value {
    width: 50px;
    text-align: right;
    color: #00ffe4;
    font-family: "Consolas", monospace;
    font-weight: bold;
    flex-shrink: 0;
}

/* ===== 世界排名追踪 ===== */
.rank-track {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    overflow: hidden;
}

.track-item {
    background: rgba(0, 50, 100, 0.3);
    border-left: 3px solid #00d4ff;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.track-item.up { border-left-color: #00ff88; }
.track-item.down { border-left-color: #ff4757; }

.track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.track-name {
    font-size: 13px;
    color: #fff;
    font-weight: bold;
}

.track-rank {
    font-size: 18px;
    font-weight: bold;
    color: #00ffe4;
    font-family: "Consolas", monospace;
}

.track-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #5a8ab5;
}

.track-change {
    font-weight: bold;
}

.track-change.up { color: #00ff88; }
.track-change.down { color: #ff4757; }

/* ===== 实时动态 ===== */
.panel-feed {
    flex: 1.2;
}

.feed-list {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-item {
    background: rgba(0, 50, 100, 0.25);
    border: 1px solid rgba(0, 200, 255, 0.15);
    border-radius: 3px;
    padding: 8px 10px;
    font-size: 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: feedIn 0.5s ease;
}

@keyframes feedIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.feed-time {
    color: #00d4ff;
    font-family: "Consolas", monospace;
    flex-shrink: 0;
    width: 50px;
}

.feed-type {
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 10px;
    flex-shrink: 0;
    height: 18px;
    line-height: 16px;
}

.feed-type.visit { background: rgba(255, 165, 2, 0.2); color: #ffa502; border: 1px solid #ffa502; }
.feed-type.sign { background: rgba(0, 255, 136, 0.2); color: #00ff88; border: 1px solid #00ff88; }
.feed-type.conf { background: rgba(0, 212, 255, 0.2); color: #00d4ff; border: 1px solid #00d4ff; }
.feed-type.award { background: rgba(255, 71, 87, 0.2); color: #ff4757; border: 1px solid #ff4757; }

.feed-text {
    color: #b8d8ff;
    flex: 1;
    line-height: 1.5;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 2px; }
