/**
 * 作者页面样式 - 一体化设计（使用父主题变量系统）
 *
 * @package    Hui
 * @subpackage Assets
 * @since      1.2.0
 */

/* 隐藏父主题的原始 Hero 区域 */
.hui-author-page .xun-author-hero {
    display: none;
}

/* 移除作者页面的背景色，让Hero渐变背景直接显示 */
body.author {
    background: var(--color-bg-layout, #f5f5f5) !important;
}

body.author .xun-site-content {
    background: transparent !important;
}

/* 确保内容区域背景色一致 */
body.author .xun-author-container {
    background: transparent;
}

/* Hero 区域 - 全宽显示 */
.hui-author-hero {
    width: 100%;
    margin-top: 1.5rem; /* 添加顶部边距，避免与导航重合 */
    margin-bottom: 0; /* 去掉底部边距，与内容区域无缝衔接 */
}

/* 透明Header模式 - 向上延伸到页面顶部 */
.hui-author-hero--transparent {
    margin-top: 0; /* 去掉顶部边距 */
    padding-top: 80px; /* 添加padding，为Header留出空间（Header高度 + 额外间距） */
}

.hui-author-hero--transparent .hui-author-hero-bg {
    height: calc(300px + 80px); /* 背景高度增加，覆盖到Header区域 */
    margin-top: -80px; /* 负边距，让背景向上延伸 */
}

/* 主体区域 - 去掉顶部边距 */
.hui-author-page.xun-author-page {
    margin-top: 0;
    padding-top: 0;
}

/* 内容容器 - 去掉顶部边距 */
.hui-author-page .xun-author-container {
    margin-top: 0;
    padding-top: 1.5rem; /* 保持内容与Hero的间距 */
}

/* Hero 包装器 - 使用父主题容器宽度和padding */
.hui-author-hero-wrapper {
    max-width: var(--xun-container-width, 1200px);
    margin: 0 auto;
    padding: 0 1rem; /* 添加左右padding，与 .xun-author-container 一致 */
}

/* Hero 内容容器 - 实际的卡片 */
.hui-author-hero-content {
    position: relative; /* 添加相对定位，让IP徽章相对于这个容器定位 */
    background: var(--color-bg-container);
    border-radius: var(--xun-radius-lg, 12px);
    overflow: hidden; /* 恢复overflow: hidden，保持圆角 */
    box-shadow: var(--shadow-card);
}

/* 封面图背景 */
.hui-author-hero-bg {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: var(--color-fill-quaternary);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll; /* 固定背景,不随滚动移动 */
    border-radius: var(--xun-radius-lg, 12px) var(--xun-radius-lg, 12px) 0 0; /* 只给顶部圆角 */
}

/* IP 归属地徽章（右上角） */
.hui-author-ip-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full, 9999px);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-author-ip-badge:hover {
    background: rgba(0, 0, 0, 0.65);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.hui-author-ip-badge svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

/* 用户信息卡片 - 横向布局 */
.hui-author-card {
    position: relative;
    padding: 1.5rem;
    background: var(--color-bg-container);
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

/* 毛玻璃过渡效果 - 只在卡片顶部 */
.hui-author-card::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.8) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    pointer-events: none;
    z-index: 1;
}

/* 头像 */
.hui-author-avatar {
    position: relative;
    z-index: 2; /* 确保头像在毛玻璃层上方 */
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.hui-author-avatar img,
.hui-author-avatar .hui-author-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full, 9999px);
    border: 3px solid var(--color-bg-container);
    box-shadow: var(--shadow-sm);
    background: var(--color-bg-container);
}

/* 认证徽章容器适配 */
.hui-author-avatar .xun-avatar-verified-wrap {
    display: block;
    width: 100%;
    height: 100%;
}

.hui-author-avatar .xun-avatar-verified-wrap img {
    border-radius: var(--radius-full, 9999px);
}

/* 用户信息 */
.hui-author-info {
    position: relative;
    z-index: 2; /* 确保内容在毛玻璃层上方 */
    flex: 1;
    min-width: 0;
}

/* 第一行：用户名 + 徽章 */
.hui-author-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.hui-author-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    line-height: 1.2;
}

.hui-author-uid-badge,
.hui-author-vip-badge,
.hui-author-level-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: var(--radius-sm, 6px);
    line-height: 1.4;
}

.hui-author-uid-badge {
    color: var(--color-text-tertiary);
    background: var(--color-fill-quaternary);
}

.hui-author-vip-badge {
    color: #fff;
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
}

/* 等级徽章 - 使用父主题的样式 */
.hui-author-level-badge.xun-level-badge--text {
    color: var(--level-color, var(--color-text-tertiary));
    background: var(--level-bg-color, var(--color-fill-quaternary));
}

/* 等级徽章 - 图标模式 */
.hui-author-level-badge.xun-level-badge--icon {
    background: transparent;
    border: none;
    padding: 0;
}

.hui-author-level-badge.xun-level-badge--icon .xun-level-icon {
    object-fit: contain;
    width: auto;
    height: 18px;
    max-height: 20px;
    display: block;
}

/* 第二行：统计数据 */
.hui-author-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.hui-author-stat {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.hui-author-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1;
}

.hui-author-stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1;
}

.hui-author-stat-divider {
    width: 1px;
    height: 0.75rem;
    background: var(--color-border);
}

/* 第三行：元信息行（紧凑布局） */
.hui-author-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.hui-author-meta {
    display: flex;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.hui-author-join {
    display: inline-flex;
    align-items: center;
}

/* 第四行：简介 */
.hui-author-bio {
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    display: flex;
    gap: 0.25rem;
}

.hui-author-bio-label {
    flex-shrink: 0;
}

.hui-author-bio-text {
    flex: 1;
}

/* 第四行：标签 */
.hui-author-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hui-author-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    background: var(--color-fill-quaternary);
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--radius-sm, 6px);
    line-height: 1.4;
    transition: all 0.2s var(--ease-smooth, ease);
}

