/* =========================================================
   新闻 · 文章页静态复刻
   - 结构还原：固定头部 / 正文左栏 / 右侧栏 / 页脚 / 左侧浮动工具条
   - 16 语种由 js/i18n.js + js/main.js 注入，本文仅管视觉
   ========================================================= */

:root {
    --bg: #f7f8fa;
    --card: #ffffff;
    --ink: #1a1a1a;
    --ink-2: #333333;
    --ink-3: #666666;
    --ink-4: #999999;
    --line: #ececec;
    --line-2: #e2e2e2;
    --accent: #ff4d3a;
    --accent-2: #ff7a5c;
    --link: #2a6ec9;
    --radius: 4px;
    --shadow: 0 1px 6px rgba(0, 0, 0, .06);
    --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Microsoft JhengHei", "Noto Sans SC", "Noto Sans TC",
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif: "Songti SC", "Songti TC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink-2);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    padding-bottom: 40px;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: #fff; }

/* ===================== 顶部导航 ===================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo { display: flex; align-items: center; flex: none; }
.logo img { height: 30px; width: auto; }
.nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: 28px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}
.nav a {
    font-size: 16px;
    color: var(--ink);
    white-space: nowrap;
    padding: 4px 0;
    transition: color .18s;
}
.nav a:hover { color: var(--accent); }
.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: none;
    margin-left: auto;
}
.search {
    display: flex;
    align-items: center;
    border: 1px solid var(--line-2);
    border-radius: 16px;
    padding: 4px 10px;
    background: #fafafa;
}
.search input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    width: 108px;
    color: var(--ink-2);
}
.search-btn {
    width: 15px; height: 15px; margin-left: 4px; flex: none;
    border: 2px solid var(--ink-4);
    border-radius: 50%;
    position: relative;
}
.search-btn::after {
    content: ""; position: absolute; right: -4px; bottom: -3px;
    width: 6px; height: 2px; background: var(--ink-4);
    transform: rotate(45deg); border-radius: 2px;
}
.header-right a { font-size: 14px; color: var(--ink-3); white-space: nowrap; transition: color .18s; }
.header-right a:hover { color: var(--accent); }

/* ===================== 主体布局 ===================== */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 26px 16px 40px; }
.article-layout { display: flex; align-items: flex-start; gap: 40px; }
.article-main { flex: 1 1 auto; min-width: 0; }
.sidebar { width: 320px; flex: none; }

