/* 前台公共样式 */

:root {
    --primary: #3478e5;
    --primary-hover: #2463c7;
    --primary-light: #edf5ff;
    --primary-soft: #dceafe;
    --accent: #c2410c;
    --bg-page: #f6f8fc;
    --bg-card: #ffffff;
    --text-primary: #243247;
    --text-secondary: #59677b;
    --text-muted: #6a778d;
    --border: #e1e7f0;
    --border-light: #edf1f7;
    --danger: #c8322a;
    --success: #3478e5;
    --warning: #a86a08;
    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    --radius: 6px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 2px rgba(16, 32, 29, .05);
    --shadow-md: 0 6px 20px rgba(16, 32, 29, .07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    /* 底色写在根元素上：切换页面时首帧就是这个色，不会先闪一帧白 */
    background: var(--bg-page);
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
html::-webkit-scrollbar { width: 0; height: 0; }
body {
    min-width: 320px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.65;
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body::-webkit-scrollbar { width: 0; height: 0; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }
button, input { font: inherit; }

.home-container { max-width: 1440px; margin: 0 auto; padding: 0 28px; }

.home-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}
.home-header .home-container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 34px;
}

.home-logo {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    overflow: hidden;
}
/* logo 常驻流光：和卡片悬停那条是同一套做法，区别是无限循环、
   而且大部分时间在休息——扫光只占一个周期的前四分之一，剩下的时间光带停在画面外，
   不然一直闪会很吵，眼睛盯着导航栏会累。 */
.home-logo::after {
    content: "";
    position: absolute;
    top: -40%;
    bottom: -40%;
    left: -45%;
    width: 34%;
    pointer-events: none;
    opacity: 0;
    transform: skewX(-22deg);
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, .92) 50%,
        rgba(255, 255, 255, 0) 100%);
    animation: logo-shine 4s linear infinite;
}
@keyframes logo-shine {
    0%   { left: -45%; opacity: 0; }
    3%   { opacity: 1; }
    20%  { opacity: 1; }
    24%  { left: 115%; opacity: 0; }
    100% { left: 115%; opacity: 0; }   /* 剩下四分之三的时间停在画面外，形成间隔 */
}
.home-logo-img { height: 38px; width: auto; border-radius: 10px; }
.home-logo-mark {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--primary);
}
.home-logo-mark::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 5px solid #fff;
    border-radius: 5px;
    transform: rotate(45deg);
}
.home-logo-text {
    color: #243447;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.home-nav {
    display: flex;
    align-items: center;
    gap: 22px;
    flex: 1;
    min-width: 0;
    height: 100%;
}
.home-nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
    color: #344356;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    transition: color .2s;
}
.home-nav-item:hover,
.home-nav-item.active { color: var(--primary); }
.home-nav-item.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--primary);
}
/* 后台「样式类名」填 nav-hot 即可把这一项做成醒目样式 */
.home-nav-item.nav-hot { color: var(--accent); font-weight: 700; }
.home-nav-item.nav-hot::before {
    content: "HOT";
    margin-right: 5px;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.5;
}
.home-nav-item.nav-hot:hover { color: var(--accent); filter: brightness(1.1); }
.home-nav-item.nav-hot.active { color: var(--accent); }
.home-nav-item.nav-hot.active::after { background: var(--accent); }

/* 抽屉里的两个比价入口，宽屏用头部右侧的按钮，这里隐藏 */
.home-nav-cta { display: none; }

.home-nav-dropdown { position: relative; }
.home-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -16px;
    min-width: 148px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
}
.home-nav-dropdown:hover .home-dropdown-menu { display: block; }
.home-dropdown-item {
    display: block;
    padding: 9px 12px;
    color: var(--text-secondary);
    border-radius: 7px;
    font-size: 14px;
}
.home-dropdown-item:hover { color: var(--primary); background: var(--primary-light); }

