/* ============================================================
   首页小组件：右栏模块（站点信息 / 随机网址 / 赞助 / 热搜 / 公告）
   与底部整宽模块（软件下载 / 分类专题四宫格）
   ============================================================ */

五、右栏模块
   数值取自 eeenav 主题实际规则（custom.css + 页面内联样式）：
   · 关于本站：封面 2:1（155 高、内缩 10、圆角 10）、头像 90 + 白色厚环、统计 16/700 主题色
   · 赞助伙伴：logo 38 圆形、名称 14/500、价格 13/600 #ff3b30、分隔线 0.5px
   · 站点公告：16px 时间轴轨道 + 2px 竖线 + 18px 节点、标题 13/500、更多按钮 36/圆角 10
   ============================================================ */

.st-rside { gap: 16px; }
.st-rside .st-card { padding: 16px; border-radius: 12px; }
.st-rside .st-card-head { margin-bottom: 12px; gap: 7px; }
.st-rside .st-card-title { font-size: 15px; font-weight: 600; }
.st-rside .st-card-title i { font-size: 16px; }
.st-rside .st-card-act { font-size: 13px; }

/* ① 站点信息卡 */
.st-sitecard { padding: 0 !important; overflow: hidden; }
.st-sitecard-cover {
    height: 155px;
    margin: 10px 10px 0;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffe0ec, #e6ecff 55%, #d9f1ff);
}
.st-sitecard-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 85%; }
.st-sitecard-avatar {
    position: relative;
    z-index: 2;
    display: block;
    width: 90px; height: 90px;
    margin: -45px auto 0;
    border: 4px solid var(--main-bg-color);
    border-radius: 50%;
    overflow: hidden;
    background: var(--main-bg-color);
    box-shadow: 0 0 0 5px var(--main-bg-color), 0 4px 14px rgba(16, 24, 40, .12);
}
.st-sitecard-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-sitecard-name {
    margin: 14px 0 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-strong);
}
.st-sitecard-desc {
    padding: 0 16px;
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.st-sitecard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 16px 8px 16px;
    text-align: center;
}
.st-sitecard-stats b {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--theme-color);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.st-sitecard-stats span { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }

/* ② 随机网址 */
.st-rand-wrap { min-height: 480px; }
.st-rand { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-rand[hidden] { display: none; }
.st-rand-item {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 52px;
    padding: 0 8px;
    border: 1px solid var(--line-color);
    border-radius: 8px;
    background: var(--main-bg-color);
    min-width: 0;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.st-rand-item:hover {
    border-color: var(--theme-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .06);
}
.st-rand-item img {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    object-fit: contain;
}
.st-rand-item span {
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-rand-item:hover span { color: var(--theme-color); }
html[data-theme="dark"] .st-rand-item { background: var(--muted-bg); border-color: var(--line-color); }
.st-rand-refresh {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 0;
    background: none;
    padding: 0;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}
.st-rand-refresh:hover { color: var(--theme-color); }
.st-rand-refresh.is-spin i { animation: stSpin .5s var(--ease); }
@keyframes stSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ③ 赞助伙伴 */
.st-sponsor { display: flex; flex-direction: column; margin: 0 -16px; }
.st-sponsor-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: .5px solid rgba(60, 60, 67, .08);
}
.st-sponsor-item:last-child { border-bottom: 0; }
.st-sponsor-logo {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    overflow: hidden;
    background: #f2f2f7;
    display: flex;
    align-items: center;
    justify-content: center;
}
html[data-theme="dark"] .st-sponsor-logo { background: #2a2d33; }
.st-sponsor-logo img { width: 100%; height: 100%; object-fit: cover; }
.st-sponsor-logo.is-empty {
    background: linear-gradient(135deg, #ffb020, #ff8a00);
    color: #fff;
    font-size: 17px;
}
.st-sponsor-info { flex: 1; min-width: 0; }
.st-sponsor-info b {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-sponsor-info em {
    display: block;
    margin-top: 1px;
    font-size: 12px;
    font-style: normal;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-sponsor-price {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 600;
    color: #ff3b30;
    white-space: nowrap;
}

/* ④ 热门搜索 */
.st-hot-tabs {
    display: flex;
    gap: 18px;
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line-color);
}
.st-hot-tab {
    position: relative;
    border: 0;
    background: none;
    padding: 0;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s var(--ease);
}
.st-hot-tab.on { color: var(--theme-color); font-weight: 600; }
.st-hot-tab.on::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -11px;
    height: 2px;
    border-radius: 2px;
    background: var(--theme-color);
}
.st-hot-list { list-style: none; margin: 0; padding: 0; }
.st-hot-list[hidden] { display: none; }
.st-hot-item { display: flex; align-items: center; gap: 10px; height: 32px; }
.st-hot-idx {
    width: 16px;
    flex: 0 0 16px;
    font-size: 13px;
    color: var(--text-xs);
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.st-hot-item:nth-child(-n+3) .st-hot-idx { color: #ff3b30; font-weight: 700; }
.st-hot-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-hot-name:hover { color: var(--theme-color); }

/* ⑤ 站点公告（时间轴：轨道 16 + 竖线 2 + 节点 18，标题 13/500） */
.st-notice {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 5px 0;
}
.st-notice::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 7px;
    width: 2px;
    border-radius: 1px;
    background: rgba(130, 130, 130, .2);
    pointer-events: none;
}
.st-notice-item {
    position: relative;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    padding-bottom: 16px;
}
.st-notice-item:last-child { padding-bottom: 0; }
.st-notice-node {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 18px;
    background: var(--main-bg-color);
}
.st-notice-node::after {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--line-strong);
    transition: background-color .2s var(--ease);
}
.st-notice-item:hover .st-notice-node::after { background: var(--theme-color); }
.st-notice-body { display: block; min-width: 0; }
.st-notice-t {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 18px;
    font-weight: 500;
    color: var(--text-color);
}
.st-notice-body:hover .st-notice-t { color: var(--theme-color); }
.st-notice-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-muted);
}
.st-notice-views { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap; }
.st-notice-views i { font-size: 12px; opacity: .85; }
.st-notice-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    margin-top: 12px;
    border-radius: 10px;
    background: var(--muted-bg);
    font-size: 13px;
    color: var(--text-muted);
    transition: color .2s var(--ease), background-color .2s var(--ease);
}
.st-notice-more:hover { color: var(--theme-color); background: var(--theme-soft); }

/* ⑥ 最近收录 */
.st-rside .st-latest-item { padding: 6px 4px; border-radius: 6px; font-size: 13px; }
.st-rside .st-latest-item:hover { background: var(--muted-bg); }
.st-rside .st-latest-ico { width: 20px; height: 20px; flex-basis: 20px; border-radius: 5px; }

/* ============================================================
   六、底部整宽模块（软件下载 / 分类专题四宫格）
   ============================================================ */

.st-download { margin-top: 0; }
.st-dl-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0 -8px;
}
.st-dl-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 9px;
    padding: 14px 8px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    min-width: 0;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}
