/* ==================== 全局样式 ==================== */
/* 
 * 全局变量定义
 * 包含主题色、文字颜色和暗黑模式变量
 */
:root {
    /* 主色调 */
    --primary-color: #ff6700;  /* 品牌主色调，用于按钮、链接等高亮元素 */
    --text-color: #000;        /* 主要文字颜色 */
    --secondary-color: #333333;  /* 次要文字颜色 */
    --light-gray: #f5f5f5;     /* 浅灰色背景 */
    --white: #fff;             /* 纯白色 */
    --E6BC: #E6E6E6;           /* 边框和分割线颜色 */
    
    /* 暗黑模式变量 */
    --dark-bg: #121212;        /* 暗黑模式背景色 */
    --dark-text: #e0e0e0;      /* 暗黑模式文字颜色 */
    --dark-card: #1e1e1e;      /* 暗黑模式卡片背景色 */
    --dark-border: #333;       /* 暗黑模式边框颜色 */
}

/* 
 * 基础body样式
 * 使用MiSans字体家族，设置全局文字颜色和过渡效果
 * 包含暗黑模式切换时的平滑过渡效果
 */
body {
    font-family: MiSans VF,MiSans,system-ui,'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--secondary-color);
    font-weight: 330;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 暗黑模式下的body样式 */
body.dark {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}
/* ==================== 头部样式 ==================== */
/* 
 * 暗黑模式下的导航链接文字颜色
 * 确保在暗黑模式下导航链接文字可见
 */
.dark .nav-links a {
    color: var(--dark-text);
}

/* 
 * 网站头部容器
 * 使用fixed定位固定在页面顶部
 * 包含透明背景和滚动时的过渡效果
 */
header {
    background-color: transparent;
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

/* 
 * 页面滚动时的头部样式
 * 添加半透明黑色背景和模糊效果
 */
header.scrolled {
    background-color: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(10px) !important;
}

/* 
 * 暗黑模式下滚动时的头部样式
 * 移除模糊效果保持视觉一致性
 */
.dark header.scrolled {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(0);
}

/* 
 * 导航栏容器
 * 使用flex布局实现水平排列
 * 设置最大宽度和居中显示
 */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 
 * Logo区域
 * 包含logo图片和文字
 */
.logo-container {
    display: flex;
    align-items: center;
}

/* Logo图片样式 */
.logo-img {
    height: 40px;
    margin-right: 10px;
}

/* Logo文字样式 */
.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

/* 
 * 导航链接容器
 * 使用flex布局实现水平排列
 * 自动外边距实现右对齐
 */
.nav-links {
    display: flex;
    list-style: none;
    margin-left: auto;
    justify-content: flex-end;
}

/* 导航链接项样式 */
.nav-links li a {
    color: white;
}

/* 导航链接项间距 */
.nav-links li {
    margin-left: 40px;
}

/* 
 * 导航链接基础样式
 * 包含文字颜色过渡效果
 */
.nav-links a {
    text-decoration: none;
    color: white;
    font-size: 16px;
    transition: color 0.3s ease;
}

/* 导航链接悬停效果 */
.nav-links a:hover {
    color: var(--primary-color);
}

/* 
 * 暗黑模式切换按钮
 * 包含太阳和月亮图标
 * 使用透明度切换实现图标变化
 */
#darkModeToggle {
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: 20px;
    width: 20px;
    height: 20px;
    padding: 0;
    position: relative;
    color: #e0e0e0; /* 确保按钮文本颜色为灰白色 */
}

/* 暗黑模式切换按钮中的图标样式 */
#darkModeToggle img {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
}

/* 暗黑模式下隐藏太阳图标 */
.dark #darkModeToggle .sun-icon {
    opacity: 0;
}

/* 
 * 暗黑模式下显示月亮图标
 * 添加灰白色滤镜效果保持视觉一致性
 */
.dark #darkModeToggle .moon-icon {
    opacity: 1;
    filter: brightness(0) invert(0.8);
}

/* 默认显示太阳图标 
* 添加灰白色滤镜效果保持视觉一致性
 */
#darkModeToggle .sun-icon {
    opacity: 1;
    filter: brightness(0) invert(0.8);
}

/* 默认隐藏月亮图标 */
#darkModeToggle .moon-icon {
    opacity: 0;
}

/* ==================== 底部样式 ==================== */
footer {
    background-color: #12151a;
    padding: 40px 120px;
    z-index: 100!important;
    position: relative;
}

.footer-container {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-links a {
    /* color: var(--white); */
    color: hsla(0,0%,100%,.8);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s ease;
}

.footer-copyright {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: hsla(0,0%,100%,.5);
}

.footer-copyright a {
    font-size: 12px;
    color: hsla(0,0%,100%,.5);
    text-decoration: none;
}

.footer-copyright img {
    height: 16px;
    vertical-align: middle;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 40px;
    height: 100%;
}

.footer-right .social-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: hsla(0,0%,100%,.7);
    text-decoration: none;
    font-size: 12px;
}

.footer-right .social-link img {
    height: 20px;
}
