@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* --- 变量定义 --- */
:root {
    --primary-color: #00aaff; /* 主题亮蓝色 */
    --secondary-color: #00eaff; /* 辅助青色 */
    --dark-bg: #0a1024; /* 深蓝背景 */
    --light-bg: #101a35; /* 稍亮的卡片背景 */
    --text-primary: #e0e0e0; /* 主要文字颜色 */
    --text-secondary: #a0a0a0; /* 次要文字颜色 */
    --glow-color: rgba(0, 170, 255, 0.5); /* 辉光颜色 */
}

/* --- 全局样式 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100%; /* 确保body至少和视口一样高 */
    display: flex; /* 启用flex布局 */
    flex-direction: column; /* 设置主轴为垂直方向 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 头部导航 --- */
header {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 20px 0;
    background: rgba(10, 16, 36, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 170, 255, 0.2);
}
/* 首页的导航栏特殊处理：绝对定位，透明背景 */
body.homepage header.homepage-header {
    position: absolute;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 0 0 10px var(--glow-color);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 16px;
    padding-bottom: 5px;
    position: relative;
    transition: color 0.3s;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s;
}

nav a:hover, nav a.active {
    color: var(--secondary-color);
}

nav a:hover::after, nav a.active::after {
    width: 100%;
}

/* --- 按钮样式 --- */
.btn {
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    display: inline-block;
    font-size: 16px;
    text-align: center;
}

.btn-login {
    padding: 10px 25px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-login:hover {
    background-color: var(--primary-color);
    color: var(--dark-bg);
    box-shadow: 0 0 15px var(--glow-color);
}

/* --- 主视觉区 (仅首页) --- */
body.homepage {
    display: block; /* 覆盖flex布局，恢复默认块级布局 */
    overflow: hidden;
}
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero-content h2 {
    font-size: 52px;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 40px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--dark-bg);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 170, 255, 0.3);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}
.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--dark-bg);
    box-shadow: 0 0 15px var(--secondary-color);
}

/* --- 子页面通用 --- */
.page-content {
    padding-top: 40px;
    flex-grow: 1; /* 让主内容区占据所有可用空间，将页脚推到底部 */
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.section-title p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* --- 核心功能页 --- */
.features-section {
    padding: 40px 0 60px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--light-bg);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(0, 170, 255, 0.2);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px var(--glow-color);
}

.feature-card .icon-container {
    margin-bottom: 20px;
    background: var(--dark-bg);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 170, 255, 0.2);
}

.feature-card svg {
    width: 30px;
    height: 30px;
    color: var(--primary-color);
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
}

/* --- 平台预览页 --- */
.preview-section {
    padding: 40px 0 60px 0;
}
.dashboard-image-container {
    margin-bottom: 40px;
}
.dashboard-image {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(0, 170, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.image-caption {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 15px;
    font-style: italic;
}

/* --- 关于我们页 --- */
.about-section {
    padding: 40px 0 60px 0;
}
.about-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--light-bg);
    padding: 40px;
    border-radius: 10px;
    border: 1px solid rgba(0, 170, 255, 0.2);
}
.about-text h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 15px;
    margin-top: 20px;
}
.about-text h3:first-child {
    margin-top: 0;
}
.about-text p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}
.about-text a {
    color: var(--secondary-color);
    text-decoration: none;
}
.about-text a:hover {
    text-decoration: underline;
}

/* --- 登录/注册页 --- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1; /* 占据可用空间，实现垂直居中 */
    padding: 20px;
    position: relative; /* 添加相对定位 */
    z-index: 2; /* 确保在canvas上层 */
}
.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--light-bg);
    padding: 40px;
    border-radius: 10px;
    border: 1px solid rgba(0, 170, 255, 0.2);
    text-align: center;
}
.login-box .logo {
    margin-bottom: 10px;
    display: inline-block;
}
.login-box h3 {
    margin-bottom: 30px;
    font-weight: 400;
    color: var(--text-secondary);
}
.input-group {
    text-align: left;
    margin-bottom: 20px;
}
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}
.input-group input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(0,170,255,0.2);
    background: var(--dark-bg);
    color: var(--text-primary);
    font-size: 16px;
}
.btn-full-width {
    width: 100%;
    padding: 12px;
}
.login-footer-text {
    margin-top: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}
.login-footer-text a {
    color: var(--primary-color);
    text-decoration: none;
}
.login-footer-text a:hover {
    text-decoration: underline;
}

/* --- 页脚 --- */
footer {
    padding: 40px 0;
    text-align: center;
    background-color: var(--light-bg);
    border-top: 1px solid rgba(0, 170, 255, 0.2);
    color: var(--text-secondary);
    flex-shrink: 0; /* 防止页脚在flex布局中被压缩 */
}
/* 子页面内容区域和页脚之间的间距 */
.page-content + footer {
    margin-top: 0; /* 在flex布局中不再需要这个外边距 */
}

/* --- 弹窗/模态 (Modal) 样式 --- */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--light-bg);
    color: var(--text-primary);
    padding: 30px 40px;
    border-radius: 10px;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 170, 255, 0.2);
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.open .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h3 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 15px;
}