@charset "utf-8";
/* ==========================================================================
   火端搜索 V3 · 响应式模板样式（PC / 手机自适应）
   纯 CSS，无框架、无 jQuery 依赖
   ========================================================================== */

:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-soft: #eff4ff;
    --text: #1f2937;
    --text-2: #4b5563;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f7f8fa;
    --card: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-hover: 0 6px 18px rgba(16, 24, 40, .08);
    --wrap: 1160px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-dark);
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
}

em {
    font-style: normal;
    color: #c2410c;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 16px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--brand);
    color: #fff;
    padding: 10px 16px;
    z-index: 99;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

/* ------------------------------ 顶部导航 ------------------------------ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 58px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    flex: 0 0 auto;
    letter-spacing: .2px;
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex: 0 0 auto;
}

.header-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.header-nav a {
    color: var(--text-2);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
}

.header-nav a:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

/* ------------------------------ 搜索框 ------------------------------ */
.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 5px 5px 5px 16px;
    transition: border-color .18s, box-shadow .18s;
}

.search-form:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.search-form input[type="text"],
.search-form input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    border: 0;
    outline: 0;
    font-size: 15px;
    color: var(--text);
    background: transparent;
    font-family: inherit;
}

.search-form input::placeholder {
    color: #9ca3af;
}

.search-form button {
    flex: 0 0 auto;
    height: 38px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: background .18s;
}

.search-form button:hover {
    background: var(--brand-dark);
}

.search-form button:active {
    transform: translateY(1px);
}

.header-search {
    flex: 1 1 auto;
    max-width: 560px;
    margin: 0 auto;
}

.header-search .search-form {
    padding: 3px 3px 3px 14px;
}

.header-search .search-form input {
    height: 34px;
    font-size: 14px;
}

.header-search .search-form button {
    height: 34px;
    padding: 0 16px;
    font-size: 14px;
}

/* ------------------------------ 首页 ------------------------------ */
.home-hero {
    padding: 56px 0 26px;
    text-align: center;
}

.home-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: .5px;
    margin-bottom: 10px;
    color: #111827;
}

.home-sub {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 26px;
}

.home-search {
    max-width: 620px;
    margin: 0 auto;
}

.home-note {
    margin: 14px 0 0;
    font-size: 13px;
    color: #9ca3af;
}

