/* ============================================================
   组件样式：栏目面板 / 站点卡片 / 搜索联想 / 页脚 / 响应式
   —— 与 star-base.css 同属设计系统，按顺序在 base 之后加载
   ============================================================ */

/* ---------------- 七、栏目面板 ---------------- */
.st-panel {
    background: var(--main-bg-color);
    border-radius: var(--main-radius);
    box-shadow: var(--shadow-sm);
    padding: 12px;
}

.st-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    min-height: 36px;
    margin-bottom: 12px;
}
.st-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    letter-spacing: 0;
}
.st-panel-title i { color: var(--theme-color); font-size: 16px; }

.st-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.st-tabs::-webkit-scrollbar { display: none; }
.st-tab {
    border: 0;
    background: transparent;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}
.st-tab:hover { color: var(--theme-color); }
.st-tab.on {
    background: transparent;
    color: var(--theme-color);
    font-weight: 600;
}

.st-more {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.st-more:hover { color: var(--theme-color); }
.st-more i { font-size: 14px; }

/* ---------------- 八、站点卡片（横排：图标 + 站名 + 描述） ----------------
   eeenav 实测：980 卡片里一行 6 个，单项可视宽 146、高 59、间距 16；
   做法是容器 -8 外边距 + 每项 8 内边距，卡片左边缘与卡片内边距对齐。 */
.st-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}
.st-grid[hidden] { display: none; }

.st-site {
    flex: 0 0 16.6667%;
    max-width: 16.6667%;
    min-width: 0;
    padding: 8px;
}

.st-site-body {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 61px;
    padding: 10px 10px 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--main-radius);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease),
                transform .18s var(--ease), background-color .18s var(--ease);
}
.st-site-body:hover {
    background: var(--main-bg-color);
    border-color: var(--theme-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .1);
    transform: scale(1.03);
    position: relative;
    z-index: 3;
}
html[data-theme="dark"] .st-site-body:hover { background: var(--muted-bg); }

.st-site-media {
    position: relative;
    width: 30px; height: 30px;
    flex: 0 0 30px;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
}
html[data-theme="dark"] .st-site-media { background: #2a2d33; }
.st-site-blur {
    position: absolute;
    inset: -8px;
    background-size: cover;
    background-position: center;
    filter: blur(7px) saturate(140%);
    opacity: .5;
}
.st-site-icon {
    position: relative;
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.st-site-icon img {
    width: 30px; height: 30px;
    border-radius: 7px;
    object-fit: contain;
    display: block;
}

.st-site-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.st-site-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 21px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.st-site-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------- 九、搜索联想 ---------------- */
.st-suggest {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 6px);
    background: var(--main-bg-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    text-align: left;
    z-index: 60;
}
.st-suggest.show { display: block; }
.st-suggest a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
}
.st-suggest a:hover { background: var(--muted-bg); }
/* 键盘上下键高亮，与 hover 保持同一视觉反馈 */
.st-suggest a.is-active { background: var(--muted-bg); }
.st-suggest img {
    width: 24px; height: 24px;
    border-radius: 6px;
    flex: 0 0 24px;
    object-fit: contain;
}
.st-suggest-tx { min-width: 0; display: flex; flex-direction: column; }
.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: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------- 十、页脚 ---------------- */
/* 云服务赞助声明：单独一行，跟在版权行下面。
   图标是雨云品牌标识里的图形部分（太阳/云/雨），16px 显示，1x/2x 屏都够清晰。 */
/*
 * 云服务声明（雨云）
 * 曾经单独占一行（.st-footer-credit，居中、margin-top 10px）挂在最底部，
 * 翻到底只看到一行孤零零的小字。现在并入版权行，跟在 Copyright 后面。
 * 22px 的图标塞进 12px 的行里，靠 vertical-align: middle 对齐文字中轴。
 */
.st-footer-rainyun {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    vertical-align: middle;
    color: var(--text-muted);
    transition: color .16s var(--ease);
}
.st-footer-rainyun img {
    display: block;
    /* 22px 是能看出「太阳 + 云 + 雨滴」的最小尺寸，再小就糊成一个点 */
    width: 22px;
    height: 22px;
    flex: none;
}
.st-footer-rainyun b { font-weight: 400; color: var(--text-color); transition: color .16s var(--ease); }
.st-footer-rainyun:hover,
.st-footer-rainyun:hover b { color: var(--theme-color); }
/* 手机端这一行本来就满，图标缩到 18、间距收到 8，否则右端贴屏幕边 */
@media (max-width: 480px) {
    .st-footer-rainyun { margin-left: 8px; gap: 5px; }
    .st-footer-rainyun img { width: 18px; height: 18px; }
}

.st-footer {
    margin-top: 8px;
    background: var(--main-bg-color);
}
.st-footer-inner {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 28px 20px 24px;
}
.st-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 18px;
    font-size: 13px;
    color: var(--text-muted);
}
.st-footer-links a:hover { color: var(--theme-color); }
.st-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line-color);
    font-size: 12px;
    color: var(--text-xs);
}
.st-footer-bottom {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-xs);
    line-height: 1.9;
}

