﻿/* ===== 新鲜事模块共享样式（Views/News/Index、Detail 共用） =====
   配色一律引用 _Layout 注入的 CSS 变量（var(--gold) 等），随赛季配色联动。 */

/* ---------- 顶部固定区：标题行 + 发布框（向下滚动时常驻，站点 header 高 56px） ---------- */
.news-sticky {
    position: sticky; top: 56px; z-index: 40;
    margin: 0 -16px; padding: 12px 16px 12px;
    background: linear-gradient(180deg, rgba(13,14,20,.98), rgba(13,14,20,.94));
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
.news-title-row { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; }
.news-title-row h2 { flex: 1 1 auto; margin: 0; padding-bottom: 0; border-bottom: 0; }
.news-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.news-caret { display: inline-block; font-size: 11px; line-height: 1; transition: transform .2s; }
.news-toggle.on .news-caret { transform: rotate(180deg); }
.news-sticky .news-editor { margin: 12px 0 0; max-height: 56vh; overflow-y: auto; }

/* ---------- 发布框 ---------- */
.news-editor input[type="text"] { margin: 0 0 8px; width: 100%; box-sizing: border-box; }
.news-editor textarea { margin: 0 0 8px; }
.news-editor-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.img-pick-btn { cursor: pointer; }

/* ---------- 状态横幅：加载失败/网络异常独占一行，不挤压标题行 ---------- */
.news-banner {
    display: none;
    margin: 12px 0 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(229,57,53,.14);
    border: 1px solid rgba(229,57,53,.45);
    color: #ff8a8a;
    font-size: 13px;
    line-height: 1.55;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.news-banner.on { display: block; }

/* ---------- 新鲜事发言身份（账号多角色「展示中」角色下拉框选择） ---------- */
.n-ident { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.n-ident-label { font-size: 12px; color: var(--muted); margin-right: 2px; flex: none; }
.n-ident-sel { margin: 0; padding: 6px 10px; font-size: 13px; cursor: pointer; min-width: 0; max-width: 320px; flex: 1 1 260px; }

/* ---------- 图片九宫格 ---------- */
.n-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.n-grid-1 { grid-template-columns: 1fr; }
.n-grid-2 { grid-template-columns: repeat(2, 1fr); }
.n-grid-edit { max-width: 420px; }
.n-cell { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--border); }
.n-grid-1 .n-cell, .n-grid-2 .n-cell { aspect-ratio: 16/10; }
/* 列表模式：贴吧/微博式紧凑小九宫格，仅显示前 3 张，第 3 张右下角 +N 角标；整格点击进入详情 */
.n-grid-list { grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 320px; }
.n-grid-list .n-cell { aspect-ratio: 1; border-radius: 6px; cursor: pointer; }
.n-grid-list .n-cell img { cursor: pointer; }
.n-more {
    position: absolute; right: 6px; bottom: 6px; z-index: 2;
    padding: 2px 9px; border-radius: 12px;
    background: rgba(0,0,0,.62); color: #fff; font-size: 13px; font-weight: 700;
    backdrop-filter: blur(2px);
    line-height: 1.4;
}
.n-cell img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; transition: transform .25s, box-shadow .25s; }
.n-cell img:hover { transform: scale(1.04); box-shadow: 0 0 0 2px var(--gold); }
.n-cell img.broken { opacity: .35; cursor: default; transform: none; }
.n-del { position: absolute; top: 4px; right: 4px; z-index: 2; width: 22px; height: 22px; line-height: 20px; text-align: center; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; border: 1px solid rgba(255,255,255,.3); cursor: pointer; font-size: 13px; }

/* ---------- 动态卡片（微博式） ---------- */
.moment-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border); border-left: 3px solid var(--gold-deep);
    border-radius: 10px; padding: 14px 16px; margin-bottom: 12px;
    box-shadow: 0 3px 14px rgba(0,0,0,.3);
    transition: border-color .15s, box-shadow .15s;
    margin-top:10px;
}
.moment-card:hover { border-left-color: var(--gold); box-shadow: 0 6px 20px rgba(0,0,0,.42); }
/* 方形角色头像：账号信息列默认 44px、热评 20px（尺寸由 nAvaBlock 内联指定） */
.mc-ava { width: 48px; height: 48px; border-radius: 6px; background: var(--bg-2) center/cover no-repeat; border: 1px solid var(--gold); flex: none; overflow: hidden; box-shadow: 0 0 0 2px rgba(248,195,81,.12); }
.mc-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mc-ava .mc-ava-fb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--gold); font-size: 16px; background: linear-gradient(145deg, var(--panel-2), var(--bg)); }
/* 列表卡片两栏（头条式）：左侧「标题 + 正文摘要 + 图片九宫格」为主，右侧细分隔线后窄列放账号信息。
   账号信息独立成列、高度不受标题行限制（头像/昵称/角色标签/发布时间纵向堆叠），顶部对齐贴标题。 */