.st-dl-item:hover {
    border-color: var(--theme-color);
    background: var(--main-bg-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}
.st-dl-icon {
    width: 64px; height: 64px;
    flex: 0 0 64px;
    border-radius: 16px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
html[data-theme="dark"] .st-dl-icon { background: #2a2d33; }
.st-dl-icon img { width: 56px; height: 56px; object-fit: contain; }
.st-dl-info { min-width: 0; width: 100%; display: flex; flex-direction: column; gap: 3px; align-items: center; }
.st-dl-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-dl-desc {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 30px;
}

/* 分类专题四宫格 */
.st-topics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 0;
}
/* 卡片：饱和一点的渐变底 + 角上的大图标装饰，条目做成浮在上面的白色小卡 */
.st-topic {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 16px 14px 14px;
    box-shadow: var(--shadow-sm);
}
.st-topic.tone-ai    { --hl: #d3e0ff; background: linear-gradient(158deg, #edf3ff 0%, #d7e4ff 100%); }
.st-topic.tone-movie { --hl: #ffd3c4; background: linear-gradient(158deg, #fff1ec 0%, #ffdccf 100%); }
.st-topic.tone-res   { --hl: #ddccff; background: linear-gradient(158deg, #f4edff 0%, #e3d4ff 100%); }
.st-topic.tone-tool  { --hl: #ffe19a; background: linear-gradient(158deg, #fffbe6 0%, #ffe9b5 100%); }
html[data-theme="dark"] .st-topic.tone-ai    { --hl: rgba(90, 130, 220, .32); background: linear-gradient(158deg, #1b2333, #1a2030); }
html[data-theme="dark"] .st-topic.tone-movie { --hl: rgba(220, 110, 80, .28); background: linear-gradient(158deg, #2a1d1b, #2a1a18); }
html[data-theme="dark"] .st-topic.tone-res   { --hl: rgba(140, 105, 220, .3); background: linear-gradient(158deg, #221d33, #1f1a2e); }
html[data-theme="dark"] .st-topic.tone-tool  { --hl: rgba(210, 165, 60, .28); background: linear-gradient(158deg, #2a2416, #292214); }

.st-topic-head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
}
.st-topic-head > i { font-size: 18px; color: var(--theme-color); }
.st-topic-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-strong);
    padding: 0 2px;
    background-image: linear-gradient(var(--hl), var(--hl));
    background-repeat: no-repeat;
    background-size: 100% 46%;
    background-position: 0 92%;
}
.st-topic-more { margin-left: auto; display: inline-flex; align-items: center; font-size: 12px; color: var(--text-muted); }
.st-topic-more:hover { color: var(--theme-color); }

.st-topic-list {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.st-topic-list a {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 10px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    min-width: 0;
    transition: background-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.st-topic-list a:hover {
    background: #fff;
    box-shadow: 0 5px 12px rgba(16, 24, 40, .09);
    transform: translateY(-1px);
}
html[data-theme="dark"] .st-topic-list a { background: rgba(255, 255, 255, .06); box-shadow: none; }
html[data-theme="dark"] .st-topic-list a:hover { background: rgba(255, 255, 255, .11); }

.st-topic-ico {
    width: 24px; height: 24px;
    flex: 0 0 24px;
    border-radius: 6px;
    object-fit: contain;
}
.st-topic-t {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-topic-list a:hover .st-topic-t { color: var(--theme-color); }
.st-topic-d {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 500;
    color: #ff7a2f;
    white-space: nowrap;
}
.st-topic-d.is-muted { color: var(--text-xs); font-weight: 400; }
/* 右侧数字按卡片主色走，四张卡各有自己的强调色 */
.tone-ai .st-topic-d { color: #4a7cff; }
.tone-movie .st-topic-d { color: #ff7a3d; }
.tone-res .st-topic-d { color: #8b5cf6; }
.tone-tool .st-topic-d { color: #16a34a; }

@media (max-width: 1200px) {
    .st-dl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    /* 四列在 1100 左右每张只剩 170，站名会被截成「Patter...」，提前折两列 */
    .st-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
    .st-dl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .st-download { margin-top: 12px; }
    .st-dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-topics { gap: 10px; margin-top: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .st-topics { grid-template-columns: minmax(0, 1fr); }
    .st-rside { gap: 12px; }
}

/* 卡片标题下加一条淡分隔线，结构感更接近 eeenav 的 widget-header */
.st-rside .st-card-head {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-color);
}
.st-rside .st-sitecard .st-card-head { border-bottom: 0; padding-bottom: 0; }

/* Hero 底部向下渐隐到页面底色，避免草坡和内容区之间出现生硬的色带 */
.st-hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 90px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(242, 244, 247, 0) 0%, rgba(242, 244, 247, .85) 60%, #f2f4f7 100%);
}
html[data-theme="dark"] .st-hero::after {
    background: linear-gradient(180deg, rgba(20, 22, 26, 0) 0%, rgba(20, 22, 26, .85) 60%, #14161a 100%);
}

/* 信息卡封面上色：底图是淡色插画，叠一层粉蓝渐变，接近 eeenav 的插画观感 */
.st-sitecard-cover { position: relative; }
.st-sitecard-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 172, 205, .5) 0%, rgba(168, 198, 255, .38) 52%, rgba(146, 226, 255, .45) 100%);
}
html[data-theme="dark"] .st-sitecard-cover::after {
    background: linear-gradient(135deg, rgba(90, 40, 70, .5) 0%, rgba(40, 52, 96, .55) 52%, rgba(20, 70, 92, .5) 100%);
}

/* 图标抓不到时的兜底：用站名首字做一个彩色块，避免整片空白灰块 */
.st-site-media.is-fallback::before {
    content: attr(data-letter);
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #7aa7ff, #a68bff);
}
.st-site:nth-child(4n+2) .st-site-media.is-fallback::before { background: linear-gradient(135deg, #ffa06b, #ff7a9c); }
.st-site:nth-child(4n+3) .st-site-media.is-fallback::before { background: linear-gradient(135deg, #59c9a5, #3aa8c9); }
.st-site:nth-child(4n+4) .st-site-media.is-fallback::before { background: linear-gradient(135deg, #ffc65c, #ff9f43); }

/* 推荐位的响应式规则已统一到 star-home.css（那边加载在后，写在这里会被它盖掉，
   2026-11-06 实测：这里写的 <=620 单列一直没生效，手机上还是 4 列挤成 75px）。 */

/* 搜索联想下拉：之前没有样式，是一块裸白 div */
.st-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    display: none;
    max-height: 420px;
    overflow-y: auto;
    padding: 6px;
    background: var(--main-bg-color);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(16, 24, 40, .16);
    text-align: left;
}
.st-suggest.show { display: block; }
.st-suggest a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    min-width: 0;
}
.st-suggest a:hover { background: var(--muted-bg); }
.st-suggest img {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 7px;
    object-fit: contain;
    background: var(--muted-bg);
}
.st-suggest-tx { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-suggest-name {
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-suggest-name em { color: var(--theme-color); font-style: normal; }
.st-suggest-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
