/* CSS变量定义 */
:root {
    --primary-color: #c41e3a;
    --secondary-color: #f4a460;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #faf8f3;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --max-width: 1400px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul, ol {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

/* 容器 */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-hover);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 80%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

/* 移动端导航切换按钮 */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 用户信息显示 */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px !important;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white) !important;
    border-radius: 25px;
    font-weight: 500;
}

.user-info:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.user-icon {
    font-size: 1.2rem;
}

.username {
    font-size: 0.95rem;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    min-width: 200px;
    overflow: hidden;
    animation: slideDown 0.3s ease;
    z-index: 1001;
}

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

.user-dropdown-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.user-dropdown-header strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.user-dropdown-header p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

.user-dropdown-body {
    padding: 10px 0;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

/* 章节标题 */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 20px;
}

.section-title::before,
.section-title::after {
    content: '————';
    color: var(--secondary-color);
    margin: 0 15px;
}

.section-title::before {
    content: '————';
}

.section-title::after {
    content: '————';
}

/* 页脚 */
.footer {
    background: var(--white);
    margin-top: 80px;
    padding: 40px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info {
    text-align: center;
    color: var(--text-light);
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: url(.././images/index/social-icon.png) no-repeat;
    background-size: 200px 40px;
    display: block;
    border-radius: 50%;
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-3px);
}

.social-link:nth-child(2) {
    background-position: -54px 0;
}

.social-link:nth-child(3) {
    background-position: -108px 0;
}

.social-link:nth-child(4) {
    background-position: -162px 0;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 20px;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-menu.active {
        max-height: 600px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: 1.2rem;
    }
    
    .nav-logo img {
        width: 40px;
        height: 40px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-title::before,
    .section-title::after {
        content: '——';
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* 卡片悬停效果 */
.card-hover {
    transition: var(--transition);
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

