/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a5490;
    --secondary-color: #2c7fb8;
    --accent-color: #4a90e2;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #ffffff;
    --bg-alt: #f5f7fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --success-color: #28a745;
    --error-color: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

body {
    opacity: 1;
    transition: opacity 0.12s ease-out;
}

html.i18n-loading body {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    body {
        transition: none;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    min-width: 0;
}

.nav-logo h1 {
    font-size: 1.4rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

.lang-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    font-family: inherit;
    text-decoration: none;
    transition: opacity 0.3s;
}

.lang-toggle-btn:hover {
    opacity: 0.8;
}

@media (min-width: 769px) {
    .nav-logo {
        flex: 0 1 340px;
    }

    .nav-logo h1 {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-menu {
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    html[lang="en"] .nav-logo {
        flex-basis: 300px;
    }

    html[lang="en"] .nav-logo h1 {
        font-size: 1.2rem;
    }

    html[lang="en"] .nav-menu {
        gap: 1.2rem;
    }
}

/* navAuth 样式（调整为适配单个按钮） */
.nav-auth {
    /* 保持垂直居中，与菜单对齐 */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 160px;
}

.nav-auth span {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 关键：按钮样式完全模仿 .nav-menu a */
#btnLogin,
#btnLogout {
    /* 清除按钮默认样式 */
    background: transparent; /* 无背景，和链接一致 */
    border: none; /* 无边框 */
    padding: 0; /* 清除默认内边距，和链接排版一致 */
    margin: 0; /* 清除默认外边距 */
    
    /* 文字样式和链接统一 */
    color: white; /* 文字颜色一致 */
    font-size: 1rem; /* 字体大小和链接保持一致（可根据需求调整） */
    font-family: inherit; /* 继承导航栏字体，避免样式差异 */
    text-decoration: none; /* 无下划线（按钮默认无，但明确写更保险） */
    
    /* 交互效果和链接统一 */
    cursor: pointer; /* 鼠标悬浮变指针，和链接一致 */
    transition: opacity 0.3s; /* 过渡效果和链接一致 */
}

/* hover 效果和链接统一 */
#btnLogin:hover,
#btnLogout:hover {
    opacity: 0.8; /* 和 .nav-menu a:hover 效果完全相同 */
}
/* 主横幅 */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--primary-color);
    color: white;
    min-height: 60vh;
    padding: 4rem 0;
    text-align: center;
}

.hero-slider .hero-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-slider .hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.9s ease, transform 6s ease;
    background-image:
        linear-gradient(135deg, rgba(26, 84, 144, 0.65), rgba(44, 127, 184, 0.35)),
        var(--hero-image);
    background-size: cover;
    background-position: center;
}

.hero-slider .hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.hero-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 2;
    pointer-events: none;
}

.hero-control {
    pointer-events: auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.hero-control:hover {
    transform: scale(1.06);
    background: rgba(0, 0, 0, 0.38);
    border-color: rgba(255, 255, 255, 0.85);
}

.hero-control:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .hero-controls {
        padding: 0 0.75rem;
    }

    .hero-control {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slider .hero-slide {
        transition: none;
        transform: none;
    }
}

/* 章节 */
.section {
    padding: 4rem 0;
}

.section-alt {
    background-color: var(--bg-alt);
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.datasets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.dataset-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.dataset-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.dataset-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 2px solid var(--bg-alt);
}

.dataset-card h3 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
}

.dataset-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dataset-description {
    color: var(--text-color);
    line-height: 1.7;
    margin: 0;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dataset-meta-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-alt);
    border-radius: 6px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
}

.dataset-features-section {
    margin-top: auto;
}

.features-title {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dataset-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dataset-features li {
    padding: 0.5rem 0;
    color: var(--text-color);
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.dataset-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
    font-size: 1rem;
}

.dataset-features li.more-features {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.85rem;
}

.dataset-features li.more-features:before {
    content: "⋯";
    color: var(--text-light);
}

.dataset-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--bg-alt);
    margin-top: auto;
}

.view-detail-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-weight: 500;
}

.view-detail-btn:hover {
    background-color: var(--secondary-color);
}

/* 数据集详情页 */
.detail-section {
    padding: 2rem 0;
}

.detail-container {
    max-width: 900px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--secondary-color);
}

.detail-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.detail-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.detail-header h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.detail-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    color: var(--text-light);
}

.detail-description {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.detail-section-item {
    margin-bottom: 2rem;
}

.detail-section-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.detail-section-item ul {
    list-style: none;
    padding-left: 0;
}

.detail-section-item li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.detail-section-item li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* 申请表单 */
.application-form-container {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.form-title {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.application-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: var(--secondary-color);
}

.submit-btn:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
}

.error-message {
    background-color: #fee;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--error-color);
}

.success-message {
    background-color: #efe;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--success-color);
}

/* 平台定位与项目背景 */
.platform-intro-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.platform-intro-content .intro-card.highlight-card {
    grid-column: 1 / -1;
}

.platform-intro-content .intro-card:first-child {
    grid-column: 1;
}

.intro-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.intro-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.intro-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.intro-card p {
    color: var(--text-color);
    line-height: 1.8;
    margin: 0;
}

.intro-card.highlight-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.intro-card.highlight-card h3 {
    color: white;
}

.intro-card.highlight-card p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
}

.sample-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 6px;
    flex: 1;
    min-width: 100px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

/* 数据总览可视化 */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.overview-grid .overview-card.stats-card {
    grid-column: 1 / -1;
}

.overview-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.overview-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}


.overview-card canvas {
    max-height: 300px;
    width: 100% !important;
    height: auto !important;
}

.overview-card {
    display: flex;
    flex-direction: column;
}

.overview-card > canvas {
    flex: 1;
    min-height: 250px;
}

.stats-card {
    display: flex;
    flex-direction: column;
}

.data-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.data-stat-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.data-stat-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.data-stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow);
}

.data-stat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.data-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.data-stat-label {
    font-size: 1rem;
    color: var(--text-light);
}

/* 关于部分 */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.intro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* 联系方式 */
.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.contact-details {
    margin-top: 2rem;
}

.contact-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.contact-item strong {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.contact-item a {
    color: var(--accent-color);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* 页脚 */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* 弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    margin: 0.5rem 0;
    color: var(--text-color);
    line-height: 1.6;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

.modal-btn-cancel {
    background-color: #f0f0f0;
    color: var(--text-color);
}

.modal-btn-cancel:hover {
    background-color: #e0e0e0;
}

.modal-btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.modal-btn-primary:hover {
    background-color: var(--secondary-color);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .platform-intro-content {
        grid-template-columns: 1fr;
    }
    
    .platform-intro-content .intro-card.highlight-card {
        grid-column: 1;
    }
    
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .overview-grid .overview-card.stats-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-grid .overview-card.stats-card {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .nav-logo h1 {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .nav-container {
        flex-wrap: wrap;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .platform-intro-content {
        grid-template-columns: 1fr;
    }
    
    .sample-stats {
        flex-direction: column;
    }
    
    .stat-item {
        width: 100%;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-card canvas {
        max-height: 250px;
    }
    
    .data-stat-item {
        flex-direction: column;
        text-align: center;
    }
    
    .data-stat-icon {
        margin: 0 auto;
    }
    
    .datasets-grid {
        grid-template-columns: 1fr;
    }
.dataset-meta-section {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .meta-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
    }
    
    .meta-label {
        font-size: 0.8rem;
    }
    
    .meta-value {
        font-size: 0.95rem;
    }
    
    .detail-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}
