/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #059669;
    --primary-light: #10B981;
    --primary-dark: #047857;
    --secondary-color: #06B6D4;
    --accent-color: #3B82F6;
    --bg-color: #F8FAFC;
    --bg-card: #FFFFFF;
    --text-color: #1E293B;
    --text-light: #64748B;
    --text-lighter: #94A3B8;
    --white: #ffffff;
    --border-color: #E2E8F0;
    --shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
    --shadow-card: 0 2px 12px rgba(5, 150, 105, 0.1);
    --shadow-hover: 0 8px 24px rgba(5, 150, 105, 0.15);
    --gold: #F59E0B;
    --silver: #6B7280;
    --bronze: #D97706;
    --gradient-primary: linear-gradient(135deg, #059669 0%, #10B981 100%);
    --gradient-card: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* 导航栏 */
.navbar {
    position: sticky;
    top: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 100;
    height: 72px;
    border-bottom: 1px solid var(--border-color);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 16px;
    position: relative;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-tabs-wrapper {
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 16px;
    min-width: 0;
    position: relative;
    padding-right: 20px;
}

.category-tabs-wrapper::-webkit-scrollbar {
    display: none;
}

.category-tabs {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: max-content;
    padding-right: 16px;
}

.tab {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    background: var(--white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
}

.tab:hover {
    border-color: var(--primary-light);
    color: var(--primary-color);
    background: #F0F9FF;
}

.tab.active {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 0;
}

.filter-select {
    width: 120px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-select:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.1);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.refresh-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-light);
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    background: var(--white);
}

.refresh-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.refresh-btn:active {
    transform: scale(0.98);
}

.refresh-btn svg {
    animation: none;
}

.refresh-btn.loading svg {
    animation: rotate 1s linear infinite;
}

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

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

/* 页面标题 */
.page-header {
    margin-bottom: 32px;
    text-align: center;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 400;
}

/* 热榜列表 */
.hot-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    min-height: 400px;
}

/* 热榜卡片 */
.hot-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: slideUp 0.4s ease forwards;
    opacity: 0;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.hot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hot-card:hover::before {
    opacity: 1;
}

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

.hot-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.hot-card .rank-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--white);
    z-index: 2;
    background: var(--text-lighter);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hot-card .rank-badge.rank-1 {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.hot-card .rank-badge.rank-2 {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
}

.hot-card .rank-badge.rank-3 {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
}

.hot-card .thumbnail-wrapper {
    width: 100%;
    height: 180px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hot-card:hover .thumbnail-wrapper {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.15);
}

.hot-card .thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: scale(1.05);
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
}

.hot-card .thumbnail.loaded {
    opacity: 1;
    transform: scale(1);
}

.hot-card .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.hot-card .title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    transition: color 0.3s ease;
}

.hot-card .title a {
    color: inherit;
    transition: color 0.3s ease;
}

.hot-card .title a:hover {
    color: var(--primary-color);
}

.hot-card .meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hot-card .category-tag {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-color);
    color: var(--text-lighter);
    transition: all 0.2s ease;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hot-card:hover .category-tag {
    transform: translateY(-1px);
}

.hot-card .category-tag.pinpai {
    background: #DBEAFE;
    color: #1E40AF;
}

.hot-card .category-tag.quality-demand {
    background: #FEF3C7;
    color: #92400E;
}

.hot-card .category-tag.standard-crowdfunding {
    background: #D1FAE5;
    color: #065F46;
}

.hot-card .category-tag.shequ {
    background: #E9D5FF;
    color: #6B21A8;
}

.hot-card .category-tag.all {
    background: #E0E7FF;
    color: #3730A3;
}

.hot-card .views,
.hot-card .comments {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.hot-card .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.hot-card .time {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.hot-card .badges {
    display: flex;
    gap: 6px;
}

.hot-card .hot-badge,
.hot-card .new-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.hot-card .hot-badge {
    background: #FEE2E2;
    color: #991B1B;
}

.hot-card .new-badge {
    background: #D1FAE5;
    color: #065F46;
}

.hot-card .price-info {
    margin-top: 4px;
}

.hot-card .price {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.hot-card .price-original {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: line-through;
}

.hot-card .price-discount {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.hot-card .mall {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 加载骨架屏 */
.loading-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

.skeleton-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid var(--border-color);
}

.skeleton-thumbnail {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    background: linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-title {
    height: 20px;
    width: 85%;
}

.skeleton-meta {
    height: 14px;
    width: 60%;
}

.skeleton-footer {
    height: 12px;
    width: 40%;
    margin-top: auto;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 错误状态 */
.error-state,
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.error-icon,
.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.error-message,
.empty-message {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 24px;
    font-weight: 500;
}

.retry-btn {
    padding: 12px 32px;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.retry-btn:active {
    transform: scale(0.98);
}

/* 底部 */
.footer {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
    padding: 32px 0;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

.footer-container a {
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-container a:hover {
    color: var(--primary-light);
}

.footer-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-lighter);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .hot-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .loading-skeleton {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 1023px) {
    .navbar-container {
        padding: 0 20px;
        gap: 12px;
    }

    .category-tabs-wrapper {
        margin: 0 12px;
        padding-right: 12px;
    }

    .category-tabs {
        padding-right: 12px;
    }

    .filters {
        gap: 8px;
    }

    .filter-select {
        width: 100px;
        font-size: 12px;
        padding: 0 10px;
    }

    .container {
        padding: 24px 20px;
    }

    .page-title {
        font-size: 28px;
    }

    .hot-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }

    .loading-skeleton {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .navbar {
        height: auto;
        min-height: 72px;
    }

    .navbar-container {
        flex-wrap: wrap;
        padding: 16px 16px;
        gap: 12px;
    }

    .logo {
        font-size: 18px;
    }

    .logo-icon {
        font-size: 24px;
    }

    .category-tabs-wrapper {
        order: 3;
        width: 100%;
        margin: 0;
        margin-top: 12px;
        padding-right: 0;
    }

    .filters {
        gap: 8px;
    }

    .filter-select {
        width: 90px;
        height: 36px;
        font-size: 12px;
    }

    .refresh-btn {
        width: 36px;
        height: 36px;
    }

    .container {
        padding: 20px 16px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-subtitle {
        font-size: 14px;
    }

    .hot-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .loading-skeleton {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hot-card {
        padding: 16px;
    }

    .hot-card .thumbnail-wrapper {
        height: 160px;
    }

    .hot-card .title {
        font-size: 15px;
    }

    .hot-card .rank-badge {
        width: 32px;
        height: 32px;
        font-size: 14px;
        top: 12px;
        right: 12px;
    }
}

