/* index.css */
/* 基础变量定义 */
:root {
    /* 颜色系统 */
    --color-primary: #3498db;/* 蓝色 */
    --color-primary-dark: #2980b9;
    --color-secondary: #95a5a6;
    --color-success: #2ecc71;
    --color-danger: #e74c3c; /*红色*/
    --color-warning: #f39c12;/* 橙色 */
    --color-info: #3498db;
    --color-light: #f5f5f5;
    --color-lighter: #f9f9f9;
    --color-dark: #2c3e50;
    --color-darker: #1a242f;
    --text-primary: #333; /*黑色*/
    --text-secondary: #777;
    --text-light: #fff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --color-border: #e0e0e0;
    /* 继承 admin_styles.css 变量，新增首页专用变量 */
    --hero-bg-color: #f8f9fa;
    --feature-item-bg: #ffffff;

    /* 尺寸系统 */
    --size-spacing-xs: 0.3125rem;  /* 5px   */
    --size-spacing-sm: 0.625rem;   /* 10px */
    --size-spacing-md: 0.9375rem;  /* 15px */
    --size-spacing-lg: 1.25rem;    /* 20px */
    --size-spacing-xl: 1.5625rem;  /* 25px */

    /* 基础样式 */
    --base-border-radius: 0.25rem;    /* 4px */
    --base-border-radius-lg: 0.5rem;  /* 8px */
    /* 阴影系统 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* 动画系统 */
    --transition-fast: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* 全局重置与基础样式 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 0.875rem; /* 14px */
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--color-light);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: var(--size-spacing-md);
}

p {
    margin-bottom: var(--size-spacing-md);
}

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

a:hover {
    text-decoration: underline;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* 顶部导航栏 */
.navbar {
    padding: var(--size-spacing-xl) var(--size-spacing-xl); /* 上下 padding 从 sm 调整为 xl（20px → 25px） */
    height: 70px; /* 固定高度，确保内容居中 */
    background: var(--hero-bg-color); /* 修改导航栏背景颜色为不透明 */
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%; /* 撑满导航栏高度 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    max-width: 150px;
    height: auto;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0 auto;
    padding: 0 20px;
    gap: var(--size-spacing-xl); /* 增大菜单项间距 */
    font-size: 1.125rem; /* 字体大小从 14px 调整为 18px */
}

.nav-item {
    margin: 0 15px;
    position: relative;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* 用户操作按钮 */
.user-actions {
    display: flex;
    align-items: center;
    gap: var(--size-spacing-sm); /* 按钮间距 */
    margin-left: auto; /* 使按钮容器靠右对齐 */
}

.header-btn,
.btn {
    padding: var(--size-spacing-sm) var(--size-spacing-md);
    border-radius: var(--base-border-radius);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    border: none;
    gap:var(--size-spacing-xs)
}

.header-btn:hover {
    transform: translateY(-1px);
}

.header-btn.logout-btn { color: var(--color-danger); }
.header-btn.logout-btn:hover { background: rgba(231, 76, 60, 0.1); }
/* 首页大图轮播 */
.hero-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
    height: 500px; /* 可根据需求调整 */
}

.slider-item {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slider-item.active {
    opacity: 1;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px; /* 增大指示点之间的间距 */
}

.dot {
    width: 15px; /* 增大指示点的宽度 */
    height: 15px; /* 增大指示点的高度 */
    background: var(--color-warning); /* 未播放的图片指示点颜色 */
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.dot.active {
    background: var(--color-primary); /* 当前图片指示点的颜色 */
}

/* 主要内容区 */
main {
    flex: 1;
    padding: 40px 20px;
}

.hero {
    background: var(--hero-bg-color);
    padding: var(--size-spacing-xl) 0;
    text-align: center;
}

.hero-title {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--color-dark);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 30px;
}

/* 特性展示区 */
.features {
    padding: 60px 0;
    background-color: var(--color-light);
}

.feature-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--size-spacing-lg);
    padding: var(--size-spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.feature-item {
    background: var(--feature-item-bg);
    padding: var(--size-spacing-lg);
    border-radius: var(--base-border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    min-width: 250px;
    max-width: 300px;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-item i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: var(--size-spacing-md);
}

.feature-item h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--color-dark);
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* 页脚 */
.footer {
    background-color: var(--color-dark);
    color: var(--text-light);
    padding: 40px 0 20px;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 30px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--color-primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--text-light);
}

.footer-section ul li i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 14px;
}

.footer-bottom p {
    margin-bottom: 10px;
}

.footer-bottom a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--text-light);
}

.menu-toggle {
    display: none; /* 桌面端隐藏，移动端通过媒体查询显示 */
    cursor: pointer;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .navbar {
        height: 80px; /* 移动端适当减小高度 */
        padding: var(--size-spacing-md) var(--size-spacing-sm);
    }

    .logo-img {
        max-height: 50px;
    }

    .menu-toggle {
        display: block;
        margin-left: var(--size-spacing-md);
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--text-light);
        flex-direction: column;
        align-items: center;
        gap: var(--size-spacing-md);
        padding: var(--size-spacing-lg);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); /* 隐藏菜单 */
        transition: clip-path 0.3s ease;
    }

    .nav-menu.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); /* 显示菜单 */
    }

    .hero-slider {
        height: 300px;
    }

    .feature-container {
        flex-direction: column;
        align-items: center;
    }

    .feature-item {
        max-width: 100%;
    }

    .footer-container {
        flex-direction: column;
    }

    .footer-section {
        margin-bottom: 30px;
    }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .navbar-container {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-menu {
        margin: 15px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-item {
        margin: 5px 10px;
    }

    .user-actions {
        margin-top: 15px;
        justify-content: center;
         margin-left: auto; /* 添加这一行，使容器靠右对齐 */
    }

    .hero-slider {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 28px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .btn {
        padding: var(--size-spacing-xs) var(--size-spacing-sm);
        font-size: 0.8125rem;
    }

    .hero-slider {
        height: 200px;
    }
}