/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s;
}

.stats-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 统计面板 */
.stats-panel {
    background: white;
    margin: 1rem 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stats-panel h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.stats-item h4 {
    margin-bottom: 1rem;
    color: #666;
}

.top-tools-list, .daily-stats-list {
    list-style: none;
}

.top-tools-list li, .daily-stats-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.top-tools-list li:last-child, .daily-stats-list li:last-child {
    border-bottom: none;
}

/* 主内容区域 */
.main-content {
    padding: 2rem;
}

/* 筛选区域 */
.filter-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* 搜索框 */
.search-container {
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #667eea;
}

/* 排序选择器 */
.sort-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
    background: white;
}

.sort-select:focus {
    border-color: #667eea;
}

/* 分类筛选 */
.category-filter {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

/* 结果统计 */
.results-info {
    margin-bottom: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.results-info p {
    margin: 0;
}

.filter-btn {
    background: white;
    border: 2px solid #e1e5e9;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tool-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.tool-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.tool-category {
    display: inline-block;
    background: #f0f2f5;
    color: #667eea;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 95%;
    height: 95%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.tool-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 12px 12px;
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filter-section {
        gap: 0.5rem;
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        min-width: auto;
        max-width: none;
    }

    .sort-container {
        align-self: flex-start;
    }

    .category-filter {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }

    .modal-content {
        width: 98%;
        height: 98%;
        border-radius: 8px;
    }


    .floating-wechat {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }

    .qr-modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }

    .qr-code {
        width: 150px;
        height: 150px;
    }
}


.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 智能体卡片样式 */
.agent-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.agent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.agent-url {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    word-break: break-all;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.usage-count {
    font-size: 0.8rem;
    color: #27ae60;
    margin-top: 0.5rem;
    font-weight: 500;
}

.tool-thumbnail {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 4px solid #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem;
    border-radius: 4px;
}

/* 部分内部的空状态 */
.content-section .empty-state {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    margin-bottom: 1rem;
}

.content-section .empty-state p {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0.5rem 0;
    font-weight: 500;
}


/* 浮动微信二维码 */
.floating-wechat {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #07C160, #00A857);
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(7, 193, 96, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: gentlePulse 3s infinite;
    width: 3.5rem;
    height: 3.5rem;
}

.floating-wechat:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(7, 193, 96, 0.6);
}

.floating-wechat-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

@keyframes gentlePulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(7, 193, 96, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(7, 193, 96, 0.6); }
}

/* 二维码弹窗 */
.qr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.qr-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-modal-header {
    margin-bottom: 1.5rem;
}

.qr-modal-header h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.5rem;
}

.qr-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qr-close-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-code {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.qr-text {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

.qr-subtitle {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}