.home-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.home-top-search {
    display: flex;
    flex: 0 1 278px;
    min-width: 0;
    height: 38px;
    overflow: hidden;
    border: 1px solid #e1e8f0;
    border-radius: 7px;
    background: #fff;
}
.home-top-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0 14px;
    color: var(--text-primary);
}
.home-top-search button {
    width: 44px;
    border: 0;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 21px;
    line-height: 1;
}
.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 66px;
    height: 38px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
    white-space: nowrap;
}
.home-btn-primary {
    color: #fff;
    background: var(--primary);
}
.home-btn-primary:hover { color: #fff; background: var(--primary-hover); }
.home-btn-outline {
    color: #344356;
    background: #fff;
    border: 1px solid #e1e8f0;
}
.home-btn-outline:hover { color: var(--primary); border-color: var(--primary); }
.home-btn-accent {
    color: #fff;
    background: var(--accent);
}
.home-btn-accent:hover { color: #fff; filter: brightness(1.08); }

.home-mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.home-mobile-toggle span,
.home-mobile-toggle::before,
.home-mobile-toggle::after {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px auto;
    content: "";
    border-radius: 2px;
    background: #344356;
}

.home-main { min-height: calc(100vh - 64px - 150px); }

.home-footer {
    margin-top: 36px;
    background: #344356;
    color: rgba(255, 255, 255, .65);
    padding: 36px 0 26px;
}
.home-footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 28px;
}
.home-footer-info p { margin-bottom: 4px; font-size: 14px; }
.home-footer-info a,
.home-footer-links a { color: rgba(255, 255, 255, .68); }
.home-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 14px;
}
.home-footer a:hover { color: #fff; }

/* 卡片悬停反光：一条斜的半透明白光从左扫到右，像玻璃面反光扫过去。
   用 animation 而不是 transition，这样每次移入都完整扫一遍，移出也不会倒着退回来。 */
.glare { position: relative; overflow: hidden; }
.glare::after {
    content: "";
    position: absolute;
    top: -60%;
    bottom: -60%;
    left: -50%;
    width: 45%;
    pointer-events: none;
    opacity: 0;
    transform: skewX(-22deg);
    /* 纯白，不掺颜色：两侧压蓝会让整条光看起来发蓝，像蒙了层色而不是反光。
       动起来之后不靠颜色对比也看得见，所以中间那点白够用了。 */
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, .38) 50%,
        rgba(255, 255, 255, 0) 100%);
}
/* linear 而不是 ease-out：缓动会让光带在前两成时间里就冲过卡片，剩下的时间在卡片外面空跑，
   看起来就跟没有一样。起止位置也压到刚好贴着卡片边缘，不浪费行程。 */
.glare:hover::after { animation: glare-sweep .85s linear; }
@keyframes glare-sweep {
    0%   { left: -50%; opacity: 0; }
    10%  { opacity: 1; }
    85%  { opacity: 1; }
    100% { left: 110%; opacity: 0; }
}

