/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-logo i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* 主要内容 */
.main-content {
    min-height: calc(100vh - 120px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 4rem 0;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    margin-bottom: 3rem;
    color: white;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* 搜索框 */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border-radius: 50px;
    outline: none;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 统计信息 */
.stats {
    margin-bottom: 3rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 1rem;
}

/* 区域样式 */
.section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
}

/* 磁力链接网格 */
.magnet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.magnet-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 磁力链接卡片 */
.magnet-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.magnet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.magnet-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.magnet-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.magnet-size {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

.magnet-date {
    color: #999;
}

.magnet-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: white;
    color: #666;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 搜索页面 */
.search-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.search-info {
    color: #666;
    margin-top: 0.5rem;
}

/* 分类网格 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.category-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.category-count {
    color: #666;
    font-size: 1rem;
}

/* 详情页 */
.magnet-detail {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.detail-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.detail-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.detail-label {
    font-weight: 600;
    color: #666;
    margin-bottom: 0.5rem;
}

.detail-value {
    color: #333;
    word-break: break-all;
}

/* 页脚 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

.loading.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }

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

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

    .search-container {
        max-width: 100%;
        padding: 0 1rem;
        margin: 0 auto;
    }

    .search-box {
        flex-direction: row;
        gap: 0;
        padding: 0.3rem;
        max-width: 100%;
        width: 100%;
    }

    .search-box input {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        flex: 1;
        min-width: 0;
        border-radius: 25px 0 0 25px;
    }

    .search-btn {
        border-radius: 0 25px 25px 0;
        padding: 0.8rem 1rem;
        flex-shrink: 0;
        min-width: 50px;
    }

    .stats-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-item {
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .magnet-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .magnet-card {
        padding: 1rem;
    }

    .magnet-title {
        font-size: 1rem;
        -webkit-line-clamp: 3;
    }

    .magnet-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .magnet-actions {
        width: 100%;
        justify-content: space-between;
    }

    .btn {
        flex: 1;
        justify-content: center;
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .category-card {
        padding: 1.5rem;
    }

    .detail-info {
        grid-template-columns: 1fr;
    }

    .detail-item {
        padding: 0.8rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .pagination button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    /* 列表页手机端适配 */
    .magnet-list-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .magnet-table {
        font-size: 0.8rem;
        margin-top: 1rem;
    }

    .magnet-table th,
    .magnet-table td {
        padding: 8px 10px;
    }

    .magnet-table th:nth-child(2),
    .magnet-table td:nth-child(2) {
        display: none; /* 在手机端隐藏大小列 */
    }

    .magnet-table th:nth-child(3),
    .magnet-table td:nth-child(3) {
        display: none; /* 在手机端隐藏日期列 */
    }

    .copy-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    .copy-btn i {
        display: none; /* 隐藏图标，只显示文字 */
    }

    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .pagination-controls button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 200px;
    }

    .pagination-controls span {
        font-size: 1rem;
        order: -1; /* 将页面信息放在按钮上方 */
    }
}

/* 超小屏幕适配 (小于480px) */
@media (max-width: 480px) {
    .nav-logo {
        font-size: 1.2rem;
    }

    .nav-logo i {
        font-size: 1.4rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .search-box input {
        font-size: 0.8rem;
        padding: 0.7rem 0.8rem;
    }

    .search-btn {
        padding: 0.7rem 0.8rem;
        min-width: 45px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .magnet-card {
        padding: 0.8rem;
    }

    .magnet-title {
        font-size: 0.9rem;
    }

    .btn {
        font-size: 0.7rem;
        padding: 0.5rem 0.6rem;
    }

    /* 列表页超小屏幕适配 */
    .magnet-list-container h1 {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 1rem;
    }

    .magnet-table {
        font-size: 0.7rem;
    }

    .magnet-table th,
    .magnet-table td {
        padding: 6px 8px;
    }

    .copy-btn {
        padding: 4px 8px;
        font-size: 0.6rem;
    }

    /* 表格在超小屏幕上的特殊处理 */
    .magnet-table td:first-child {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* 搜索提示样式 */
.search-tips {
    margin-top: 2rem;
    text-align: center;
}

.search-tips p {
    color: #666;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    border-radius: 25px;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 快速链接样式 */
.quick-links {
    padding: 3rem 0;
    background: white;
    margin-top: 2rem;
}

.quick-links-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.quick-links h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #333;
}

.quick-link-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quick-link-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quick-link-item i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #667eea;
    transition: color 0.3s ease;
}

.quick-link-item:hover i {
    color: white;
}

.quick-link-item span {
    font-size: 1rem;
    font-weight: 500;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .search-tips p {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .quick-link-items {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .quick-link-item {
        padding: 1.5rem 0.8rem;
    }
    
    .quick-link-item i {
        font-size: 2rem;
    }
    
    .quick-link-item span {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .quick-link-items {
        grid-template-columns: 1fr;
    }
}

