.navbar {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    border-bottom: 3px solid #0891b2;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.navbar-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    margin-right: 20px;
}


.navbar-brand .logo i {
    font-size: 36px;
    color: white;
}

.navbar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.navbar-brand .brand-title {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 2px;
}

.navbar-brand .brand-subtitle {
    font-size: 14px;
    opacity: 0.8;
    color: #65d806;
}

.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.nav-dropdown {
    position: relative;
    margin: 0 8px;
}

.nav-dropdown>a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.nav-dropdown>a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #06b6d4;
    border-color: rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
}

.nav-dropdown>a i {
    margin-right: 8px;
    font-size: 16px;
}

.nav-dropdown>a .arrow {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    border: 1px solid #e2e8f0;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 8px 8px 0 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #334155;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: #0891b2;
    transform: translateX(5px);
}

.dropdown-item i {
    margin-right: 10px;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.dropdown-item .item-desc {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.status-indicator {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    color: #10b981;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 2s infinite;
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(45deg, #8b5cf6, #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-avatar:hover {
    transform: scale(1.05);
    border-color: #06b6d4;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 主体内容调整 */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}
.main-container {
    width: 100%;
    height: 100%;
}

.map-container {
    width: 100%;
    height: 100%;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .navbar-container {
        padding: 0 15px;
    }

    .navbar-brand .brand-text {
        display: none;
    }

    .nav-dropdown>a {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .navbar-nav {
        display: none;
    }

    .navbar-actions {
        gap: 8px;
    }
}

/* ========== 用户信息显示样式 ========== */

.user-info-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 15px;
    font-size: 12px;
}

.user-welcome {
    color: #e2e8f0;
    margin-bottom: 2px;
}

.welcome-text {
    opacity: 0.7;
}

.user-name {
    font-weight: 600;
    color: #06b6d4;
}

.user-role-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(6, 182, 212, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.role-icon {
    font-size: 10px;
}

.role-text {
    font-size: 10px;
    font-weight: 500;
    color: #06b6d4;
}

/* 用户头像增强 */
.user-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #8b5cf6, #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-avatar:hover {
    transform: scale(1.05);
    border-color: #06b6d4;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.3);
}

.user-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}


/* ═══════════════════════════════════════════════════════════════
   用户下拉面板 — 全面重设计
   ─────────────────────────────────────────────────────────────── */

/* 容器 */
.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0,0,0,0.08);
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top right;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    z-index: 1001;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ── 头部 ── */
.user-header {
    padding: 22px 20px 18px;
    /* 背景由 JS 动态注入，fallback 为系统蓝黑 */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border-radius: 18px 18px 0 0;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

/* 头部装饰光晕 */
.user-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}
.user-header::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 60px;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

/* 大头像 */
.user-avatar-large {
    width: 58px;
    height: 58px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.user-details {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.user-name-large {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-large {
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.22);
    padding: 3px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 6px;
    border: 1px solid rgba(255,255,255,0.25);
    letter-spacing: 0.3px;
}

.user-status {
    font-size: 12px;
    opacity: 0.88;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 400;
}

.user-status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
    animation: statusPulse 2s infinite;
}

/* ── 快速信息（卡片网格）── */
.user-quick-info {
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e8eef4;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border-radius: 10px;
    padding: 10px 8px;
    border: 1px solid #e5eaf0;
    gap: 4px;
    text-align: center;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.info-value {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

/* ── 菜单项 ── */
.dropdown-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
    margin: 4px 12px;
}

/* 菜单分组标签 */
.dropdown-group-label {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 16px;
    color: #334155;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    border-bottom: none;
    border-radius: 10px;
    margin: 1px 6px;
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:last-child {
    border-radius: 10px;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: translateX(3px);
}

.dropdown-item i {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #f1f5f9;
    color: #475569;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover i {
    background: #e0f2fe;
    color: #0284c7;
}

/* 菜单项标题和描述 */
.dropdown-item > div > div:first-child {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1px;
}
.dropdown-item .item-desc {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}
.dropdown-item:hover > div > div:first-child {
    color: #0284c7;
}

/* 任务角标 */
.task-count-badge {
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 2px 7px;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

/* ── 退出登录（危险区）── */
.logout-item {
    margin: 4px 6px 8px;
    border: 1.5px solid #fecaca;
    background: #fff5f5;
}

.logout-item i {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}

.logout-item > div > div:first-child {
    color: #dc2626 !important;
}

.logout-item .item-desc {
    color: #f87171 !important;
}

.logout-item:hover {
    background: #fee2e2;
    transform: translateX(3px);
    border-color: #f87171;
}

.logout-item:hover i {
    background: #fca5a5 !important;
    color: #dc2626 !important;
}

/* 游客菜单 */
.guest-menu .dropdown-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-bottom: 1px solid #e2e8f0;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 18px 18px 0 0;
}


/* 响应式：小屏幕调整 */
@media (max-width: 768px) {
    .user-info-display {
        display: none;
    }
    .user-dropdown {
        min-width: 280px;
        right: -20px;
    }
    .user-header {
        padding: 16px;
    }
    .user-quick-info {
        padding: 12px;
    }
}

/* 角色特定样式 */
.role-super-admin {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.role-manager {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.role-researcher {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.role-regular {
    background: linear-gradient(135deg, #059669, #047857);
}

/* ========== 游客访问限制样式 ========== */

/* 游客提示横幅 */
.guest-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 15px 0;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    animation: slideInDown 0.5s ease;
}

.guest-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.guest-banner-icon {
    font-size: 24px;
    opacity: 0.9;
}

.guest-banner-text {
    flex: 1;
}

.guest-banner-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.guest-banner-desc {
    font-size: 13px;
    opacity: 0.9;
}

.guest-banner-actions {
    display: flex;
    gap: 12px;
}

.guest-login-btn,
.guest-register-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guest-login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.guest-login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.guest-register-btn {
    background: white;
    color: #d97706;
}

.guest-register-btn:hover {
    background: #f9fafb;
    transform: translateY(-1px);
}

.guest-banner-close {
    position: absolute;
    top: -5px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.guest-banner-close:hover {
    opacity: 1;
}

/* 地图覆盖层 */
.guest-map-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.guest-overlay-icon {
    font-size: 48px;
    color: #06b6d4;
    margin-bottom: 20px;
}

.guest-overlay-content h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #1e293b;
}

.guest-overlay-content p {
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.6;
}

.guest-overlay-features {
    text-align: left;
    margin-bottom: 25px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.feature-item i.fa-check {
    color: #10b981;
}

.feature-item i.fa-lock {
    color: #f59e0b;
}

.guest-overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* 登录提示弹窗 */
.login-prompt-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.login-prompt-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.3s ease;
}

.login-prompt-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-radius: 16px 16px 0 0;
}

.login-prompt-header h3 {
    flex: 1;
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
}

.login-prompt-body {
    padding: 24px;
}

.login-prompt-body p {
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 16px;
}

.login-benefits h4 {
    margin-bottom: 12px;
    color: #1e293b;
    font-size: 14px;
}

.login-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.login-benefits li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #64748b;
}

.login-benefits li i {
    color: #10b981;
    font-size: 12px;
}

.login-prompt-footer {
    padding: 20px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

.login-prompt-footer .btn-primary,
.login-prompt-footer .btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 受限制元素样式 */
.guest-restricted {
    opacity: 0.5 !important;
    pointer-events: none !important;
    position: relative;
}

.guest-restricted::after {
    content: '🔒';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 12px;
}

/* 演示标记 */
.demo-badge {
    background: #10b981 !important;
    color: white !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    margin-left: auto !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .guest-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .guest-banner-actions {
        order: 2;
    }

    .guest-banner-close {
        top: 5px;
        right: 5px;
    }

    .guest-map-overlay {
        margin: 20px;
        padding: 20px;
    }

    .login-prompt-content {
        margin: 20px;
    }
}

/* 动画 */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 图例样式 */
.rice-legend {
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

.rice-legend .legend-title {
    font-weight: bold;
    color: #333;
}

.rice-legend .legend-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* 添加动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rice-legend {
    animation: fadeIn 0.5s ease-out;
}

/* 在 style.css 中添加 */
@media (max-width: 1200px) {
    .navbar-nav {
        display: none;
    }

    .navbar-toggle {
        display: block;
    }

    .navbar-collapsed {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .navbar-collapsed .navbar-nav {
        display: block;
    }

    .navbar-collapsed .nav-dropdown {
        display: block;
        width: 100%;
    }
}

/* 在 style.css 中添加 */
.icon-menu-mode .navbar-nav {
    display: flex;
}

.icon-menu-mode .navbar-nav>li>a {
    padding: 10px;
    text-align: center;
}

.icon-menu-mode .navbar-nav>li>a i {
    font-size: 20px;
    display: block;
    margin-bottom: 5px;
}

.icon-menu-mode .navbar-nav>li>a span {
    font-size: 12px;
}

.icon-menu-mode .arrow {
    display: none;
}

.production-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    width: 56px;
    height: 56px;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.production-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
}
