/**
 * HuSNS - 发现页面样式 (美化版)
 */

/* 页面容器 */
.discover-content {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding-bottom: env(safe-area-inset-bottom);
}

/* 搜索栏 */
.discover-search-wrapper {
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0 0 24px 24px;
    position: relative;
}

.discover-search {
    padding: 12px 0;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 12px 20px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-input-wrapper:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-icon {
    font-size: 20px;
    color: #667eea;
    margin-right: 12px;
}

.search-input {
    flex: 1;
    font-size: 15px;
    color: #666;
}

/* 快捷入口 */
.quick-entry {
    display: flex;
    justify-content: space-around;
    padding: 24px 16px;
    margin-top: -12px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin-left: 16px;
    margin-right: 16px;
    position: relative;
    z-index: 10;
}

.quick-entry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.quick-entry-item:active {
    transform: scale(0.9);
}

.quick-entry-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.quick-entry-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.quick-entry-icon.hot {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    box-shadow: 0 4px 12px rgba(238, 90, 90, 0.3);
}

.quick-entry-icon.circle {
    background: linear-gradient(135deg, #4ecdc4 0%, #3dbdb5 100%);
    box-shadow: 0 4px 12px rgba(61, 189, 181, 0.3);
}

.quick-entry-icon.trend {
    background: linear-gradient(135deg, #45b7d1 0%, #3aa5bd 100%);
    box-shadow: 0 4px 12px rgba(58, 165, 189, 0.3);
}

.quick-entry-icon.rank {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
    box-shadow: 0 4px 12px rgba(240, 147, 43, 0.3);
}

.quick-entry-text {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* 内容区块 */
.discover-section {
    padding: 24px 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.section-icon.trending {
    background: linear-gradient(135deg, #45b7d1 0%, #3aa5bd 100%);
}

.section-icon.recommend {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

.section-icon.hot {
    background: linear-gradient(135deg, #f0932b 0%, #f9ca24 100%);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.section-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
}

.section-more:active {
    color: #667eea;
}

.section-more svg {
    transition: transform 0.2s ease;
}

.section-more:active svg {
    transform: translateX(4px);
}

/* 热门话题网格 */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.topic-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.topic-card:active {
    transform: scale(0.97);
}

.topic-card:nth-child(even) {
    background: linear-gradient(135deg, #f0932b 0%, #f5576c 100%);
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.2);
}

.topic-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-card-icon .iconify {
    font-size: 20px;
    color: #fff;
}

.topic-card-content {
    flex: 1;
}

.topic-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topic-card-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* 推荐用户滚动 */
.user-scroll-wrapper {
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px;
    -webkit-overflow-scrolling: touch;
}

.user-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.user-scroll {
    display: flex;
    gap: 12px;
    padding: 4px 0;
}

.user-card {
    flex-shrink: 0;
    width: 100px;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.user-card:active {
    transform: scale(0.95);
}

.user-card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 3px solid #f0f0f0;
}

.user-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-card-followers {
    font-size: 12px;
    color: #999;
}

/* 热门帖子列表 */
.hot-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hot-post-item {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.hot-post-item:active {
    transform: scale(0.98);
}

.hot-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.hot-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid #f0f0f0;
}

.hot-post-user {
    flex: 1;
}

.hot-post-username {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.hot-post-time {
    font-size: 12px;
    color: #999;
}

.hot-post-content {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.hot-post-images {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
}

.hot-post-images.single {
    grid-template-columns: 1fr;
}

.hot-post-images.multiple {
    grid-template-columns: repeat(3, 1fr);
}

.hot-post-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    background: #f5f5f5;
}

.hot-post-images.single .hot-post-image {
    max-height: 200px;
    aspect-ratio: auto;
}

.hot-post-stats {
    display: flex;
    gap: 16px;
}

.hot-post-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #999;
}

.hot-post-stat .iconify {
    font-size: 16px;
}

/* 加载状态 */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

.loading-text {
    font-size: 14px;
    color: #999;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    width: 100%;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-text {
    font-size: 14px;
    color: #999;
}

/* 底部留白 */
.discover-bottom-spacer {
    height: 20px;
}

/* 暗黑模式 */
.dark-mode .discover-content {
    background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 100%);
}

.dark-mode .quick-entry {
    background: #2a2a2a;
}

.dark-mode .quick-entry-text {
    color: #fff;
}

.dark-mode .section-title {
    color: #fff;
}

.dark-mode .section-more {
    color: #666;
}

.dark-mode .user-card {
    background: #2a2a2a;
}

.dark-mode .user-card-name {
    color: #fff;
}

.dark-mode .hot-post-item {
    background: #2a2a2a;
}

.dark-mode .hot-post-username {
    color: #fff;
}

.dark-mode .hot-post-content {
    color: #ccc;
}

.dark-mode .hot-post-avatar {
    border-color: #3a3a3a;
}

.dark-mode .user-card-avatar {
    border-color: #3a3a3a;
}

/* 响应式设计 */
@media (max-width: 320px) {
    .quick-entry-icon {
        width: 48px;
        height: 48px;
    }

    .quick-entry-icon svg {
        width: 24px;
        height: 24px;
    }

    .topic-grid {
        grid-template-columns: 1fr;
    }

    .user-card {
        width: 90px;
    }

    .user-card-avatar {
        width: 56px;
        height: 56px;
    }
}
