/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

/* 通用隐藏样式 */
.hidden {
    display: none !important;
}

/* Cesium容器全屏显示 */
#cesiumContainer {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* 隐藏Cesium默认元素 */
.cesium-viewer-bottom {
    display: none; /* 隐藏底部版权信息 */
}

/* 可选：隐藏右上角logo */
.cesium-viewer .cesium-viewer-toolbar {
    /* display: none; */
}

/* 加载遮罩层 */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#loadingOverlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

/* 加载动画 */
.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content p {
    font-size: 16px;
    margin-top: 10px;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .loading-content p {
        font-size: 14px;
    }
}

/* ========== 测量工具栏样式 ========== */
#measureToolbar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    color: #333;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tool-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.tool-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tool-btn.btn-clear {
    border-color: #ff6b6b;
}

.tool-btn.btn-clear:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

.tool-icon {
    font-size: 18px;
    line-height: 1;
}

.tool-text {
    font-size: 14px;
    font-weight: 500;
}

/* 测量结果面板 */
.measure-panel {
    position: absolute;
    top: 90px;
    right: 20px;
    width: 320px;
    max-height: 500px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s ease;
}

.measure-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
}

.panel-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.panel-content {
    padding: 15px 20px;
    max-height: 400px;
    overflow-y: auto;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

.measure-item {
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(102, 126, 234, 0.05);
    border-left: 4px solid #667eea;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.measure-item:hover {
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.measure-item .item-type {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.measure-item .item-result {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.measure-item .item-time {
    font-size: 11px;
    color: #999;
}

.measure-item .item-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.item-actions button {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-actions button:hover {
    background: #f5f5f5;
    border-color: #667eea;
    color: #667eea;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

/* 测量提示 */
.measure-tip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.measure-tip.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(10px);
}

/* Cesium标注样式覆盖 */
.cesium-infoBox {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
}

/* 高度调整面板 */
.height-adjust-panel {
    position: absolute;
    top: 90px;
    left: 20px;
    width: 350px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: all 0.3s ease;
}

.height-adjust-panel.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.slider-container {
    padding: 15px 0;
}

.slider-container label {
    display: block;
    margin-bottom: 15px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

#heightOffsetValue {
    color: #667eea;
    font-size: 18px;
    margin-left: 5px;
}

#heightOffsetSlider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #ff6b6b, #667eea, #51cf66);
    outline: none;
    -webkit-appearance: none;
}

#heightOffsetSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid #667eea;
}

#heightOffsetSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid #667eea;
}

.slider-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #999;
}

.adjust-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.adjust-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.adjust-btn:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.adjust-btn.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.adjust-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.adjust-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.adjust-info p {
    font-size: 12px;
    color: #666;
    margin: 5px 0;
}

/* 响应式适配 - 测量工具 */
@media (max-width: 768px) {
    #measureToolbar {
        left: 10px;
        right: 10px;
        transform: none;
        width: calc(100% - 20px);
        justify-content: space-between;
        padding: 8px 10px;
        gap: 5px;
        flex-wrap: wrap;
    }
    
    .tool-btn {
        padding: 6px 10px;
        font-size: 12px;
        flex: 0 0 auto;
    }
    
    .tool-icon {
        font-size: 16px;
    }
    
    .tool-text {
        display: none;
    }
    
    .measure-panel {
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-height: 300px;
    }
    
    .height-adjust-panel {
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
    }
    
    .measure-tip {
        font-size: 12px;
        padding: 10px 20px;
        bottom: 20px;
    }
}

/* ========== 考官模式样式 ========== */

/* 考官模式工具栏 */
.admin-toolbar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(255, 107, 107, 0.95);
    padding: 10px 15px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    z-index: 1000;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-btn.btn-exit {
    background: #ff6b6b;
    color: white;
}

.admin-btn.btn-exit:hover {
    background: #ff5252;
}

.admin-icon {
    font-size: 18px;
}

.admin-text {
    font-size: 14px;
}

/* 模态框遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-box {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-content {
    padding: 20px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.input-group input[type="text"],
.input-group input[type="password"],
.input-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

.view-group {
    margin-bottom: 15px;
}

.view-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.view-text {
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn.btn-primary {
    background: #667eea;
    color: white;
}

.modal-btn.btn-primary:hover {
    background: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.modal-btn:not(.btn-primary) {
    background: #f0f0f0;
    color: #666;
}

.modal-btn:not(.btn-primary):hover {
    background: #e0e0e0;
}

/* 右键菜单 */
.context-menu {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 8px 0;
    min-width: 150px;
    z-index: 3000;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

.menu-icon {
    font-size: 16px;
}

.menu-text {
    font-size: 14px;
    color: #333;
}

/* 点列表面板 */
.point-list-panel {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 300px;
    max-height: calc(100vh - 100px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.point-list-panel .panel-header {
    padding: 15px 20px;
    border-bottom: 2px solid #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.point-list-panel .panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.point-count {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.point-list-panel .panel-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.search-box {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.point-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.no-points {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.point-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.point-item:hover {
    border-color: #ff6b6b;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
    transform: translateX(-2px);
}

.point-item.selected {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.05);
    box-shadow: 0 2px 12px rgba(255, 107, 107, 0.3);
}

.point-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.point-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.point-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.point-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.point-action-btn {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.point-action-btn.btn-edit {
    background: #667eea;
    color: white;
}

.point-action-btn.btn-edit:hover {
    background: #5568d3;
}

.point-action-btn.btn-delete {
    background: #ff6b6b;
    color: white;
}

.point-action-btn.btn-delete:hover {
    background: #ff5252;
}

.point-action-btn.btn-locate {
    background: #51cf66;
    color: white;
}

.point-action-btn.btn-locate:hover {
    background: #40c057;
}

/* 响应式 - 考官模式 */
@media (max-width: 768px) {
    .admin-toolbar {
        left: 10px;
        right: 10px;
        transform: none;
        width: calc(100% - 20px);
    }
    
    .modal-box {
        min-width: 300px;
        max-width: calc(100% - 40px);
        margin: 20px;
    }
    
    .point-list-panel {
        right: 10px;
        width: 280px;
        max-height: calc(100vh - 120px);
    }
}


