/* ==========================================================================
   如浩传世 · 资讯攻略（列表页 + 详情页）
   --------------------------------------------------------------------------
   只在四个页面上加载：news.html / m_news.html / news_detail.html /
   m_news_detail.html。**不放进 legend-layout.css** 的原因：
   那个文件是全站共用的结构层，资讯页的规则塞进去会让每个页面都多背一份
   用不到的字节；而老内核与 4G 用户对首屏体积是敏感的。

   加载顺序（四个页面都一样）：
     PC：style.css         → legend.css → legend-layout.css → legend-news.css → legend-motion.css
     手机：mobile.css      → legend.css → legend-layout.css → legend-news.css → legend-motion.css
   本层排在 legend-layout.css 之后，所以同特异性的规则由本层胜出；
   但排在 legend-motion.css 之前，动效层里的 transform / animation 仍然有效。

   ★ 老内核禁用清单（与 check_css.py 一致）：
     var() / :has() / :is() / :where() / display:grid / flex 容器里的 gap /
     inset / clamp() / min(calc()) / aspect-ratio / conic-gradient / mix-blend-mode
     —— 这些在旧 WebKit 里不是降级，而是**整条声明作废**。
   ★ 本文件全程只用 background-color，不用 background 简写：
     列表卡片与侧栏面板会挂 .legend-frame 四角包角，而包角是靠
     background-image 贴四张角图，任何 background 简写都会把它整条抹掉。
   ★ 分栏一律用 display:table + table-cell，不用 float：
     float 会把 table-cell 强制降级成 block（这个站已经因此踩过一次坑）。
   ========================================================================== */

/* ==========================================================================
   1. 页面骨架与页头
   ========================================================================== */
.news-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 56px;
}

.news-head {
    text-align: center;
    margin-bottom: 26px;
}

.news-title {
    font-size: 34px;
    font-weight: bold;
    letter-spacing: 6px;
    color: #e8c987;
    text-shadow: 0 0 14px rgba(255, 158, 46, .35), 0 2px 0 rgba(0, 0, 0, .6);
    margin: 0 0 10px;
}

/* 标题两侧的金线：与 .section-title 同一套语言，但宽度用百分比，
   窄屏下不会顶到文字上 */
