/* ============================================================
   Star 模板 · 首页专属样式（Hero / 推荐位 / 首页细节）
   公共部分见 star-base.css。
   Hero 尺寸按 eeenav 实测：整宽 450 高、搜索框 800×50、上方胶囊 tab。
   ============================================================ */

/* ---------------- 一、Hero ----------------
   eeenav 实测：整宽 450 高、上下内边距 80/60（内容区正好 310），
   搜索区宽 800、tab 胶囊行 45 + 10 + 输入框 50 + 引擎行 42 = 147，垂直居中。 */
.st-hero {
    position: relative;
    height: 450px;
    margin: 0;
    padding: 80px 20px 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 搜索联想是 absolute 从搜索框往下展开的，会越过 hero 下边界。
       这里有两个坑，缺一个都不行：
       1) overflow:hidden 会把它裁掉，下半截露出的正是下面的推荐位卡片；
       2) isolation:isolate 会让 hero 自成层叠上下文，联想的 z-index:40 只在
          hero 内部有效，整体仍然被 z-index:5 的 .st-wrap 压住
          （.st-wrap 用 margin-top:-50px 上移盖住 hero 底部，所以它必须在上层）。
       放开 isolation 后，联想的 40 直接和 .st-wrap 的 5 比较，才能浮到最上面。
       hero 里需要裁剪的只有背景图和 .st-hero-mask，两者都是 inset:0，本来就不溢出。 */
    overflow: visible;
    /* 没配背景图时的兜底：天光渐变 + 柔和光斑，避免整块发灰 */
    background:
        radial-gradient(120% 90% at 18% 12%, #cfe4ff 0%, rgba(207, 228, 255, 0) 58%),
        radial-gradient(110% 88% at 84% 8%, #ffd9e6 0%, rgba(255, 217, 230, 0) 60%),
        radial-gradient(120% 100% at 50% 108%, #d9f2e6 0%, rgba(217, 242, 230, 0) 62%),
        linear-gradient(150deg, #eaf2ff 0%, #f6ecff 52%, #ffeef1 100%);
}

/* 配了背景图就用图，promo 图的取景一般偏上，取 38% 更稳 */
.st-hero[style*="--hero-bg"] {
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center 38%;
    background-repeat: no-repeat;
}

/* 后台没配横幅图时用内置插画兜底（想换图：后台「首页横幅」= home_hero_bg） */
.st-hero:not([style*="--hero-bg"]) {
    background-image: url("../img/hero-default.jpg");
    background-size: cover;
    background-position: center 62%;
    background-repeat: no-repeat;
}
html[data-theme="dark"] .st-hero:not([style*="--hero-bg"]) {
    background-image: url("../img/hero-default.jpg");
}
html[data-theme="dark"] .st-hero:not([style*="--hero-bg"]) .st-hero-mask {
    background: linear-gradient(180deg, rgba(10, 12, 18, .55) 0%, rgba(10, 12, 18, .42) 45%, rgba(10, 12, 18, .68) 100%);
}

.st-hero-mask {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 14, 20, .16) 0%, rgba(10, 14, 20, .10) 45%, rgba(10, 14, 20, .20) 100%);
    pointer-events: none;
}

/* 没配图时不需要压暗，纯渐变本身够亮 */
.st-hero:not([style*="--hero-bg"]) .st-hero-mask {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, .06) 100%);
}

.st-hero-inner {
    position: relative;
    /* 必须高过 .st-wrap 的 z-index:5：搜索联想挂在这个容器里，
       容器的 z-index 就是它的天花板，2 会让整块联想被内容区压住。
       它和 .st-wrap 不重叠（inner 底部约 309，内容区从 400 开始），
       抬高不影响版式。 */
    z-index: 6;
    width: 800px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* 胶囊 tab 行：半透明底 + 白色滑块 */
.st-hero-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.st-hero-tabs::-webkit-scrollbar { display: none; }

.st-hero-tab {
    border: 0;
    background: transparent;
    height: 37px;
    padding: 8px 15px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .92);
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .28);
    transition: background-color .15s var(--ease), color .15s var(--ease);
}
.st-hero-tab:hover { background: rgba(255, 255, 255, .22); }
.st-hero-tab.on {
    background: #fff;
    color: #484b4f;
    font-weight: 600;
    text-shadow: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

/* 搜索框：800×50、圆角 8、右侧 50×50 主色方钮 */
.st-hero-search {
    position: relative;
    width: 100%;
    height: 50px;
    margin-top: 10px;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .16);
}

