@charset "UTF-8";
/**
 * FlintHub — 首页精选区块插件 样式
 *
 * 内容分三段：
 *   A. 前台精选区块（.hs-*）：左轮播 + 右 Tab 帖子列表，纯 CSS radio tab（零 JS 切换）
 *   B. 前台上墙页（.hs-wall-*）
 *   C. 后台设置页（.hs-adm-*）：仅补充核心 admin.css 未覆盖的局部
 *
 * ⚠️ 颜色**只用既有 `--mn-*`（前台）与 `--c-*`（后台）变量**：
 *    `--mn-danger` 虽存在但语义是错误色，本插件不需要；`--mn-spectrum-*` 从未定义。
 * ⚠️ 本文件在 `layout_head_end` 注入 → **加载早于核心 modern.css / admin.css**
 *    → 与核心**同特异性**的冲突一律由核心后胜 ⇒ 覆盖核心属性必须**提高特异性**
 *    （例：`.mn-section.hs-section` 而非 `.hs-section`），不要靠 `!important` 打补丁。
 * ⚠️ 轮播图上的标题是**图片上的浮层**，与主题无关 → 固定白字 + 深色渐变（不取 --mn-*）。
 * ⚠️ 改动本文件后 URL 上的 `?v=filemtime` 会自动变化 → 浏览器缓存失效，无需手动 bump。
 *
 * @file plugins/home_spotlight/assets/style.css
 * @package Plugin\HomeSpotlight
 * @version 1.0.0
 */

/* ==========================================================================
   A. 前台精选区块
   ========================================================================== */

/* 外层：复用核心 .mn-section 的卡片底（背景/边框/圆角/阴影），这里只改成两栏 */
.mn-section.hs-section {
    display: flex;
    align-items: flex-start;
}

/* ---------- A.1 左：轮播 ---------- */
.hs-left {
    flex: 0 0 300px;
    max-width: 300px;
    padding: 12px 0 12px 12px;
}

.hs-rotator {
    position: relative;
    width: 100%;
    /* 3:2（与参考图一致）；老浏览器不支持 aspect-ratio 时由 min-height 兜底 */
    aspect-ratio: 3 / 2;
    min-height: 180px;
    /* ★ 1px 细边框（主题边框色 --mn-border）：白底图在白色卡片上不再"糊"成一片，
       图片边界清晰。用主题变量而非硬编码色值 → 换配色变体时自动跟随。
       配合 overflow:hidden：图片被裁在 border 内侧，边框不会被图盖住。 */
    border: 1px solid var(--mn-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--mn-tag-bg);
}

.hs-track {
    position: absolute;
    inset: 0;
}

.hs-slide {
    position: absolute;
    inset: 0;
    display: none;
    text-decoration: none;
    color: inherit;
}

.hs-slide.is-active {
    display: block;
}

.hs-slide img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hs-slide-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 10px 8px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, .66), rgba(0, 0, 0, 0));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hs-nav {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.hs-nav-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, .38);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hs-nav-btn:hover {
    background: rgba(0, 0, 0, .6);
}

.hs-dots {
    position: absolute;
    left: 10px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hs-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: background-color .12s, width .12s;
}

.hs-dot.is-active {
    width: 16px;
    border-radius: 4px;
    background: #fff;
}

/* ---------- A.2 右：Tab + 帖子列表 ---------- */
.hs-right {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px 12px;
}

/* 视觉隐藏但仍可聚焦：键盘 Tab 聚焦 + 方向键切换 → :checked 联动（不能 display:none） */
.hs-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.hs-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--mn-border-light);
}

.hs-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--mn-text-secondary);
    cursor: pointer;
    transition: color .12s, background-color .12s;
}

.hs-tab:hover {
    color: var(--mn-primary);
    background: var(--mn-bg-row-hover);
}

.hs-panes {
    padding-top: 6px;
}

.hs-pane {
    display: none;
}

/* 纯 CSS 切换：radio 是 .hs-tabs / .hs-panes 的前置兄弟节点
   （:nth-of-type 只数 input —— 本面板内**零 <form>**，故不会被隐藏域打乱序号） */
