/**
 * FlintHub — 网盘互助插件（netdisk_help）前台样式
 *
 * 约定：
 *   · 类名前缀一律 .ndh-（规范 §十二：插件样式必须带前缀，防与核心/其它插件撞名）
 *   · 颜色**只用全主题（9/9）都定义过的 --mn-* 变量**，零硬编码色值；
 *     已核实**不存在**的变量（用了会静默回落成空 → 颜色丢失）：
 *     --mn-danger / --mn-radius / --mn-radius-sm / --mn-bg-light / --mn-panel-color
 *   · 注入点在 app/Views/layouts/main.php:40，**早于核心 editor.css** →
 *     同权重时核心后胜，故本文件不试图覆盖核心类；需要盖过核心时用元素+类提权
 *     （如 `select.ndh-select`，核心 .mn-select 是 (0,1,0)）
 *
 * @file plugins/netdisk_help/assets/style.css
 * @package Plugin\NetdiskHelp
 * @version 1.0.0
 */

/* ============================================================ 独立页：外壳 */

.ndh-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mn-border-light);
}

.ndh-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--mn-text);
}

.ndh-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ndh-my-points {
    font-size: 13px;
    color: var(--mn-text-secondary);
}

.ndh-intro {
    margin: 0;
    padding: 12px 20px 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--mn-text-muted);
}

/* ============================================================ 提示条 */

.ndh-flash,
.ndh-error {
    margin: 12px 20px;
    padding: 10px 14px;
    border: 1px solid var(--mn-border-light);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    background: var(--mn-tag-bg);
}

.ndh-flash-success {
    color: var(--mn-success);
}

.ndh-flash-error,
.ndh-error {
    color: var(--mn-error);
}

/* ============================================================ 状态筛选 */

.ndh-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
}

.ndh-tab {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
    background: var(--mn-tag-bg);
    color: var(--mn-text-secondary);
}

.ndh-tab:hover {
    color: var(--mn-primary);
}

.ndh-tab-active {
    background: var(--mn-primary-subtle);
    color: var(--mn-primary);
}

/* ============================================================ 求助列表 */

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

.ndh-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--mn-border-light);
}

.ndh-item-main {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 8px;
}

.ndh-item-title {
    font-size: 14px;
    color: var(--mn-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ndh-item-meta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    font-size: 12px;
    color: var(--mn-text-muted);
}

.ndh-points {
    font-weight: 600;
    color: var(--mn-primary);
}

/* ============================================================ 状态徽章 */

.ndh-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 18px;
    white-space: nowrap;
    background: var(--mn-tag-bg);
    color: var(--mn-text-secondary);
}

.ndh-badge-pending {
    color: var(--mn-primary);
}

.ndh-badge-assisting {
    color: var(--mn-warning);
}

.ndh-badge-completed {
    color: var(--mn-success);
}

.ndh-badge-expired,
.ndh-badge-cancelled {
    color: var(--mn-text-muted);
}

/* ============================================================ 空状态 / 分页 */

.ndh-empty {
    padding: 36px 20px;
    text-align: center;
    font-size: 14px;
    line-height: 1.9;
    color: var(--mn-text-muted);
}

.ndh-empty-link {
    color: var(--mn-primary);
    text-decoration: none;
}

/* ============================================================ 发布表单 */

.ndh-form {
    padding: 16px 20px 24px;
}

.ndh-row {
    margin-bottom: 18px;
}

.ndh-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--mn-text-secondary);
}

.ndh-help {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--mn-text-muted);
}

.ndh-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* 提权：核心 .mn-textarea 是 (0,1,0)，同权重时核心后胜 → 用元素+类 (0,1,1) */
textarea.ndh-textarea {
    min-height: 170px;
}

/* 提权：核心 .mn-select 未设宽度，(0,1,0) → 元素+类 (0,1,1) 才能控宽 */
select.ndh-select {
    width: 100%;
    max-width: 320px;
}

/* ============================================================ 帖子详情页：求助卡片 */

/* ⚠️ 本卡片只在**该帖自己发过求助**时渲染（Plugin::findByThread()），
   不再按版块判断 —— 所以这里没有「列表」「入口按钮」那套通用件。
   `.ndh-entry-list/-item/-btn/-inline/-icon/-text/-sub` 已于 2026-09-28 随旧实现删除，
   它们当时服务于「按版块列出本版块最新求助」的旧行为。 */

