/**
 * Red 模板 - 用户登陆状态显示样式
 */

/* ========== 用户登陆区域容器 ========== */
.user-login-section {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.user-login-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 10px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 未登陆状态 - 登陆/注册链接 ========== */
.user-login-links {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.login-link,
.register-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.login-link:hover {
    color: #8b6f47;
    text-decoration: underline;
}

.register-link:hover {
    color: #8b6f47;
    text-decoration: underline;
}

.link-icon {
    font-size: 16px;
}

.link-separator {
    color: #ccc;
    margin: 0 4px;
}

/* ========== 已登陆状态 - 用户下拉菜单 ========== */
.user-dropdown-wrapper {
    position: relative;
    display: inline-block;
    white-space: normal;
    flex-shrink: 0;
}

/* 触发器（用户信息显示区） */
.user-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: auto;
    color: #333;
}

.user-trigger:hover {
    opacity: 0.7;
}

/* 用户头像 */
.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, rgb(241, 116, 77) 0%, rgb(223, 39, 39) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    flex: none;
}

.user-avatar svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* 用户信息文本 */
.user-info {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    gap: 6px;
    white-space: nowrap;
}

.user-name {
    font-size: 13px;
    color: #5a5a5a;
    font-weight: 600;
    white-space: nowrap;
}

/* VIP 徽章 */
.user-vip-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 普通会员 - 灰色 */
.user-vip-badge.vip-normal {
    background: #d9d9d9;
    color: #666;
}

/* 月卡VIP - 浅红色 */
.user-vip-badge.vip-monthly {
    background: rgba(241, 116, 77, 0.15);
    color: rgb(241, 116, 77);
}

/* 季卡VIP - 大红色 */
.user-vip-badge.vip-quarterly {
    background: linear-gradient(135deg, rgb(241, 116, 77), rgb(223, 39, 39));
    color: #fff;
}

/* 年卡VIP - 橙红色 */
.user-vip-badge.vip-yearly {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
}

/* 终身VIP - 粉红色 */
.user-vip-badge.vip-lifetime {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: #fff;
}

/* 兼容旧的样式 */
.user-vip-badge.user-vip-active {
    background: linear-gradient(135deg, #E6B800, #D4A500);
    color: #fff;
}

/* 下拉箭头 */
.dropdown-arrow {
    color: #999;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.user-dropdown-wrapper.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* ========== 下拉菜单 ========== */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #fff !important;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 999;
    overflow: hidden;
    color-scheme: light;
}

.user-dropdown-wrapper.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 下拉菜单头部 */
.dropdown-header {
    padding: 12px 16px;
    background: #f6f6f6 !important;
    border-bottom: 1px solid #e9ecef;
}

.dropdown-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.dropdown-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgb(223, 39, 39) 0%, rgb(241, 116, 77) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.dropdown-avatar svg {
    width: 20px;
    height: 20px;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.dropdown-username {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-email {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-right {
    flex-shrink: 0;
}

.dropdown-right .user-vip-badge {
    padding: 4px 10px;
    font-size: 12px;
}

/* 下拉菜单主体 */
.dropdown-body {
    padding: 12px;
    background: #fff !important;
}

.user-checkin-btn,
.user-checkin-btn-disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.user-checkin-btn {
    background: linear-gradient(135deg, rgb(241, 116, 77), rgb(223, 39, 39));
    box-shadow: 0 2px 8px rgba(223, 39, 39, 0.2);
}

.user-checkin-btn:hover {
    background: linear-gradient(135deg, rgb(255, 140, 100), rgb(230, 60, 50));
    box-shadow: 0 4px 12px rgba(223, 39, 39, 0.3);
    transform: translateY(-1px);
}

.user-checkin-btn-disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.user-checkin-btn i,
.user-checkin-btn-disabled i {
    font-size: 14px;
}

/* 统计行 */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.stat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: #f8f9fa;
}

.stat-label {
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
}

.stat-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-left: auto;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    flex-shrink: 0;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 6px;
    background: #fff;
    border-radius: 6px;
}

.dahe-card-icon {
    font-size: 14px;
}

.stat-card-num {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.stat-card-label {
    display: none;
}

/* 淡色统计卡片 */
.stat-card-blue {
    background: #eef7ff;
}

.stat-card-green {
    background: #f7f0f9;
}

.stat-card-pink {
    background: #f0f9f4;
}

.stat-card-red {
    background: #fff5f5;
}

/* 下拉菜单底部 */
.dropdown-footer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #fff !important;
    border-top: 1px solid #e9ecef;
}

.footer-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    color: #666;
    text-decoration: none;
    font-size: 11px;
    transition: all 0.3s ease;
    border-right: 1px solid #e9ecef;
    text-align: center;
    cursor: pointer;
}

.footer-link:last-child {
    border-right: none;
}

.footer-link:hover {
    background: rgba(241, 116, 77, 0.08);
    color: rgb(223, 39, 39);
}

.footer-icon {
    font-size: 18px;
}

.footer-text {
    display: none;
}

/* ========== 搜索右侧区域容器 ========== */
.search-right-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 1 auto;
}

