/* ================== 登录/注册弹窗 ================== */
.auth-modal-mask {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.auth-modal-mask.open {
    display: flex;
}

.auth-modal {
    width: 360px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 32px 30px 28px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: authModalIn 0.22s ease;
}
@keyframes authModalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-modal-header img {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
}
.auth-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 10px;
}
.auth-modal-header p {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

.auth-modal-tabs {
    display: flex;
    margin-bottom: 22px;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 3px;
}
.auth-modal-tab {
    flex: 1;
    text-align: center;
    padding: 9px;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.25s;
    user-select: none;
}
.auth-modal-tab:hover { color: #555; }
.auth-modal-tab.active {
    background: #fff;
    color: #1a1a1a;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.auth-modal-form { display: none; }
.auth-modal-form.active { display: block; }

.auth-modal-field {
    margin-bottom: 16px;
}
.auth-modal-field label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}
.auth-modal-field input {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    color: #1a1a1a;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}
.auth-modal-field input:focus {
    border-color: #14785a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(20, 120, 90, 0.1);
}
.auth-modal-field input::placeholder { color: #bbb; }

.auth-modal-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #14785a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}
.auth-modal-submit:hover { background: #0f6349; }
.auth-modal-submit:active { transform: scale(0.98); }
.auth-modal-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-modal-hint {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: 16px;
}
.auth-modal-hint a {
    color: #14785a;
    cursor: pointer;
    font-weight: 500;
}
.auth-modal-hint a:hover { text-decoration: underline; }

.auth-modal-alert {
    display: none;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 13px;
    margin-bottom: 14px;
    text-align: center;
}
.auth-modal-alert.error {
    display: block;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}
.auth-modal-alert.success {
    display: block;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* ================== 导航栏已登录状态 ================== */
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}
.nav-user:hover {
    background: rgba(255, 255, 255, 0.14);
}
.nav-user-avatar {
    font-size: 18px;
}
.nav-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 已登录下拉菜单 */
.nav-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    min-width: 150px;
    background: rgba(10, 38, 24, 0.95);
    border: 1px solid rgba(212, 163, 64, 0.25);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: none;
    z-index: 10001;
}
.nav-user:hover .nav-user-menu { display: block; }
.nav-user-menu-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.2s;
}
.nav-user-menu-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-user-menu-item.danger { color: #f87171; }

/* 移动端：用户菜单改为点击触发 */
@media (max-width: 768px) {
    .nav-user-menu { position: static; margin-top: 0; min-width: auto; }
    .nav-user:hover .nav-user-menu { display: none; }
    .nav-user-menu.show { display: block; }
}

/* ================== 我的信息弹窗 ================== */
.nav-profile-mask {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}
.nav-profile-mask.open { display: flex; }

.nav-profile-modal {
    width: 340px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 14px;
    padding: 30px 28px 24px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: authModalIn 0.22s ease;
}
.nav-profile-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-profile-close:hover { background: #f0f0f0; color: #333; }

.nav-profile-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 22px;
}
.nav-profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 18px;
}
.nav-profile-avatar {
    font-size: 36px;
}
.nav-profile-nickname {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
}
.nav-profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.nav-profile-stat {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.nav-profile-stat-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}
.nav-profile-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #14785a;
}
.nav-profile-btn {
    width: 100%;
    padding: 11px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #14785a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}
.nav-profile-btn:hover { background: #0f6349; }
