/* ============================================================
   news.css · 要闻 / 世界热点 / 推荐 / 详情（信息流式）
   ------------------------------------------------------------
   结构：.nx-post = 头像 + 正文列（头部元信息 / 正文 / 媒体 / 动作）
   颜色：全部走 #page-news / #page-news-detail 上的 --nx-* 变量，
         日间只在 day.css 里覆盖变量，不再逐条压色。
   说明：本文件在 home.css 之后加载，同名选择器以本文件为准。
   ============================================================ */

/* ===== 主题变量（夜间默认） ===== */
#page-news,
#page-news-detail {
    --nx-ink: rgba(246, 240, 244, .92);
    /* 正文、标题 */
    --nx-ink-2: rgba(246, 240, 244, .64);
    /* 次级正文 */
    --nx-dim: rgba(246, 240, 244, .46);
    /* 账号、时间、计数 */
    --nx-faint: rgba(246, 240, 244, .30);
    /* 分隔符、脚注 */
    --nx-line: rgba(255, 255, 255, .07);
    /* 结构线 */
    --nx-line-2: rgba(255, 255, 255, .045);
    /* 条目细线 */
    --nx-fill: rgba(255, 255, 255, .055);
    --nx-fill-2: rgba(255, 255, 255, .028);
    --nx-accent: var(--primary, #D46A93);
    --nx-radius: 12px;
    color: var(--nx-ink);
}

/* ===== 页面骨架 ===== */
#page-news,
#page-news-detail {
    padding: var(--statusbar-h) 0 0;
    background: transparent;
    position: relative;
    min-height: 0;
}

#page-news .news-header,
#page-news-detail .news-detail-page-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 10px 4px 4px;
    border-bottom: 1px solid var(--nx-line);
    background: transparent;
}

#page-news .news-header-title,
#page-news-detail .news-detail-page-title {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--nx-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 顶栏图标按钮（返回 / 加号 / 设置） */
.nx-iconbtn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--nx-ink-2);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s, background .15s;
}

.nx-iconbtn .icon {
    width: 20px;
    height: 20px;
    font-size: 20px;
    stroke-width: 1.9;
}

.nx-iconbtn:hover {
    color: var(--nx-ink);
    background: var(--nx-fill-2);
}

#page-news .news-back,
#page-news-detail .news-detail-page-back {
    color: var(--nx-ink);
    font-size: 0;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
}

#page-news .news-back .icon,
#page-news-detail .news-detail-page-back .icon {
    width: 20px;
    height: 20px;
    font-size: 20px;
    stroke-width: 1.9;
}

#page-news .news-world-settings-btn,
#page-news .btn-add,
#page-news .news-tab-action {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--nx-ink-2);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: color .15s, background .15s;
}

#page-news .news-world-settings-btn:hover,
#page-news .btn-add:hover {
    color: var(--nx-ink);
    background: var(--nx-fill-2);
}

#page-news .news-world-settings-btn .icon,
#page-news .btn-add .icon {
    width: 20px;
    height: 20px;
    font-size: 20px;
    stroke-width: 1.9;
}

/* 页签上的「推进世界 / 换一批」是文字按钮，按宽度自适应 */
#page-news .news-tab-action {
    width: auto;
    padding: 0 12px;
    height: 28px;
    font-size: 12px;
    color: var(--nx-accent);
    border: 1px solid currentColor;
    border-radius: 999px;
    opacity: .9;
}

#page-news .news-tab-action:disabled {
    color: var(--nx-dim);
    opacity: .5;
}

/* ===== 页签 ===== */
#page-news .news-tabs {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid var(--nx-line);
}

#page-news .news-tab {
    flex: 1;
    padding: 11px 0 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--nx-dim);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

#page-news .news-tab:hover {
    color: var(--nx-ink-2);
}

#page-news .news-tab.active {
    color: var(--nx-ink);
    border-bottom-color: var(--nx-accent);
    font-weight: 600;
}

/* ===== 世界演化状态行 ===== */
#page-news .news-world-status {
    flex-shrink: 0;
    margin: 0;
    padding: 7px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--nx-faint);
    font-size: 11px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 滚动容器（列表 / 详情） ===== */
#page-news .news-list,
#page-news-detail .news-detail-page-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#page-news .news-list::-webkit-scrollbar,
#page-news-detail .news-detail-page-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* ===== 帖子 ===== */
.nx-post {
    display: flex;
    gap: 10px;
    padding: 11px 14px 9px;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}

.nx-post + .nx-post,
.nx-post + .nx-hot,
.nx-hot + .nx-hot {
    border-top: 1px solid var(--nx-line-2);
}

@media (hover: hover) {
    .nx-post:hover {
        background: var(--nx-fill-2);
        transform: none;
        border-color: transparent;
    }
}

