/* SVG图标颜色 */
.unified-nav-menu svg,
.unified-sidebar-menu svg {
    fill: #666;
}

.unified-nav-menu a:hover svg,
.unified-sidebar-menu a:hover svg {
    fill: #1890ff;
}

.unified-mobile-menu-btn svg,
.unified-search-icon-btn svg,
.unified-mobile-sidebar-close svg {
    fill: #666;
}

.unified-search-icon-btn:hover svg {
    fill: #1890ff;
}

/* 统一头部导航样式 */
.unified-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 10px;
    left: 1%;
    right: 1%;
    z-index: 1000;
    height: 70px;
    border-radius: 8px;
}

.unified-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.unified-nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.unified-nav-center {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: flex-end;
    margin-right: 20px;
}

.unified-nav-right {
    display: flex;
    align-items: center;
}

.unified-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    height: 100%;
}

.unified-logo img {
    height: 45px;
    width: auto;
    max-width: 180px;
    border-radius: 8px;
    transition: transform 0.3s;
}

.unified-logo:hover img {
    transform: scale(1.05);
}

.unified-nav-menu {
    display: flex;
    gap: 35px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.unified-nav-menu li {
    list-style: none;
    display: flex;
    align-items: center;
}

.unified-nav-menu a {
    text-decoration: none;
    color: #666;
    font-size: 15px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 70px;
    line-height: 70px;
}

.unified-nav-menu a:hover {
    color: #1890ff;
}

.unified-mobile-menu-btn {
    display: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 8px;
}

.unified-search-icon-btn {
    font-size: 20px;
    color: #666;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px 15px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    height: 70px;
}

.unified-search-icon-btn:hover {
    color: #1890ff;
}

.unified-user-icon-btn {
    font-size: 20px;
    color: #666;
    cursor: pointer;
    text-decoration: none;
    padding: 10px 15px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    height: 70px;
}

.unified-user-icon-btn:hover {
    color: #1890ff;
}

.unified-user-icon-btn svg {
    fill: #666;
}

.unified-user-icon-btn:hover svg {
    fill: #1890ff;
}

/* 移动端侧边栏 */
.unified-mobile-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 272px;
    background: #f8faff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    border-radius: 0 16px 16px 0;
}

.unified-mobile-sidebar.show {
    display: flex;
    transform: translateX(0);
}

.unified-mobile-sidebar-header {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f4ff;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-logo img {
    height: 40px;
    width: auto;
    max-width: 160px;
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-site-name {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.3px;
}

.unified-mobile-sidebar-header span {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.3px;
}

.unified-mobile-sidebar-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.unified-mobile-sidebar-close svg {
    fill: #64748b;
}

.unified-mobile-sidebar-close:hover {
    background: #e2e8f0;
}

/* 菜单区：平分一半多高度 */
.unified-sidebar-menu {
    padding: 4px 12px;
    background: #fff;
    margin: 10px 12px 0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.unified-sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 10px;
    color: #374151;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.unified-sidebar-menu a:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.unified-sidebar-menu svg {
    fill: #6b7280;
    flex-shrink: 0;
}

.unified-sidebar-menu a:hover svg {
    fill: #1d4ed8;
}

.unified-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.unified-sidebar-overlay.show {
    display: flex;
}

/* 搜索弹窗样式 */
.unified-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    align-items: center;
    justify-content: center;
}

.unified-search-modal.show {
    display: flex;
}

/* 页面内容上边距 */
body.has-unified-header {
    padding-top: 70px;
}

@media (max-width: 768px) {
    .unified-header {
        top: 8px;
        left: 2%;
        right: 2%;
        height: 60px;
        border-radius: 8px;
    }

    .unified-nav-container {
        padding: 0 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    .unified-nav-center {
        display: none;
    }

    .unified-nav-menu {
        display: none;
    }

    .unified-mobile-menu-btn {
        display: flex;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .unified-nav-left {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .unified-logo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .unified-logo img {
        height: 42px;
        max-width: 200px;
    }

    .unified-nav-right {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .unified-search-icon-btn {
        display: flex !important;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 20px;
    }

    .unified-user-icon-btn {
        display: flex !important;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 20px;
    }
}

/* 更小屏幕优化 */
@media (max-width: 480px) {
    .unified-logo img {
        height: 38px;
        max-width: 180px;
    }
}

@media (max-width: 360px) {
    .unified-logo img {
        height: 35px;
        max-width: 160px;
    }
}

/*
 iOS Safari 输入框修复 - 防止点击输入框时页面拉伸 */
/* iOS Safari 在输入框字体小于 16px 时会自动放大页面 */
@media screen and (max-width: 768px) {

    /* 搜索弹窗中的输入框 */
    .unified-search-modal input[type="text"],
    .unified-search-modal input[type="search"] {
        font-size: 16px !important;
    }
}

/* 移动端底部导航栏 */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.08);
    z-index: 999;
    padding: 2px 0 calc(2px + env(safe-area-inset-bottom));
    padding-bottom: max(2px, env(safe-area-inset-bottom));
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-bottom-nav.hidden {
    transform: translateY(calc(100% + 30px));
}

.mobile-bottom-nav {
    display: none;
    justify-content: space-around;
    align-items: flex-end;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 11px;
    padding: 3px 8px;
    transition: all 0.3s;
    flex: 1;
    max-width: 70px;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.mobile-nav-item svg {
    fill: #666;
    margin-bottom: 2px;
    transition: all 0.3s;
}

.mobile-nav-item span {
    font-size: 10px;
    white-space: nowrap;
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
    color: #1890ff;
}

.mobile-nav-item:hover svg,
.mobile-nav-item:active svg {
    fill: #1890ff;
    transform: scale(1.08);
}

/* 中间的提交收录按钮 */
.mobile-nav-center {
    position: relative;
    margin-top: -18px;
}

.mobile-nav-center-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
    margin-bottom: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid rgba(255, 255, 255, 0.95);
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-center-btn svg {
    fill: #fff !important;
    width: 24px;
    height: 24px;
}

.mobile-nav-center:hover .mobile-nav-center-btn,
.mobile-nav-center:active .mobile-nav-center-btn {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 144, 255, 0.5);
}

.mobile-nav-center span {
    color: #1890ff;
    font-weight: 500;
    font-size: 10px;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    /* 隐藏顶部的用户图标 */
    .unified-user-desktop-only {
        display: none !important;
    }

    /* 给页面底部留出空间 */
    body {
        padding-bottom: 52px;
    }
}

/* 高亮当前页面 */
.mobile-nav-item.active {
    color: #1890ff;
}

.mobile-nav-item.active svg {
    fill: #1890ff;
}

/* ===== 电脑端用户下拉面板 ===== */
.unified-user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 70px;
}

.unified-user-dropdown .unified-user-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    background: none;
    border: none;
    transition: background 0.2s;
}

.unified-user-dropdown .unified-user-icon-btn:hover {
    background: rgba(24, 144, 255, 0.08);
}

.nav-user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8e8e8;
}

/* 下拉面板容器 — JS控制 show 类 */
.nav-user-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: -8px;
    width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1100;
    pointer-events: none;
}