/* ===================== 正文 ===================== */
.article-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--ink);
    letter-spacing: .2px;
    margin-bottom: 22px;
}
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 13px;
    color: var(--ink-4);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.article-meta .meta-link { color: #5b8fd6; }
.article-meta .meta-link:hover { text-decoration: underline; }
.article-meta .dot { color: #d4d4d4; }
.meta-right { margin-left: auto; display: flex; align-items: center; gap: 18px; color: var(--ink-3); }
.meta-right .listen { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.meta-right .listen::before {
    content: ""; width: 0; height: 0;
    border-left: 7px solid var(--accent);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}
.meta-right .font-size { cursor: pointer; }

.article-body {
    font-size: 18px;
    line-height: 2;
    color: var(--ink-2);
    padding-top: 26px;
    word-wrap: break-word;
}
.article-body p { margin-bottom: 24px; }
.article-body p.ab-h {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin: 34px 0 18px;
    line-height: 1.6;
}
.article-body p.ab-h strong, .article-body p strong { font-weight: 700; }
.article-figure { margin: 30px auto; text-align: center; }
.article-figure img {
    max-width: 600px; width: 100%; height: auto;
    margin: 0 auto; border-radius: 2px;
}
.article-figure figcaption {
    font-size: 14px; color: var(--ink-4); margin-top: 10px; line-height: 1.6;
}

/* 标签 */
.article-tags { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px; }
.article-tags a {
    font-size: 14px; color: var(--accent);
    background: rgba(255, 77, 58, .07);
    padding: 3px 10px; border-radius: 12px;
    transition: background .18s;
}
.article-tags a:hover { background: rgba(255, 77, 58, .16); }

/* 版权信息 */
.copyright {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-4);
    line-height: 1.9;
}
.copyright .cr-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.copyright .cr-row + .cr-row { margin-top: 6px; }

/* 互动操作 */
.article-actions {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}
.act-btn {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 14px; color: var(--ink-3);
    background: none; border: none; padding: 4px 0;
    transition: color .18s;
}
.act-btn:hover { color: var(--accent); }
.act-btn .ico {
    width: 20px; height: 20px; display: inline-flex;
    align-items: center; justify-content: center;
    border-radius: 50%; background: #f1f1f1; font-size: 12px;
    transition: background .18s, color .18s;
}
.act-btn:hover .ico { background: var(--accent); color: #fff; }
.act-btn.on .ico { background: var(--accent); color: #fff; }
.act-btn .count { font-variant-numeric: tabular-nums; }

/* ===================== 左侧浮动工具条 ===================== */
.side-tools {
    position: fixed;
    left: calc(50% - 640px);
    top: 150px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 60;
}
.side-tools .tool {
    width: 42px; height: 42px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--ink-3); border: none;
    transition: transform .18s, color .18s;
    position: relative;
}
.side-tools .tool:hover { transform: translateY(-2px); color: var(--accent); }
.side-tools .tool.praised { color: var(--accent); }
.side-tools .plus-one {
    position: absolute; top: -4px; right: -2px;
    color: var(--accent); font-weight: 700; font-size: 12px;
    opacity: 0; transition: opacity .2s, transform .6s;
}
.side-tools .tool.praised .plus-one { opacity: 1; transform: translateY(-16px); }

/* ===================== 右侧栏 ===================== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.card-head { display: flex; align-items: center; margin-bottom: 14px; }
.card-head img { height: 24px; width: auto; }
.card-head.card-title {
    font-size: 18px; font-weight: 700; color: var(--ink);
    letter-spacing: 1px; line-height: 1.3;
}
.hot-list { counter-reset: hot; }
.hot-list li {
    counter-increment: hot;
    display: flex; align-items: baseline; gap: 10px;
    font-size: 14px; color: var(--ink-2); line-height: 1.5;
    padding: 9px 0; border-bottom: 1px dashed var(--line);
}
.hot-list li:last-child { border-bottom: none; }
.hot-list li::before {
    content: counter(hot);
    flex: none; width: 18px;
    font-weight: 700; color: var(--ink-4); font-style: italic;
}
.hot-list li:nth-child(1)::before,
.hot-list li:nth-child(2)::before,
.hot-list li:nth-child(3)::before { color: var(--accent); }
.hot-list li a { flex: 1 1 auto; }
.hot-list li a:hover { color: var(--accent); }

.ad-slot {
    background: repeating-linear-gradient(45deg, #fafafa, #fafafa 10px, #f2f2f2 10px, #f2f2f2 20px);
    border: 1px dashed var(--line-2);
    border-radius: var(--radius);
    height: 90px; margin-bottom: 20px;
    display: flex; align-items: center; justify-content: center;
    color: #bbb; font-size: 12px; letter-spacing: 2px;
}

.mini-list li {
    font-size: 14px; color: var(--ink-2); line-height: 1.55;
    padding: 7px 0;
}
.mini-list li a:hover { color: var(--accent); }
.card-btn {
    display: block; width: 100%; margin-top: 12px;
    padding: 9px 0; text-align: center;
    border: 1px solid var(--line-2); border-radius: 3px;
    background: #fafafa; color: var(--ink-3); font-size: 13px;
    transition: all .18s;
}
.card-btn:hover { border-color: var(--accent); color: var(--accent); }
.card-more {
    display: block; margin-top: 12px; text-align: center;
    font-size: 13px; color: var(--link);
}
.card-more:hover { text-decoration: underline; }

.download-card { display: flex; align-items: center; gap: 16px; }
.download-card .qr { width: 78px; height: 78px; flex: none; }
.download-card .qr img { width: 100%; height: 100%; object-fit: contain; }
.download-card .dl-title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.download-card .dl-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.download-card .dl-links a { font-size: 13px; color: var(--link); }
.download-card .dl-links a:hover { text-decoration: underline; }

/* ===================== 页脚 ===================== */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 40px 16px 34px;
    color: var(--ink-3);
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-links {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 10px 28px; font-size: 14px; color: var(--ink-2);
    padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.footer-links a:hover { color: var(--accent); }
.footer-cols {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 30px 60px; margin-top: 24px; font-size: 13px;
}
.footer-col h4 {
    font-size: 13px; color: var(--ink); font-weight: 700;
    margin-bottom: 10px; text-align: center;
}
.footer-col ul { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.footer-col ul li a { color: var(--ink-3); }
.footer-col ul li a:hover { color: var(--accent); }
.footer-col ul li span { color: var(--ink-3); }
.footer-col .wechat-qr { margin-top: 6px; }
.footer-col .wechat-qr img { width: 84px; height: 84px; margin: 0 auto; }
.footer-beian {
    margin-top: 28px; text-align: center;
    font-size: 12px; color: var(--ink-4); line-height: 1.9;
}
.footer-beian a:hover { color: var(--accent); }
.footer-certs {
    margin-top: 20px; display: flex; justify-content: center;
    align-items: center; gap: 20px; flex-wrap: wrap;
}
.footer-certs img { height: 40px; width: auto; opacity: .9; }

/* ===================== 右下角浮动 ===================== */
.float-actions {
    position: fixed; right: 20px; bottom: 40px;
    display: flex; flex-direction: column; gap: 12px; z-index: 70;
}
.float-actions button, .float-actions a {
    width: 46px; height: 46px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--ink-3); border: none;
    transition: transform .18s, color .18s;
}
.float-actions button:hover, .float-actions a:hover { transform: translateY(-2px); color: var(--accent); }
.float-actions .backtop { opacity: 0; pointer-events: none; transition: opacity .25s; }
.float-actions .backtop.show { opacity: 1; pointer-events: auto; }

/* ===================== 响应式 ===================== */
@media (max-width: 1180px) {
    .side-tools { display: none; }
}
@media (max-width: 900px) {
    .nav { display: none; }
    .article-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .article-title { font-size: 26px; }
    .article-body { font-size: 17px; line-height: 1.9; }
    .header-right { gap: 12px; }
    .search { display: none; }
}
@media (max-width: 560px) {
    .header-inner { height: 54px; }
    .logo img { height: 26px; }
    .header-right a.download { display: none; }
    .article-title { font-size: 22px; }
    .article-body { font-size: 16px; }
    .article-figure img { max-width: 100%; }
    .footer-cols { gap: 24px 32px; }
    .float-actions { right: 12px; bottom: 24px; }
}

/* ===================== RTL ===================== */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .nav { margin-left: 0; margin-right: 28px; }
[dir="rtl"] .header-right { margin-left: 0; margin-right: auto; flex-direction: row-reverse; }
[dir="rtl"] .meta-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .article-meta .dot { display: none; }
[dir="rtl"] .hot-list li::before { font-style: normal; }
[dir="rtl"] .side-tools { left: auto; right: calc(50% - 640px); }
[dir="rtl"] .float-actions { right: auto; left: 20px; }
[dir="rtl"] .article-body p.ab-h { text-align: right; }