.ndh-entry {
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px solid var(--mn-border-light);
    border-radius: 8px;
    background: var(--mn-bg-card);
}

.ndh-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.ndh-entry-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mn-text);
}

.ndh-entry-desc {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--mn-text-muted);
}

.ndh-entry-more {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--mn-primary);
    text-decoration: none;
}

/* PRG 一次性提示嵌在卡片内部 → 抵消 .ndh-flash 的页面级外边距。
   ⚠️ `.ndh-entry .ndh-flash` 是 (0,2,0)，压过 .ndh-flash 的 (0,1,0)，
   与书写顺序无关 —— 这正是本仓「插件 CSS 早于核心」环境下唯一可靠的提权写法。 */
.ndh-entry .ndh-flash {
    margin: 0 0 10px;
}

/* ============================================================ 发帖页：附带求助折叠块 */

/* ⚠️ 类名一律用 `.ndh-embed-*`，**绝不能复用 `.ndh-form`** ——
   那个类名已被独立页发布表单占用（见上方 `.ndh-form { padding: 16px 20px 24px; }`），
   复用到 `<details>` 上会串出莫名其妙的页面级内边距。 */

.ndh-embed {
    margin: 14px 0;
    border: 1px solid var(--mn-border-light);
    border-radius: 8px;
    background: var(--mn-bg-card);
}

.ndh-embed-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--mn-text);
    cursor: pointer;
}

.ndh-embed-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.ndh-embed-hint {
    font-size: 12px;
    color: var(--mn-text-muted);
}

.ndh-embed-body {
    padding: 0 14px 14px;
    border-top: 1px solid var(--mn-border-light);
}

.ndh-embed-field {
    margin: 12px 0 0;
}

.ndh-embed-help {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--mn-text-muted);
}

.ndh-embed-help-warn {
    margin-top: 12px;
    color: var(--mn-warning);
}

/* 提权：核心 .mn-input 是 (0,1,0)，同权重时核心后胜 → 元素+类 (0,1,1) 才能控宽 */
input.ndh-embed-input {
    max-width: 200px;
}

/* ============================================================ 后台：版块勾选网格 */

.ndh-forum-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    max-width: 720px;
}

.ndh-forum-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid var(--mn-border-light);
    border-radius: 6px;
    font-size: 13px;
    color: var(--mn-text);
    cursor: pointer;
}

.ndh-forum-item:hover {
    background: var(--mn-tag-bg);
}

/* ============================================================ 列表：可点标题 */

.ndh-item-link {
    text-decoration: none;
}

.ndh-item-link:hover {
    color: var(--mn-primary);
}

/* ============================================================ 求助详情 */

.ndh-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: var(--mn-text-secondary);
    text-decoration: none;
}

.ndh-back:hover {
    color: var(--mn-primary);
}

.ndh-detail-card {
    padding: 16px 20px;
    border-top: 1px solid var(--mn-border-light);
}

.ndh-detail-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ndh-detail-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--mn-text);
    word-break: break-word;
}

.ndh-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--mn-text-muted);
}

.ndh-detail-user {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ndh-detail-content {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--mn-text);
    background: var(--mn-bg-body);
    word-break: break-word;
}

/* ============================================================ 应助区 */

.ndh-answers {
    padding: 16px 20px;
    border-top: 1px solid var(--mn-border-light);
}

.ndh-answers-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.ndh-answers-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--mn-text);
}

.ndh-privacy {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.7;
    color: var(--mn-text-muted);
}

.ndh-answers-empty {
    padding: 24px 0;
}

/* 「还有 N 条你看不到」的提示（求助者/管理员以外的访客会看到） */
.ndh-hidden-note {
    margin: 10px 0 0;
    padding: 10px 14px;
    border: 1px solid var(--mn-border-light);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--mn-text-muted);
    background: var(--mn-tag-bg);
}

.ndh-answer-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.ndh-answer {
    padding: 12px 14px;
    border: 1px solid var(--mn-border-light);
    border-radius: 8px;
    background: var(--mn-bg-card);
}

.ndh-answer + .ndh-answer {
    margin-top: 10px;
}

/* 自己那条应助：描边高亮，便于快速定位 */
.ndh-answer-mine {
    border-color: var(--mn-primary);
}

.ndh-answer-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--mn-text-muted);
}

.ndh-answer-user {
    font-weight: 600;
    color: var(--mn-text-secondary);
}