.hui-author-tag:hover {
    color: var(--color-primary);
    background: var(--color-primary-bg);
    border-color: var(--color-primary-border);
}

/* 操作按钮 */
.hui-author-actions {
    position: relative;
    z-index: 2; /* 确保按钮在毛玻璃层上方 */
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.hui-author-message-btn,
.hui-author-follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    border-radius: var(--xun-radius, 8px);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
    white-space: nowrap;
}

.hui-author-message-btn {
    color: var(--color-text-secondary);
    background: var(--color-fill-quaternary);
    border: 1px solid var(--color-border-secondary);
}

.hui-author-message-btn:hover {
    color: var(--color-text);
    background: var(--color-fill-tertiary);
    border-color: var(--color-border);
}

.hui-author-follow-btn {
    color: #fff;
    background: var(--color-primary);
    box-shadow: var(--shadow-xs);
}

.hui-author-follow-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.hui-author-follow-btn.is-following {
    color: var(--color-text-secondary);
    background: var(--color-fill-quaternary);
    border: 1px solid var(--color-border-secondary);
    box-shadow: none;
}

.hui-author-follow-btn.is-following:hover {
    color: var(--color-error);
    background: var(--color-error-bg);
    border-color: var(--color-error-border);
}

/* 深色模式适配 - 使用父主题变量自动适配 */
@media (prefers-color-scheme: dark) {
    :root:not(.light) .hui-author-ip-badge {
        background: rgba(0, 0, 0, 0.6);
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    :root:not(.light) .hui-author-ip-badge:hover {
        background: rgba(0, 0, 0, 0.75);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    /* 深色模式下的毛玻璃过渡 */
    :root:not(.light) .hui-author-card::before {
        background: linear-gradient(to bottom, 
            rgba(15, 23, 42, 0) 0%,
            rgba(15, 23, 42, 0.4) 50%,
            rgba(15, 23, 42, 0.8) 100%
        );
    }
}

.dark .hui-author-ip-badge {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.dark .hui-author-ip-badge:hover {
    background: rgba(0, 0, 0, 0.75);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 深色模式下的毛玻璃过渡 */
.dark .hui-author-card::before {
    background: linear-gradient(to bottom, 
        rgba(15, 23, 42, 0) 0%,
        rgba(15, 23, 42, 0.4) 50%,
        rgba(15, 23, 42, 0.8) 100%
    );
}

/* 响应式 */
@media (max-width: 768px) {
    .hui-author-hero-wrapper {
        padding: 0; /* 移动端去掉padding */
    }
    
    .hui-author-hero-content {
        border-radius: 0; /* 移动端去掉圆角 */
    }
    
    .hui-author-hero-bg {
        height: 200px; /* 移动端背景高度 */
    }
    
    .hui-author-card {
        padding: 1rem;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hui-author-avatar {
        width: 64px;
        height: 64px;
    }
    
    .hui-author-info {
        width: 100%;
    }
    
    .hui-author-name-row {
        justify-content: center;
    }
    
    .hui-author-name {
        font-size: 1.125rem;
    }
    
    .hui-author-stats {
        justify-content: center;
        gap: 0.75rem;
    }
    
    .hui-author-stat-value {
        font-size: 0.875rem;
    }
    
    .hui-author-stat-label {
        font-size: 0.75rem;
    }
    
    .hui-author-meta {
        justify-content: center;
        font-size: 0.75rem;
    }
    
    .hui-author-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .hui-author-tags {
        justify-content: center;
    }
    
    .hui-author-ip-badge {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.1875rem 0.5rem;
        font-size: 0.6875rem;
    }
    
    .hui-author-actions {
        width: 100%;
        justify-content: center;
    }
    
    .hui-author-message-btn,
    .hui-author-follow-btn {
        flex: 1;
        max-width: 120px;
    }
}

/* 编辑个人资料按钮 - 使用父主题配色变量 */
.hui-author-edit-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #fff;
    background: var(--xun-primary, var(--color-primary));
    border: none;
    border-radius: var(--xun-radius, 8px);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth, ease);
    white-space: nowrap;
    box-shadow: var(--shadow-xs);
}

.hui-author-edit-profile-btn svg {
    flex-shrink: 0;
}

.hui-author-edit-profile-btn:hover {
    color: #fff;
    background: var(--xun-primary-hover, var(--color-primary-hover));
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.hui-author-edit-profile-btn:active {
    background: var(--xun-primary-active, var(--color-primary-active));
    transform: translateY(0);
}

/* 响应式 - 移动端 */
@media (max-width: 768px) {
    .hui-author-edit-profile-btn {
        flex: 1;
        max-width: 200px;
    }
}

/* 作者页面头像认证徽章 - 增大尺寸 */
.hui-author-avatar .xun-avatar-verified-badge {
    width: 32px;
    height: 32px;
    bottom: 2px;
    right: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hui-author-avatar .xun-avatar-verified-badge img,
.hui-author-avatar .xun-avatar-verified-badge svg {
    width: 28px;
    height: 28px;
}

/* 响应式 - 移动端认证徽章 */
@media (max-width: 768px) {
    .hui-author-avatar .xun-avatar-verified-badge {
        width: 26px;
        height: 26px;
        bottom: 1px;
        right: 1px;
    }
    
    .hui-author-avatar .xun-avatar-verified-badge img,
    .hui-author-avatar .xun-avatar-verified-badge svg {
        width: 22px;
        height: 22px;
    }
}