.hs-radio:nth-of-type(1):checked ~ .hs-tabs > .hs-tab:nth-child(1),
.hs-radio:nth-of-type(2):checked ~ .hs-tabs > .hs-tab:nth-child(2),
.hs-radio:nth-of-type(3):checked ~ .hs-tabs > .hs-tab:nth-child(3),
.hs-radio:nth-of-type(4):checked ~ .hs-tabs > .hs-tab:nth-child(4),
.hs-radio:nth-of-type(5):checked ~ .hs-tabs > .hs-tab:nth-child(5) {
    background: var(--mn-primary);
    color: var(--mn-text-inverse);
    font-weight: 500;
}

.hs-radio:nth-of-type(1):checked ~ .hs-panes > .hs-pane:nth-child(1),
.hs-radio:nth-of-type(2):checked ~ .hs-panes > .hs-pane:nth-child(2),
.hs-radio:nth-of-type(3):checked ~ .hs-panes > .hs-pane:nth-child(3),
.hs-radio:nth-of-type(4):checked ~ .hs-panes > .hs-pane:nth-child(4),
.hs-radio:nth-of-type(5):checked ~ .hs-panes > .hs-pane:nth-child(5) {
    display: block;
}

.hs-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hs-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 2px;
    border-bottom: 1px solid var(--mn-border-light);
}

.hs-item:last-child {
    border-bottom: none;
}

.hs-item-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--mn-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hs-item-title:hover {
    color: var(--mn-primary);
}

.hs-item-meta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    white-space: nowrap;
}

.hs-item-author {
    color: var(--mn-text-secondary);
    text-decoration: none;
}

.hs-item-author:hover {
    color: var(--mn-primary);
}

.hs-item-time {
    color: var(--mn-text-muted);
}

.hs-foot {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
}

.hs-wall-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid var(--mn-primary);
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    line-height: 1.4;
    color: var(--mn-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s, color .12s;
}

.hs-wall-btn:hover {
    background: var(--mn-primary-subtle);
}

.hs-empty {
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: var(--mn-text-muted);
}

/* ==========================================================================
   B. 前台上墙页
   ========================================================================== */

.hs-wall-body {
    padding: 14px 16px 18px;
}

.hs-wall-intro {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--mn-text-secondary);
}

.hs-wall-stats {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 12.5px;
    color: var(--mn-text-muted);
}

.hs-wall-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--mn-border-light);
}

.hs-wall-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--mn-border-light);
}

