/* 第7章交互式可视化网页样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 50px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInDown 1s ease;
}

header p {
    font-size: 1.3rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.3s both;
}

.navigation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.section-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.section-card:nth-child(1) { animation-delay: 0.1s; }
.section-card:nth-child(2) { animation-delay: 0.2s; }
.section-card:nth-child(3) { animation-delay: 0.3s; }

.section-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    background: rgba(255, 255, 255, 1);
}

.section-card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
}

.section-card h2 .icon {
    font-size: 1.8rem;
    margin-right: 10px;
}

.section-card p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 1rem;
}

.plot-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plot-link {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-weight: 500;
    font-size: 0.95rem;
}

.plot-link:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.plot-link .number {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: bold;
    font-size: 0.9rem;
}

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

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

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

.pulse {
    animation: pulse 2s infinite;
}

.info-badge {
    background: #48bb78;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-left: 10px;
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    header p {
        font-size: 1.1rem;
    }
    .navigation-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .section-card {
        padding: 20px;
    }
}

.footer {
    text-align: center;
    color: white;
    margin-top: 50px;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 美国人口地图样式 */
.main-map-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.5s forwards;
}

.main-map-container h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    font-size: 2rem;
    text-align: center;
}

.map-content {
    min-height: 600px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.loading {
    color: #666;
    text-align: center;
    font-size: 1.2rem;
    padding: 40px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 1rem;
    margin-bottom: 5px;
}

.stat-detail {
    color: #888;
    font-size: 0.9rem;
}

.parameter-controls {
    background: #f0f8ff;
    padding: 25px;
    border-radius: 10px;
    margin: 20px 0;
}

.parameter-controls h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.parameter-group {
    display: flex;
    align-items: center;
    margin: 15px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.parameter-group label {
    min-width: 150px;
    color: #555;
    font-weight: 500;
    font-size: 1rem;
}

.parameter-group select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.parameter-group select:focus {
    outline: none;
    border-color: #667eea;
}

.parameter-group input[type="range"] {
    flex: 1;
    min-width: 200px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.parameter-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.parameter-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.parameter-group span {
    min-width: 80px;
    text-align: right;
    color: #667eea;
    font-weight: bold;
    font-size: 1.1rem;
}

.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn.secondary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn.danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn.danger:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* 图表展示区域样式 */
.chart-display-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.chart-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin: 0;
}

.close-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.chart-content {
    min-height: 600px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.plot-link {
    cursor: pointer;
}