/* static/css/style.css - 优化后的响应式样式 */
:root {
    --primary-color: #6366f1;
    --secondary-color: #10b981;
    --background-color: #f8fafc;
    --text-color: #334155;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

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

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.header h1 {
    margin-bottom: 0.5rem;
    font-size: clamp(1.8rem, 4vw, 2.5rem); /* 响应式字体 */
}

.header p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    opacity: 0.9;
    margin: 0;
}

/* 主内容区网格布局 - 电脑端3列，平板2列，手机1列 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
}

.card-header i.fa-cube {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 1rem;
}

.tool-icon {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    border-radius: 8px;
}

.card-header h3 {
    margin: 0;
    flex-grow: 1;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.hot-badge {
    background: #ef4444;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.tool-description {
    color: #64748b;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.category {
    background: #f1f5f9;
    color: #475569;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.button {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.button:hover {
    background: #5b5cdb;
}

.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
}
/* 搜索区域样式 */
.search-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    gap: 0;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

#searchInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    font-size: 1.1rem;
    outline: none;
}

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #5a6fd8;
}

/* 分类筛选器 */
.category-filter {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem auto;
    max-width: 1200px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 搜索结果信息 */
.search-results-info {
    background: #e7f3ff;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    text-align: center;
}

.clear-filters {
    margin-left: 1rem;
    color: var(--primary-color);
    text-decoration: none;
}

.clear-filters:hover {
    text-decoration: underline;
}

/* 无结果状态 */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

/* 实时搜索建议样式 */
.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-top: 5px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

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

.suggestion-item i {
    color: var(--primary-color);
    width: 20px;
}

.suggestion-item strong {
    color: var(--primary-color);
}

/* 搜索输入组相对定位 */
.search-input-group {
    position: relative;
}
/* ==================== 响应式断点 ==================== */

/* 平板端 (768px - 1024px) */
@media (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .container {
        padding: 0 1.5rem;
    }
}

/* 大手机端 (576px - 768px) */
@media (max-width: 768px) {
    .tool-grid {
        grid-template-columns: 1fr; /* 单列显示 */
        gap: 1rem;
    }
    
    .header {
        padding: 2rem 0;
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .card-footer .button {
        align-self: stretch;
        text-align: center;
    }
}

/* 小手机端 (< 576px) */
@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .header {
        padding: 1.5rem 0;
    }
    
    .card {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .card-header {
        flex-wrap: wrap;
    }
    
    .card-header h3 {
        font-size: 1.2rem;
    }
}

/* 超大桌面端 (> 1440px) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .tool-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
}