/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    overflow: hidden;
}

/* 返回按钮 */
.back-button-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.back-button {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
}

.back-button:hover {
    color: #293df2;
    transform: translateY(-2px);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

.back-button:active {
    transform: translateY(1px);
}

/* 主容器 */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

header {
    text-align: center;
    padding: 20px 0;
    z-index: 10;
    backdrop-filter: blur(5px);
}

h1 {
    font-size: 1.6rem;
    background: linear-gradient(to right, #ffffff, #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

/* 地球和实时数据容器 */
.main-content {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

#earth-container {
    flex: 3;
    position: relative;
    height: 100%;
    overflow: hidden;
}

#realtime-panel {
    flex: 1;
    min-width: 320px;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    color: white;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h2 {
    font-size: 1.6rem;
    font-weight: 550;
    background: linear-gradient(to right, #00ccff, #00ffcc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.data-section {
    margin-bottom: 25px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #00ccff;
}

.section-title-1 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #00ccff;
}

.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.data-item {
    background: rgba(30, 40, 60, 0.5);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid rgba(100, 180, 255, 0.1);
    transition: all 0.3s ease;
}

.data-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 100, 255, 0.2);
    border-color: rgba(100, 180, 255, 0.3);
}

.data-label {
    font-size: 0.8rem;
    color: #a0d0ff;
    margin-bottom: 5px;
}

.data-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
}

.data-unit {
    font-size: 0.8rem;
    color: #66aaff;
    margin-left: 3px;
}

