/* ==========================================================================
   2025 年 TAM 你能接受强人工智能的定制化指导式学习调研项目样式表
   版本: 1.1
   描述: 包含所有全局、组件、布局和响应式样式。优化了 Footer 沉底、全直角设计、图表响应式滚动。
   ========================================================================== */

/* ---------------------------------- */
/* 1. 全局变量与基础样式 (Variables & Base) */
/* ---------------------------------- */
:root {
    --primary-color: #3498db;      /* 主题蓝 */
    --secondary-color: #2c3e50;    /* 深蓝灰 (用于标题) */
    --light-bg: #f8f9fa;           /* 浅灰色背景 */
    --dark-text: #34495e;           /* 主要文本颜色 */
    --light-text: #7f8c8d;          /* 辅助文本颜色 */
    --white-color: #ffffff;
    --border-color: #e9ecef;       /* 边框颜色 */
    --success-bg: #d4edda;
    --success-text: #155724;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --info-bg: #cce5ff;
    --info-text: #004085;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 核心修改：使用 Flexbox 实现 Sticky Footer */
body {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: var(--dark-text);
    background-color: var(--white-color);
    
    /* 保证页面至少占满屏幕高度 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 核心修改：内容区域自动伸展，将 Footer 挤到底部 */
main {
    flex: 1;
    width: 100%; /* 确保内容宽度正常 */
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; width: 100%; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--secondary-color); }
hr { border: none; border-top: 1px solid var(--border-color); margin: 20px 0; }
img { max-width: 100%; height: auto; }

/* ---------------------------------- */
/* 2. 布局与通用组件 (Layout & Common) */
/* ---------------------------------- */
header[role="banner"] {
    background-color: rgba(255, 255, 255, 0.95); /* 稍微增加不透明度 */
    backdrop-filter: blur(5px);
    padding: 1rem 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05); /* 改用纯线代替模糊阴影，配合直角风格 */
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

footer[role="contentinfo"] {
    background-color: var(--secondary-color);
    color: var(--white-color);
    text-align: center;
    padding: 2rem 0;
    margin-top: auto; /* 防止在某些非Flex环境下的失效，双重保险 */
    width: 100%;
}

.section { padding: 4rem 0; }
.section.alternate { background-color: var(--light-bg); }

/* 修改：移除圆角，使用直角 */
.button {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 12px 30px; /* 稍微增加内边距 */
    border: none;
    border-radius: 0; /* 直角 */
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.button:hover {
    background-color: #2980b9;
    color: var(--white-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 0 rgba(41, 128, 185, 0.5); /* 改为硬阴影，增强立体感 */
}

/* ---------------------------------- */
/* 3. 导航栏 (Navbar) */
/* ---------------------------------- */
.navbar { display: flex; justify-content: space-between; align-items: center; min-height: 50px; }
.navbar-brand a { text-decoration: none; color: var(--secondary-color); }
.navbar-brand span { display: block; line-height: 1.3; }
.navbar-brand .title-line-1 { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.navbar-brand .title-line-2 { font-size: 0.8rem; font-weight: 400; color: var(--light-text); }

.navbar-menu { display: flex; align-items: center; gap: 1.5rem; }
.navbar-links { display: flex; list-style: none; gap: 1rem; }
/* 修改：移除圆角 */
.navbar-links a { 
    color: var(--dark-text); 
    font-weight: 500; 
    font-size: 0.95rem; 
    padding: 8px 12px; 
    border-radius: 0; /* 直角 */
    transition: all 0.2s ease-in-out; 
}
.navbar-links a:hover { color: var(--primary-color); background-color: var(--light-bg); }
.menu-toggle { display: none; color: var(--dark-text); background: none; border: none; font-size: 2rem; cursor: pointer; z-index: 1001; border-radius: 0; }

/* ---------------------------------- */
/* 4. 表单 (Forms) */
/* ---------------------------------- */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
/* 修改：移除圆角，增强边框 */
.form-group input[type="text"], 
.form-group input[type="email"], 
.form-group textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid #ccc; 
    border-radius: 0; /* 直角 */
    font-size: 1rem; 
    background-color: #fff;
    transition: border-color 0.3s, box-shadow 0.3s; 
}
.form-group input:focus, .form-group textarea:focus { 
    outline: none; 
    border-color: var(--primary-color); 
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2); /* 调整聚焦样式 */
}

/* ---------------------------------- */
/* 5. Cookie 横幅 (Cookie Banner) */
/* ---------------------------------- */
.cookie-consent-banner { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background-color: var(--secondary-color); /* 纯色背景 */
    color: var(--white-color); 
    padding: 20px 30px; 
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    z-index: 2000; 
    transform: translateY(100%); 
    transition: transform 0.5s ease-in-out; 
}
.cookie-consent-banner.show { transform: translateY(0); }
.cookie-consent-banner p { margin: 0 20px 0 0; font-size: 14px; }
.cookie-consent-banner .button { 
    white-space: nowrap; 
    background-color: var(--white-color);
    color: var(--secondary-color);
    border: 1px solid var(--white-color);
}
.cookie-consent-banner .button:hover {
    background-color: var(--light-bg);
    color: var(--dark-text);
    box-shadow: none;
}

/* ---------------------------------- */
/* 6. 页面特定样式 (Page-Specific Styles) */
/* ---------------------------------- */
/* 修改：移除圆角 */
.hero-header, .hero { 
    text-align: center; 
    padding: 5rem 2rem; 
    background-color: var(--light-bg); 
    border-radius: 0; /* 直角 */
    margin-bottom: 2rem; 
}
.hero-header h1, .hero h1 { font-size: 2.5rem; color: var(--secondary-color); margin-bottom: 0.5rem; }
.hero-header p, .hero p { font-size: 1.2rem; color: var(--light-text); max-width: 700px; margin: 0 auto 1.5rem auto; }

/* 修改：移除圆角，卡片样式 */
.info-card { 
    background: var(--white-color); 
    padding: 2rem; 
    border-radius: 0; /* 直角 */
    border: 1px solid var(--border-color); /* 增加边框 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    border-top: 4px solid var(--primary-color); /* 顶部粗线条 */
    height: 100%; /* 确保卡片等高 */
    
    /* 核心修改：支持内部横向滚动 */
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
}
.info-card h3 { 
    margin-top: 0; 
    color: var(--secondary-color); 
    font-size: 1.5rem; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 15px; 
    margin-bottom: 1.5rem; 
}
.info-card ul { padding-left: 20px; }
.info-card li { margin-bottom: 10px; }

.content-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    gap: 2rem; 
    margin-bottom: 2rem;
}
.full-width-card { grid-column: 1 / -1; }

/* 图表容器 */
.chart-container { 
    position: relative; 
    height: 350px; 
    width: 100%;
    min-width: 300px; /* 保证最小显示宽度 */
}

/* 核心修改：表格样式优化，支持滚动 */
.heatmap-table-wrapper {
    width: 100%;
    overflow-x: auto; /* 超出宽度允许滚动 */
}
.heatmap-table { 
    width: 100%; 
    min-width: 600px; /* 强制表格最小宽度，防止内容挤压 */
    border-collapse: collapse; 
    margin-top: 1rem; 
}
.heatmap-table th, .heatmap-table td { 
    border: 1px solid var(--border-color); 
    padding: 12px; 
    text-align: center; 
    white-space: nowrap; /* 防止文字换行 */
}
.heatmap-table th { background-color: var(--light-bg); font-weight: 600; color: var(--secondary-color); }
.heatmap-table td { font-size: 1rem; font-weight: 500; color: var(--white-color); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* ---------------------------------- */
/* 7. 语言下拉菜单 (Language Dropdown) */
/* ---------------------------------- */
.language-dropdown { position: relative; display: inline-block; }
/* 修改：移除圆角 */
.language-button { 
    background-color: transparent; 
    border: 1px solid var(--border-color); 
    color: var(--dark-text); 
    padding: 8px 16px; 
    font-size: 0.9rem; 
    border-radius: 0; /* 直角 */
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: all 0.2s ease; 
}
.language-button:hover { background-color: var(--secondary-color); color: var(--white-color); border-color: var(--secondary-color); }
.language-button .arrow { transition: transform 0.3s ease; }

/* 修改：移除圆角，硬朗阴影 */
.language-options { 
    display: none; 
    opacity: 0; 
    visibility: hidden; 
    transform: translateY(10px); 
    transition: all 0.2s ease; 
    position: absolute; 
    background-color: var(--white-color); 
    min-width: 160px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); 
    border: 1px solid var(--border-color); 
    z-index: 1002; 
    list-style: none; 
    padding: 0; 
    border-radius: 0; /* 直角 */
    right: 0; 
    margin-top: 0; 
}
.language-dropdown.active .language-options { display: block; opacity: 1; visibility: visible; transform: translateY(0); }
.language-dropdown.active .language-button .arrow { transform: rotate(180deg); }
.language-options li a { 
    color: var(--dark-text); 
    padding: 12px 20px; 
    text-decoration: none; 
    display: block; 
    font-size: 0.9rem; 
    font-weight: normal; 
    white-space: nowrap; 
    border-bottom: 1px solid #f0f0f0;
}
.language-options li:last-child a { border-bottom: none; }
.language-options li a:hover { background-color: var(--light-bg); color: var(--primary-color); }
.language-options li a.active { background-color: var(--primary-color); color: var(--white-color); font-weight: bold; }

/* ---------------------------------- */
/* 8. 响应式设计 (Responsive Design) */
/* ---------------------------------- */
@media (max-width: 992px) {
    .menu-toggle { display: block; }
    .navbar-menu { 
        display: none; 
        position: fixed; 
        width: 100%; 
        height: 100vh; /* 全屏菜单 */
        top: 0; 
        left: 0; 
        background-color: var(--white-color); 
        flex-direction: column; 
        justify-content: center; 
        gap: 2rem; 
        transition: transform 0.3s ease-in-out; 
        transform: translateX(100%); 
        z-index: 999;
    }
    .navbar-menu.active { display: flex; transform: translateX(0); }
    .navbar-links { flex-direction: column; gap: 1.5rem; align-items: center; width: 100%; }
    .navbar-links a { 
        font-size: 1.5rem; 
        display: block; 
        width: 100%; 
        text-align: center; 
        padding: 15px; 
        border-bottom: 1px solid var(--border-color);
    }
    
    /* 适配：移动端卡片 grid 变为单列 */
    .content-grid { grid-template-columns: 1fr; }
    
    .desktop-switcher { display: block; margin-top: 2rem; }
}

@media (max-width: 576px) {
    .hero-header h1 { font-size: 2rem; }
    .container { padding: 0 15px; }
    .section { padding: 3rem 0; }
}