.home-empty { padding: 46px 20px; color: var(--text-muted); text-align: center; }
.home-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 28px; }
.home-pagination a,
.home-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
}
.home-pagination a { background: #fff; border: 1px solid var(--border); color: var(--text-secondary); }
.home-pagination a:hover,
.home-pagination a.current { border-color: var(--primary); color: var(--primary); }
.home-pagination span.current { color: #fff; background: var(--primary); }
.home-pagination span.disabled { opacity: .5; color: var(--text-muted); }

@media (max-width: 1280px) {
    .home-header .home-container { gap: 20px; }
    .home-nav { gap: 16px; }
    .home-top-search { flex-basis: 200px; }
}

@media (max-width: 1100px) {
    .home-header .home-container { gap: 14px; }
    .home-nav { gap: 12px; }
    .home-nav-item { font-size: 14px; }
    .home-top-search { display: none; }     /* 让位给按钮，站点列表页顶部本来就有搜索 */
    .home-btn { min-width: 0; padding: 0 13px; }
}

@media (max-width: 900px) {
    .home-header-right { display: none; }
    .home-mobile-toggle { display: block; margin-left: auto; }
    .home-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 64px;
        height: auto;
        padding: 10px 22px 16px;
        background: #fff;
        border-bottom: 1px solid var(--border-light);
        box-shadow: var(--shadow-md);
    }
    .home-nav.is-open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
    .home-nav-cta {
        display: inline-flex;
        justify-content: center;
        height: 38px;
        margin-top: 6px;
        border-radius: 8px;
        background: var(--primary);
        color: #fff;
        font-weight: 600;
    }
    .home-nav-cta:hover { color: #fff; }
    .home-nav-cta-start { grid-column: 1; }   /* 两个按钮并排，单独占最后一行 */
    .home-nav-cta-accent { background: var(--accent); }
    .home-nav-item { height: 38px; }
    .home-nav-item.active::after { display: none; }
}

@media (max-width: 640px) {
    .home-container { padding: 0 16px; }
    .home-logo-text { font-size: 19px; }
    .home-footer-inner { flex-direction: column; }
}


/* ============================================================
   广告条组件 .ad-bar
   .ad-bar-top    导航下方全站通栏（外层需 .ad-bar-slot 限宽）
   .ad-bar-detail 站点详情页正文下方
============================================================ */
.ad-bar-slot { max-width: 1440px; margin: 14px auto 0; padding: 0 28px; }

.ad-bar {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.ad-bar:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(18, 76, 148, .14);
}
.ad-bar-detail { margin-bottom: 20px; }

.ad-bar-in {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 16px;
}
.ad-bar-tag {
    flex: none;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}
.ad-bar-body {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    line-height: 1;
}
.ad-bar-name {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.ad-bar-desc {
    min-width: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ad-bar-old {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}
.ad-bar-now {
    display: inline-flex;
    align-items: baseline;
    color: #e2300b;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.ad-bar-now small { margin-right: 1px; font-size: 13px; font-weight: 700; }
.ad-bar-cut {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    border-radius: 3px;
    background: #fff2ee;
    color: #e2300b;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.ad-bar-sep {
    flex: none;
    width: 1px;
    height: 14px;
    margin: 0 2px;
    background: var(--border);
}
.ad-bar-go {
    flex: none;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    height: 32px;
    padding: 0 16px;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .2s;
}
.ad-bar:hover .ad-bar-go { background: var(--primary-hover); }

@media (max-width: 768px) {
    .ad-bar-slot { margin-top: 12px; padding: 0 16px; }
    .ad-bar-in { gap: 9px; min-height: 46px; padding: 9px 12px; }
    .ad-bar-body { gap: 8px; }
    .ad-bar-name, .ad-bar-sep { display: none; }
    /* 没填现价时，移动端保留商品名，否则整条只剩一个按钮 */
    .ad-bar-noprice .ad-bar-name {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .ad-bar-noprice .ad-bar-desc { display: none; }
    .ad-bar-tag { padding: 3px 8px; font-size: 11px; }
    .ad-bar-old { font-size: 12px; }
    .ad-bar-now { font-size: 18px; }
    .ad-bar-cut { height: 18px; padding: 0 6px; font-size: 11px; }
    .ad-bar-go { height: 30px; padding: 0 13px; font-size: 13px; }
}

/* 清爽浅蓝主题：页脚保持轻量 */
.home-footer { background: #edf2f9; color: #59677b; border-top: 1px solid var(--border); }
.home-footer-info a, .home-footer-links a { color: #59677b; }
/* 浅底 footer 覆盖了背景色，上面那条 :hover{color:#fff} 会让链接消失，这里一并改掉 */
.home-footer a:hover { color: var(--primary); }

/* 页脚友情链接：独立一行，链接多时自动换行 */
.home-friend-links {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(89, 103, 123, .18);
    font-size: 13px;
}
.home-friend-label { flex-shrink: 0; color: var(--text-muted); }
.home-friend-items { display: flex; flex-wrap: wrap; gap: 8px 18px; min-width: 0; }
.home-friend-items a { color: #59677b; }
.home-friend-items a:hover { color: var(--primary); }
@media (max-width: 700px) {
    .home-friend-links { flex-direction: column; gap: 9px; margin-top: 18px; padding-top: 14px; }
    .home-friend-items { gap: 8px 14px; }
}

/* ============================================================
   移动端兜底：iOS 聚焦放大
   输入框字号小于 16px 时，iOS Safari / 微信聚焦后会把整页放大且不会缩回。
   这里统一抬到 16px。用 !important 是因为各页自己的 CSS 在 home.css 之后加载，
   普通声明会被盖掉；视觉上需要更小的地方请用 transform: scale() 改外观，
   不要把 font-size 调回去。
   ============================================================ */
@media (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ============================================================
   列表页页头长条：面包屑 + H1 + 一句话，挤在同一条白色横幅里
   分类页、精选副业列表共用。窄屏自动换行，面包屑掉到下一行。
   ============================================================ */
.home-pagebar {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0 0 14px;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.home-pagebar h1 {
    flex: none;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.2px;
    line-height: 1.5;
}
.home-pagebar > p {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-pagebar-crumb {
    flex: none;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-muted);
    white-space: nowrap;
}
.home-pagebar-crumb a { color: var(--text-secondary); }
.home-pagebar-crumb a:hover { color: var(--primary); }

@media (max-width: 900px) {
    .home-pagebar { padding: 13px 15px; margin: 0 0 12px; border-radius: var(--radius-sm); }
    .home-pagebar h1 { font-size: 17px; }
    .home-pagebar-crumb { flex-basis: 100%; margin-left: 0; }
}
