/* ========================================
   yingjideng — 主样式（V6 性能优化版）
   ======================================== */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --ai-native-color: #dc3545;
    --ai-enhanced-color: #ffc107;
    --traditional-color: #6c757d;
    --ai-recommend-color: #17a2b8;
    --automation-color: #28a745;
}

/* PWA 安装横幅 */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 0;
    z-index: 1050;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.pwa-install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.pwa-install-text {
    font-size: 14px;
    flex: 1;
}

.pwa-install-banner .btn {
    font-size: 13px;
    padding: 4px 12px;
}

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

/* ========================================
   Slogan 横幅
   ======================================== */

.slogan-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 0;
}

.slogan-box h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slogan-box p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
}

/* ========================================
   AI 筛选栏
   ======================================== */

.filter-section {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ai-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.filter-btn, .category-btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover, .category-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active, .category-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    margin: 0 8px;
}

#category-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: 4px;
}

/* ========================================
   工具网格
   ======================================== */

.tools-section {
    padding: 30px 0;
    min-height: 60vh;
}

.result-count {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    /* 确保容器有最小高度，避免虚拟滚动计算错误 */
    min-height: 400px;
}

/* 虚拟滚动容器样式 */
#tools-grid.virtual-scroll-container {
    height: calc(100vh - 280px) !important;
    min-height: 400px !important;
}

/* ========================================
   工具卡片
   ======================================== */

.tool-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.tool-card-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 12px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tool-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.tool-card-body {
    padding: 15px;
}

.tool-description {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tool-price {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}

.tool-price.free { background: #d4edda; color: #155724; }
.tool-price.freemium { background: #fff3cd; color: #856404; }
.tool-price.paid { background: #f8d7da; color: #721c24; }

/* ========================================
   AI 推荐框（传统工具卡片内）
   ======================================== */

.ai-recommend-box {
    margin-top: 12px;
    padding: 10px 12px;
    background: #e8f4fd;
    border-left: 3px solid var(--ai-recommend-color);
    border-radius: 0 4px 4px 0;
    font-size: 12px;
}

.ai-recommend-box .label {
    font-weight: 600;
    color: var(--ai-recommend-color);
    margin-right: 4px;
}

.ai-recommend-box a {
    color: var(--ai-recommend-color);
    font-weight: 600;
    text-decoration: none;
}

.ai-recommend-box a:hover {
    text-decoration: underline;
}

/* ========================================
   自动化标签
   ======================================== */

.automation-box {
    margin-top: 8px;
    padding: 6px 10px;
    background: #f0f8ff;
    border-left: 3px solid var(--automation-color);
    border-radius: 0 4px 4px 0;
    font-size: 11px;
}

.automation-box .label {
    font-weight: 600;
    color: var(--automation-color);
    margin-right: 4px;
}

.automation-box a {
    color: var(--automation-color);
    text-decoration: none;
}

/* ========================================
   模态框
   ======================================== */

.modal-body .tool-detail {
    padding: 10px 0;
}

.modal-body .tool-detail h4 {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
}

.modal-body .tool-detail p {
    margin: 0;
    line-height: 1.7;
}

/* ========================================
   页脚
   ======================================== */

.site-footer {
    background: #2d3748;
    color: #cbd5e0;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-brand h5 {
    color: #fff;
    margin-bottom: 10px;
}

.footer-links h6, .footer-about h6 {
    color: #fff;
    margin-bottom: 12px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 6px;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 13px;
}

.footer-links a:hover {
    color: #fff;
}

.footer-about p {
    font-size: 13px;
    line-height: 1.6;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 15px;
    text-align: center;
    font-size: 12px;
}

.footer-bottom a {
    color: #cbd5e0;
}

/* ========================================
   移动端适配
   ======================================== */

/* ========================================
   用户反馈系统（W5）
   ======================================== */

.feedback-section {
    max-width: 600px;
    margin: 0 auto;
}

.feedback-overview {
    display: flex;
    gap: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: center;
}

.feedback-average {
    text-align: center;
    min-width: 120px;
}

.feedback-rating-number {
    font-size: 42px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
}

.feedback-rating-stars {
    margin: 8px 0;
    font-size: 18px;
}

.feedback-review-count {
    font-size: 12px;
    color: #6c757d;
}

.feedback-distribution {
    flex: 1;
}

.feedback-dist-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.feedback-dist-label {
    width: 30px;
    color: #495057;
}

.feedback-dist-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.feedback-dist-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s;
}

.feedback-dist-count {
    width: 50px;
    text-align: right;
    color: #6c757d;
}

.feedback-dist-empty {
    color: #6c757d;
    font-size: 13px;
    padding: 10px;
}

.feedback-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.feedback-form h5 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #2d3748;
}

.feedback-rating-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.star-rating-input {
    display: flex;
    gap: 4px;
}

.star-input {
    font-size: 28px;
    cursor: pointer;
    color: #ffc107;
    transition: transform 0.15s;
    user-select: none;
}

.star-input:hover,
.star-input.selected {
    transform: scale(1.2);
}

.feedback-form textarea {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}

.feedback-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.feedback-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback-char-count {
    font-size: 12px;
    color: #6c757d;
}

.feedback-list {
    margin-top: 20px;
}

.feedback-list h5 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #2d3748;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.feedback-empty {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-size: 14px;
}

.feedback-review-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.feedback-review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.feedback-review-author {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.feedback-review-date {
    font-size: 12px;
    color: #6c757d;
}

.feedback-review-rating {
    margin-bottom: 8px;
    font-size: 14px;
}

.feedback-review-comment {
    font-size: 14px;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 10px;
}

.feedback-review-actions {
    display: flex;
    gap: 15px;
}

.feedback-like-btn,
.feedback-delete-btn {
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 12px;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.feedback-like-btn:hover {
    color: #667eea;
}

.feedback-delete-btn:hover {
    color: #dc3545;
}

@media (max-width: 768px) {
    .feedback-overview {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .feedback-distribution {
        width: 100%;
    }

    .feedback-dist-row {
        justify-content: flex-start;
    }
}

/* ========================================
   移动端适配
   ======================================== */

@media (max-width: 768px) {
    .slogan-box h2 {
        font-size: 22px;
    }
    
    .slogan-box p {
        font-size: 14px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn, .category-btn {
        text-align: left;
    }
    
    .filter-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
    }
    
    .navbar-brand {
        font-size: 18px;
    }
}

/* ========================================
   搜索高亮
   ======================================== */

mark.search-highlight {
    background-color: rgba(255, 193, 7, 0.4);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 500;
}

/* ========================================
   无结果提示
   ======================================== */

#no-results {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

#no-results h4 {
    margin-bottom: 8px;
}