.satellite-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.satellite-item {
    background: rgba(40, 100, 180, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-good {
    background: #00ff88;
}

.status-warning {
    background: #ffcc00;
}

.status-critical {
    background: #ff5555;
}

.signal-meter {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.signal-level {
    height: 100%;
    background: linear-gradient(to right, #ff5555, #ffcc00, #00ff88);
    border-radius: 4px;
}

.signal-level-1 {
    height: 100%;
    background: linear-gradient(to right, #ff5555, #ffcc00, #00ff88);
    border-radius: 4px;
}

.signal-level-user {
    height: 100%;
    background: linear-gradient(to right, #ff5555, #ffcc00, #00ff88);
    border-radius: 4px;
}

.signal-level-station {
    height: 100%;
    background: linear-gradient(to right, #ff5555, #ffcc00, #00ff88);
    border-radius: 4px;
}

/* 观测站信息 */
#info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding: 20px;
    border-radius: 15px;
    max-width: 400px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 10;
}

#info-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #00ccff, #00ffcc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

#info-panel h2 i {
    font-size: 1.0rem;
}

#city-info {
    font-size: 1.0rem;
    line-height: 1.2;
}

#city-info .city {
    font-size: 1.0rem;
    color: #ffffff;
    margin-bottom: 10px;
}

#city-info .coords {
    font-size: 1.0rem;
    color: #ffffff;
    opacity: 0.8;
    margin-bottom: 10px;
}

/* 暂停按钮 */
.controls {
    position: absolute;
    bottom: 30px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 1000;
}

.btn {
    background: none;
    border: none;
    color: #ffffff;
    padding: 12px 25px;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
}

.btn:hover {
    color: #293df2;
    transform: translateY(-2px);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

.btn:active {
    transform: translateY(1px);
}

.btn i {
    font-size: 1.2rem;
}

/* 事件日志样式 */
.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-good {
    color: #00ff88;
}

.log-warning {
    color: #ffcc00;
}

.log-critical {
    color: #ff5555;
}

.log-icon {
    margin-right: 5px;
    width: 12px;
    text-align: center;
}

/* 模拟控制按钮 */
.sim-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.sim-btn {
    flex: 1;
    padding: 8px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.sim-btn:hover {
    transform: translateY(-2px);
}

#start-sim {
    background: linear-gradient(135deg, #00cc66, #00b359);
    color: white;
}

#stop-sim {
    background: linear-gradient(135deg, #ff4444, #cc3636);
    color: white;
}

.log-container {
    height: 150px;
    overflow-y: auto;
    background: rgba(15, 20, 35, 0.5);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    border: 1px solid rgba(100, 180, 255, 0.1);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.clear-log {
    background: transparent;
    border: none;
    color: #66aaff;
    cursor: pointer;
    font-size: 0.7rem;
}

.clear-log:hover {
    text-decoration: underline;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 200, 255, 0.3);
    border-radius: 50%;
    border-top: 5px solid #62F571;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    background: linear-gradient(to right, #F5AB22, #00ffcc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

/* 性能指标图 */
.performance-chart{
  display: grid;
  grid-template-rows: repeat(4, 200px); /* 每个图200px，高度你可调 */
  gap: 12px;
  margin-top: 15px;
  background: rgba(20, 30, 50, 0.4);
  border-radius: 8px;
  position: relative;
  height: auto;            /* 让容器随内容增长 */
}

.performance-chart canvas{
  position: static !important;
  width: 100%;
  height: 100%;
}

.chart-title {
    position: absolute;
    color: #ffffff;
    font-size: 1.0rem;
    top: 10px;
    left: 10px;
}

.chart-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(5, 1fr);
    border-top: 1px solid rgba(100, 150, 255, 0.1);
    border-left: 1px solid rgba(100, 150, 255, 0.1);
}

.chart-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    background: linear-gradient(to top, rgba(0, 200, 255, 0.3), transparent);
    clip-path: polygon(0% 100%, 10% 70%, 20% 60%, 30% 40%, 40% 50%, 50% 30%, 60% 40%, 70% 50%, 80% 60%, 90% 40%, 100% 100%);
}

/* 城市性能指标图 */
.station-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.station-btn {
    background: rgba(40, 100, 180, 0.5);
    border: 1px solid rgba(100, 180, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.station-btn:hover {
    background: rgba(40, 100, 180, 0.8);
}

.station-btn.active {
    background: #00ccff;
    color: #000;
    font-weight: 500;
}

.performance-chart canvas {
    width: 100%;
    height: 100%;
}

/* 汉堡菜单按钮 */
.dropdown {
    position: fixed;
    top: 25px;
    right: 50px;
    z-index: 1000;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 25px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 5px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: center;
}

.hamburger-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 50vh;
    background: rgba(0, 0, 0, 0.9);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 60px 20px 20px;
    margin-top: 50px;
    border-radius: 10px 0 0 10px;
}

.hamburger-menu.active {
    right: 0;
}

.close-hamburger {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    z-index: 2101;
}

.close-hamburger:hover {
    color: #66aaff;
}

.hamburger-nav-item {
    display: flex;
    align-items: center;
    padding: 15px;
    color: #ffffff;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger-nav-item:hover {
    background: #2e2e38;
    color: #66aaff;
}

.hamburger-nav-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.hamburger-nav-item a {
    color: #ffffff;
    text-decoration: none;
}

.hamburger-nav-item a:hover,
.hamburger-nav-item button:hover {
    color: #66aaff;
    text-decoration: underline;
}

.hamburger-nav-item button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
}

.nav {
    display: flex;
    z-index: 2000;
    justify-content: space-between;
}

/* 优化移动设备触摸体验 */
#earth-container {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* 防止长按弹出菜单 */
#earth-container, .marker, .city-label {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 优化按钮触摸反馈 */
.station-btn, 
#rotation-btn, 
#clear-log,
.back-button,
.hamburger, 
.close-hamburger,
.btn {
    touch-action: manipulation;
}

@media (max-width: 1300px) {
    body, html {
        overflow-y: auto;
        height: auto;
    }

    .main-content {
        flex-direction: column;
        overflow: visible;
    }

    .container {
        height: auto;
        overflow: visible;
    }

    #earth-container {
        flex: none;
        height: auto;
        min-height: 70vh;
        overflow: visible;
    }

    #realtime-panel {
        min-width: 100%;
        height: 300px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    #info-panel {
        max-width: 220px;
        bottom: 10px;
        left: 10px;
        padding: 10px;
    }

    #info-panel h2 {
        font-size: 1rem;
        margin-bottom: 10px;
        color: #ffffff;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    #info-panel h2 i {
        font-size: 0.8rem;
    }

    #city-info {
        font-size: 0.8rem;
    }

    #city-info .city {
        font-size: 0.8rem;
    }

    #city-info .coords {
        font-size: 0.8rem;
    }

    .btn {
        font-size: 1.1rem;
    }

    .btn i {
        font-size: 1.1rem;
    }

    #earth-container {
        flex: 5;
    }

    #realtime-panel {
        flex: 1;
    }
}

@media (max-width: 920px) {
    .back-button-container {
        position: relative;
        top: 5px;
        left: 5px;
    }

    .dropdown {
        position: relative;
        top: 10px;
        right: 20px;
    }
    
    h1 {
        font-size: 1.2rem;
        margin-bottom: 0px;
    }
    
    .controls {
        bottom: 10px;
        right: 10px;
    }
    
    .btn {
        font-size: 0.8rem;
    }

    .btn i {
        font-size: 0.8rem;
    }

    #info-panel {
        max-width: 180px;
        bottom: 5px;
        left: 5px;
        padding: 2px;
    }

    #info-panel h2 {
        font-size: 0.8rem;
    }

    #info-panel h2 i {
        font-size: 0.6rem;
    }

    #city-info {
        font-size: 0.6rem;
    }

    #city-info .city {
        font-size: 0.6rem;
    }

    #city-info .coords {
        font-size: 0.6rem;
    }

    .back-button {
        font-size: 12px;
    }

    /* 增大触摸目标大小 */
    .marker {
        min-width: 20px;
        min-height: 20px;
    }
}