.st-top {
    position: fixed;
    right: 22px;
    bottom: 26px;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--main-bg-color);
    color: var(--text-muted);
    box-shadow: var(--shadow-md);
    z-index: 120;
}
.st-top.show { display: flex; }
.st-top:hover { color: var(--theme-color); }

/* ---------------- 十一、响应式 ---------------- */
@media (max-width: 1200px) {
    .st-wrap { grid-template-columns: 92px minmax(0, 1fr); gap: 0 14px; }
    .st-side { width: 92px; }
    .st-cols { grid-template-columns: minmax(0, 1fr) 240px; gap: 20px 14px; }
    .st-rside { width: 240px; }
    .st-site { flex-basis: 20%; max-width: 20%; }
}

@media (max-width: 1024px) {
    .st-wrap { grid-template-columns: 88px minmax(0, 1fr); }
    .st-side { width: 88px; }
    .st-cols { grid-template-columns: minmax(0, 1fr); }
    .st-rside { display: none; }
    .st-site { flex-basis: 25%; max-width: 25%; }
}

@media (max-width: 860px) {
    .st-header { height: 64px; padding: 0 8px; }
    .st-header-inner { height: 52px; margin-top: 6px; padding: 0 10px; }
    .st-burger { display: flex; align-items: center; justify-content: center; }
    .st-logo { margin-right: auto; }
    .st-logo img { width: 30px; height: 30px; flex-basis: 30px; }
    .st-logo-name { font-size: 16px; }
    .st-nav { display: none; }
    .st-hbtn span { display: none; }

    .st-wrap {
        grid-template-columns: minmax(0, 1fr);
        margin-top: -36px;
        padding: 0 10px 28px;
        gap: 12px;
        /* 手机端抽屉要盖过 fixed 顶栏和遮罩，这里不能再自建层叠上下文 */
        z-index: auto;
    }
    .st-cols { margin-top: 12px; }
    .st-flow { gap: 12px; }
    .st-side {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 250px;
        max-height: none;
        z-index: 250;
        padding: 14px 10px;
        background: var(--main-bg-color);
        border-radius: 0;
        box-shadow: var(--shadow-lg);
        transform: translateX(-102%);
        transition: transform .25s var(--ease);
    }
    .st-side.open { transform: translateX(0); }
    .st-side-title { justify-content: flex-start; gap: 8px; padding: 0 6px 0 4px; height: 40px; }
    .st-side-title > span { display: block; font-size: 14px; font-weight: 600; }
    .st-side-toggle { width: 30px; height: 28px; margin-left: auto; }
    .st-side-toggle-tx { display: none; }   /* 抽屉里只留箭头，标题已经写了「分类导航」 */
    .st-menu { padding: 0; }
    .st-menu a {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        height: 44px;
        padding: 0 10px;
        border-radius: 8px;
        text-align: left;
    }
    .st-menu a.on { background: var(--theme-soft); box-shadow: none; }
    .st-menu a.on::before { display: none; }
    .st-menu a .mi { width: 22px; height: 22px; flex-basis: 22px; }
    .st-menu a .mi .mdi { font-size: 21px; }
    .st-side-label { font-size: 13px; max-width: none; }
    .st-side-actions { border-top: 0; }
    .st-side-btn { flex-direction: row; justify-content: flex-start; gap: 8px; height: 40px; padding: 0 10px; font-size: 13px; }

    .st-panel { padding: 12px 10px; }
    .st-panel-title { font-size: 15px; }
    .st-panel-title i { font-size: 17px; }
    .st-grid { margin: 0 -6px; }
    .st-site { flex-basis: 33.3333%; max-width: 33.3333%; padding: 6px; }
    .st-site-body { height: 56px; padding: 8px 8px 8px 10px; gap: 8px; }
    .st-footer-inner { padding: 20px 14px; }
}

