/* 粉紫色渐变主题样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Poppins', 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.8;
    color: #4a4a4a;
    background: linear-gradient(135deg, #ffb6c1 0%, #d8bfd8 30%, #9370db 70%, #8a2be2 100%);
    background-attachment: fixed;
    display: grid;
    grid-template-areas:
        "header header header"
        "nav nav nav"
        "aside main main"
        "footer footer footer";
    grid-template-columns: 280px 1fr 1fr;
    grid-template-rows: auto auto 1fr auto;
    min-height: 100vh;
    gap: 0;
}

/* 头部样式 - 粉紫色渐变 */
header {
    grid-area: header;
    background: linear-gradient(135deg, #ff69b4 0%, #da70d6 50%, #8a2be2 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.3);
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 2px;
    background: linear-gradient(45deg, #ffffff 0%, #ffebf3 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 导航样式 - 圆形按钮设计 */
nav {
    grid-area: nav;
    background: linear-gradient(135deg, #ff69b4 0%, #da70d6 50%, #8a2be2 100%);
    padding: 1rem;
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(255, 105, 180, 0.4);
}

nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
    gap: 1rem;
}

nav a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
    letter-spacing: 1px;
    min-width: 120px;
    text-align: center;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

nav a.active {
    background: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* 主内容区域 - 半透明白色 */
main {
    grid-area: main;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: 0 12px 40px rgba(255, 105, 180, 0.3);
    border-radius: 20px;
    margin: 1rem 1rem 1rem 0;
    border: 1px solid rgba(255, 182, 193, 0.3);
}

/* 图表容器 */
#chart-container {
    margin-bottom: 2rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-controls button {
    background: linear-gradient(135deg, #ff69b4 0%, #da70d6 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(255, 105, 180, 0.3);
}

.chart-controls button:hover {
    background: linear-gradient(135deg, #ff1493 0%, #c71585 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.4);
}

.chart-wrapper {
    position: relative;
    height: 450px;
    margin-bottom: 2rem;
    border: 3px solid rgba(255, 182, 193, 0.6);
    border-radius: 20px;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 240, 252, 0.95) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(255, 105, 180, 0.2);
    transition: all 0.3s ease;
}

.chart-wrapper:hover {
    border-color: rgba(255, 182, 193, 0.8);
    box-shadow: 0 12px 40px rgba(255, 105, 180, 0.3);
    transform: translateY(-2px);
}

.chart-description {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.3) 0%, rgba(216, 191, 216, 0.3) 100%);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #ff69b4;
}

/* 数据面板 */
#data-panel {
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.2) 0%, rgba(216, 191, 216, 0.2) 100%);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 182, 193, 0.3);
}

.data-table-container {
    max-height: 300px;
    overflow-y: auto;
    margin: 1rem 0;
    border: 1px solid rgba(255, 182, 193, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
}

#data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent;
}

#data-table th,
#data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 182, 193, 0.3);
}

#data-table th {
    background: linear-gradient(135deg, #ffb6c1 0%, #d8bfd8 100%);
    font-weight: bold;
    color: #333;
}

#data-table tr:hover {
    background: rgba(255, 182, 193, 0.2);
}

.data-controls {
    display: flex;
    gap: 0.5rem;
}

.data-controls button {
    background: linear-gradient(135deg, #ff69b4 0%, #da70d6 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.data-controls button:hover {
    background: linear-gradient(135deg, #ff1493 0%, #c71585 100%);
    transform: translateY(-2px);
}

.data-controls button:disabled {
    background: #d8bfd8;
    cursor: not-allowed;
    transform: none;
}

/* 侧边栏 */
aside {
    grid-area: aside;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 182, 193, 0.5);
    border-radius: 20px;
    margin: 1rem 0 1rem 1rem;
    box-shadow: 0 12px 40px rgba(255, 105, 180, 0.4), 
                0 4px 20px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.option-group {
    margin-bottom: 1.2rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #8a2be2;
}

.option-group select,
.option-group input[type="range"] {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #d8bfd8;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.option-group select:focus,
.option-group input[type="range"]:focus {
    outline: none;
    border-color: #ff69b4;
    box-shadow: 0 0 5px rgba(255, 105, 180, 0.5);
}

.option-group.checkbox {
    display: flex;
    align-items: center;
}

.option-group.checkbox label {
    margin-bottom: 0;
    margin-left: 0.5rem;
}

/* 页脚 */
footer {
    grid-area: footer;
    background: linear-gradient(135deg, #ff69b4 0%, #da70d6 50%, #8a2be2 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    box-shadow: 0 -4px 20px rgba(255, 105, 180, 0.4);
    border-top: 3px solid rgba(255, 255, 255, 0.2);
}

footer p {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    body {
        grid-template-areas:
            "header header"
            "nav nav"
            "aside main"
            "footer footer";
        grid-template-columns: 250px 1fr;
    }
    
    aside {
        margin: 1rem 0.5rem 1rem 1rem;
    }
    
    main {
        margin: 1rem 1rem 1rem 0.5rem;
    }
}

@media (max-width: 992px) {
    body {
        grid-template-areas:
            "header"
            "nav"
            "aside"
            "main"
            "footer";
        grid-template-columns: 1fr;
    }
    
    nav ul {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    nav a {
        min-width: 100px;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    main, aside {
        margin: 0.5rem;
        border-radius: 15px;
    }
    
    .chart-wrapper {
        height: 350px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .chart-controls {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .chart-controls button {
        flex: 1;
        margin: 0 0.25rem;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
    
    .chart-wrapper {
        height: 300px;
        padding: 1rem;
    }
    
    main, aside {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    nav a {
        min-width: 80px;
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .chart-wrapper {
        height: 250px;
    }
    
    main, aside {
        padding: 1rem;
    }
}

/* 编辑模式样式 */
.edit-mode .editable {
    background-color: rgba(255, 182, 193, 0.3);
    border: 1px dashed #ff69b4;
    padding: 2px;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 工具提示 */
.tooltip {
    position: absolute;
    background: linear-gradient(135deg, #ff69b4 0%, #da70d6 100%);
    color: white;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.9) 0%, rgba(216, 191, 216, 0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s;
}

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

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

/* 数据标签样式 */
.data-label {
    position: absolute;
    font-size: 12px;
    font-weight: bold;
    color: #8a2be2;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    border: 1px solid #d8bfd8;
}

/* 图表切换动画 */
.chart-transition {
    transition: all 0.5s ease;
}

/* 高亮效果 */
.highlight {
    animation: highlight 1s ease;
}

@keyframes highlight {
    0% { background-color: rgba(255, 105, 180, 0.5); }
    100% { background-color: transparent; }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 182, 193, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff69b4 0%, #da70d6 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff1493 0%, #c71585 100%);
}