/**
 * 磁力搜索页面样式 - 蔚蓝意式风格
 *
 * @package NordicTimeline
 * @version 1.0.0
 */

/* 页面容器 */
.magnet-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 60px;
    min-height: calc(100vh - 200px);
}

/* 搜索区域 */
.magnet-hero {
    padding-top: 80px;
    text-align: center;
}

.magnet-title {
    font-family: var(--font-wenkai, 'LXGWWenKaiLite-Regular', Georgia, serif);
    font-size: 48px;
    font-weight: 400;
    color: #4A8DB7;
    margin: 0 0 12px;
    letter-spacing: 2px;
}

.magnet-subtitle {
    font-size: 14px;
    color: #8A8275;
    margin: 0 0 40px;
    letter-spacing: 1px;
}

/* 搜索框 */
.magnet-search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 28px;
    border: 2px solid #4A8DB7;
    background: #fff;
    box-shadow: 0 4px 20px rgba(74, 141, 183, 0.15);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.magnet-search-box:focus-within {
    box-shadow: 0 6px 30px rgba(74, 141, 183, 0.25);
}

.magnet-search-box input {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 18px;
    font-family: var(--font-body, -apple-system, 'Noto Sans SC', sans-serif);
    color: #2C2C2C;
    background: transparent;
    outline: none;
}

.magnet-search-box input::placeholder {
    color: #B0A89C;
}

.magnet-search-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: linear-gradient(135deg, #4A8DB7 0%, #3A7CA7 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.magnet-search-btn:hover {
    background: linear-gradient(135deg, #3A7CA7 0%, #2A6C97 100%);
}

.magnet-search-btn svg {
    width: 20px;
    height: 20px;
}

/* 搜索源切换 */
.magnet-sources {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.magnet-source-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #4A8DB7;
    background: transparent;
    color: #4A8DB7;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body, -apple-system, 'Noto Sans SC', sans-serif);
}

.magnet-source-btn:hover {
    background: rgba(74, 141, 183, 0.08);
}

.magnet-source-btn.active {
    background: linear-gradient(135deg, #4A8DB7 0%, #3A7CA7 100%);
    color: #fff;
    border-color: #4A8DB7;
}

/* 搜索历史 */
.magnet-history {
    margin-top: 40px;
    text-align: center;
}

.magnet-history-title {
    font-size: 14px;
    color: #8A8275;
    margin: 0 0 16px;
    font-weight: 400;
    letter-spacing: 1px;
}

.magnet-history-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.history-tag {
    padding: 6px 14px;
    border-radius: 16px;
    background: rgba(74, 141, 183, 0.06);
    color: #4A8DB7;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.history-tag:hover {
    border-color: #4A8DB7;
    background: rgba(74, 141, 183, 0.1);
}

.magnet-history-clear {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: #B0A89C;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.magnet-history-clear:hover {
    color: #8A8275;
}

/* 搜索结果 */
.magnet-results {
    margin-top: 40px;
}

.magnet-results-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E8E2D9;
}

.magnet-results-count {
    font-size: 14px;
    color: #8A8275;
}

.magnet-results-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* 结果项 */
.magnet-result-item {
    padding: 16px 20px;
    border-bottom: 1px solid #F0EDE8;
    transition: background 0.3s ease;
}

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

.magnet-result-item:hover {
    background: #FAF8F5;
}

.result-name {
    font-size: 16px;
    font-weight: 600;
    color: #2C2C2C;
    margin: 0 0 8px;
    line-height: 1.5;
}

.result-name .highlight {
    color: #4A8DB7;
    font-weight: 700;
}

.result-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #8A8275;
}

.result-size,
.result-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.result-size::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8275' stroke-width='2'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") center/contain no-repeat;
}

.result-date::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8275' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
}

.result-copy-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #4A8DB7;
    background: transparent;
    color: #4A8DB7;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body, -apple-system, 'Noto Sans SC', sans-serif);
}

.result-copy-btn:hover {
    background: #4A8DB7;
    color: #fff;
}

.result-copy-btn.copied {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

/* 无结果提示 */
.magnet-no-result {
    padding: 60px 20px;
    text-align: center;
    color: #8A8275;
    font-size: 14px;
}

/* 加载更多 */
.magnet-load-more {
    text-align: center;
    margin-top: 24px;
}

.magnet-load-more-btn {
    padding: 10px 28px;
    border-radius: 24px;
    border: 1px solid #4A8DB7;
    background: transparent;
    color: #4A8DB7;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-body, -apple-system, 'Noto Sans SC', sans-serif);
}

.magnet-load-more-btn:hover {
    background: #4A8DB7;
    color: #fff;
}

.magnet-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading 动画 */
.magnet-loading {
    text-align: center;
    padding: 60px 20px;
}

.magnet-loading p {
    margin-top: 16px;
    color: #8A8275;
    font-size: 14px;
}

.magnet-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid rgba(74, 141, 183, 0.2);
    border-top-color: #4A8DB7;
    border-radius: 50%;
    animation: magnet-spin 0.8s linear infinite;
}

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

/* 响应式适配 */
@media (max-width: 768px) {
    .magnet-page {
        padding: 0 16px 40px;
    }
    
    .magnet-hero {
        padding-top: 40px;
    }
    
    .magnet-title {
        font-size: 36px;
    }
    
    .magnet-subtitle {
        margin-bottom: 24px;
    }
    
    .magnet-search-box {
        max-width: 100%;
        border-radius: 24px;
    }
    
    .magnet-search-box input {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    .magnet-search-btn {
        width: 52px;
        height: 52px;
    }
    
    .magnet-sources {
        gap: 6px;
    }
    
    .magnet-source-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .magnet-history {
        margin-top: 32px;
    }
    
    .magnet-results {
        margin-top: 32px;
    }
    
    .magnet-result-item {
        padding: 14px 16px;
    }
    
    .result-name {
        font-size: 15px;
    }
    
    .result-meta {
        gap: 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .magnet-title {
        font-size: 28px;
    }
    
    .magnet-search-box {
        border-width: 1.5px;
    }
    
    .magnet-source-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .history-tag {
        padding: 5px 10px;
        font-size: 12px;
    }
}