@media (max-width: 620px) {
    .st-site { flex-basis: 50%; max-width: 50%; }
    .st-site-body { height: 58px; }
    .st-site-name { font-size: 13px; }
    .st-site-desc { font-size: 11px; }
    .st-more { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* 栏目头部右侧工具区：翻页 + 更多 */
.st-panel-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}
.st-panel-tools .st-more { margin-left: 0; }
.st-pager { display: inline-flex; align-items: center; gap: 4px; }
.st-pager-btn {
    width: 26px; height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-color);
    border-radius: 7px;
    background: var(--main-bg-color);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    transition: color .15s var(--ease), border-color .15s var(--ease), background-color .15s var(--ease);
}
.st-pager-btn:hover:not(:disabled) {
    color: var(--theme-color);
    border-color: var(--theme-color);
}
.st-pager-btn:disabled { opacity: .38; cursor: default; }
.st-pager-num {
    min-width: 18px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.st-pager.is-loading { opacity: .55; pointer-events: none; }

/* 手机上给翻页按钮留够点击面积 */
@media (max-width: 860px) {
    .st-pager-btn { width: 30px; height: 30px; }
    .st-panel-tools { gap: 10px; }
}

/* 明暗切换按钮：theme.js 注入的是裸 button，和胶囊里的按钮对齐一下 */
.st-header-right .ys-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s var(--ease), background-color .15s var(--ease);
}
.st-header-right .ys-theme-toggle i { font-size: 17px; line-height: 1; }
.st-header-right .ys-theme-toggle:hover { color: var(--theme-color); background: rgba(0, 0, 0, .05); }
html[data-theme="dark"] .st-header-right .ys-theme-toggle:hover { background: rgba(255, 255, 255, .08); }

/* 页脚数据条：访问量与收录规模 */
.st-footer-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 2px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line-color);
}
.st-fs-item {
    position: relative;
    padding: 6px 8px;
    text-align: center;
}
.st-fs-item + .st-fs-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 26px;
    transform: translateY(-50%);
    background: var(--line-color);
}
.st-fs-item b {
    display: block;
    font-size: 24px;
    line-height: 1.2;
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.5px;
    transition: color .16s var(--ease);
}
.st-fs-item span {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-muted);
}
.st-fs-item:hover b { color: var(--theme-color); }

@media (max-width: 640px) {
    .st-footer-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 2px; margin-bottom: 18px; padding-bottom: 16px; }
    .st-fs-item { padding: 4px 2px; }
    .st-fs-item b { font-size: 19px; }
    .st-fs-item span { font-size: 11px; }
    /* 三列时每行第一项不该有左竖线，否则行首会多出一根悬空的线 */
    .st-fs-item:nth-child(3n+1)::before { display: none; }
}

/* 站点卡片悬停时右上角的小飞机：提示「点进去会离开本站」 */
.st-site-body { position: relative; }
.st-site-go {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--theme-color);
    color: #fff;
    box-shadow: 0 3px 8px rgba(241, 64, 75, .35);
    opacity: 0;
    transform: translate(-5px, 5px) scale(.75);
    transition: opacity .18s var(--ease), transform .18s var(--ease);
    pointer-events: none;
}
.st-site-go i {
    font-size: 13px;
    line-height: 1;
    /* 飞机默认朝右，转 -45° 变成朝右上，像起飞 */
    transform: rotate(-45deg);
}
.st-site-body:hover .st-site-go,
.st-site-body:focus-visible .st-site-go {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}
@media (prefers-reduced-motion: reduce) {
    .st-site-go { transition: opacity .12s linear; transform: none; }
}

/* 触屏设备没有 hover，飞机只在点击瞬间闪一下，不如不显示 */
@media (hover: none) {
    .st-site-go { display: none; }
}
