/**
 * 统一网站样式文件
 * 包含导航栏、页脚、夜间模式和响应式设计
 * 主色调：#667eea 0%, #764ba2 100%
 */

/* 全局变量定义 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-primary: #333333;
    --text-secondary: #666666;
    --bg-light: #ffffff;
    --bg-gray: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 16px rgba(0,0,0,0.2);
}

/* 夜间模式变量 */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --card-border: #404040;
    --shadow-light: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-medium: 0 4px 8px rgba(0,0,0,0.4);
    --shadow-heavy: 0 8px 16px rgba(0,0,0,0.5);
}

/* 基础样式重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* 导航栏样式 */
.navbar {
    background: var(--primary-gradient) !important;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.05);
}

/* Logo样式 */
.navbar-logo {
    max-height: 40px;
    max-width: 120px;
    height: auto;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 2px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* 手机端和平板端导航栏样式 */
.mobile-menu-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle:active,
.mobile-menu-toggle:focus {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    box-shadow: none;
}

/* 汉堡包图标样式 */
.mobile-menu-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-menu-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #667eea;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* 折叠状态动画 */
.mobile-menu-toggle.collapsed .mobile-menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.collapsed .mobile-menu-icon span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle.collapsed .mobile-menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* 搜索按钮样式 */
.desktop-search-btn,
.mobile-search-btn {
    background: transparent;
    border: none;
    color: #667eea;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.desktop-search-btn:hover,
.mobile-search-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    text-decoration: none;
    transform: scale(1.05);
}

/* 主题切换按钮 */
.theme-toggle {
    background: transparent !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.theme-toggle:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* 折叠菜单样式 */
.mobile-nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    box-shadow: var(--shadow-heavy);
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

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

.mobile-nav-content {
    padding: 20px;
    color: var(--text-primary);
}

.mobile-nav-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mobile-nav-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.mobile-nav-link {
    display: block;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background-color: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateX(5px);
}

.mobile-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mobile-action-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 10px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.mobile-action-btn:hover,
.mobile-action-btn.active {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-2px);
}

.mobile-action-btn i {
    font-size: 16px;
}

.mobile-theme-btn {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mobile-theme-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 页脚样式 - 与首页完全一致 */
.footer {
    background: var(--primary-gradient);
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
}

.footer h5 {
    font-weight: 700;
    margin-bottom: 20px;
    color: white;
    font-size: 1.2rem;
}

.footer h5 i {
    color: rgba(255, 255, 255, 0.8);
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* 移动端折叠菜单样式 - 与首页完全一致 */
.mobile-menu-icon {
    display: block;
    width: 22px;
    height: 18px;
    position: relative;
    z-index: 2;
}

.mobile-menu-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: #667eea;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(102, 126, 234, 0.2);
}

.mobile-menu-icon span:nth-child(1) {
    top: 0px;
    transform-origin: left center;
}

.mobile-menu-icon span:nth-child(2) {
    top: 7px;
    transform-origin: left center;
}

.mobile-menu-icon span:nth-child(3) {
    top: 14px;
    transform-origin: left center;
}

/* 展开状态的X图标 */
.mobile-menu-toggle.active .mobile-menu-icon span:nth-child(1) {
    transform: rotate(45deg);
    top: 0px;
    left: 3px;
}

.mobile-menu-toggle.active .mobile-menu-icon span:nth-child(2) {
    width: 0%;
    opacity: 0;
}

.mobile-menu-toggle.active .mobile-menu-icon span:nth-child(3) {
    transform: rotate(-45deg);
    top: 16px;
    left: 3px;
}

.mobile-theme-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.mobile-theme-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 移动端导航内容样式 */
.mobile-nav-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.mobile-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover {
    color: white;
    text-decoration: none;
    transform: translateX(5px);
}

.footer-links a::before {
    content: '→';
    margin-right: 8px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.footer-links a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.contact-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.contact-info a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: white;
    text-decoration: none;
}

.copyright {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.copyright p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    font-size: 0.9rem;
}

/* 夜间模式适配 */
[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
}

[data-theme="dark"] .navbar-logo {
    filter: brightness(0.9);
}

[data-theme="dark"] .mobile-nav-menu {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .mobile-nav-content {
    color: var(--text-primary);
}

[data-theme="dark"] .mobile-nav-title {
    color: var(--text-primary);
}

[data-theme="dark"] .mobile-nav-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .mobile-nav-link:hover,
[data-theme="dark"] .mobile-nav-link.active {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

[data-theme="dark"] .mobile-action-btn {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .mobile-action-btn:hover,
[data-theme="dark"] .mobile-action-btn.active {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

[data-theme="dark"] .mobile-theme-btn {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .mobile-theme-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

[data-theme="dark"] .mobile-nav-section {
    border-bottom-color: var(--border-color);
}

/* 响应式设计 */
@media (max-width: 767px) {
    .mobile-nav-content {
        padding: 15px;
    }
    
    .mobile-nav-title {
        font-size: 14px;
    }
    
    .mobile-nav-link {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .mobile-action-btn {
        padding: 10px 8px;
        font-size: 12px;
        min-width: 100px;
    }
    
    .mobile-action-btn i {
        font-size: 14px;
    }
    
    .modern-footer {
        padding: 40px 0 15px;
        margin-top: 40px;
    }
    
    .modern-footer h5 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
}

/* 平板端优化 */
@media (min-width: 768px) and (max-width: 991px) {
    .mobile-nav-content {
        padding: 25px;
    }
    
    .mobile-nav-title {
        font-size: 18px;
    }
    
    .mobile-nav-link {
        padding: 14px 18px;
        font-size: 15px;
    }
    
    .mobile-action-btn {
        padding: 14px 12px;
        font-size: 13px;
    }
    
    .mobile-action-btn i {
        font-size: 18px;
    }
}

/* 通用卡片样式 */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    background: var(--bg-light);
}

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

[data-theme="dark"] .card {
    background: var(--card-bg);
    border-color: var(--card-border);
    color: var(--text-primary);
}

/* 按钮样式 */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

/* 表单样式 */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    background: var(--bg-light);
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

[data-theme="dark"] .form-control {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}