.nx-av {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--nx-ink-2);
    background: var(--nx-fill);
    border: 1px solid var(--nx-line);
    user-select: none;
}

.nx-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* 头部元信息：名字 徽标 @账号 · 时间 · 地点 */
.nx-head {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    line-height: 1.3;
}

.nx-name {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 52%;
    font-size: 14px;
    font-weight: 600;
    color: var(--nx-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nx-badge {
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 1;
    padding: 2px 5px 2px;
    border-radius: 4px;
    border: 1px solid var(--nx-line);
    background: var(--nx-fill-2);
    color: var(--nx-dim);
    white-space: nowrap;
    position: relative;
    top: -1px;
}

.nx-handle {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    color: var(--nx-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nx-sep {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--nx-faint);
}

.nx-time {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--nx-dim);
    white-space: nowrap;
}

.nx-loc {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 12px;
    color: var(--nx-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nx-unread {
    flex: 0 0 auto;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--nx-accent);
    margin-left: 2px;
    align-self: center;
}

/* 详情页：时间 / 地点 / 状态另起一行 */
.nx-submeta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    font-size: 12px;
    color: var(--nx-dim);
}

.nx-submeta .nx-time {
    color: var(--nx-dim);
}

.nx-submeta .nx-loc {
    color: var(--nx-faint);
}

/* 正文：4 行截断 + 展开 */
.nx-text {
    margin-top: 5px;
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: .005em;
    color: var(--nx-ink);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.nx-text.open {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.nx-more {
    align-self: flex-start;
    margin-top: 3px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--nx-accent);
    font-size: 12px;
    line-height: 1.6;
    cursor: pointer;
}

/* 图片网格：1 张 16:9 / 2 张并排 / 3 张左大右两小 / 4 张 2×2 */
.nx-media {
    display: grid;
    gap: 2px;
    margin-top: 8px;
    border-radius: 6px;
    overflow: hidden;
    max-height: 240px;
}

.nx-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--nx-fill);
}

.nx-media[data-n="1"] {
    grid-template-columns: 1fr;
}

.nx-media[data-n="1"] img {
    aspect-ratio: 16 / 9;
}

.nx-media[data-n="2"] {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 126px;
}

.nx-media[data-n="3"],
.nx-media[data-n="4"] {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 117px;
}

.nx-media[data-n="3"] img:first-child {
    grid-row: span 2;
}

/* 动作行：评论 / 喜欢 / 分享 / 收藏 */
.nx-actions {
    display: flex;
    align-items: center;
    margin: 6px 0 0 -7px;
    padding-right: 4px;
}

.nx-act {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    min-height: 30px;
    padding: 0 7px;
    border: 0;
    background: none;
    color: var(--nx-dim);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    border-radius: 999px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s;
}

.nx-act .icon {
    width: 17px;
    height: 17px;
    font-size: 17px;
    stroke-width: 1.8;
    flex: 0 0 auto;
}

.nx-act:hover {
    color: var(--nx-ink-2);
}

.nx-act.on {
    color: var(--nx-accent);
}

.nx-act.on .icon {
    fill: currentColor;
}

/* ===== 详情页 ===== */
.nx-post-big {
    padding: 13px 14px 11px;
}

.nx-post-big .nx-text {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    margin-top: 8px;
    font-size: 16.5px;
    line-height: 1.6;
}

.nx-post-big .nx-time {
    font-size: 12px;
}

.nx-post-big .nx-actions {
    margin-top: 11px;
    padding-top: 9px;
    border-top: 1px solid var(--nx-line-2);
}

/* 详情页的图更大一档 */
.nx-post-big .nx-media[data-n="1"] img {
    aspect-ratio: 4 / 3;
}

.nx-post-big .nx-media[data-n="2"] {
    grid-auto-rows: 170px;
}

.nx-post-big .nx-media[data-n="3"],
.nx-post-big .nx-media[data-n="4"] {
    grid-auto-rows: 130px;
}

.nx-post-big .nx-act {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 8px;
    gap: 6px;
    margin-right: 14px;
}

.nx-stats {
    padding: 0 14px 11px;
    border-bottom: 1px solid var(--nx-line);
    font-size: 12px;
    color: var(--nx-dim);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.nx-stats b {
    color: var(--nx-ink);
    font-weight: 600;
}

.nx-section {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nx-ink-2);
}

.nx-section .nx-section-num {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--nx-dim);
}

/* 评论 */
.nx-cmt {
    display: flex;
    gap: 10px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--nx-line-2);
}

.nx-cmt-av {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--nx-ink-2);
    background: var(--nx-fill);
    border: 1px solid var(--nx-line);
}

.nx-cmt-body {
    flex: 1;
    min-width: 0;
}

.nx-cmt-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.nx-cmt-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--nx-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nx-cmt-text {
    margin-top: 2px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--nx-ink);
    white-space: pre-wrap;
    word-break: break-word;
}

