/* AI工具导航网站样式文件 */

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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 25px rgba(37, 99, 235, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 头部导航 ===== */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 28px;
}

.search-box {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-box form {
    display: flex;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.search-box form:focus-within {
    border-color: var(--primary-color);
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
}

.search-box button {
    padding: 12px 25px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--primary-hover);
}

.header-links {
    display: flex;
    gap: 15px;
}

.btn-submit, .btn-admin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-submit {
    background: var(--primary-color);
    color: white;
}

.btn-submit:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-admin {
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-admin:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ===== 主内容布局 ===== */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.layout {
    display: flex;
    gap: 30px;
}

/* ===== 左侧侧边栏 ===== */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 15px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.sidebar-title i {
    color: var(--primary-color);
}

.category-nav {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 20px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    color: var(--text-secondary);
    transition: all 0.3s;
    border-bottom: 1px solid var(--border-color);
}

.category-link:last-child {
    border-bottom: none;
}

.category-link:hover {
    background: var(--bg-color);
    color: var(--primary-color);
    padding-left: 20px;
}

.category-link i {
    width: 20px;
    text-align: center;
}

.sidebar-section {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 15px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 12px;
    background: var(--bg-color);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.stats-label {
    color: var(--text-secondary);
}

.stats-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== 右侧内容区 ===== */
.content {
    flex: 1;
    min-width: 0;
}

/* ===== 推荐工具区 ===== */
.featured-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    color: var(--text-primary);
}

.section-header h2 i {
    color: #f59e0b;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.featured-card {
    position: relative;
    border-color: #f59e0b !important;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%) !important;
}

/* ===== 工具卡片 ===== */
.tool-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.tool-logo {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-placeholder {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-visit {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.3s;
    flex-shrink: 0;
}

.tool-card:hover .tool-visit {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.tool-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

/* ===== 分类区块 ===== */
.category-section {
    margin-bottom: 50px;
    scroll-margin-top: 100px;
}

.category-section .section-header {
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
}

.empty-category {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-category i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ===== 底部 ===== */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 50px;
}

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

.footer-info p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 5px;
}

.footer-desc {
    font-size: 12px !important;
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
    }
    
    .search-box {
        margin: 0 25px;
    }
}

@media (max-width: 992px) {
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
    
    .category-nav {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .category-link {
        border-right: 1px solid var(--border-color);
    }
    
    .category-link:hover {
        padding-left: 15px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }
    
    .search-box {
        order: 3;
        margin: 0;
        max-width: 100%;
        width: 100%;
    }
    
    .header-links {
        order: 2;
    }
    
    .logo {
        order: 1;
    }
    
    .category-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .category-nav {
        grid-template-columns: 1fr;
    }
    
    .category-link {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .btn-submit span {
        display: none;
    }
    
    .btn-submit {
        padding: 10px 15px;
    }
}
