/* ============================================================ */
/* /header.css - 导航样式 */
/* ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "微软雅黑", "PingFang SC", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 44px;
    padding-top: 44px;
}

.chat-site-header {
    height: 44px;
    width: 100%;
    color: #fff;
    background: linear-gradient(to bottom right, #008000, #FB9749);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow: visible;
}
.chat-site-header table {
    width: 100%;
    height: 44px;
    border: 0;
    table-layout: fixed;
}
.chat-site-header table td {
    padding: 0 8px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-site-header table td:nth-child(2) {
    width: auto !important;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-align: center;
}

.chat-site-header .top-link {
    color: white;
    text-decoration: none;
    font-size: 13px;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
}
.chat-site-header .top-link:hover {
    background: rgba(255,255,255,0.35);
}

.chat-site-header .system-name {
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}
.chat-site-header .system-name a {
    color: white;
    text-decoration: none;
}

.chat-site-header .user-account-display {
    color: white;
    font-size: 13px;
    background: rgba(0,0,0,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    font-family: monospace;
    letter-spacing: 1px;
    max-width: 100%;
    overflow: visible;
    white-space: nowrap;
}

.header-right-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

/* ===== 底部菜单 ===== */
.menu {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(to bottom right, #FB9749, #008000);
    height: 44px;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}
.menu .subMenu {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu .subMenu .menu_name {
    width: 100%;
    height: 44px;
    line-height: 44px;
    text-align: center;
}
.menu .subMenu .menu_name a {
    color: white;
    text-decoration: none;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    display: inline-block;
}
.menu .subMenu .menu_name a:hover {
    background: rgba(255,255,255,0.15);
}
.menu .subMenu .menu_name a.active {
    background: rgba(255,255,255,0.25);
    font-weight: bold;
}

/* ===== Toast ===== */
#toastMsg {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a2332;
    color: white;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    font-family: -apple-system, "Microsoft YaHei", sans-serif;
    max-width: 90%;
    text-align: center;
}
#toastMsg.show { opacity: 1; }
#toastMsg.success { background: #16a34a; }
#toastMsg.error { background: #dc2626; }

/* ===== 登录弹窗 ===== */
#loginModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
#loginModalOverlay.show { display: flex; }
#loginModalOverlay iframe {
    width: 440px;
    max-width: 92vw;
    height: auto;
    min-height: 420px;
    max-height: 92vh;
    border: none;
    border-radius: 28px;
    background: transparent;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1000001;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 480px) {
    #loginModalOverlay iframe {
        min-height: 380px;
        max-height: 95vh;
    }
}

/* ===== 导航链接白色字体 ===== */
.header-right-links .nav-link {
    color: #ffffff !important;
    text-decoration: none;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    background: rgba(255,255,255,0.1);
}
.header-right-links .nav-link:hover {
    background: rgba(255,255,255,0.25);
}

/* ===== 翻译框样式 ===== */
#translate-container {
    position: fixed;
    top: 48px;
    right: 10px;
    z-index: 999;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    padding: 4px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.tr-translate-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tr-translate-wrapper select {
    background: transparent !important;
    border: none !important;
    color: #333333 !important;
    padding: 2px 6px 2px 8px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    height: 26px;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    max-width: 100px;
    border-radius: 4px;
}
.tr-translate-wrapper select option {
    background: #ffffff !important;
    color: #333333 !important;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    body { padding-top: 40px !important; padding-bottom: 44px !important; }
    .chat-site-header { height: 40px; }
    .chat-site-header table { height: 40px; }
    .chat-site-header table td { padding: 0 4px; }
    .chat-site-header .system-name { font-size: 13px; }
    .chat-site-header .top-link { font-size: 11px !important; padding: 2px 6px !important; }
    .chat-site-header .user-account-display { font-size: 11px !important; padding: 2px 8px !important; }
    .header-right-links { gap: 3px; }
    
    /* 手机端翻译框位置 */
    #translate-container {
        top: 30px !important;
        right: 1px !important;
        padding: 2px 6px !important;
        background: rgba(255,255,255,0.9) !important;
    }
    .tr-translate-wrapper select {
        font-size: 11px;
        max-width: 80px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    body { padding-top: 36px !important; padding-bottom: 40px !important; }
    .chat-site-header { height: 36px; }
    .chat-site-header table { height: 36px; }
    .chat-site-header table td { padding: 0 2px; }
    .chat-site-header .system-name { font-size: 11px; }
    .chat-site-header .top-link { font-size: 10px !important; padding: 1px 4px !important; }
    .chat-site-header .user-account-display { font-size: 10px !important; padding: 1px 6px !important; }
    .header-right-links { gap: 2px; }
    
    /* 小屏手机翻译框位置 */
    #translate-container {
        top: 38px !important;
        right: 3px !important;
        padding: 2px 4px !important;
    }
    .tr-translate-wrapper select {
        font-size: 10px;
        max-width: 60px;
        height: 22px;
    }
}