/* AI工具导航 前台样式（左侧导航 + 右侧全宽内容，移动端抽屉自适应） */
:root {
    --primary: #4f46e5;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #f5f6fa;
    --card: #ffffff;
    --border: #e5e7eb;
    --radius: 10px;
    --side-w: 224px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; }
/* PC 内容区不再固定宽度：占满右侧全部宽度，仅留内边距 */
.container { width: 100%; max-width: none; margin: 0; padding: 0 24px; }

/* ---------- 左侧导航 ---------- */
.site-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); background: var(--card); border-right: 1px solid var(--border); overflow-y: auto; overscroll-behavior: contain; z-index: 40; padding: 14px 10px 24px; }
.site-sidebar::-webkit-scrollbar { width: 5px; }
.site-sidebar::-webkit-scrollbar-thumb { background: #d7d9e3; border-radius: 3px; }
.side-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; padding: 4px 10px 14px; }
.logo-badge { background: var(--primary); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 14px; flex-shrink: 0; }
.logo-img { width: 34px; height: 34px; border-radius: 9px; display: block; flex-shrink: 0; object-fit: cover; }
.side-nav { display: flex; flex-direction: column; }
.side-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--text); min-width: 0; }
.side-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item:hover { background: #eef2ff; color: var(--primary); }
.side-item.active { background: #eef2ff; color: var(--primary); font-weight: 600; }
.side-ico { width: 20px; text-align: center; flex-shrink: 0; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.side-svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.side-group { font-size: 12px; color: var(--muted); padding: 16px 10px 4px; letter-spacing: 1px; }
/* 二级分类 */
.side-row { display: flex; align-items: center; gap: 2px; }
.side-row .side-item { flex: 1; min-width: 0; }
.side-caret { border: none; background: none; cursor: pointer; color: var(--muted); padding: 4px 6px; font-size: 12px; line-height: 1; flex-shrink: 0; transition: transform .15s; transform: rotate(-90deg); }
.side-node.open > .side-row .side-caret { transform: rotate(0); }
.side-sub { display: none; padding: 2px 0 4px 30px; }
.side-node.open > .side-sub { display: block; }
.side-sub-item { display: block; padding: 7px 10px; font-size: 13px; color: var(--muted); border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-sub-item:hover { color: var(--primary); background: #f3f4ff; }
.side-sub-item.active { color: var(--primary); font-weight: 600; background: #eef2ff; }
.side-mask { display: none; position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 35; }

/* ---------- 右侧主体 ---------- */
.site-body { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.site-header { background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; gap: 14px; height: 56px; }
.menu-toggle { display: none; border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text); padding: 4px 8px; flex-shrink: 0; }
.header-logo { display: none; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.header-search { display: flex; margin-left: auto; }
.header-search input { border: 1px solid var(--border); border-radius: 8px 0 0 8px; padding: 7px 12px; width: 220px; outline: none; font-size: 14px; }
.header-search input:focus { border-color: var(--primary); }
.header-search button { border: none; background: var(--primary); color: #fff; border-radius: 0 8px 8px 0; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.header-links { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-shrink: 0; }

/* hero */
.site-main { flex: 1; padding: 10px 0 40px; }
.hero { text-align: center; padding: 36px 0 20px; }
.hero h1 { margin: 0 0 8px; font-size: 28px; }
.hero-sub { color: var(--muted); margin: 0 0 6px; }
.hero-stat { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.hero-search { display: flex; max-width: 640px; margin: 0 auto; }
.hero-search input { flex: 1; border: 2px solid var(--primary); border-right: none; border-radius: 10px 0 0 10px; padding: 10px 14px; font-size: 15px; outline: none; }
.hero-search button { border: none; background: var(--primary); color: #fff; border-radius: 0 10px 10px 0; padding: 10px 22px; font-size: 15px; cursor: pointer; }

/* category blocks */
.cat-block { margin-top: 26px; }
.cat-block h2 { font-size: 19px; margin: 0 0 12px; display: flex; align-items: baseline; gap: 10px; }
.cat-block h2 .more { margin-left: auto; font-size: 13px; font-weight: normal; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-grid-full { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tool-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); transition: box-shadow .15s, transform .15s; }
.tool-card:hover { box-shadow: 0 6px 18px rgba(79, 70, 229, .12); transform: translateY(-2px); }
.tool-card-link { display: block; padding: 14px; height: 100%; }
.tool-card-head { display: flex; align-items: center; gap: 10px; }
.tool-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #f3f4f6; flex-shrink: 0; }
.tool-logo-fallback { display: inline-flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700; }
.tool-logo-lg { width: 72px; height: 72px; }
.tool-name { font-size: 15px; }
.tool-desc { margin: 8px 0 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* breadcrumb */
.breadcrumb { font-size: 13px; color: var(--muted); margin: 14px 0; }
.breadcrumb a:hover { color: var(--primary); }

/* category header */
.cat-header h1 { margin: 0 0 6px; font-size: 24px; }
.cat-desc { color: var(--muted); margin: 0 0 4px; }
.cat-count { font-size: 14px; color: var(--muted); }
/* 子分类导航条 */
.sub-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.sub-chip { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 4px 14px; font-size: 13px; color: var(--muted); }
.sub-chip:hover { color: var(--primary); border-color: var(--primary); }
.sub-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* tool detail */
.tool-detail { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.tool-detail-head { display: flex; gap: 18px; }
.tool-detail-info h1 { margin: 0 0 6px; font-size: 22px; }
.tool-short { color: var(--muted); margin: 0 0 10px; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.meta-tag { background: #eef2ff; color: var(--primary); font-size: 12px; border-radius: 6px; padding: 2px 8px; }
.btn-visit { display: inline-block; background: var(--primary); color: #fff !important; border-radius: 8px; padding: 8px 20px; font-size: 14px; }
.btn-visit:hover { opacity: .9; }
.tool-body { margin-top: 22px; }
.tool-body h2 { font-size: 17px; border-left: 4px solid var(--primary); padding-left: 8px; }
.rich-text p { margin: 8px 0; }
.shots img { border: 1px solid var(--border); border-radius: 8px; margin: 6px 6px 0 0; }

/* articles */
.article-list .article-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.article-item h2 { margin: 0 0 6px; font-size: 17px; }
.article-item time { font-size: 12px; color: var(--muted); }
.article-detail { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.article-detail h1 { margin: 0 0 6px; }
.article-meta { color: var(--muted); font-size: 13px; }

/* 每日AI资讯（时间线） */
.news-layout { display: flex; gap: 20px; align-items: flex-start; }
.news-page { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; }
.news-head h1 { margin: 0 0 10px; font-size: 24px; }
.news-desc { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0 0 8px; }
.news-group { margin-top: 22px; }
.news-day { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--primary); margin: 0 0 6px; }
.day-mark { width: 14px; height: 14px; background: var(--primary); border-radius: 3px; display: inline-block; }
.news-timeline { margin-left: 6px; padding-left: 22px; border-left: 2px solid var(--border); }
.news-item { position: relative; padding: 10px 0 14px; }
.news-item::before { content: ""; position: absolute; left: -29px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary); }
.news-title { margin: 0 0 6px; font-size: 16px; line-height: 1.6; }
.news-title a { color: var(--text); }
.news-title a:hover { color: var(--primary); }
.news-summary { margin: 0 0 6px; color: #555; font-size: 14px; line-height: 1.8; }
.news-from { margin: 0; color: var(--muted); font-size: 13px; display: flex; gap: 14px; }
.news-from a { color: var(--muted); }
.news-from a:hover { color: var(--primary); }

/* 资讯页右侧栏 */
.news-aside { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.aside-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.aside-title { display: flex; align-items: center; gap: 6px; font-size: 16px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.aside-title i { font-style: normal; }
.aside-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.aside-tool { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: var(--bg); border-radius: 8px; font-size: 13px; color: var(--text); min-width: 0; }
.aside-tool:hover { color: var(--primary); background: #eef2ff; }
.aside-tool img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.tool-noimg { width: 20px; height: 20px; border-radius: 5px; background: var(--primary); color: #fff; font-style: normal; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.aside-tool span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aside-articles { display: flex; flex-direction: column; }
.aside-article { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.aside-article:last-child { border-bottom: 0; }
.aside-article img { width: 72px; height: 54px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.aside-article-main { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.aside-article-title { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aside-article:hover .aside-article-title { color: var(--primary); }
.aside-article-time { font-size: 12px; color: var(--muted); }
@media (max-width: 1200px) { .news-aside { width: 280px; } }
@media (max-width: 992px) { .news-layout { flex-direction: column; } .news-aside { width: 100%; position: static; } }

/* pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0 6px; flex-wrap: wrap; }
.pagination a, .pagination span { border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 5px 12px; font-size: 14px; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .dots { border: none; background: none; }

/* footer */
.site-footer { background: var(--card); border-top: 1px solid var(--border); padding: 18px 0; margin-top: 30px; }
.footer-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: 14px; }
.footer-links a { color: var(--muted); }
.copyright { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 0; }

.empty-tip { color: var(--muted); text-align: center; padding: 30px 0; }
.error-page { text-align: center; padding: 60px 0; }

/* ---------- 平板：收窄侧栏 ---------- */
@media (max-width: 1100px) {
    :root { --side-w: 180px; }
    .header-links { display: none; }
}

/* ---------- 移动端：侧栏变抽屉，隐藏顶栏 logo ---------- */
@media (max-width: 860px) {
    .site-sidebar { width: 264px; padding: 0 10px 24px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
    body.nav-open .site-sidebar { transform: none; box-shadow: 0 0 24px rgba(0, 0, 0, .18); }
    body.nav-open .side-mask { display: block; }
    body.nav-open { overflow: hidden; }
    .site-body { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .header-logo { display: flex; }
    .container { padding: 0 14px; }
    .header-search { flex: 1; margin-left: 0; }
    .header-search input { width: 100%; flex: 1; min-width: 0; }
    .header-inner { gap: 8px; }
}

@media (max-width: 720px) {
    .header-inner { height: 52px; }
    .tool-detail-head { flex-direction: column; }
    .tool-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
    .tool-card-link { padding: 10px; }
    .hero { padding: 22px 0 12px; }
    .hero h1 { font-size: 22px; }
}
