/* 第四章高级数据可视化平台样式表 - 高级淡色系风格 */

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #E1F5FE 0%, #F3E5F5 100%);
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    color: #2c3e50;
    padding: 1rem 0;
    box-shadow: 0 8px 32px rgba(154, 197, 244, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #9AC5F4, #A7ECEE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-info {
    font-size: 1rem;
    color: #6c757d;
    text-align: center;
    opacity: 0.9;
}

.nav-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 按钮样式 - 高级淡色系 */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus {
    outline: 2px solid rgba(154, 197, 244, 0.5);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #9AC5F4, #A7ECEE);
    color: #2c3e50;
    border: 1px solid rgba(154, 197, 244, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #8AB4E3, #97DCDE);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #6c757d;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    color: #2c3e50;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* 主容器布局 */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 80px);
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 侧边栏样式 */
.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(154, 197, 244, 0.15);
    height: fit-content;
    position: sticky;
    top: 120px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(154, 197, 244, 0.6);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(154, 197, 244, 0.8);
}

/* 控制面板样式 */
.control-panel h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
    border-left: 4px solid #9AC5F4;
    padding-left: 0.8rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: #2c3e50;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #9AC5F4;
    box-shadow: 0 0 0 3px rgba(154, 197, 244, 0.2);
    background: rgba(255, 255, 255, 1);
}

/* 颜色方案选择器 */
.color-palette {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.color-scheme {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 1rem;
}

.color-scheme:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.color-scheme.active {
    border-color: #9AC5F4;
    background: rgba(154, 197, 244, 0.1);
    box-shadow: 0 4px 15px rgba(154, 197, 244, 0.2);
}

.color-sample {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.color-scheme span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

/* 图表网格配置 */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.chart-config {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chart-config h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 700;
}

/* 按钮组 */
.button-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

/* 数据编辑面板 */
.data-editor {
    margin-top: 2rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.data-editor h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 700;
    border-left: 4px solid #A7ECEE;
    padding-left: 0.8rem;
}

.data-info {
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.data-table {
    margin-bottom: 1rem;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    overflow: hidden;
}

.data-table th {
    background: linear-gradient(135deg, #9AC5F4, #A7ECEE);
    color: #2c3e50;
    padding: 0.8rem;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 600;
}

.data-table td {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.data-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    font-size: 0.9rem;
}

.data-input:focus {
    outline: none;
    border-color: #9AC5F4;
    background: rgba(255, 255, 255, 1);
}

.editor-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 主内容区域 */
.chart-area {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(154, 197, 244, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chart-header {
    margin-bottom: 2rem;
}

.chart-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.chapter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* 多图表布局 */
.multi-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.chart {
    width: 100%;
    height: 400px;
    min-height: 400px;
}

.chart-actions {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* 统计信息面板 */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    background: linear-gradient(135deg, #9AC5F4, #A7ECEE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 代码展示区域 */
.code-section {
    margin-bottom: 2rem;
}

.code-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
    border-left: 4px solid #FFE699;
    padding-left: 0.8rem;
}

.code-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.code-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    color: #6c757d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.code-tab.active {
    background: linear-gradient(135deg, #FFE699, #FFA8A8);
    color: #2c3e50;
}

.code-display {
    display: none;
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-display.active {
    display: block;
}

.code-display pre {
    margin: 0;
    white-space: pre-wrap;
    color: #2c3e50;
}

/* 分析区域 */
.analysis-section {
    margin-bottom: 2rem;
}

.analysis-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
    border-left: 4px solid #C4C1E0;
    padding-left: 0.8rem;
}

.analysis-content {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.analysis-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.analysis-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.analysis-tab.active {
    background: rgba(255, 255, 255, 1);
    color: #2c3e50;
    border-bottom: 2px solid #9AC5F4;
}

.analysis-panel {
    display: none;
    padding: 1.5rem;
}

.analysis-panel.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.insights-list {
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 8px;
}

.insights-list h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.insights-list ul {
    list-style: none;
    padding: 0;
}

.insights-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: #6c757d;
}

.insights-list li:last-child {
    border-bottom: none;
}

/* 知识点区域 */
.knowledge-section {
    margin-bottom: 2rem;
}

.knowledge-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
    border-left: 4px solid #B5EAD7;
    padding-left: 0.8rem;
}

.knowledge-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.knowledge-item {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.knowledge-item h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 700;
}

.knowledge-item ul {
    list-style: none;
    padding: 0;
}

.knowledge-item li {
    padding: 0.3rem 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.knowledge-item li:before {
    content: "•";
    color: #9AC5F4;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* 响应式设计展示 */
.responsive-section {
    margin-bottom: 2rem;
}

.responsive-section h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 700;
    border-left: 4px solid #C9C2FF;
    padding-left: 0.8rem;
}

.device-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.device {
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.device span {
    display: block;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.chart-preview {
    height: 100px;
    background: linear-gradient(135deg, #9AC5F4, #A7ECEE);
    border-radius: 8px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    margin: 15% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #6c757d;
}

.close:hover {
    color: #2c3e50;
}

/* 深色主题 */
.dark-theme {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e9ecef;
}

.dark-theme .navbar {
    background: rgba(26, 26, 46, 0.95);
    color: #e9ecef;
}

.dark-theme .sidebar {
    background: rgba(26, 26, 46, 0.95);
    color: #e9ecef;
}

.dark-theme .chart-area {
    background: rgba(26, 26, 46, 0.95);
    color: #e9ecef;
}

.dark-theme .form-control {
    background: rgba(26, 26, 46, 0.8);
    color: #e9ecef;
    border-color: rgba(255, 255, 255, 0.1);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar {
        position: static;
        max-height: none;
    }
    
    .multi-charts {
        grid-template-columns: 1fr;
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .knowledge-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
    }
    
    .device-preview {
        grid-template-columns: 1fr;
    }
    
    .chart {
        height: 300px;
    }
}