.news-title-line {
    display: block;
    width: 150px;
    height: 2px;
    margin: 0 auto 14px;
    background-image: linear-gradient(to right, transparent, #b88646, transparent);
}

.news-sub {
    font-size: 13.5px;
    letter-spacing: 2px;
    color: #a08f6f;
    margin: 0;
}

/* ---- 搜索框 ---- */
.news-search {
    margin-top: 20px;
    font-size: 0;                 /* 消掉 inline-block 之间的空白间隙（老内核没有 flex gap 可依赖） */
}
.news-search input {
    display: inline-block;
    vertical-align: middle;
    width: 320px;
    max-width: 62%;
    height: 40px;
    line-height: 40px;
    padding: 0 14px;
    font-size: 14px;
    color: #e3d0a4;
    background-color: #14100b;
    border: 1px solid #6d5420;
    border-radius: 3px;
    outline: none;
    box-sizing: border-box;
}
.news-search input:focus {
    border-color: #d8b463;
    box-shadow: 0 0 12px rgba(255, 158, 46, .28);
}
.news-search button {
    display: inline-block;
    vertical-align: middle;
    height: 40px;
    padding: 0 26px;
    margin-left: 8px;
    font-size: 14px;
    letter-spacing: 2px;
    color: #2a1c07;
    font-weight: bold;
    background-color: #e0b95c;
    background-image: linear-gradient(180deg, #ffe9a8 0%, #e0b95c 46%, #a87c28 100%);
    border: 1px solid #ffe9a8;
    border-radius: 3px;
    cursor: pointer;
}
.news-search button:hover {
    box-shadow: 0 0 16px rgba(255, 172, 60, .55);
}

/* 关键词回显条 */
.news-kw-tip {
    display: none;
    margin-top: 12px;
    font-size: 13px;
    color: #a08f6f;
}
.news-kw-tip a {
    color: #d8b463;
    text-decoration: underline;
}

/* ==========================================================================
   2. 两栏骨架（栏目侧栏 + 内容区）
   ========================================================================== */
.news-body {
    display: table;
    table-layout: fixed;
    width: 100%;
}
.news-side {
    display: table-cell;
    width: 268px;
    vertical-align: top;
    padding-right: 22px;
}
.news-main {
    display: table-cell;
    vertical-align: top;
}

/* 侧栏面板。会由 legend.js 挂上 .legend-frame 四角包角，
   所以这里只能给 background-color。 */
.news-panel {
    position: relative;
    background-color: #16100a;
    border: 1px solid rgba(109, 84, 32, .8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
    padding: 18px 14px 14px;
    margin-bottom: 18px;
}
.news-panel:last-child { margin-bottom: 0; }

.news-panel-title {
    font-size: 15px;
    letter-spacing: 3px;
    color: #e8c987;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(216, 180, 99, .22);
    position: relative;
}
.news-panel-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 46px;
    height: 2px;
    background-image: linear-gradient(to right, #e0b95c, rgba(224, 185, 92, 0));
}

/* ---- 栏目列表 ---- */
.news-cats {
    list-style: none;
    margin: 0;
    padding: 0;
}
.news-cats li { margin: 0 0 4px; }
.news-cats li a {
    display: block;
    padding: 8px 10px 8px 16px;
    font-size: 14px;
    letter-spacing: 1px;
    color: #c9b78d;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 3px;
    position: relative;
    transition: color .2s, background-color .2s, border-color .2s;
}
/* 左侧小菱形：传世菜单的典型记号 */
.news-cats li a::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    background-color: #6d5420;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
    transition: background-color .2s;
}
.news-cats li a:hover {
    color: #ffe9a8;
    background-color: rgba(109, 84, 32, .22);
    border-color: rgba(216, 180, 99, .3);
}
.news-cats li a:hover::before { background-color: #e0bd6a; }
.news-cats li.active a {
    color: #2a1c07;
    font-weight: bold;
    background-color: #e0b95c;
    background-image: linear-gradient(180deg, #ffe9a8 0%, #e0b95c 50%, #a87c28 100%);
    border-color: #ffe9a8;
}
.news-cats li.active a::before { background-color: #4a3208; }
/* 篇数：靠右且不换行。用 float 而不是 flex —— 老内核上最稳。 */
.news-cats li a em {
    float: right;
    font-style: normal;
    font-size: 12px;
    color: #8d7c5c;
    padding-left: 8px;
}
.news-cats li.active a em { color: #5a3f0d; }

/* ---- 热门推荐 ---- */
.news-hot {
    list-style: none;
    margin: 0;
    padding: 0;
}
.news-hot li {
    padding: 7px 0;
    font-size: 13.5px;
    line-height: 1.6;
    border-bottom: 1px dashed rgba(109, 84, 32, .3);
}
.news-hot li:last-child { border-bottom: 0; }
.news-hot .hot-no {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    margin-right: 8px;
    text-align: center;
    font-size: 11px;
    color: #2a1c07;
    font-weight: bold;
    background-color: #b08e4c;
    border-radius: 2px;
    vertical-align: 1px;
}
.news-hot li:nth-child(1) .hot-no { background-color: #e8c987; }
.news-hot li:nth-child(2) .hot-no { background-color: #d3bb86; }
.news-hot li:nth-child(3) .hot-no { background-color: #bd9a5f; }
.news-hot li a {
    color: #c9b78d;
    text-decoration: none;
}
.news-hot li a:hover { color: #ffe9a8; }

/* ==========================================================================
   3. 列表区
   ========================================================================== */
.news-bar {
    margin-bottom: 14px;
    font-size: 0;
    border-bottom: 1px solid rgba(216, 180, 99, .16);
    padding-bottom: 10px;
}
.news-sort {
    display: inline-block;
    vertical-align: middle;
    padding: 6px 16px;
    margin-right: 8px;
    font-size: 13.5px;
    letter-spacing: 1px;
    color: #a08f6f;
    text-decoration: none;
    border: 1px solid rgba(109, 84, 32, .7);
    border-radius: 3px;
    transition: color .2s, border-color .2s, background-color .2s;
}
/* 排序容器必须 inline-block：它是个 <div>，默认 block 会另起一行，
   把右侧浮动的"共 N 篇"甩到上面一行去。 */
.news-sort-tabs {
    display: inline-block;
    vertical-align: middle;
}
.news-sort:hover { color: #ffe9a8; border-color: #d8b463; }
.news-sort.active {
    color: #2a1c07;
    font-weight: bold;
    background-color: #e0b95c;
    border-color: #ffe9a8;
}
.news-total {
    float: right;
    font-size: 13px;
    color: #8d7c5c;
    line-height: 30px;
}
.news-total b { color: #e0bd6a; font-weight: normal; }

/* 当前栏目名（JS 填充）。搜索/筛选后这里会跟着变，
   让用户在长列表里始终知道"我在看哪一块"。 */
.news-cat-title {
    font-size: 19px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #e8c987;
    margin: 0 0 14px;
    padding-left: 12px;
    position: relative;
}
.news-cat-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 17px;
    margin-top: -9px;
    background-image: linear-gradient(180deg, #ffe9a8, #a87c28);
    border-radius: 1px;
}

.news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.news-list > li { margin-bottom: 14px; }

/* 卡片：图片列 + 文字列。
   用 display:table 而不是 float —— 文字列高度随内容变化时，
   两列永远对齐到同一条基线上，不会出现"图片掉到下一行"。 */
.news-card {
    position: relative;
    background-color: #16100a;
    border: 1px solid rgba(109, 84, 32, .72);
    box-shadow: 0 1px 0 rgba(255, 224, 160, .06) inset, 0 2px 8px rgba(0, 0, 0, .45);
    transition: border-color .22s, box-shadow .22s, -webkit-transform .22s;
    transition: border-color .22s, box-shadow .22s, transform .22s;
}
.news-card:hover {
    border-color: #d8b463;
    box-shadow: 0 1px 0 rgba(255, 224, 160, .12) inset, 0 0 18px rgba(255, 158, 46, .28), 0 3px 12px rgba(0, 0, 0, .5);
    -webkit-transform: translateY(-2px);
    transform: translateY(-2px);
}
.news-link {
    display: table;
    table-layout: fixed;
    width: 100%;
    padding: 14px;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}
.news-thumb {
    display: table-cell;
    width: 186px;
    vertical-align: middle;
    padding-right: 16px;
    text-align: center;
}
/* ★ 不写死 width/height：旧站图片长宽比五花八门，
   硬给 170×118 会把人物拉变形（老内核没有 object-fit 兜底）。
   用 max-width + max-height 让图片自己按比例缩到框内。 */
.news-thumb img {
    display: block;
    max-width: 100%;
    max-height: 118px;
    width: auto;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(216, 180, 99, .28);
    background-color: #0d0a06;
}
.news-body-cell {
    display: table-cell;
    vertical-align: middle;
}
/* 没有封面时（.is-nocover）不显示缩略图列，文字列自然占满整行 */
.news-card.is-nocover .news-link { display: block; }

.news-name {
    font-size: 17.5px;
    line-height: 1.55;
    letter-spacing: 1px;
    color: #e8c987;
    margin: 0 0 8px;
    font-weight: bold;
}
.news-card:hover .news-name { color: #fff3cf; }
.news-top {
    display: inline-block;
    padding: 1px 7px;
    margin-right: 8px;
    font-size: 11.5px;
    font-style: normal;
    font-weight: normal;
    letter-spacing: 1px;
    color: #2a1c07;
    background-color: #e0b95c;
    border-radius: 2px;
    vertical-align: 2px;
}
/* 摘要固定两行高度：line-height 1.7 × 13.5 ≈ 23px */
.news-desc {
    font-size: 13.5px;
    line-height: 1.7;
    color: #a89a80;
    margin: 0 0 10px;
    max-height: 46px;
    overflow: hidden;
}
.news-meta {
    font-size: 12.5px;
    color: #8d7c5c;
    margin: 0;
}
.news-meta span { margin-right: 14px; }
.news-meta .news-cat {
    color: #c9a95f;
    border: 1px solid rgba(109, 84, 32, .7);
    border-radius: 2px;
    padding: 1px 7px;
}

.news-empty {
    display: none;
    padding: 60px 20px;
    text-align: center;
    font-size: 14px;
    letter-spacing: 1px;
    color: #8d7c5c;
    background-color: #14100b;
    border: 1px dashed rgba(109, 84, 32, .6);
}

/* ---- 分页 ---- */
.news-pager {
    margin-top: 24px;
    text-align: center;
}
.page-btn {
    display: inline-block;
    min-width: 38px;
    height: 36px;
    line-height: 34px;
    padding: 0 10px;
    margin: 0 4px 8px;
    font-size: 13.5px;
    text-align: center;
    color: #c9b78d;
    text-decoration: none;
    background-color: #16100a;
    border: 1px solid rgba(109, 84, 32, .8);
    border-radius: 3px;
    box-sizing: border-box;
    transition: color .2s, border-color .2s;
}
.page-btn:hover { color: #ffe9a8; border-color: #d8b463; }
.page-btn.active {
    color: #2a1c07;
    font-weight: bold;
    background-color: #e0b95c;
    border-color: #ffe9a8;
}
.page-gap {
    display: inline-block;
    margin: 0 2px;
    color: #6d5420;
}

/* ==========================================================================
   4. 详情页
   ========================================================================== */
.nd-crumb {
    font-size: 13px;
    color: #8d7c5c;
    margin: 0 0 16px;
    padding-left: 2px;
}
.nd-crumb a { color: #c9a95f; text-decoration: none; }
.nd-crumb a:hover { color: #ffe9a8; text-decoration: underline; }
.nd-sep { margin: 0 6px; color: #55452a; }
.nd-here { color: #a08f6f; }

.nd-body {
    display: table;
    table-layout: fixed;
    width: 100%;
}
.nd-main {
    display: table-cell;
    vertical-align: top;
    padding-right: 26px;
}

/* 正文外框：挂 .legend-frame 包角，故只用 background-color */
.nd-article {
    position: relative;
    background-color: #16100a;
    border: 1px solid rgba(109, 84, 32, .8);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .55);
    padding: 30px 34px 26px;
}

.nd-title {
    font-size: 26px;
    line-height: 1.55;
    letter-spacing: 2px;
    text-align: center;
    color: #f0d79a;
    text-shadow: 0 0 12px rgba(255, 158, 46, .28);
    margin: 0 0 14px;
}
.nd-meta {
    text-align: center;
    font-size: 12.5px;
    color: #8d7c5c;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(216, 180, 99, .18);
}
.nd-dot { margin: 0 8px; color: #55452a; }

/* ---- 正文排版 ----
   旧站正文是织梦生成的 HTML，结构很杂（段落、表格、居中 div、
   内联字号都可能出现）。这里按"能读"优先：行高给到 2，
   段落之间留白，图片一律自适应宽度。 */
.nd-content {
    padding-top: 22px;
    font-size: 15px;
    line-height: 2;
    color: #cfc0a4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.nd-content p { margin: 0 0 16px; }
.nd-content img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    margin: 16px auto;
    border: 1px solid rgba(216, 180, 99, .22);
    background-color: #0d0a06;
}
.nd-content a { color: #e0bd6a; text-decoration: underline; }
.nd-content a:hover { color: #fff3cf; }
.nd-content h1, .nd-content h2, .nd-content h3, .nd-content h4 {
    color: #e8c987;
    letter-spacing: 1px;
    margin: 22px 0 12px;
    line-height: 1.6;
}
.nd-content h1 { font-size: 21px; }
.nd-content h2 { font-size: 19px; }
.nd-content h3 { font-size: 17px; }
.nd-content h4 { font-size: 15.5px; }
/* 表格：旧站资料类文章几乎全靠表格对齐数值 */
.nd-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}
.nd-content td, .nd-content th {
    border: 1px solid rgba(216, 180, 99, .22);
    padding: 8px 10px;
    line-height: 1.7;
}
.nd-content th {
    color: #e8c987;
    background-color: rgba(109, 84, 32, .22);
}
.nd-content ul, .nd-content ol { margin: 0 0 16px 22px; }
.nd-content li { margin-bottom: 6px; }
.nd-content blockquote {
    margin: 16px 0;
    padding: 10px 16px;
    border-left: 3px solid #6d5420;
    background-color: rgba(109, 84, 32, .12);
    color: #b8a684;
}
.nd-plain { color: #8d7c5c; text-align: center; padding: 40px 0; }

.nd-tags {
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid rgba(216, 180, 99, .16);
    font-size: 0;
}
.nd-tag {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 8px 8px 0;
    font-size: 12.5px;
    color: #c9b78d;
    text-decoration: none;
    background-color: #14100b;
    border: 1px solid rgba(109, 84, 32, .7);
    border-radius: 12px;
}
.nd-tag:hover { color: #ffe9a8; border-color: #d8b463; }

/* ---- 上一篇 / 下一篇 ---- */
.nd-nav {
    margin-top: 22px;
}
.nd-nav-row {
    font-size: 13.5px;
    line-height: 1.8;
    color: #8d7c5c;
    padding: 9px 12px;
    background-color: #14100b;
    border: 1px solid rgba(109, 84, 32, .55);
    border-radius: 3px;
    margin-bottom: 8px;
}
.nd-nav-row.has-link a { color: #c9a95f; text-decoration: none; }
.nd-nav-row.has-link a:hover { color: #ffe9a8; text-decoration: underline; }
.nd-nav-label { color: #e0bd6a; letter-spacing: 1px; }

/* ---- 右侧栏 ---- */
.nd-side {
    display: table-cell;
    width: 280px;
    vertical-align: top;
}
.nd-side-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nd-side-list li {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(109, 84, 32, .3);
    font-size: 13.5px;
    line-height: 1.6;
}
.nd-side-list li:last-child { border-bottom: 0; }
.nd-side-list a { color: #c9b78d; text-decoration: none; }
.nd-side-list a:hover { color: #ffe9a8; }

/* ---- 相关推荐（正文下方） ---- */
.nd-related {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid rgba(216, 180, 99, .16);
}
.nd-rel-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nd-rel-list li {
    padding: 8px 0;
    border-bottom: 1px dashed rgba(109, 84, 32, .3);
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    padding-left: 14px;
}
.nd-rel-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    width: 4px;
    height: 4px;
    background-color: #6d5420;
    -webkit-transform: rotate(45deg);
    transform: rotate(45deg);
}
.nd-rel-list a { color: #c9b78d; text-decoration: none; }
.nd-rel-list a:hover { color: #ffe9a8; }
.nd-rel-date { float: right; font-size: 12px; color: #7b6c50; }

/* ---- 详情页空状态 / 返回 ---- */
.nd-empty {
    display: none;
    padding: 80px 20px;
    text-align: center;
    font-size: 15px;
    line-height: 2.2;
    color: #96876a;
    background-color: #14100b;
    border: 1px dashed rgba(109, 84, 32, .6);
}
.nd-back-btn {
    display: inline-block;
    padding: 8px 22px;
    font-size: 14px;
    color: #2a1c07;
    text-decoration: none;
    font-weight: bold;
    background-color: #e0b95c;
    border: 1px solid #ffe9a8;
    border-radius: 3px;
}
.nd-back-btn:hover { box-shadow: 0 0 14px rgba(255, 172, 60, .5); }

/* ==========================================================================
   5. 窄屏
   --------------------------------------------------------------------
   ★ 媒体查询不增加特异性，所以这些规则必须排在要被覆盖的规则**之后**
     （整份文件里它们已经在最后了）。
   ========================================================================== */
@media (max-width: 980px) {
    /* 两栏改一栏：侧栏移到列表上方，变成一行可横向滚动的栏目条 */
    .news-body { display: block; }
    .news-side {
        display: block;
        width: auto;
        padding-right: 0;
        margin-bottom: 16px;
    }
    .news-main { display: block; }

    .nd-body { display: block; }
    .nd-main { display: block; padding-right: 0; }
    .nd-side { display: block; width: auto; margin-top: 20px; }

    /* 栏目条：横向排列、不换行，超出就横向滚动（手机上的通行做法） */
    .news-panel-cats {
        padding: 12px 6px;
    }
    .news-panel-cats .news-panel-title { display: none; }
    .news-cats {
        white-space: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0;
    }
    .news-cats li {
        display: inline-block;
        margin: 0 8px 0 0;
    }
    .news-cats li a { padding: 7px 14px; }
    .news-cats li a::before { display: none; }
    .news-cats li a em { float: none; padding-left: 6px; }

    .news-hot { display: none; }
}

@media (max-width: 768px) {
    .news-section { padding: 24px 14px 40px; }
    .news-title { font-size: 25px; letter-spacing: 3px; }
    .news-search input { width: 100%; max-width: 100%; }
    .news-search button { width: 100%; margin: 10px 0 0; }

    /* 卡片：缩略图从左侧栏变成顶在图上的小图会更占地方，
       这里保留左图右文，但把图列收到 112px */
    .news-link { padding: 10px; }
    .news-thumb { width: 112px; padding-right: 10px; }
    .news-thumb img { max-height: 82px; }
    .news-name { font-size: 15.5px; margin-bottom: 6px; }
    .news-desc { font-size: 12.5px; max-height: 42px; }
    .news-meta { font-size: 11.5px; }
    .news-meta span { margin-right: 10px; }

    .news-total { float: none; display: block; line-height: 1.6; margin-top: 8px; }
    .page-btn { min-width: 34px; height: 34px; line-height: 32px; margin: 0 3px 8px; }

    .nd-article { padding: 20px 16px 18px; }
    .nd-title { font-size: 20px; }
    .nd-content { font-size: 14.5px; line-height: 1.95; }
    .nd-content table { font-size: 12.5px; }
    .nd-content td, .nd-content th { padding: 6px 7px; }
    .nd-rel-date { display: block; float: none; }
}