.nav-user-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* 信息卡：左右缩进，让按钮卡在视觉上更宽 */
.nav-user-info-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px;
    background: linear-gradient(135deg, #0d6efd 0%, #38bdf8 100%);
    border-radius: 14px 14px 10px 10px;
    position: relative;
    z-index: 2;
    margin-bottom: -16px;
    margin-left: 10px;
    margin-right: 10px;
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.35);
}

.nav-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
}

.nav-guest-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 2px;
}

/* 按钮卡片：占满面板全宽，比信息卡宽 */
.nav-user-actions-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 22px 10px 10px;
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

/* 按钮块：横向长方形，图标+文字左右排列 */
.nav-action-tile {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.15s, transform 0.15s;
}

.nav-action-tile:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.nav-action-tile svg {
    flex-shrink: 0;
}

.nav-tile-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.nav-tile-blue svg {
    fill: #1d4ed8;
}

.nav-tile-cyan {
    background: #ccfbf1;
    color: #0d9488;
}

.nav-tile-cyan svg {
    fill: #0d9488;
}

.nav-tile-gray {
    background: #f1f5f9;
    color: #64748b;
}

.nav-tile-gray svg {
    fill: #64748b;
}

/* ===== 手机端侧边栏用户区 ===== */
.sidebar-user-section {
    padding: 0 12px 28px;
    margin-top: 24px;
    flex-shrink: 0;
    background: #f8faff;
}

/* 用户信息行 */
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px 10px;
    background: #fff;
    border-radius: 14px 14px 0 0;
    margin-top: 12px;
}

.sidebar-guest-card {
    background: #fff;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e8f0fe;
    flex-shrink: 0;
}

.sidebar-guest-avatar-wrap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8f0fe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

/* 横向列表按钮 */
.sidebar-user-links {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
    padding: 0 4px 8px;
}

.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    margin: 0 2px;
}

.sidebar-user-link svg {
    fill: #6b7280;
    flex-shrink: 0;
    transition: fill 0.15s;
}

.sidebar-link-arrow {
    margin-left: auto;
    fill: #cbd5e1 !important;
}

.sidebar-user-link:hover,
.sidebar-user-link:active {
    background: #eff6ff;
    color: #1d4ed8;
}

.sidebar-user-link:hover svg,
.sidebar-user-link:active svg {
    fill: #1d4ed8;
}

.sidebar-link-primary {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.sidebar-link-primary svg {
    fill: #1d4ed8;
}

.sidebar-link-primary:hover,
.sidebar-link-primary:active {
    background: #dbeafe;
}

.sidebar-link-danger {
    color: #ef4444;
}

.sidebar-link-danger svg {
    fill: #ef4444;
}

.sidebar-link-danger:hover,
.sidebar-link-danger:active {
    background: #fef2f2;
    color: #dc2626;
}

.sidebar-link-danger:hover svg,
.sidebar-link-danger:active svg {
    fill: #dc2626;
}