.st-hero-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    padding: 9px 20px;
    font-size: 16px;
    color: #2c3038;
    border-radius: 8px 0 0 8px;
    outline: none;
}
.st-hero-search input::placeholder { color: #9aa0aa; }

.st-hero-search > button {
    width: 50px;
    flex: 0 0 50px;
    height: 100%;
    border: 0;
    border-radius: 0 8px 8px 0;
    background: var(--theme-color);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter .15s var(--ease);
}
.st-hero-search > button:hover { filter: brightness(1.08); }
.st-hero-search > button i { font-size: 21px; }

/* 引擎切换：与 eeenav 一致，纯文字一行，不用胶囊 */
.st-hero-engines {
    width: 100%;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 0 20px;
}
.st-engine {
    border: 0;
    background: transparent;
    padding: 0 10px;
    font-size: 14px;
    line-height: 42px;
    color: rgba(255, 255, 255, .82);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: color .15s var(--ease);
}
.st-engine:hover { color: #fff; }
.st-engine.on { color: #fff; font-weight: 600; }
.st-engine[hidden] { display: none; }

/* 没配背景图、走浅色渐变时，白字看不清：换成深色 */
.st-hero:not([style*="--hero-bg"]) .st-hero-tab { color: #3d4350; text-shadow: none; }
.st-hero:not([style*="--hero-bg"]) .st-hero-tab:hover { background: rgba(255, 255, 255, .6); }
.st-hero:not([style*="--hero-bg"]) .st-hero-tab.on { background: #fff; box-shadow: 0 2px 10px rgba(16, 24, 40, .1); }
.st-hero:not([style*="--hero-bg"]) .st-hero-tabs { background: rgba(255, 255, 255, .55); }
.st-hero:not([style*="--hero-bg"]) .st-engine { color: #565c66; text-shadow: none; }
.st-hero:not([style*="--hero-bg"]) .st-engine:hover { color: var(--theme-color); }
.st-hero:not([style*="--hero-bg"]) .st-engine.on { color: var(--theme-color); }

/* 暗色下仍然用插画，靠 .st-hero-mask 压暗，不再用纯色渐变顶掉图片 */
html[data-theme="dark"] .st-hero:not([style*="--hero-bg"]) .st-hero-tab { color: #f2f4f8; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
html[data-theme="dark"] .st-hero:not([style*="--hero-bg"]) .st-hero-tabs { background: rgba(255, 255, 255, .14); }
html[data-theme="dark"] .st-hero:not([style*="--hero-bg"]) .st-hero-tab.on { background: rgba(255, 255, 255, .92); color: #1b1e23; }
html[data-theme="dark"] .st-hero:not([style*="--hero-bg"]) .st-engine { color: rgba(255,255,255,.85); text-shadow: 0 1px 3px rgba(0,0,0,.3); }
html[data-theme="dark"] .st-hero:not([style*="--hero-bg"]) .st-engine.on { color: #fff; }

/* ---------------- 二、推荐位 ----------------
   形态对齐 eeenav 的广告位墙：一行 4 张等宽小卡，白底 + 1px 描边，
   图标 44、站名 14/600、描述 12，未售出的席位用同尺寸虚位卡补满。
   不再出现横跨半屏的长条。 */
.st-featured .st-feat-hint {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* 入驻入口做成橙色实心按钮，和 eeenav 一致 */
.st-featured .st-panel-head .st-more {
    padding: 4px 12px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ffb020, #ff8a00);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(255, 138, 0, .35);
}
.st-featured .st-panel-head .st-more:hover { color: #fff; filter: brightness(1.05); }
.st-featured .st-panel-head .st-more i { color: #fff; }

.st-feat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
/* 虚位卡是 <button>，撑满所在格子 */
.st-feat-slot { display: flex; }
.st-feat-slot .st-feat-card { flex: 1; width: 100%; }

.st-feat-grid .st-site {
    flex: none;
    max-width: none;
    padding: 0;
    min-width: 0;
}

.st-feat-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 84px;
    padding: 12px;
    border: 1px solid var(--line-color);
    border-radius: 10px;
    background: var(--main-bg-color);
    min-width: 0;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.st-feat-card:hover {
    border-color: var(--theme-color);
    box-shadow: 0 6px 18px rgba(16, 24, 40, .08);
    transform: translateY(-1px);
}

.st-feat-card {
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.st-feat-card .st-site-media,
.st-feat-card .st-site-icon,
.st-feat-card .st-site-icon img {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
}
.st-feat-card .st-site-icon img { border-radius: 10px; }
/* 角标要压在图标外沿，媒体容器不能再裁切；模糊底衬干脆去掉 */
.st-feat-card .st-site-media { overflow: visible; }
.st-feat-card .st-site-blur { display: none; }
.st-feat-card .st-site-media.is-fallback::before { border-radius: 10px; }
.st-feat-card .st-site-info { gap: 5px; }
.st-feat-card .st-site-name { font-size: 14px; font-weight: 600; }
.st-feat-card .st-site-desc { font-size: 12px; }

/* 金色「荐」角标贴在图标右下角 */
.st-feat-crown {
    position: absolute;
    right: -5px;
    bottom: -5px;
    z-index: 2;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb020, #ff8a00);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(255, 138, 0, .45), 0 0 0 2px var(--main-bg-color);
    pointer-events: none;
}
.st-feat-card:hover .st-site-name { color: var(--theme-color); }

/* 未售出席位 */
.st-feat-empty {
    border-style: dashed;
    border-color: var(--line-strong);
    background: transparent;
}
.st-feat-empty:hover {
    border-color: var(--theme-color);
    background: var(--theme-soft);
    box-shadow: none;
    transform: none;
}
.st-feat-empty:hover .st-site-name { color: var(--theme-color); }
.st-feat-plus {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 176, 32, .1);
    color: #e8971a;
    font-size: 20px;
    transition: color .18s var(--ease), background-color .18s var(--ease);
}
.st-feat-empty:hover .st-feat-plus { color: var(--theme-color); background: var(--main-bg-color); }

/* ---------------- 三、tab 面板切换动画 ---------------- */
.pane-in { animation: stPaneIn .22s var(--ease) both; }
@keyframes stPaneIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

/* ---------------- 四、响应式 ---------------- */
@media (max-width: 860px) {
    .st-hero {
        height: 330px;
        min-height: 330px;
        padding: 86px 14px 26px;
        background-position: center 30%;
    }
    .st-hero-tab { font-size: 13px; padding: 6px 11px; height: 34px; }
    .st-hero-search { height: 46px; margin-top: 8px; }
    .st-hero-search input { font-size: 15px; padding: 8px 16px; }
    .st-hero-search > button { width: 46px; flex-basis: 46px; }
    .st-hero-engines { height: 36px; padding: 0 16px; }
    .st-engine { font-size: 13px; line-height: 36px; padding: 0 8px; }
    .st-featured .st-feat-hint { display: none; }

    /* 手机上内容区是往上压 36px 盖住 hero 底边的，而 .st-wrap 在移动端
       z-index:auto（不动它，抽屉要靠这个才能盖过 fixed 顶栏）。
       于是 hero 自己那两个 z-index 为正的层（.st-hero-mask=1）就盖到了
       推荐位的标题行上 —— 站长看到的就是「推荐位」半透明、入驻按钮被切一半。
       只把这一块提到 mask 之上，不动整个内容区的层级，抽屉行为不受影响。 */
    .st-featured { position: relative; z-index: 2; }

    /* 列数按「一行能放满」来定：860 以下三列时 4 张卡会剩一张孤零零占半行，
       两列刚好 2×2；再窄到 620 以下换成紧凑两列。 */
    .st-feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* 「立即入驻」原来只有 84×24，手指点上去太窄；触控目标给足 34 高 */
    .st-featured .st-panel-head .st-more {
        padding: 9px 14px;
        font-size: 13px;
        border-radius: 8px;
    }
}

@media (max-width: 620px) {
    .st-hero { height: 300px; min-height: 300px; padding: 78px 12px 22px; }
    .st-hero-tabs { justify-content: flex-start; width: 100%; }
    .st-hero-engines { justify-content: center; }

    /* 手机上一行 4 格只有 75px 宽，图标就占满整张卡，站名和描述全被裁掉
       （只剩一个「淘」字图标）。改成一行 2 格，和下面「热门推荐」的节奏一致。 */
    .st-feat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .st-feat-card {
        height: auto;
        min-height: 68px;
        padding: 10px;
        gap: 10px;
    }
    .st-feat-card .st-site-media,
    .st-feat-card .st-site-icon,
    .st-feat-card .st-site-icon img {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border-radius: 9px;
    }
    .st-feat-card .st-site-name { font-size: 13.5px; }
    .st-feat-card .st-site-desc { font-size: 11.5px; }
    /* 两格里文字只剩 90 出头，站名像「淘宝(taobao.com)」一行只能显示「淘宝(taobao...」。
       手机上允许站名折两行（描述仍一行）：读完整名字比省 10px 高度重要。 */
    .st-feat-card .st-site-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 18px;
    }
    /* 虚位卡只有一个 + 和两行字，别让它比真卡矮一截 */
    .st-feat-empty { min-height: 68px; }
    .st-feat-plus { width: 38px; height: 38px; flex: 0 0 38px; }
    /* 手机上只留一个招租卡：全屏都是「虚位以待」比没位置更难看 */
    .st-feat-slot ~ .st-feat-slot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pane-in { animation: none; }
}

/* ---------- 底部 Dock（对齐 eeenav 的 .dock） ----------
 * 实测它的规格：position:fixed; bottom:20px; left:50%；
 * 背景 rgba(255,255,255,.65) + backdrop-filter saturate(2) blur(15px)；
 * 圆角 20px；padding 10px；shadow 0 10px 10px rgba(0,0,0,.1)；z-index 999；
 * 收起时 transform: translate(-50%, 70px)，整条藏到屏幕外。
 *
 * 我们的取舍：只在「接近页面底部」时升起 —— 首页很长，常驻会一直挡着内容；
 * 升起的时机正好是"一屏看完了，想再去个常用站"的时候。
 */
.st-dock {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 999;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .68);
    -webkit-backdrop-filter: saturate(2) blur(15px);
    backdrop-filter: saturate(2) blur(15px);
    border: 1px solid rgba(255, 255, 255, .65);
    box-shadow: 0 10px 26px rgba(16, 24, 40, .14);
    transform: translate(-50%, calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
    transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.st-dock.is-up {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}
html[data-theme="dark"] .st-dock {
    background: rgba(34, 36, 42, .74);
    border-color: rgba(255, 255, 255, .08);
}

.st-dock-list {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.st-dock-item { display: flex; }

.st-dock-link {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    text-decoration: none;
}
.st-dock-link img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    object-fit: contain;
    background: #fff;
    transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
/* macOS 那种往上弹一下的观感 */
.st-dock-link:hover img,
.st-dock-link:focus-visible img {
    transform: translateY(-9px) scale(1.16);
    box-shadow: 0 10px 20px rgba(16, 24, 40, .22);
}
.st-dock-tip {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translate(-50%, 4px);
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(17, 24, 39, .9);
    color: #fff;
    font-size: 11px;
    line-height: 1.5;
    white-space: nowrap;
    /* 站名带域名时能到 20 多个字，不限制会顶出屏幕左右边界 */
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s var(--ease), transform .16s var(--ease);
}
.st-dock-link:hover .st-dock-tip,
.st-dock-link:focus-visible .st-dock-tip {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* 手机上不显示：占屏幕高度，还会和浏览器底部工具栏/手势条打架 */
@media (hover: none), (max-width: 768px) {
    .st-dock { display: none; }
}

/*
 * Dock 压住页脚的问题
 *
 * Dock 是 position:fixed，不占文档流。滚到页面最底时它正好盖在
 * 版权行和雨云徽章上（站长截图指出的那处）。
 * 这里给页脚补一块底边距，让版权行停到 Dock 上方。
 *
 * 尺寸：Dock 高 62（40 图标 + 上下 padding 10）+ 距底 20 = 82，留 96 有余量。
 * 只在「Dock 会显示」的环境生效 —— 手机端 Dock 是 display:none，
 * 不加这段留白，不然页脚底下会凭空多出一截空白。
 * has-dock 由 core.js 在有 Dock 的页面加到 <html> 上。
 */
@media (hover: hover) and (min-width: 769px) {
    html.has-dock .st-footer-inner { padding-bottom: 96px; }
}
