/* ===== AI Base 前台样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f7fa; color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; height: 64px; gap: 30px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; color: #1a73e8; }
.logo-icon { font-size: 28px; }
.main-nav { display: flex; gap: 24px; flex: 1; }
.main-nav > a { font-size: 15px; color: #555; padding: 6px 0; border-bottom: 2px solid transparent; transition: .2s; }
.main-nav > a:hover, .main-nav > a.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.nav-dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.12); border-radius: 8px; padding: 8px 0; min-width: 160px; z-index: 200; }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 16px; font-size: 14px; color: #555; }
.dropdown-menu a:hover { background: #f0f4ff; color: #1a73e8; }
.search-box { display: flex; border: 1px solid #ddd; border-radius: 20px; overflow: hidden; }
.search-box input { border: none; outline: none; padding: 8px 14px; font-size: 14px; width: 200px; }
.search-box button { border: none; background: #1a73e8; color: #fff; padding: 0 14px; cursor: pointer; font-size: 14px; }

/* Main */
.site-main { min-height: calc(100vh - 64px - 200px); padding: 24px 0; }
.section { margin-bottom: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 20px; font-weight: 700; color: #222; }
.section-more { font-size: 14px; color: #1a73e8; }

/* 工具卡片网格 */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tool-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: .2s; display: flex; flex-direction: column; }
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.tool-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.tool-logo { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #f0f4ff; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.tool-name { font-size: 16px; font-weight: 600; color: #222; }
.tool-domain { font-size: 12px; color: #999; }
.tool-desc { font-size: 13px; color: #666; flex: 1; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tool-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #eef3ff; color: #1a73e8; }
.tool-tag.free { background: #e8f5e9; color: #43a047; }
.tool-tag.cn { background: #fff3e0; color: #fb8c00; }
.tool-footer { display: flex; align-items: center; justify-content: space-between; }
.tool-visits { font-size: 12px; color: #999; }
.tool-btn { font-size: 13px; padding: 5px 14px; border-radius: 6px; background: #1a73e8; color: #fff; border: none; cursor: pointer; }
.tool-btn:hover { background: #1557b0; }

/* 排行榜 */
.rank-list { background: #fff; border-radius: 12px; padding: 8px 0; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.rank-item { display: flex; align-items: center; padding: 12px 20px; gap: 16px; border-bottom: 1px solid #f0f0f0; }
.rank-item:last-child { border-bottom: none; }
.rank-num { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: #f0f0f0; color: #999; }
.rank-num.top1 { background: #ffd700; color: #fff; }
.rank-num.top2 { background: #c0c0c0; color: #fff; }
.rank-num.top3 { background: #cd7f32; color: #fff; }
.rank-info { flex: 1; }
.rank-name { font-size: 15px; font-weight: 600; color: #222; }
.rank-domain { font-size: 12px; color: #999; }
.rank-visits { font-size: 13px; color: #1a73e8; font-weight: 600; }

/* 文章卡片 */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.article-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); transition: .2s; }
.article-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.article-cover { width: 100%; height: 160px; object-fit: cover; background: linear-gradient(135deg, #667eea, #764ba2); }
.article-body { padding: 16px; }
.article-title { font-size: 15px; font-weight: 600; color: #222; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-summary { font-size: 13px; color: #666; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta { display: flex; justify-content: space-between; font-size: 12px; color: #999; }

/* 详情页 */
.detail-page { background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.detail-title { font-size: 28px; font-weight: 700; margin-bottom: 16px; color: #222; }
.detail-meta { display: flex; gap: 20px; font-size: 14px; color: #999; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eee; }
.detail-content { font-size: 15px; line-height: 1.8; color: #444; }
.detail-content img { max-width: 100%; border-radius: 8px; margin: 16px 0; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 6px; font-size: 14px; border: 1px solid #ddd; background: #fff; color: #555; }
.pagination .current { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.pagination a:hover { border-color: #1a73e8; color: #1a73e8; }

/* Tab切换 */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn { padding: 6px 16px; border-radius: 20px; font-size: 14px; background: #fff; border: 1px solid #ddd; color: #555; cursor: pointer; }
.tab-btn.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }

/* Footer */
.site-footer { background: #1a1a2e; color: #aaa; padding: 40px 0 0; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-col p, .footer-col a { font-size: 13px; color: #aaa; display: block; margin-bottom: 8px; }
.footer-col a:hover { color: #1a73e8; }
.footer-bottom { border-top: 1px solid #333; padding: 16px 0; text-align: center; font-size: 13px; }

/* ===== 前台补充样式（新增页面） ===== */
/* 双栏布局：主内容 + 侧栏 */
.layout-with-sidebar { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
@media (max-width: 900px) { .layout-with-sidebar { grid-template-columns: 1fr; } }
.sidebar-widget { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.06); margin-bottom: 20px; }
.sidebar-widget h4 { font-size: 16px; margin-bottom: 14px; color: #222; }
.sidebar-cat-list a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 14px; color: #555; }
.sidebar-cat-list a:hover, .sidebar-cat-list a.active { background: #eef3ff; color: #1a73e8; }

/* 新闻列表 */
.news-list-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px dashed #eee; font-size: 14px; }
.news-list-item:last-child { border-bottom: none; }
.news-list-item a { color: #333; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-list-item a:hover { color: #1a73e8; }
.news-list-item .time { color: #999; font-size: 12px; white-space: nowrap; }

/* 面包屑 / 空态 */
.breadcrumb { font-size: 13px; color: #999; margin-bottom: 16px; }
.breadcrumb a { color: #1a73e8; }
.empty-tip { color: #999; font-size: 14px; text-align: center; padding: 20px 0; }
.cat-desc { color: #666; font-size: 14px; margin-bottom: 16px; }
.result-count { font-size: 13px; color: #999; margin-bottom: 14px; }

/* 详情页头部 */
.detail-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
.detail-logo { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: #f0f4ff; display: flex; align-items: center; justify-content: center; font-size: 32px; color: #1a73e8; flex-shrink: 0; }
.detail-sub { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.detail-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.btn-primary { display: inline-block; padding: 10px 24px; border-radius: 8px; background: #1a73e8; color: #fff; font-size: 15px; }
.btn-primary:hover { background: #1557b0; }
.btn-outline { display: inline-block; padding: 9px 18px; border-radius: 8px; border: 1px solid #ddd; color: #555; font-size: 14px; }
.detail-summary { font-size: 15px; color: #444; margin-bottom: 20px; }
.tag-link { font-size: 13px; color: #1a73e8; background: #eef3ff; padding: 3px 10px; border-radius: 4px; }
.feature-block { margin: 24px 0; }
.feature-block h3, .detail-content h3 { font-size: 17px; margin-bottom: 12px; color: #222; }
.feature-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* 文章详情 */
.article-detail-cover { width: 100%; border-radius: 10px; margin: 8px 0 24px; }
.prev-next { display: flex; justify-content: space-between; gap: 16px; margin: 24px 0; font-size: 14px; }
.prev-next a { color: #1a73e8; }
.prev-next span { color: #ccc; }

/* 侧栏文章列表 */
.hot-article-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.hot-article-item:last-child { border-bottom: none; }
.hot-article-rank { width: 20px; height: 20px; border-radius: 4px; background: #f0f0f0; color: #999; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.hot-article-rank.top1 { background: #ffd700; color: #fff; }
.hot-article-rank.top2 { background: #c0c0c0; color: #fff; }
.hot-article-rank.top3 { background: #cd7f32; color: #fff; }
.hot-article-title { flex: 1; font-size: 13px; color: #444; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hot-article-item:hover .hot-article-title { color: #1a73e8; }
.hot-article-meta { font-size: 12px; color: #999; white-space: nowrap; }

/* 回到顶部 */
.back-top { position: fixed; right: 24px; bottom: 80px; width: 44px; height: 44px; border-radius: 50%; background: #1a73e8; color: #fff; display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 300; font-size: 20px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.back-top.show { display: flex; }

/* 移动端汉堡按钮 */
.nav-toggle { display: none; margin-left: auto; background: none; border: none; font-size: 24px; cursor: pointer; color: #333; }
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .main-nav { display: none; flex-direction: column; gap: 4px; padding: 10px 0; width: 100%; }
    .main-nav.open { display: flex; }
    .dropdown-menu { position: static; box-shadow: none; }
}

/* 响应式 */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 10px; }
    .main-nav { order: 3; width: 100%; overflow-x: auto; }
    .search-box input { width: 140px; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .tool-grid { grid-template-columns: 1fr; }
}
