* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #7c3aed;
    --primary-dark: #5b21b6;
    --secondary: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --border: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: var(--white);
}

/* 顶部导航 */
.top-nav {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.nav-brand i {
    color: var(--primary);
    font-size: 1.3rem;
}

.nav-tabs {
    display: flex;
    gap: 5px;
}

.nav-tab {
    padding: 8px 16px;
    color: var(--gray);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.nav-tab:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.nav-tab.active {
    color: var(--white);
    background: var(--primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--gray);
}

.nav-user .avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* 页面容器 */
.page-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 驾驶舱头部 */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-header h1 i {
    color: var(--primary);
}

.header-time {
    color: var(--gray);
    font-size: 0.95rem;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-info {
    text-align: center;
}

.stat-card.blue .stat-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.stat-card.green .stat-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.stat-card.purple .stat-icon {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.stat-card.cyan .stat-icon {
    background: rgba(6, 182, 212, 0.2);
    color: #06b6d4;
}

.stat-card.orange .stat-icon {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.stat-card.red .stat-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-value small {
    font-size: 0.9rem;
    font-weight: 400;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

.stat-trend {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up {
    color: var(--secondary);
}

.stat-trend.down {
    color: var(--secondary);
}

.stat-trend.stable {
    color: var(--gray);
}

/* 图表网格 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i {
    color: var(--primary);
}

.card-header .badge {
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.chart-content {
    padding: 15px;
}

/* 柱状图 */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 120px;
    gap: 15px;
    padding-top: 25px;
    margin-bottom: 25px;
    position: relative;
}

.bar-chart::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.bar-item {
    flex: 1;
    max-width: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}

.bar {
    width: 100%;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.8) 0%, rgba(124, 58, 237, 0.3) 100%);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 15px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.bar span {
    position: absolute;
    top: -18px;
    font-size: 0.7rem;
    color: var(--gray);
    white-space: nowrap;
}

.bar-item.active .bar {
    background: linear-gradient(180deg, var(--primary) 0%, rgba(124, 58, 237, 0.5) 100%);
}

.bar-label {
    font-size: 0.75rem;
    color: var(--gray);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
}

.bar-item.active .bar-label {
    color: var(--primary);
    font-weight: 600;
}

/* 趋势线图 */
.line-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trend-line-svg {
    width: 100%;
    height: 140px;
}

.grid-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.trend-area {
    opacity: 0.6;
}

.trend-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 4px rgba(124, 58, 237, 0.4));
}

.trend-dot {
    fill: var(--primary);
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 2;
}

.trend-dot.active {
    fill: #22c55e;
    stroke: rgba(34, 197, 94, 0.5);
    stroke-width: 3;
    filter: drop-shadow(0 0 8px #22c55e);
}

.line-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.line-labels span {
    font-size: 0.7rem;
    color: var(--gray);
    text-align: center;
}

.line-labels span small {
    color: rgba(255, 255, 255, 0.6);
}

.line-labels span.active {
    color: var(--primary);
    font-weight: 600;
}

.line-labels span.active small {
    color: #22c55e;
}

/* 进度列表 */
.progress-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.green {
    background: var(--secondary);
}

.progress-fill.purple {
    background: #a855f7;
}

.progress-fill.orange {
    background: #f97316;
}

/* 底部网格 */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 系统状态列表 */
.system-status-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.system-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.system-item .system-icon {
    width: 36px;
    height: 36px;
    background: rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.system-name {
    flex: 1;
    font-size: 0.85rem;
}

.system-state {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.system-state .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary);
}

.system-item.online .system-state {
    color: var(--secondary);
}

.system-item.offline .system-state {
    color: var(--danger);
}

.system-item.offline .system-state .dot {
    background: var(--danger);
}

/* 告警列表 */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
}

.alert-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-item.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-item.warning .alert-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.alert-item.info .alert-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.alert-desc {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 4px;
}

.alert-time {
    font-size: 0.75rem;
    color: var(--gray);
}

.btn-handle {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-handle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== 运营监控页面 ==================== */
.monitor-header {
    margin-bottom: 20px;
}

.monitor-header h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.monitor-header h1 i {
    color: var(--primary);
}

.monitor-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h2 i {
    color: var(--primary);
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--secondary);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 数据流 */
.data-stream {
    padding: 15px;
}

.stream-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stream-item:last-child {
    border-bottom: none;
}

.stream-time {
    font-size: 0.8rem;
    color: var(--gray);
    width: 70px;
}

.stream-from,
.stream-to {
    font-size: 0.85rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

.stream-arrow {
    color: var(--gray);
}

.stream-type {
    flex: 1;
    font-size: 0.85rem;
    color: var(--gray);
}

.stream-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.stream-status.success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--secondary);
}

/* 监控统计 */
.monitor-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.monitor-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-number.green {
    color: var(--secondary);
}

.stat-number.red {
    color: var(--danger);
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--gray);
}

/* 系统详情卡片 */
.system-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.system-detail-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-icon.ship {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.detail-icon.dispatch {
    background: rgba(6, 182, 212, 0.2);
    color: #06b6d4;
}

.detail-icon.trade {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.detail-icon.cold {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.detail-icon.vehicle {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.detail-icon.property {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}

.detail-header h3 {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.status-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.status-tag.online {
    background: rgba(34, 197, 94, 0.2);
    color: var(--secondary);
}

.detail-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.detail-stat .label {
    color: var(--gray);
}

.detail-stat .value {
    font-weight: 500;
}

.detail-stat .value.green {
    color: var(--secondary);
}

/* ==================== 系统管理页面 ==================== */
.systems-header {
    margin-bottom: 20px;
}

.systems-header h1 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.systems-header h1 i {
    color: var(--primary);
}

/* 架构图 */
.architecture-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.architecture-diagram {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.arch-layer {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.arch-layer.top {
    gap: 30px;
}

.arch-layer.bottom {
    flex-wrap: wrap;
}

.arch-box {
    padding: 15px 25px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.arch-box i {
    font-size: 1.3rem;
}

.arch-box.dashboard {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.arch-box.monitor {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.arch-box.platform {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px 40px;
}

.platform-features {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.platform-features span {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.arch-box.system {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 100px;
}

.arch-arrow {
    color: var(--gray);
    font-size: 1.2rem;
}

/* 系统列表 */
.systems-list-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.btn-add {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add:hover {
    background: var(--primary-dark);
}

.systems-table {
    padding: 15px;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
    gap: 15px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    font-size: 0.85rem;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row .col:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-row .col:first-child i {
    color: var(--primary);
}

.tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.tag.purchase {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.tag.self {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status.online {
    color: var(--secondary);
}

.status.online::before {
    background: var(--secondary);
}

.btn-sm {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-sm:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 响应式 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .system-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .top-nav {
        padding: 0 15px;
    }

    .nav-brand span {
        display: none;
    }

    .nav-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid,
    .bottom-grid {
        grid-template-columns: 1fr;
    }

    .monitor-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .system-details {
        grid-template-columns: 1fr;
    }

    .system-status-list {
        grid-template-columns: 1fr;
    }

    .table-header,
    .table-row {
        grid-template-columns: 2fr 1fr 1fr;
    }

    .table-header .col:nth-child(4),
    .table-header .col:nth-child(5),
    .table-row .col:nth-child(4),
    .table-row .col:nth-child(5) {
        display: none;
    }

    .arch-layer.bottom {
        gap: 10px;
    }

    .arch-box.system {
        min-width: 80px;
        padding: 10px 15px;
        font-size: 0.8rem;
    }
}