.hs-wall-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    color: var(--mn-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hs-wall-title:hover {
    color: var(--mn-primary);
}

.hs-wall-time {
    flex: 0 0 auto;
    font-size: 12.5px;
    color: var(--mn-text-muted);
}

.hs-wall-op {
    flex: 0 0 auto;
}

.hs-wall-tag {
    font-size: 12.5px;
    color: var(--mn-primary);
    white-space: nowrap;
}

.hs-wall-form {
    display: inline;
    margin: 0;
}

.hs-wall-btn-sm {
    padding: 4px 12px;
    font-size: 12.5px;
}

/* ==========================================================================
   C. 后台设置页（加载早于 admin.css → 一律用更高特异性）
   ========================================================================== */

/* 说明文字：核心没有对应类，自建即可（不与核心同名） */
.hs-adm-hint {
    margin: 4px 0 8px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--c-text-muted, #64748b);
}

/* 复选行：核心 `.admin-content .form-group label` 是 display:block (0,2,1)，
   这里用 (0,3,1) 压过去，让 checkbox 与文字同行 */
.admin-content .form-group label.hs-adm-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 0;
    font-weight: 500;
    color: var(--c-text, #1e293b);
    cursor: pointer;
}

.admin-content .form-group label.hs-adm-check input[type="checkbox"] {
    margin: 0;
    flex: 0 0 auto;
}

/* 数字输入：核心 `.admin-content .form-group input:not(...)` 是 width:100% (0,4,1)。
   不正面冲突 —— 用 max-width 收窄（max-width 优先于 width），零特异性战争。 */
.admin-content .hs-adm-input {
    max-width: 160px;
}

.admin-content .hs-adm-seq {
    max-width: 76px;
}

.admin-content .hs-adm-textarea {
    max-width: 620px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Tab 勾选行 */
.hs-adm-tabrows {
    max-width: 620px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.hs-adm-tabrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--c-border, #e2e8f0);
}

.hs-adm-tabrow:last-child {
    border-bottom: none;
}

.hs-adm-tabrow-head {
    background: var(--c-bg-light, #f1f5f9);
    font-size: 12.5px;
    color: var(--c-text-muted, #64748b);
}

.hs-adm-actions {
    margin-top: 20px;
}

/* 新增轮播图：字段两列排布 */
.hs-adm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 18px;
    max-width: 760px;
}

.hs-adm-file {
    display: block;
    max-width: 100%;
    font-size: 13px;
    color: var(--c-text-secondary, #475569);
}

/* 轮播图列表：每张图一个自成一体的 <form> 卡片（表单不能横跨 <tr>，故不用 table） */
.hs-adm-slides {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hs-adm-slide {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 8px;
    background: var(--c-bg, #ffffff);
    flex-wrap: wrap;
}

.hs-adm-slide-thumb {
    flex: 0 0 160px;
    width: 160px;
    height: 107px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--c-bg-light, #f1f5f9);
}

.hs-adm-slide-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hs-adm-slide-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 24px;
    color: var(--c-text-muted, #94a3b8);
}

.hs-adm-slide-fields {
    flex: 1 1 320px;
    min-width: 240px;
}

.hs-adm-slide-ops {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
}

/* 上墙记录表：不复用核心 .admin-table（其列序/nowrap/移动端重排均按别的语义硬编码） */
.hs-adm-scroll {
    overflow-x: auto;
}

.hs-adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--c-bg, #ffffff);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.hs-adm-table th,
.hs-adm-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--c-border, #e2e8f0);
    vertical-align: middle;
}

.hs-adm-table thead th {
    background: var(--c-bg-light, #f1f5f9);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-text-secondary, #475569);
    white-space: nowrap;
}

.hs-adm-table tbody tr:last-child td {
    border-bottom: none;
}

.hs-adm-table th.hs-adm-num,
.hs-adm-table td.hs-adm-num {
    text-align: right;
    white-space: nowrap;
}

.hs-adm-uid {
    margin-left: 6px;
    font-size: 12px;
    color: var(--c-text-muted, #64748b);
}

.hs-adm-muted {
    color: var(--c-text-muted, #64748b);
}

.hs-adm-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11.5px;
    background: var(--c-bg-light, #f1f5f9);
    color: var(--c-text-muted, #64748b);
}

/* 已过期行：整行减淡，避免管理员误以为还在墙上 */
.hs-adm-row-off td {
    opacity: .6;
}

.hs-adm-inline-form {
    display: inline-block;
    margin: 0;
}

.hs-adm-empty {
    margin: 0;
    font-size: 13px;
    color: var(--c-text-muted, #64748b);
}

/* ==========================================================================
   D. 移动端收敛
   ========================================================================== */
@media (max-width: 768px) {
    .mn-section.hs-section {
        flex-direction: column;
    }

    /* ★ 窄屏把轮播图「拉宽」= 去掉左右内边距，让图片通栏贴到区块两边（原来左右各留 12px，
       在 375px 屏上白丢 24px）。圆角改由外层 .mn-section 的 overflow:hidden 统一裁切；
       上/左/右三边边框一并去掉，否则会与区块自身的 1px 边框叠成双线。 */
    .hs-left {
        flex: 0 0 auto;
        max-width: none;
        padding: 0;
    }

    .hs-rotator {
        border-radius: 0;
        border-top: 0;
        border-right: 0;
        border-left: 0;
    }

    .hs-right {
        padding: 10px 12px 12px;
    }

    .hs-tabs {
        gap: 2px;
    }

    .hs-tab {
        padding: 6px 9px;
    }

    /* ★ 窄屏帖子标题：改为「独占一行 + 最多折两行」。
       原来强制单行（white-space:nowrap）又被右侧作者名挤窄，长标题只剩十几个字就省略号截断
       （如「[程序发布] Flinthub 1.1.0 完…」）。现在标题拿整行宽度、最多两行 → 完整显示；
       作者名顺延到第二行，行距收紧（row-gap 1px）避免行高虚胖。 */
    .hs-item {
        flex-wrap: wrap;
        gap: 1px 8px;
    }

    .hs-item-title {
        flex: 1 1 100%;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        white-space: normal;
        font-size: 13px;
        line-height: 1.45;
    }

    .hs-item-meta {
        flex: 0 0 auto;
    }

    /* 窄屏把「时间」收起来，保证标题不被挤没 */
    .hs-item-time {
        display: none;
    }

    .hs-adm-slide-thumb {
        flex-basis: 120px;
        width: 120px;
        height: 80px;
    }
}
