/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000;
    color: #fff;
    overflow: hidden;
    /* 防止滚动条 */
}

/* 地球容器样式 */
#globeViz {
    width: 100vw;
    height: 100vh;
}

/* 底部说明文字样式 */
.globe-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
}

/* 数据控制面板样式 */
#controls-overlay {
    position: absolute;
    width: 320px;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0 15px 15px;
    max-height: 90vh;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

/* 头部容器 */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

#controls-overlay h2 {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 0;
    padding: 0;
    border: none;
}

/* 旋转图标样式 */
.rotate-icon {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.rotate-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.rotate-icon.active {
    color: rgba(76, 201, 240, 0.8);
    background: rgba(76, 201, 240, 0.05);
    animation: spin 10s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

/* 控制组样式 */
.control-group {
    margin: 0;
    gap: 10px;
}


.control-group+.control-group {
    margin-top: 20px;
}

.control-label {
    display: block;
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 5px;
}

/* 自定义下拉选择框 */
.styled-select {
    width: 100%;
    padding: 8px 35px 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}


.styled-select option {
    background-color: #222;
    color: #fff;
}

/* 年份滑块样式 */
.year-highlight {
    color: #4db6ac;
    font-weight: 500;
    margin-left: 5px;
}

.slider-container {
    padding: 0 5px;
}

.styled-slider {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    margin: 10px 0;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4db6ac;
    cursor: pointer;
    transition: transform 0.1s;
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #888;
}

/* 移除旧表格样式，保留 .control-item */
.control-item {
    margin-bottom: 15px;
}

/* 隐藏 dat.gui 如果还有残留 */
.dg.ac {
    display: none !important;
}



.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #ccc;
    font-weight: 500;
}

.legend-gradient {
    height: 13px;
    width: 100%;
    border-radius: 6px;
    background: linear-gradient(to right, #ccc, #ccc);
    margin: 8px 0 5px 0;
    /* border: 1px solid rgba(255, 255, 255, 0.2); */
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.7);
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #aaa;
}

/* 移动端适配 */
@media (max-width: 768px) {

    /* 调整地球容器高度，使其显示在上半部分 */
    #globeViz {
        height: 70vh;
        position: absolute;
        top: -10vh;
        left: 0;
        width: 100%;
    }

    #controls-overlay {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: none;
        border-radius: 12px 12px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        background: rgba(0, 0, 0, 0.9);
        transition: transform 0.3s ease;
    }

    /* 折叠手柄样式 */
    .collapse-handle {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 8px 0;
        cursor: pointer;
        border-radius: 12px 12px 0 0;
        transition: background-color 0.2s;
    }

    .collapse-handle:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    .collapse-bar {
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        transition: background-color 0.2s;
    }

    .collapse-handle:hover .collapse-bar {
        background: rgba(255, 255, 255, 0.5);
    }

    /* 折叠状态 */
    #controls-overlay.collapsed {
        transform: translateY(calc(100% - 20px));
    }

    #controls-overlay.collapsed .collapse-bar {
        background: rgba(255, 255, 255, 0.6);
    }

    .data-table {
        font-size: 0.75rem;
    }
}