/* 粉丝/关注页面样式 - 全新美化版 */

/* ========== 变量定义 ========== */
:root {
    --fans-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --fans-primary-solid: #667eea;
    --fans-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --fans-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --fans-heart: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --fans-glow: 0 8px 32px rgba(102, 126, 234, 0.3);
    --fans-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --fans-card-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ========== 页面包装器 ========== */
.fans-wrapper {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
}

@media (prefers-color-scheme: dark) {
    .fans-wrapper {
        background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    }
}

/* ========== 页面头部 ========== */
.fans-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: env(safe-area-inset-top) 0 0 0;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--fans-primary);
    z-index: -1;
}

.header-bg::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -10%;
    right: -10%;
    height: 40px;
    background: linear-gradient(180deg, #f8fafc 0%, transparent 100%);
    border-radius: 50% 50% 0 0;
}

@media (prefers-color-scheme: dark) {
    .header-bg::after {
        background: linear-gradient(180deg, #1a1a2e 0%, transparent 100%);
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    backdrop-filter: blur(10px);
}

.fans-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.fans-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.fans-back svg {
    flex-shrink: 0;
}

.fans-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin: 0;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title-icon {
    animation: heartBeat 1.5s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
}

.fans-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.fans-actions:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ========== 标签栏样式 ========== */
.follow-tabs {
    background: white;
    position: sticky;
    top: calc(env(safe-area-inset-top) + 64px);
    z-index: 90;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .follow-tabs {
        background: #252542;
    }
}

.follow-tab-bar {
    display: flex;
    position: relative;
    height: 56px;
    max-width: 360px;
    margin: 0 auto;
    padding: 0 16px;
}

.follow-tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-secondary-color);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 2;
}

.tab-icon {
    transition: all 0.3s ease;
    opacity: 0.7;
}

.follow-tab-item.active {
    color: var(--fans-primary-solid);
    font-weight: 600;
}

.follow-tab-item.active .tab-icon {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(102, 126, 234, 0.5));
}

.tab-indicator {
    position: absolute;
    bottom: 8px;
    left: 16px;
    width: calc(50% - 16px);
    height: 3px;
    background: var(--fans-primary);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.follow-tab-item[data-tab="followers"].active ~ .tab-indicator {
    transform: translateX(100%);
}

.tab-count {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--background-color);
    border-radius: 10px;
    color: var(--text-secondary-color);
    transition: all 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .tab-count {
        background: #363654;
    }
}

.follow-tab-item.active .tab-count {
    background: rgba(102, 126, 234, 0.15);
    color: var(--fans-primary-solid);
}

/* ========== 用户列表 ========== */
.user-list {
    margin: 16px;
    margin-top: 12px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: white;
    border-radius: 16px;
    margin-bottom: 10px;
    box-shadow: var(--fans-card-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.user-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--fans-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.user-item:hover {
    box-shadow: var(--fans-card-shadow-hover);
    transform: translateY(-2px);
}

.user-item:hover::before {
    transform: scaleX(1);
}

@media (prefers-color-scheme: dark) {
    .user-item {
        background: #2a2a48;
    }
}

.user-item-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin-right: 14px;
    flex-shrink: 0;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.user-item:hover .user-item-avatar {
    transform: scale(1.05);
    border-color: var(--fans-primary-solid);
}

.user-item-avatar.default {
    background: var(--fans-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
}

.user-item-info {
    flex: 1;
    min-width: 0;
}

.user-item-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.user-item-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--fans-secondary);
    color: white;
    border-radius: 6px;
    font-weight: 600;
}

.user-item-badge.vip {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
}

.user-item-bio {
    font-size: 13px;
    color: var(--text-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========== 关注按钮 ========== */
.follow-btn {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.follow-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.follow-btn:hover::before {
    left: 100%;
}

.follow-btn:active {
    transform: scale(0.95);
}

.follow-btn.following {
    background: linear-gradient(135deg, #e8eaf6 0%, #e0e0e0 100%);
    color: var(--fans-primary-solid);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.follow-btn.following:hover {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: #ef5350;
    color: #ef5350;
}

.follow-btn.following:hover::after {
    content: '取消';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.follow-btn.following span {
    visibility: hidden;
}

.follow-btn.not-following {
    background: var(--fans-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.follow-btn.not-following:hover {
    background: var(--fans-secondary);
    box-shadow: 0 6px 16px rgba(245, 87, 108, 0.4);
    transform: translateY(-2px);
}

.follow-btn.cancel {
    background: transparent;
    color: var(--text-secondary-color);
    border: 1px solid var(--border-color);
}

/* ========== 空状态 ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--fans-primary-solid);
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.empty-icon::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 2px dashed rgba(102, 126, 234, 0.3);
    animation: rotate 10s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.empty-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 14px;
    color: var(--text-secondary-color);
    margin-bottom: 24px;
}

.empty-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--fans-primary);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.empty-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* ========== 标签页内容 ========== */
.tab-content {
    display: none;
    padding-top: 0;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 加载更多 ========== */
.load-more {
    padding: 20px 16px;
    text-align: center;
}

.load-more-btn {
    padding: 12px 32px;
    background: white;
    border: 2px solid var(--fans-primary-solid);
    border-radius: 24px;
    color: var(--fans-primary-solid);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: var(--fans-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

@media (prefers-color-scheme: dark) {
    .load-more-btn {
        background: #2a2a48;
    }
}

/* ========== 响应式调整 ========== */
@media (max-width: 320px) {
    .fans-header {
        padding: 8px 12px;
    }
    
    .fans-title {
        font-size: 16px;
    }
    
    .follow-tab-bar {
        height: 50px;
    }
    
    .user-item {
        padding: 12px 14px;
    }
    
    .user-item-avatar {
        width: 46px;
        height: 46px;
    }
}

/* ========== 动画效果 ========== */
.user-item {
    animation: slideIn 0.4s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 交错动画 */
.user-item:nth-child(1) { animation-delay: 0.05s; }
.user-item:nth-child(2) { animation-delay: 0.1s; }
.user-item:nth-child(3) { animation-delay: 0.15s; }
.user-item:nth-child(4) { animation-delay: 0.2s; }
.user-item:nth-child(5) { animation-delay: 0.25s; }
.user-item:nth-child(6) { animation-delay: 0.3s; }
.user-item:nth-child(7) { animation-delay: 0.35s; }
.user-item:nth-child(8) { animation-delay: 0.4s; }
.user-item:nth-child(9) { animation-delay: 0.45s; }
.user-item:nth-child(10) { animation-delay: 0.5s; }
