/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    color: #ffffff;
    padding-top: 70px;
    overflow-x: hidden;
}

/* 顶部导航栏 */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(90deg, #00d4ff, #ff00ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-links a:hover::before {
    left: 100%;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 主内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 图表容器 */
.chart-section {
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.chart-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-title {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(90deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(240, 147, 251, 0.5);
}

.chart-controls {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.control-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.control-btn:hover::before {
    width: 300px;
    height: 300px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: linear-gradient(45deg, #f093fb, #f5576c);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.5);
}

.chart-container {
    width: 100%;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.canvas-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #00d4ff, #ff00ff);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px) rotate(360deg);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.6);
}

/* 加载状态 */
.loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 400px;
    color: #00d4ff;
    font-size: 1.1rem;
    gap: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 信息提示 */
.info-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.info-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    body {
        padding-top: 120px;
    }

    main {
        padding: 1rem;
    }

    .chart-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .chart-container {
        height: 400px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .chart-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .control-btn {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .back-to-top {
        width: 50px;
        height: 50px;
        right: 1rem;
        bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.4rem;
    }

    .chart-title {
        font-size: 1.4rem;
    }

    .chart-container {
        height: 300px;
    }

    .control-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #764ba2, #667eea);
}

/* 选中文本样式 */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: white;
}