.quick-links {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 200px;
}

.quick-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    flex-shrink: 0;
}

.quick-links a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    transition: all 0.3s ease;
    display: inline-block;
    white-space: nowrap;
}

.quick-links a:hover {
    color: #FFD700;
    text-decoration: underline;
}

/* ========== 响应式设计 ========== */

/* 平板设备 */
@media (max-width: 1024px) {
    .user-dropdown-menu {
        width: 260px;
    }

    .user-trigger {
        min-width: auto;
        padding: 4px 8px;
    }

    .user-name {
        font-size: 13px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .user-avatar svg {
        width: 16px;
        height: 16px;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    .search-right-section {
        flex-direction: column;
        gap: 12px;
        align-items: flex-end;
        width: 100%;
    }

    .quick-links {
        width: 100%;
        font-size: 12px;
    }

    .quick-title {
        font-size: 12px;
    }

    .quick-links a {
        font-size: 12px;
        padding: 3px 6px;
    }

    .user-login-section {
        width: 100%;
        min-width: auto;
    }

    .user-login-links {
        width: 100%;
        justify-content: flex-end;
    }

    .user-trigger {
        width: 100%;
        justify-content: flex-end;
        min-width: auto;
        padding: 4px 8px;
    }

    .user-dropdown-menu {
        width: 280px;
        right: 0;
    }

    .user-info {
        display: none;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .dropdown-footer {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-link:nth-child(4) {
        grid-column: 3;
    }

    .footer-link {
        font-size: 10px;
        padding: 8px 4px;
    }

    .footer-icon {
        font-size: 16px;
    }

    .dropdown-header {
        padding: 10px 12px;
    }

    .dropdown-body {
        padding: 10px;
    }

    .stat-item {
        padding: 6px 8px;
        font-size: 11px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 13px;
    }
}

/* 超小屏幕 */
@media (max-width: 480px) {
    .quick-links {
        font-size: 11px;
        min-width: auto;
    }

    .quick-title {
        font-size: 11px;
    }

    .quick-links a {
        font-size: 11px;
        padding: 2px 4px;
    }

    .user-login-links {
        gap: 4px;
    }

    .login-link,
    .register-link {
        padding: 4px 8px;
        font-size: 12px;
    }

    .link-separator {
        margin: 0 2px;
    }

    .dropdown-header {
        padding: 8px 10px;
    }

    .dropdown-user-info {
        display: none;
    }

    .user-dropdown-menu {
        width: 240px;
    }
}

/* ========== 暗色主题优化 ========== */
@media (prefers-color-scheme: dark) {
    .user-dropdown-menu {
        background: #fff !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

    .dropdown-header,
    .dropdown-body {
        background: #fff !important;
    }

    .dropdown-header {
        background: #f6f6f6 !important;
        border-bottom-color: #e9ecef;
    }

    .dropdown-footer {
        background: #fff !important;
        border-top-color: #e9ecef;
    }

    .dropdown-username {
        color: #333;
    }

    .dropdown-email {
        color: #999;
    }

    .stat-item {
        background: #f8f9fa;
    }

    .stat-label {
        color: #666;
    }

    .stat-value {
        color: #333;
    }

    .footer-link {
        color: #666;
        border-right-color: #e9ecef;
    }

    .footer-link:hover {
        background: rgba(241, 116, 77, 0.08);
        color: rgb(223, 39, 39);
    }
}
