* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: #333;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.loading {
    text-align: center;
    color: #666;
    font-size: 1.2rem;
    margin: 50px 0;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* 平板设备适配 */
@media (max-width: 1024px) {
    .platforms-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .container {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
}

.platform-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* 移动端平台卡片优化 */
@media (max-width: 768px) {
    .platform-card {
        box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    }
    
    .platform-card:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    }
}

/* 移动端平台卡片优化 - 移除滚动条 */
@media (max-width: 480px) {
    .platform-card {
        /* 移除最大高度限制和滚动条 */
        overflow: visible;
    }
}

.platform-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.platform-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1rem;
    background-size: 20px 20px;
    background-repeat: no-repeat;
    background-position: center;
}

.platform-title {
    flex: 1;
}

.platform-title h2 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.platform-date {
    color: #666;
    font-size: 0.9rem;
}

.hot-list {
    list-style: none;
}

.hot-item {
    padding: 8px 10px;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    margin: 0 -10px;
    border-radius: 8px;
}

/* 确保序号图标和文本垂直对齐 */
.hot-number {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hot-link {
    display: flex;
    align-items: center;
    flex: 1;
}

.hot-item:last-child {
    border-bottom: none;
}

.hot-item:hover {
    background-color: #f8f9fa;
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .hot-item:active {
        background-color: #e9ecef;
    }
    
    .platform-card:active {
        transform: scale(0.98);
    }
    
    .refresh-btn:active {
        transform: scale(0.9);
    }
    
    /* 增加触摸区域 */
    .hot-item {
        min-height: 44px; /* iOS推荐的最小触摸区域 */
    }
    
    .hot-link {
        padding: 4px 0;
    }
}

.hot-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.hot-link {
    text-decoration: none;
    color: #333;
    display: block;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: color 0.2s ease;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

/* 移动端链接优化 */
@media (max-width: 768px) {
    .hot-link {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.4;
        min-height: 2.8em;
        margin-top: 4px;
    }
}

/* 移动端加载状态优化 */
@media (max-width: 480px) {
    .loading {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .loading::after {
        margin-left: 0;
        margin-top: 10px;
    }
}

.hot-link:hover {
    color: #667eea;
}

.refresh-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
    -webkit-touch-callout: none; /* 禁用长按菜单 */
    -webkit-user-select: none; /* 禁用文本选择 */
    user-select: none;
}

/* 防止移动端横向滚动 */
body {
    overflow-x: hidden;
}

/* 优化移动端滚动体验 */
.platforms-grid {
    -webkit-overflow-scrolling: touch;
}

.platform-card {
    -webkit-overflow-scrolling: touch;
}

/* 移动端链接优化 */
.hot-link {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    position: relative;
}

/* 移动端字体优化 */
@media (max-width: 768px) {
    body {
        font-size: 14px; /* 基础字体大小 */
        line-height: 1.5;
    }
    
    .header h1 {
        font-weight: 600;
    }
    
    .platform-title h2 {
        font-weight: 600;
    }
    
    .hot-link {
        font-weight: 500;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
}

@media (max-width: 320px) {
    body {
        font-size: 12px;
    }
}

.refresh-btn:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

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

.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid #fcc;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .platforms-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .platform-card {
        padding: 20px;
    }

    .refresh-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* 大屏手机设备适配 */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .header {
        margin-bottom: 30px;
    }

    .header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .header p {
        font-size: 1rem;
    }

    .platforms-grid {
        gap: 15px;
        margin-top: 20px;
    }

    .platform-card {
        padding: 15px;
        border-radius: 12px;
    }

    .platform-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .platform-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
        margin-right: 10px;
    }

    .platform-title h2 {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }

    .platform-date {
        font-size: 0.8rem;
    }

    .hot-item {
        padding: 6px 8px; /* 减少上下间距 */
        margin: 0 -8px;
        align-items: center; /* 移动端使用居中对齐 */
    }
    
    .hot-number {
        align-items: center;
        padding-top: 0; /* 移除顶部padding，确保居中 */
    }
    
    .hot-link {
        align-items: center;
        padding-top: 0; /* 移除顶部padding，确保居中 */
        line-height: 1.2; /* 调整行高确保文字垂直居中 */
        display: flex; /* 使用flex确保文字垂直居中 */
        align-items: center; /* 文字内容垂直居中 */
        margin-top: 4px;
    }

    .hot-number {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
        margin-right: 10px;
    }

    .hot-link {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .refresh-btn {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .loading {
        font-size: 1.1rem;
        margin: 40px 0;
    }

    .loading::after {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
}

/* 小屏手机设备适配 */
@media (max-width: 320px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .platforms-grid {
        gap: 12px;
    }

    .platform-card {
        padding: 12px;
    }

    .platform-icon {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
        margin-right: 8px;
    }

    .platform-title h2 {
        font-size: 1.1rem;
    }

    .hot-item {
        padding: 5px 6px; /* 减少上下间距 */
        margin: 0 -6px;
        align-items: center; /* 小屏手机也使用居中对齐 */
    }
    
    .hot-number {
        align-items: center;
        padding-top: 0; /* 移除顶部padding，确保居中 */
    }
    
    .hot-link {
        align-items: center;
        padding-top: 0; /* 移除顶部padding，确保居中 */
        line-height: 1.1; /* 调整行高确保文字垂直居中 */
        display: flex; /* 使用flex确保文字垂直居中 */
        align-items: center; /* 文字内容垂直居中 */
        margin-top: 4px;
    }

    .hot-number {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        margin-right: 8px;
    }

    .hot-link {
        font-size: 0.85rem;
    }

    .refresh-btn {
        bottom: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .loading {
        font-size: 1rem;
        margin: 30px 0;
    }
}

/* 移动端提示样式 */
.mobile-hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-hint.show {
    opacity: 1;
}

/* 移动端特定的优化 */
@media (max-width: 768px) {
    .mobile-hint {
        bottom: 80px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    /* 优化移动端的错误消息 */
    .error-message {
        margin: 15px 0;
        padding: 12px;
        font-size: 14px;
    }
    
    /* 优化移动端的加载状态 */
    .loading {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .mobile-hint {
        bottom: 70px;
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .error-message {
        margin: 10px 0;
        padding: 10px;
        font-size: 13px;
    }
}

/* 移动端滚动条优化 */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 2px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* 移动端字体渲染优化 */
@media (max-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    .header h1,
    .platform-title h2 {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 移动端动画性能优化 */
@media (max-width: 768px) {
    .platform-card,
    .refresh-btn,
    .hot-item {
        will-change: transform;
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}