/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2c3e50;
}

/* 页面容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 标题样式 */
.header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 2px;
}

.header h1 {
    font-size: 2.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    color: #666;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 卡片容器 */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px;
    perspective: 1000px;
    min-height: 200px;
    position: relative;
}

/* 卡片样式 */
.card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
    backdrop-filter: blur(10px);
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.card:hover::before {
    transform: scaleX(1);
}

.card h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: #6a11cb;
    border-radius: 1.5px;
}

.card .graph-type {
    color: #6a11cb;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    display: inline-block;
    padding: 5px 12px;
    background: rgba(106, 17, 203, 0.1);
    border-radius: 15px;
}

.card .graph-stats {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.95rem;
    padding: 10px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.card .graph-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card .graph-stats span::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #6a11cb;
    border-radius: 50%;
    opacity: 0.6;
}

.card .click-hint {
    color: #999;
    font-size: 0.9rem;
    margin: 0;
    text-align: right;
    font-style: italic;
    transition: color 0.3s ease;
}

.card:hover .click-hint {
    color: #6a11cb;
}

.no-data, .error {
    text-align: center;
    padding: 60px;
    color: #666;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.error {
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* 加载动画 */
.loading {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    width: 100%;
}

.loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto 0;
    border: 3px solid rgba(106, 17, 203, 0.1);
    border-top: 3px solid #6a11cb;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 加载文字样式 */
.loading-text {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.2rem;
    }
    
    .header p {
        font-size: 1.1rem;
    }
    
    .card-container {
        grid-template-columns: 1fr;
        padding: 10px;
        min-height: 150px;
    }
    
    .card {
        padding: 25px;
    }
    
    .loading {
        font-size: 1rem;
    }
}

/* 模态弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    backdrop-filter: blur(5px);
}

.modal.show {
    opacity: 1;
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 2% auto;
    padding: 25px;
    width: 92%;
    height: 90%;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    transform: scale(0.7) translateY(-50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.close-button {
    position: absolute;
    right: 25px;
    top: 15px;
    color: #666;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.close-button:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    height: calc(100% - 20px);
    width: 100%;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
}

.iframe-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.iframe-loading::after {
    content: '';
    display: block;
    width: 50px;
    height: 50px;
    margin: 20px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6a11cb;
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

#graphFrame {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    overflow: hidden;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#graphFrame::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

#graphFrame.loaded {
    opacity: 1;
}

/* 字体应用 */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 增强卡片动画效果 */
.card {
    animation: cardAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 为卡片添加延迟动画 */
.card-container .card:nth-child(1) { animation-delay: 0.1s; }
.card-container .card:nth-child(2) { animation-delay: 0.2s; }
.card-container .card:nth-child(3) { animation-delay: 0.3s; }
.card-container .card:nth-child(4) { animation-delay: 0.4s; }
.card-container .card:nth-child(5) { animation-delay: 0.5s; }