.home-note a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 热门榜 */
.hotbox {
    max-width: 980px;
    margin: 34px auto 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hot-tabs {
    display: flex;
    gap: 2px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hot-tabs::-webkit-scrollbar {
    display: none;
}

.hot-tabs button {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font-family: inherit;
    font-size: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

.hot-tabs button[aria-selected="true"] {
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 600;
}

.hot-panel {
    display: none;
    padding: 8px 12px 16px;
}

.hot-panel.is-active {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
}

.hot-panel a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 6px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-panel a:hover {
    background: #f3f6ff;
    color: var(--brand-dark);
}

.hot-panel .num {
    flex: 0 0 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

.hot-panel .num.top1 {
    color: #ef4444;
}

.hot-panel .num.top2 {
    color: #f97316;
}

.hot-panel .num.top3 {
    color: #eab308;
}

/* 友链 */
.links-box {
    max-width: 980px;
    margin: 26px auto 0;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--muted);
    line-height: 2;
}

.links-box a {
    color: var(--text-2);
    margin-right: 14px;
    white-space: nowrap;
}

.links-box a:hover {
    color: var(--brand);
}

/* ------------------------------ 搜索结果页 ------------------------------ */
.search-layout {
    display: block;
    padding: 20px 0 40px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb span {
    margin: 0 6px;
    color: #c7cbd1;
}

.page-head {
    margin-bottom: 16px;
}

.page-head h1 {
    font-size: 21px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.page-head .meta {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.page-head .meta b {
    font-weight: 600;
    color: var(--text-2);
}

/* AI 回答卡（可选功能，后台「AI 兜底」开启后才出现） */
.ai-box {
    background: linear-gradient(180deg, #f6f8ff 0%, #fff 100%);
    border: 1px solid #dbe4f5;
    border-radius: var(--radius);
    padding: 14px 16px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.ai-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.ai-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
}

.ai-note {
    font-size: 12px;
    color: var(--muted);
}

.ai-body {
    font-size: 14.5px;
    line-height: 1.78;
    color: var(--text);
    word-break: break-word;
}

/* 结果卡片 */
.result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.g {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    transition: box-shadow .18s, border-color .18s, transform .18s;
}

.g:hover {
    box-shadow: var(--shadow-hover);
    border-color: #cfd8e8;
}

.g h2 {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 6px;
    word-break: break-word;
}

.g h2 .nums {
    display: inline-block;
    min-width: 18px;
    margin-right: 4px;
    font-size: 13px;
    color: #9ca3af;
    font-weight: 700;
}

.g h2 a.s {
    color: #1a0dab;
}

.g h2 a.s:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.g .std {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.72;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.g .a {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    color: #4d7c0f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g .a::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #86b300;
    margin-right: 6px;
    vertical-align: middle;
}

/* 空结果 */
.empty-box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    color: var(--text-2);
}

.empty-box strong {
    display: block;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-box .sug {
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
}

.empty-box .sug a {
    display: inline-block;
    margin: 4px 6px 0 0;
    padding: 5px 12px;
    background: var(--brand-soft);
    border-radius: 999px;
    color: var(--brand-dark);
}

/* 分页 */
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 22px 0 4px;
}

.pager a,
.pager .this {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-2);
}

.pager a:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.pager .this {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 600;
}

.pager .n {
    padding: 0 14px;
}

/* 相关搜索 */
.rel-box {
    margin-top: 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px 16px;
}

.rel-box h2 {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 10px;
}

.rel-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rel-box a {
    display: inline-block;
    padding: 6px 13px;
    background: #f3f4f6;
    border-radius: 999px;
    font-size: 13.5px;
    color: var(--text-2);
}

.rel-box a:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

/* 侧栏 */
.sidebar {
    margin-top: 24px;
}

.side-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 6px 10px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.side-card h3 {
    font-size: 14px;
    color: var(--text-2);
    padding: 12px 10px 8px;
    border-bottom: 1px solid #f1f3f5;
    margin-bottom: 6px;
}

.side-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-card li a {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-card li a:hover {
    background: #f3f6ff;
    color: var(--brand-dark);
}

.side-card li .num {
    flex: 0 0 16px;
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    text-align: center;
}

.side-card li .num.top1 {
    color: #ef4444;
}

.side-card li .num.top2 {
    color: #f97316;
}

.side-card li .num.top3 {
    color: #eab308;
}

/* 广告位容器 */
.ad-slot {
    margin: 16px 0;
    text-align: center;
    overflow: hidden;
}

.ad-slot img {
    max-width: 100%;
}

/* 结果列表内的广告位：未填充（里面只有 script、没有实际广告元素）时不占位，
   避免联盟代码没返回内容时在结果之间留出空白断层 */
.result-list > .ad-slot {
    margin: 0;
}

.result-list > .ad-slot:not(:has(ins, iframe, img, a, div, table, video, canvas)) {
    display: none;
}

/* ------------------------------ 页脚 ------------------------------ */
.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
    padding: 22px 0 26px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.9;
    text-align: center;
}

.site-footer a {
    color: var(--text-2);
}

.site-footer a:hover {
    color: var(--brand);
}

.footer-links {
    margin-bottom: 8px;
}

.footer-links a {
    margin: 0 8px;
    white-space: nowrap;
}

/* ------------------------------ 平板/桌面 ------------------------------ */
@media (min-width: 640px) {
    .hot-panel.is-active {
        grid-template-columns: 1fr 1fr;
        column-gap: 10px;
    }

    .home-title {
        font-size: 34px;
    }

    .home-hero {
        padding: 72px 0 30px;
    }

    .g {
        padding: 16px 18px;
    }

    .g h2 {
        font-size: 18px;
    }
}

@media (min-width: 960px) {
    .search-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 26px;
        align-items: start;
    }

    .sidebar {
        margin-top: 0;
        position: sticky;
        top: 74px;
    }

    .hot-panel.is-active {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 移动端：隐藏次要信息、放大点击区域 */
@media (max-width: 639px) {
    body {
        font-size: 15px;
    }

    /* 手机端顶部：第一行 logo + 导航，搜索框独占第二行通栏 */
    .header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 0 10px;
        gap: 8px;
    }

    .header-search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        margin: 0;
    }

    .header-search .search-form input {
        height: 36px;
    }

    .header-search .search-form button {
        height: 36px;
    }

    /* 导航项在手机端收起，页脚仍有入口 */
    .header-nav {
        display: none;
    }

    .home-hero {
        padding: 34px 0 16px;
    }

    .home-title {
        font-size: 24px;
    }

    .home-sub {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .hotbox {
        margin-top: 24px;
    }

    .search-form button {
        padding: 0 16px;
    }

    .page-head h1 {
        font-size: 18px;
    }

    .g h2 {
        font-size: 16px;
    }

    .g .std {
        -webkit-line-clamp: 4;
        font-size: 13.5px;
    }

    .pager a,
    .pager .this {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* 打印 */
@media print {

    .site-header,
    .sidebar,
    .pager,
    .ad-slot,
    .site-footer {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .g {
        box-shadow: none;
        border-color: #ddd;
        page-break-inside: avoid;
    }
}