.ndh-answer-state {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--mn-tag-bg);
}

.ndh-answer-state-done {
    color: var(--mn-success);
}

.ndh-answer-state-wait {
    color: var(--mn-warning);
}

.ndh-answer-body {
    margin-top: 8px;
}

.ndh-answer-link {
    display: block;
    font-size: 13px;
    line-height: 1.7;
    color: var(--mn-primary);
    text-decoration: none;
    word-break: break-all;
}

.ndh-answer-link:hover {
    text-decoration: underline;
}

/* 非法协议链接的降级展示（纯文本，不可点） */
.ndh-answer-link-plain {
    display: block;
    font-size: 13px;
    line-height: 1.7;
    color: var(--mn-text-muted);
    word-break: break-all;
}

.ndh-answer-code {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    background: var(--mn-tag-bg);
    color: var(--mn-text-secondary);
}

.ndh-answer-note {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--mn-text-secondary);
    word-break: break-word;
}

/* ============================================================ 应助表单 */

.ndh-answer-form {
    padding: 16px 20px 24px;
    border-top: 1px solid var(--mn-border-light);
}

.ndh-answer-form-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mn-text);
}

.ndh-answer-blocked {
    padding: 16px 20px;
    border-top: 1px solid var(--mn-border-light);
    font-size: 13px;
    line-height: 1.8;
    color: var(--mn-text-muted);
}

/* 提权：核心 .mn-input / .mn-textarea 都是 (0,1,0)，同权重时核心后胜
   （插件 CSS 在 main.php:40 注入，早于核心 editor.css）→ 元素+类 (0,1,1) 才能控宽 */
input.ndh-answer-code-input {
    max-width: 200px;
}

textarea.ndh-answer-note-input {
    min-height: 90px;
}

/* ============================================================ 采纳 */

/* 已采纳那条应助：成功色描边，和「待采纳」拉开距离。
   ⚠️ 与 .ndh-answer-mine 同为 (0,1,0) —— 两者互斥（求助者不可能应助自己的求助），
   但本规则写在**文件更靠后**的位置，即使同时命中也是它胜，符合直觉。 */
.ndh-answer-accepted {
    border-color: var(--mn-success);
}

/* 采纳按钮容器。.ndh-accept-form 是核心没有的新类 → 不涉及同权重层叠问题，
   只写核心没定义的属性即可（按钮本身沿用 .mn-btn .mn-btn-primary .mn-btn-sm）。 */
.ndh-accept-form {
    margin-top: 10px;
}

/* 列表项里的「已采纳 / 待采纳」小徽章（我的互助 → 我应助的）
   —— 复用 .ndh-answer-state 的底色，这里只补它没有的间距 */
.ndh-item-title + .ndh-answer-state {
    margin-left: 8px;
    flex: none;
}

/* ============================================================ 取消 / 过期 */

/* 终态说明（已过期 / 已取消）—— 复用 .ndh-hidden-note 的描边块形态，保持视觉一致。
   ⚠️ 与 .ndh-cancel-form 同属「页面级兄弟节点」，原 `margin: 10px 0 0` 同样
   ① 贴左、② 贴下方 .ndh-answers 的分割线 → 一并补 20px 左右缩进 + 下边距。
   （两者互斥：终态显示本块，未终态才显示取消按钮，永不共存。） */
.ndh-final-note {
    margin: 10px 20px 16px;
    padding: 10px 14px;
    border: 1px solid var(--mn-border-light);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--mn-text-muted);
}

/* ⚠️ 页面级块的统一约定 = 左右各 20px 缩进（.ndh-head / .ndh-detail-card /
   .ndh-answers / .ndh-answer-form / .ndh-answer-blocked 都是 `padding: … 20px`）。
   本表单是 .ndh-detail-card 与 .ndh-answers 的**兄弟节点**，原实现只写 margin-top：
     ① 没有左右内边距 → 按钮**贴住卡片左边缘**，与上下内容的 20px 缩进错位；
     ② margin-bottom 为 0 → 按钮**直接贴着 .ndh-answers 的 border-top（那条分割线）**。
   补上左右内边距 + 下边距即可。 */
.ndh-cancel-form {
    margin: 12px 0 16px;
    padding: 0 20px;
}