.nx-cmt-foot {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 11.5px;
    color: var(--nx-dim);
}

.nx-cmt-like {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--nx-dim);
}

.nx-cmt-like .icon {
    width: 13px;
    height: 13px;
    font-size: 13px;
    stroke-width: 1.8;
}

/* 加载更多 / 空态 */
.nx-load {
    display: block;
    width: calc(100% - 28px);
    margin: 12px 14px 20px;
    height: 40px;
    border: 1px solid var(--nx-line);
    border-radius: 999px;
    background: transparent;
    color: var(--nx-ink-2);
    font-size: 13px;
    cursor: pointer;
}

.nx-load:hover:not(:disabled) {
    color: var(--nx-ink);
    background: var(--nx-fill-2);
}

.nx-load:disabled {
    opacity: .45;
    cursor: default;
}

.nx-load-accent {
    border-color: var(--nx-accent);
    color: var(--nx-accent);
}

.nx-load-accent:hover:not(:disabled) {
    background: transparent;
    color: var(--nx-accent);
    opacity: .85;
}

#page-news .news-empty,
#page-news-detail .news-empty,
.nx-empty {
    padding: 64px 24px;
    text-align: center;
    font-size: 13px;
    line-height: 1.7;
    color: var(--nx-dim);
}

#page-news .news-empty-hint {
    display: inline-block;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--nx-faint);
}

.nx-loading,
.nx-error {
    padding: 56px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--nx-dim);
}

/* ===== 世界热点 ===== */
.nx-pool {
    padding: 12px 14px 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--nx-dim);
}

.nx-hot {
    margin: 8px 14px 0;
    padding: 12px 13px 11px;
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius);
    background: var(--nx-fill-2);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color .15s, background .15s;
}

@media (hover: hover) {
    .nx-hot:hover {
        background: var(--nx-fill);
        border-color: var(--nx-line);
    }
}

.nx-hot.cooling {
    opacity: .52;
}

.nx-hot-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nx-tag {
    font-size: 11px;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--nx-line);
    color: var(--nx-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}

.nx-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    color: var(--nx-accent);
    opacity: .85;
}

.nx-stars .icon {
    width: 12px;
    height: 12px;
    font-size: 12px;
    stroke-width: 1.5;
}

/* 详情页的头条里，热度紧跟在标签后，不甩到最右 */
#page-news-detail .nx-stars {
    margin-left: 2px;
}

.nx-stars .nx-star-off {
    opacity: .3;
}

.nx-star-fill {
    fill: currentColor;
    stroke: none;
}

.nx-hot-title {
    margin-top: 9px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--nx-ink);
}

.nx-post-big .nx-hot-title {
    margin-top: 10px;
    font-size: 19px;
    line-height: 1.4;
}

.nx-post-big .nx-hot-title+.nx-text {
    margin-top: 7px;
}

.nx-hot-sum {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--nx-ink-2);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.nx-hot-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 11px;
}

.nx-hot-prog {
    font-size: 11.5px;
    color: var(--nx-dim);
}

.nx-btn {
    margin-left: auto;
    height: 28px;
    padding: 0 15px;
    border: 1px solid var(--nx-accent);
    border-radius: 999px;
    background: transparent;
    color: var(--nx-accent);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
}

.nx-btn:hover:not(:disabled) {
    background: var(--nx-accent);
    color: #fff;
}

.nx-btn:disabled {
    border-color: var(--nx-line);
    color: var(--nx-dim);
    background: transparent;
    cursor: default;
}

.nx-btn.danger {
    border-color: var(--nx-line);
    color: var(--nx-dim);
}

.nx-btn.danger:hover {
    border-color: #d0738a;
    color: #e08a9a;
    background: transparent;
}

.nx-btn+.nx-btn {
    margin-left: 8px;
}

.nx-hot-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 4px;
}

.nx-hot-tools .nx-btn {
    margin-left: 0;
    border-color: var(--nx-line);
    color: var(--nx-dim);
}

.nx-hot-tools .nx-btn:hover {
    border-color: var(--nx-line);
    background: var(--nx-fill-2);
    color: var(--nx-ink-2);
}

.nx-empty-sm {
    padding: 22px 14px 26px !important;
}

/* 热点详情：后续列表 */
.nx-follow {
    border-top: 1px solid var(--nx-line);
    padding: 12px 14px 4px;
}

.nx-follow-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid var(--nx-line-2);
}

.nx-follow-kind {
    flex: 0 0 auto;
    font-size: 10px;
    line-height: 1.6;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid var(--nx-line);
    color: var(--nx-dim);
    margin-top: 2px;
}

.nx-follow-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--nx-ink-2);
    word-break: break-word;
}

.nx-follow-empty {
    padding: 10px 0 14px;
    font-size: 12.5px;
    color: var(--nx-dim);
}