.mc-bd { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 8px; }
.mc-bd-main { flex: 1 1 auto; min-width: 0; }
.mc-bd .mc-title {
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
    white-space: normal; margin-bottom: 6px;
}
/* 详情页标题不截断，完整展开 */
.mc-bd-detail .mc-title { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
.mc-bd .mc-text { margin-bottom: 0; }
.mc-side {
    flex: 0 0 108px; min-width: 0;
    display: flex; flex-direction: column; align-items: center;
    gap: 5px; text-align: center;
    border-left: 1px dashed rgba(44,51,80,.55); padding-left: 14px;
}
.mc-side .mc-ava { border-radius: 8px; box-shadow: none; }
.mc-side-nick { max-width: 100%; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-side-tag { max-width: 100%; min-width: 0; display: flex; justify-content: center; line-height: 1; }
.mc-side-tag .need-slot, .mc-side-tag .mc-role-plain { margin: 0; max-width: 100%; min-width: 0; overflow: hidden; }
.mc-side-tag .need-slot { padding: 2px 7px 2px 3px; border-radius: 14px; font-size: 11px; font-weight: 600; }
.mc-side-tag .need-slot > span:last-child { display: inline-block; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.mc-side-tag .cls-icon { width: 16px; height: 16px; border-radius: 3px; flex: none; }
.mc-side-tag .mc-role-plain { font-size: 11px; max-width: 100%; }
.mc-side-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
/* 无职业徽章时的纯文本角色名（账号信息列内） */
.mc-role-plain { color: var(--muted); font-size: 12px; cursor: pointer; border-bottom: 1px dashed rgba(248,195,81,.55); }
.mc-role-plain:hover { color: var(--gold); }
/* 删除/举报操作：统一落到底部「点赞/评论」操作行的最右侧（不占标题行） */
.mc-ops { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.mc-ops a { font-size: 12px; color: var(--muted); cursor: pointer; }
.mc-ops a:hover { color: var(--gold); }
.mc-ops a.ops-danger:hover { color: var(--err); }
/* 标题：列表最多两行截断（见 .mc-bd .mc-title），详情页完整展开（见 .mc-bd-detail .mc-title） */
.mc-title {
    flex: 1; min-width: 0; color: var(--gold); font-size: 16px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5;
    cursor: pointer;
}
.mc-title:hover { color: var(--gold-glow); }
.mc-text { white-space: pre-wrap; word-break: break-word; color: var(--text); font-size: 14px; line-height: 1.75; margin-bottom: 8px; }
/* 列表卡片正文摘要：最多 120 字（前端截断）+ 固定 3 行高度（行高 24px × 3），详情页不加本类按全文展开。 */
.mc-text-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 24px;
    height: 72px;
}
.mc-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; padding-top: 8px; border-top: 1px solid rgba(44,51,80,.5); }
.act { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); cursor: pointer; background: none; border: none; padding: 2px 6px; border-radius: 6px; transition: color .15s, background .15s; }
.act:hover { color: var(--gold); background: rgba(248,195,81,.08); }
.act.liked { color: var(--gold); font-weight: 700; }
.act.liked .hc { animation: nHeartPop .35s ease; }
@keyframes nHeartPop { 0% { transform: scale(.7); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
.act.report { margin-left: auto; }
.act.report:hover { color: var(--err); }
.act .num { font-variant-numeric: tabular-nums; }
/* 列表热评：操作行下方，展示本动态点赞最高的一级评论，整块可点进详情 */
.mc-hot {
    margin-top: 10px; display: flex; align-items: center; gap: 8px; min-width: 0;
    padding: 7px 10px; border: 1px solid rgba(248,195,81,.35); border-radius: 8px;
    background: rgba(248,195,81,.06); cursor: pointer;
    transition: background .15s;
}
.mc-hot:hover { background: rgba(248,195,81,.13); }
.mc-hot-badge {
    flex: none; color: var(--gold); font-size: 11px; font-weight: 700;
    padding: 1px 8px; border: 1px solid rgba(248,195,81,.55); border-radius: 10px;
    line-height: 1.5; letter-spacing: .5px;
}
.mc-hot-text {
    flex: 1; min-width: 0; color: var(--text); font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-hot-meta { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.mc-hot-meta .mc-ava { width: 20px; height: 20px; border-radius: 50%; box-shadow: none; }
.mc-hot-meta .mc-ava .mc-ava-fb { font-size: 9px; }
.mc-hot-nick { font-weight: 600; max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-hot-like { flex: none; color: var(--gold); font-weight: 700; }
.mc-hot-like .num { font-variant-numeric: tabular-nums; }
.mc-audit { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 12px; background: rgba(248,195,81,.15); color: var(--gold); border: 1px solid rgba(248,195,81,.4); margin-bottom: 8px; }
.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* ---------- 详情页评论输入 + 贴吧式楼中楼 ---------- */
.cm-input-box { display: flex; align-items: flex-end; gap: 10px; }
.cm-input-box textarea { flex: 1; min-height: 64px; }
.cmt-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cmt {
    border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 12px; margin-bottom: 8px;
    background: linear-gradient(180deg, rgba(35,40,64,.5), rgba(27,31,46,.5));
}
.cmt-h { display: flex; align-items: flex-start; gap: 8px; }
/* 评论头两行：第一行账号昵称 + 时间，第二行职业徽章 + 角色标签（与动态卡头同款 nRoleTag） */
.cmt-lines { flex: 1; min-width: 0; }
.cmt-nick-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.cmt-role-line { margin-top: 3px; line-height: 1; }
.cmt-role-line .need-slot { margin: 0; padding: 1px 8px 1px 4px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.cmt-role .cls-icon { width: 16px; height: 16px; border-radius: 3px; }
.cmt-ava { width: 48px; height: 48px; border-radius: 6px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--border); flex: none; }
.cmt-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmt-ava .cmt-ava-fb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--gold); }
.cmt-name { color: var(--gold); font-size: 14px; font-weight: 700; }
.cmt-time { color: var(--muted); font-size: 12px; }
/* 楼主标识：评论者 == 动态作者时，昵称后追加金色描边小标签 */
.cmt-owner {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(248,195,81,.15);
    color: var(--gold);
    border: 1px solid rgba(248,195,81,.55);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    vertical-align: middle;
    letter-spacing: .5px;
}
.cmt-ops { margin-left: auto; display: inline-flex; gap: 2px; }
.cmt-ops a { font-size: 12px; color: var(--muted); cursor: pointer; padding: 0 4px; }
.cmt-ops a:hover { color: var(--gold); }
.cmt-ops a.danger:hover { color: var(--err); }
/* 评论操作行：点赞（❤）+ 回复/删除/举报置行最右 */
.cmt-act { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.cmt-like {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--muted); cursor: pointer;
    background: none; border: none; padding: 2px 6px; border-radius: 6px;
    transition: color .15s, background .15s;
}
.cmt-like:hover { color: var(--gold); background: rgba(248,195,81,.08); }
.cmt-like.on { color: var(--gold); font-weight: 700; }
.cmt-like .num { font-variant-numeric: tabular-nums; }
.cmt-txt { margin: 6px 0 2px; color: var(--text); font-size: 14px; word-break: break-word; white-space: pre-wrap; }
.cmt-sub { margin-left: 32px; padding-left: 10px; border-left: 2px solid rgba(248,195,81,.25); }
.cmt-sub .cmt { background: rgba(255,255,255,.02); border-color: rgba(44,51,80,.6); }
.reply-to { color: var(--gold); font-size: 12px; }
.cm-inline { display: none; margin-top: 6px; }
.cm-inline.on { display: flex; align-items: center; gap: 8px; }
.cm-inline input { flex: 1; margin: 0; padding: 6px 10px; }
.cm-inline .btn { white-space: nowrap; }
.cm-del-hint { color: var(--muted); font-size: 12px; padding: 4px 0; }
.cm-count { font-size: 13px; color: var(--muted); margin-left: 6px; }

/* ---------- 举报弹窗 / 大图 ---------- */
#reportModal textarea { min-height: 70px; }
.btn-accept { background: var(--gold); border: 0; color: #1a1206; border-radius: 6px; padding: 7px 18px; cursor: pointer; font-weight: 600; }
.btn-accept:hover { filter: brightness(1.08); }

@media (max-width: 520px) {
    .n-grid { grid-template-columns: repeat(2, 1fr); }
    .n-grid-1 { grid-template-columns: 1fr; }
    .mc-actions { flex-wrap: wrap; }
    .cmt-sub { margin-left: 12px; }
    /* 两栏：窄屏压缩右侧账号列宽度与间距 */
    .mc-bd { gap: 10px; }
    .mc-side { flex-basis: 88px; padding-left: 10px; gap: 4px; }
    .mc-side-tag .need-slot > span:last-child { max-width: 48px; }
}

/* ===== 移动端适配（≤768px）=====
   固定区负边距需与 .container 移动端左右内边距（12px）对齐；
   账号列进一步收窄，评论输入与九宫格按小屏重排。 */
@media (max-width: 768px) {
    .news-sticky { margin: 0 -12px; padding: 10px 12px; }
    .news-title-row { gap: 8px; padding-bottom: 8px; }
    .news-sticky .news-editor { max-height: 60vh; padding: 12px; }
    .news-editor-foot { gap: 8px; }
    .news-editor-foot .img-pick-btn { order: 2; }
    .news-editor-foot #pubHint { order: 3; width: 100%; }
    .news-editor-foot #pubBtn { order: 1; margin-left: auto; }
    .n-ident-sel { flex: 1 1 100%; max-width: none; }
    .n-grid-list { max-width: none; }
    .n-grid-edit { max-width: none; }
    /* 账号列：小屏改为横向窄条，正文区获得更多宽度 */
    .mc-bd { gap: 10px; }
    .mc-side { flex-basis: 76px; padding-left: 8px; gap: 3px; }
    .mc-side .mc-ava { width: 36px; height: 36px; }
    .mc-side-tag .need-slot > span:last-child { max-width: 44px; }
    .mc-title { font-size: 15px; }
    .mc-text-clamp { height: 66px; line-height: 22px; }
    .cmt-ava { width: 36px; height: 36px; }
    .cmt-sub { margin-left: 12px; padding-left: 8px; }
    .cm-input-box { gap: 8px; }
    .cm-inline { flex-wrap: wrap; }
}