/* ⚠️ 必须写成 .mn-btn.ndh-cancel-btn（(0,2,0)）—— 单写 .ndh-cancel-btn 是 (0,1,0)，
   与核心 .mn-btn 同权重；而插件 CSS 在 main.php:40 注入、**早于**核心 modern.css
   → 同权重核心后胜，本规则会被**静默压掉**。提权后插件才拿得回控制权。
   ⚠️ 不用 --mn-danger（本仓 9 套主题 0 套定义，写了等于没写）→ 用降级文字色表达「次要动作」。
   ⚠️ hover 态故意不覆盖：核心 .mn-btn:hover 也是 (0,2,0) 且后加载 → 悬停仍走主题高亮，符合直觉。 */
.mn-btn.ndh-cancel-btn {
    color: var(--mn-text-muted);
}

/* ============================================================ P6：后台求助管理
   ⚠️⚠️ 插件 CSS 在 main.php:40 注入、**早于**核心 modern.css / admin.css →
      要覆盖核心 `.admin-table` / `.mn-input` 已定义的属性**必须提权**（写成 0,2,0），
      单写 `.ndh-admin-table` 是 (0,1,0)，会被核心同权重规则**静默压掉**（不报错、只是没生效）。
   ⚠️ 危险色一律走核心的 `.admin-content .btn-danger`（内部用 `--c-danger`），
      **不自己写颜色** —— 本仓 `--mn-danger` 在 9 套主题里 0 套定义，写了等于没写。 */

/* ---- 状态统计条 ---- */
.ndh-admin-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ndh-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 84px;
    padding: 10px 14px;
    border: 1px solid var(--mn-border-light);
    border-radius: 8px;
    background: var(--mn-bg-card);
    text-decoration: none;
}

.ndh-stat-active {
    border-color: var(--mn-primary);
    background: var(--mn-primary-subtle);
}

.ndh-stat-num {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--mn-text);
}

.ndh-stat-label {
    margin-top: 2px;
    font-size: 12px;
    color: var(--mn-text-muted);
}

/* ---- 搜索 / 筛选栏 ---- */
.ndh-admin-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* (0,2,0) 提权：核心 `.mn-input` 是 (0,1,0) 且后加载，不提权这里控不住宽度 */
.ndh-admin-filter .mn-input {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
}

.ndh-admin-filter .ndh-admin-q {
    flex: 1 1 240px;
    min-width: 200px;
}

.ndh-admin-filter .ndh-admin-select {
    min-width: 130px;
}

/* ---- 结果表 ---- */
.ndh-admin-tablewrap {
    overflow-x: auto;
}

/* (0,2,1) —— 只锚**自己的**类，不写 `.admin-table.ndh-admin-table td` 这种
   「核心类 + 插件类」混合提权选择器：效果相同，但后者会被样式门禁的
   「自定义类必须带 .ndh- 前缀」判为违规。 */
.ndh-admin-table td.ndh-col-act,
.ndh-admin-table td.ndh-admin-answer-cell {
    vertical-align: top;
}

.ndh-col-id {
    width: 60px;
    white-space: nowrap;
}

.ndh-col-act {
    width: 90px;
    white-space: nowrap;
}

.ndh-admin-title {
    font-weight: 500;
    color: var(--mn-primary);
    text-decoration: none;
}

.ndh-admin-title:hover {
    text-decoration: underline;
}

.ndh-admin-pager {
    margin-top: 14px;
}

/* ---- 详情页 ---- */
.ndh-admin-back {
    font-size: 13px;
    color: var(--mn-text-muted);
    text-decoration: none;
}

.ndh-admin-back:hover {
    color: var(--mn-primary);
}

.ndh-admin-sub {
    margin: 16px 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mn-text);
}

.ndh-admin-content {
    padding: 12px 14px;
    border: 1px solid var(--mn-border-light);
    border-radius: 6px;
    background: var(--mn-bg-body);
    font-size: 14px;
    line-height: 1.8;
    color: var(--mn-text);
    word-break: break-word;
}

.ndh-admin-answer-cell {
    max-width: 420px;
    word-break: break-all;
}

.ndh-admin-code {
    margin-top: 4px;
    font-size: 12px;
    color: var(--mn-text-secondary);
}

.ndh-admin-note {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--mn-text-muted);
}

.ndh-admin-delta {
    font-weight: 600;
    white-space: nowrap;
}

.ndh-delta-in {
    color: var(--mn-success);
}

.ndh-delta-out {
    color: var(--mn-error);
}

/* ---- 操作区 ---- */
.ndh-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

