/* 顶部导航栏样式 */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
}

.logo-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-btn, .user-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover, .user-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* 语言切换器样式 */
.language-switcher {
    position: relative;
    display: inline-block;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
    white-space: nowrap;
    line-height: 1.2;
    height: 36px;
    box-sizing: border-box;
}

.language-toggle:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

/* Banner控制按钮样式 */
.banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: white;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.2;
    height: 36px;
    box-sizing: border-box;
    padding: 15px;
}

.banner-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.banner-btn i {
    font-size: 14px;
}

.language-toggle i.fa-globe {
    font-size: 14px;
}

.language-toggle i.fa-chevron-down {
    font-size: 10px;
    transition: transform 0.3s;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 200px;
    max-height: 600px;
    overflow-y: auto;
    z-index: 1100;
    padding: 8px 0;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s;
}

.language-dropdown.is-open {
    opacity: 1;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    cursor: pointer;
}

.language-option:hover {
    background: #f5f7fa;
}

.language-option:active {
    background: #e8ecf1;
}

.lang-flag-emoji {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.lang-flag-img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.language-option span {
    white-space: nowrap;
}

/* 语言切换器滚动条样式 */
.language-dropdown::-webkit-scrollbar {
    width: 4px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.language-dropdown::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.language-dropdown::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar-toggle {
        display: flex;
        position: relative;
        top: auto;
        left: auto;
        margin-right: 10px;
    }
    .header-container {
        justify-content: flex-start;
        padding: 0 15px;
    }
    .mobile-hidden {
        display: none;
    }
    .banner-control {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
    }
    .language-toggle {
        padding: 6px 12px;
        font-size: 12px;
        height: 32px;
    }
    .banner-btn {
        padding: 6px 12px;
        font-size: 12px;
        height: 32px;
    }
    .language-dropdown {
        min-width: 180px;
        right: -40px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
    }
    .banner-control {
        top:20px !important;
        gap: 8px;
    }
    .banner-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    .banner-btn span {
        display: none;
    }
    .language-toggle {
        padding: 6px 10px;
        font-size: 11px;
    }
    .language-toggle .current-lang-label {
        display: none;
    }
    .language-dropdown {
        min-width: 160px;
        right: -50px;
    }
}

/* 语言切换确认模态框样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 16px 24px 24px;
}

.modal-message {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 0 24px 20px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-btn-cancel {
    background: #f0f2f5;
    color: #666;
}

.modal-btn-cancel:hover {
    background: #e4e6eb;
}

.modal-btn-confirm {
    background: var(--primary-color, #4a6cf7);
    color: #fff;
}

.modal-btn-confirm:hover {
    background: var(--primary-dark, #3b5de7);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
}

/* 语言选项激活状态 */
.language-option.active {
    background: #f0f4ff;
    color: var(--primary-color, #4a6cf7);
    font-weight: 600;
}

.language-option.active .lang-flag-img {
    border: 2px solid var(--primary-color, #4a6cf7);
}

/* 响应式模态框 */
@media (max-width: 480px) {
    .modal-container {
        width: 85%;
        max-width: 320px;
    }
    .modal-header {
        padding: 16px 20px 0;
    }
    .modal-body {
        padding: 12px 20px 20px;
    }
    .modal-footer {
        padding: 0 20px 16px;
    }
    .modal-btn {
        padding: 8px 20px;
        font-size: 13px;
    }
}