/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 加载状态指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* 用户反馈提示样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    min-width: 250px;
    max-width: 350px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #1f2937;
}

.toast-message {
    color: #6b7280;
    font-size: 0.9rem;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 数据面板样式 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 0 10px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card.highlighted {
    border: 2px solid #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-content {
    flex: 1;
    text-align: left;
}

.stat-content h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 5px;
    line-height: 1.2;
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

.stat-change.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.stat-change.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* 头部样式 */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
}

/* 主题切换按钮 */
.theme-switcher {
    display: flex;
    align-items: center;
}

.theme-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.theme-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.theme-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.theme-btn:hover .theme-icon {
    transform: rotate(15deg);
}

/* 暗色主题 */
body.dark-theme {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
}

body.dark-theme .stat-card {
    background: linear-gradient(135deg, #2d2d44 0%, #1e1e2e 100%);
    color: #e4e4e7;
}

body.dark-theme .stat-value {
    color: #a8b3cf;
}

body.dark-theme .stat-content h3 {
    color: #a8a8b3;
}

body.dark-theme header,
body.dark-theme .chart-container,
body.dark-theme .chart-controls,
body.dark-theme .stat-card {
    background: rgba(30, 30, 46, 0.95);
    color: #e4e4e7;
}

body.dark-theme .chart-container {
    background: rgba(30, 30, 46, 0.95);
}

body.dark-theme .chart {
    background: #1e1e2e;
}

body.dark-theme .chart-type-btn {
    background: linear-gradient(135deg, #2d2d44 0%, #1e1e2e 100%);
    color: #e4e4e7;
    border: 2px solid rgba(168, 179, 207, 0.2);
}

body.dark-theme .chart-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-theme .control-group select,
body.dark-theme .control-group input {
    background: #1e1e2e;
    color: #e4e4e7;
    border-color: rgba(168, 179, 207, 0.2);
}

body.dark-theme .export-btn,
body.dark-theme .animation-controls button,
body.dark-theme .geo-controls button,
body.dark-theme .surface-controls button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.dark-theme .chart-info,
body.dark-theme .animation-controls,
body.dark-theme .geo-controls,
body.dark-theme .surface-controls {
    background: #2d2d44;
    color: #e4e4e7;
}

body.dark-theme footer {
    background: rgba(30, 30, 46, 0.9);
}

body.dark-theme footer p {
    color: #a8a8b3;
}

header h1 {
    font-size: 2.5rem;
    color: #1e3c72;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

/* 图表类型选择器 */
.chart-types {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.chart-type-btn {
    padding: 12px 24px;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    color: #1e3c72;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.chart-type-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 控制面板样式 */
.chart-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.control-group {
    display: inline-block;
    margin: 0 20px 15px 0;
}

.control-group label {
    display: inline-block;
    margin-right: 10px;
    font-weight: 600;
    color: #1e3c72;
}

.control-group select,
.control-group input[type="range"] {
    padding: 8px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    transition: all 0.3s ease;
}

.control-group select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.export-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* 主内容区域 */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 图表容器 */
.chart-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.chart-container.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.chart-title {
    font-size: 1.8rem;
    color: #1e3c72;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 700;
}

.chart-description {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.chart {
    width: 100%;
    height: 500px;
    position: relative;
    margin: 0 auto 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.chart > div {
    width: 100%;
    height: 100%;
    min-height: 500px;
}

/* 动画控制面板 */
.animation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    flex-wrap: wrap;
}

.animation-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.animation-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.speed-control input {
    width: 120px;
}

/* 地理控制面板 */
.geo-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    flex-wrap: wrap;
}

.geo-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 曲面控制面板 */
.surface-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    flex-wrap: wrap;
}

/* 图表信息 */
.chart-info {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.chart-info h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.chart-info ul {
    list-style: none;
    padding-left: 0;
}

.chart-info li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    padding-left: 25px;
}

.chart-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.chart-info li:last-child {
    border-bottom: none;
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

footer p {
    margin: 5px 0;
    color: #666;
    font-size: 0.95rem;
}

/* 键盘快捷键提示样式 */
.help-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    padding: 0;
    max-width: 500px;
    width: 90%;
}

.help-content {
    padding: 30px;
}

.help-content h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #1e3c72;
    font-size: 1.3rem;
}

.help-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.help-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

kbd {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin: 0 2px;
}

.help-close {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.help-close:hover {
    transform: translateY(-2px);
}

/* 自定义数据面板样式 */
.custom-data-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.custom-data-panel h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #1e3c72;
    font-size: 1.5rem;
}

.custom-data-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.custom-data-section h4 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.1rem;
}

.data-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.data-input-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-input-item label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.data-input-item input {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.data-input-item input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.data-input-item .unit {
    color: #666;
    font-size: 0.85rem;
    margin-left: 5px;
}

.custom-data-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.apply-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* 暗色主题适配 */
body.dark-theme .custom-data-panel {
    background: rgba(30, 30, 46, 0.95);
}

body.dark-theme .custom-data-panel h3 {
    color: #e4e4e7;
}

body.dark-theme .custom-data-section {
    background: #2d2d44;
    border-color: rgba(168, 179, 207, 0.2);
}

body.dark-theme .custom-data-section h4 {
    color: #a8b3cf;
}

body.dark-theme .data-input-item label {
    color: #e4e4e7;
}

body.dark-theme .data-input-item input {
    background: #1e1e2e;
    border-color: rgba(168, 179, 207, 0.2);
    color: #e4e4e7;
}

body.dark-theme .data-input-item .unit {
    color: #a8a8b3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .custom-data-panel {
        padding: 20px;
    }
    
    .data-input-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .custom-data-actions {
        flex-direction: column;
    }
    
    .apply-btn,
    .reset-btn {
        width: 100%;
    }
}

/* 键盘焦点样式 */
.chart-type-btn:focus,
.control-group select:focus,
.control-group input:focus,
button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        margin: 20px 0;
    }
    
    .stat-card {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .stat-content {
        text-align: center;
    }
    
    .stat-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .chart-types {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .chart-type-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
    }
    
    .control-group {
        display: block;
        margin: 0 0 15px 0;
    }
    
    .chart-controls {
        display: block;
    }
    
    .control-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
    }
    
    .control-group select,
    .control-group input {
        width: 100%;
        max-width: none;
    }
    
    .export-btn {
        width: 100%;
        margin-top: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    .chart-container {
        padding: 20px;
    }
    
    .chart {
        height: 350px;
    }
    
    .chart > div {
        min-height: 350px;
    }
    
    /* 移动端动画控制优化 */
    .animation-controls,
    .geo-controls,
    .surface-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .animation-controls button,
    .geo-controls button,
    .surface-controls button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .speed-control,
    .control-group {
        background: white;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .speed-control input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: row;
        text-align: left;
        gap: 12px;
    }
    
    .stat-content {
        text-align: left;
    }
    
    .stat-icon {
        font-size: 1.8rem;
        width: 45px;
        height: 45px;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .chart-type-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    main {
        padding: 15px;
    }
    
    .chart-container {
        padding: 15px;
    }
    
    .chart {
        height: 300px;
    }
    
    .chart > div {
        min-height: 300px;
    }
}