/**
 * space-header.css — 个人空间头部组件样式
 * 参考 profile.ftl 风格：Banner + 居中头像 + 紧凑统计行
 */

/* ============================================================
   Banner 区域
   ============================================================ */
.sh-banner {
    position: relative;
    height: 210px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #444 100%);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

.sh-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================================
   头部容器：覆盖旧的 space-header
   ============================================================ */
.space-header {
    background: #ffffff;
    border-radius: 16px;
    overflow: visible;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 10px;
    padding: 0;
}

/* ============================================================
   用户信息区（头像从 Banner 溢出）
   ============================================================ */
.sh-info {
    padding: 0 24px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    margin-top: -44px;
}

/* ============================================================
   头像
   ============================================================ */
.sh-avatar-wrapper {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 4px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    overflow: hidden;
    background: #e5e5e5;
    cursor: default;
}

.sh-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* ============================================================
   昵称行：左侧昵称+VIP + 右侧操作按钮
   ============================================================ */
.sh-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
    gap: 12px;
    flex-wrap: nowrap;
}

/* 左侧：昵称 + VIP 徽章 */
.sh-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sh-nickname {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.3px;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.sh-vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.sh-vip-badge i {
    font-size: 11px;
}

/* ============================================================
   个性签名
   ============================================================ */
.sh-signature {
    color: #888888;
    font-size: 12px;
    margin-top: 4px;
    max-width: 420px;
    line-height: 1.4;
    word-break: break-word;
}

/* ============================================================
   紧凑统计行
   ============================================================ */
.sh-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 8px;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 4px 4px;
}

.sh-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 12px;
    cursor: pointer;
    transition: color 0.15s ease;
    white-space: nowrap;
    position: relative;
}

/* 分隔线 */
.sh-stat-item + .sh-stat-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 12px;
    width: 1px;
    background: #ddd;
}

.sh-stat-item:hover {
    color: #4a90e2;
}

.sh-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.sh-stat-label {
    font-size: 12px;
    color: #999;
    line-height: 1;
}

.sh-stat-item:hover .sh-stat-value {
    color: #4a90e2;
}

.sh-stat-item:hover .sh-stat-label {
    color: #4a90e2;
}

/* ============================================================
   操作按钮区（在昵称行右侧）
   ============================================================ */
.sh-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* 基础按钮 - 小巧黑白配色 */
.sh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    background: none;
}

/* 关注按钮：黑色背景白色文字 */
.sh-btn-primary {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

.sh-btn-primary:hover {
    background: #333333;
    border-color: #333333;
    color: #ffffff;
    text-decoration: none;
}

/* 已关注按钮：浅灰背景深色文字 */
.sh-btn-followed {
    background: #f5f5f5;
    color: #333333;
    border-color: #d0d0d0;
}

.sh-btn-followed:hover {
    background: #e85d5d;
    color: #ffffff;
    border-color: #e85d5d;
}

/* 编辑资料按钮 */
.sh-btn-outline {
    background: #ffffff;
    color: #555;
    border-color: #e0e0e0;
}

.sh-btn-outline:hover {
    background: #f5f5f5;
    color: #1a1a1a;
    border-color: #aaa;
    text-decoration: none;
}

/* 更多操作图标按钮 - 小巧圆形 */
.sh-btn-icon {
    padding: 4px;
    border-radius: 50%;
    background: transparent;
    color: #888;
    border: none;
    width: 28px;
    height: 28px;
}

.sh-btn-icon:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

/* ============================================================
   下拉菜单
   ============================================================ */
.sh-dropdown {
    position: relative;
}

.sh-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 130px;
    z-index: 200;
    padding: 4px 0;
    white-space: nowrap;
}

.sh-dropdown-menu.is-open {
    display: block;
}

.sh-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s ease;
    cursor: pointer;
}

.sh-dropdown-item:hover {
    background: #f8f9fa;
    color: #1a1a1a;
    text-decoration: none;
}

.sh-dropdown-item.sh-danger {
    color: #e85d5d;
}

.sh-dropdown-item.sh-danger:hover {
    background: rgba(232, 93, 93, 0.06);
    color: #e85d5d;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
    /* 头部容器底部去掉圆角，与下方tabs区域衔接 */
    .space-header {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .sh-banner {
        height: 130px;
        border-radius: 0;
    }

    .sh-info {
        padding: 0 12px 12px;
        margin-top: -36px;
    }

    .sh-avatar-wrapper {
        width: 85px;
        height: 85px;
        border-width: 3px;
    }

    /* 昵称和按钮保持在同一行 */
    .sh-name-row {
        flex-wrap: nowrap;
        gap: 8px;
    }

    .sh-meta {
        justify-content: flex-start;
        flex: 1;
        min-width: 0;
    }

    .sh-actions {
        flex-shrink: 0;
        margin-left: auto;
    }

    .sh-nickname {
        font-size: 16px;
    }

    .sh-signature {
        text-align: center;
    }

    .sh-stats {
        padding: 3px 2px;
        margin-top: 6px;
    }

    .sh-stat-item {
        padding: 0 9px;
    }

    .sh-stat-value {
        font-size: 13px;
    }

    .sh-stat-label {
        font-size: 11px;
    }

    .sh-btn {
        font-size: 11px;
        padding: 4px 10px;
    }

    .sh-btn-icon {
        width: 26px;
        height: 26px;
    }
}
