/* =========================================================
   文章页 · 静态克隆样式
   视觉基准：https://www.thepaper.cn/newsDetail_forward_34600538
   仅手写还原，无任何外部依赖
   ========================================================= */

:root {
    --font-base: PingFangSC-Regular, "Microsoft Yahei", "Hiragino Sans GB", "Noto Sans", sans-serif;
    --font-article: "MicrosoftYaHei", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans", sans-serif;
    --color-text: #333333;
    --color-title: #000000;
    --color-muted: #999999;
    --color-desc: #808080;
    --color-link: #00a5eb;
    --color-bg: #f8f9f9;
    --shadow-soft: 2px 2px 4px 0 #dee4e6, -2px -2px 4px 0 #ffffff;
    --shadow-inset: inset 1px 1px 4px 0 #dee4e6;
}

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    background-image: url("../images/body_bg.png");
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: 100% 387px;
    color: var(--color-text);
    font-family: var(--font-base);
    font-size: 14px;
    line-height: 22px;
}

a {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(0, 165, 235, 0.55);
    outline-offset: 2px;
}

/* ---------------- 顶部导航 ---------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1052;
    height: 115px;
    background: var(--color-bg) url("../images/header_bg.png") center / cover no-repeat;
}

.nav {
    display: flex;
    align-items: center;
    height: 115px;
    padding: 0 40px;
    box-sizing: border-box;
}

.nav-menu {
    margin: 0 50px 0 0;
    min-width: 0;
}

.nav-menu ul {
    display: flex;
    align-items: flex-start;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 115px;
}

.nav-menu li {
    width: 54px;
    height: 115px;
    display: flex;
}

.nav-menu a {
    display: flex;
    width: 100%;
    height: 115px;
    padding: 30px 18px 0;
    box-sizing: border-box;
    color: #666666;
    font-size: 18px;
    line-height: 19px;
    text-decoration: none;
    transition: color 0.18s ease;
}

.nav-menu a i {
    display: block;
    width: 18px;
    font-style: normal;
}

.nav-menu a:hover {
    color: var(--color-link);
}

/* 拉丁 / 阿拉伯 / 其他语种：导航横向排版，避免逐字换行 */
html[data-vertical="false"] .nav-menu {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 24px;
}

html[data-vertical="false"] .nav-menu ul {
    height: 115px;
    flex-wrap: wrap;
    align-content: center;
}

html[data-vertical="false"] .nav-menu li {
    width: auto;
    height: auto;
}

html[data-vertical="false"] .nav-menu a {
    height: auto;
    padding: 3px 10px;
    align-items: center;
    font-size: 14px;
    line-height: 22px;
    white-space: nowrap;
}

html[data-vertical="false"] .nav-menu a i {
    width: auto;
}

.login-menu {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex: none;
}

.search-box {
    position: relative;
    width: 150px;
    height: 32px;
    margin-right: 10px;
}

.search-input {
    width: 100%;
    height: 32px;
    padding: 4px 11px 4px 35px;
    box-sizing: border-box;
    border: 0;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-inset);
    color: rgba(0, 0, 0, 0.85);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    background: url("../images/search_icon.png") center / 12px 12px no-repeat;
}

.downapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 130px;
    height: 32px;
    margin-right: 10px;
    box-sizing: border-box;
    border-radius: 16px;
    background: linear-gradient(135deg, #00d9ff, #00a5eb);
    color: #ffffff;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.downapp b {
    font-weight: 400;
}

.downapp-icon {
    flex: none;
}

.login {
    padding: 0 14px;
    color: var(--color-text);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.a11y {
    margin-left: 2px;
    padding-left: 12px;
    border-left: 1px solid #d8dde0;
    color: var(--color-text);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.login:hover,
.a11y:hover {
    color: var(--color-link);
}

/* ---------------- 左侧悬浮操作条 ---------------- */
.left-bar {
    position: fixed;
    left: 33px;
    top: 161px;
    z-index: 1053;
    width: 50px;
}

.lb-group {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    background: var(--color-bg);
    box-shadow: var(--shadow-soft);
}

.lb-group li {
    margin: 10px;
}

.lb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
}

.lb-icon {
    width: 30px;
    height: 30px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: transform 0.18s ease;
}

.lb-item:hover .lb-icon {
    transform: translateY(-1px);
}

.lb-comment {
    background-image: url("../images/icon_comment.png");
}

.lb-like {
    background-image: url("../images/icon_like.png");
}

.lb-star {
    background-image: url("../images/icon_star.png");
}

.lb-wechat {
    background-image: url("../images/icon_wechat.png");
}

.lb-weibo {
    background-image: url("../images/icon_weibo.png");
}

.lb-num {
    color: var(--color-text);
    font-size: 12px;
    line-height: 15px;
}

/* ---------------- 页面主容器 ---------------- */
.container {
    display: flex;
    justify-content: space-between;
    width: 1260px;
    max-width: 100%;
    margin: 10px auto 0;
    padding: 82px 0 80px 107px;
    box-sizing: border-box;
}

.main-col {
    flex: 0 0 894px;
    width: 894px;
}

.article-wrap {
    padding-right: 80px;
}

.article {
    width: 618px;
    margin: 0 98px;
}

.article-title {
    margin: 0;
    color: var(--color-title);
    font-family: var(--font-article);
    font-size: 32px;
    font-weight: 700;
    line-height: 42px;
    word-wrap: break-word;
}

/* ---------------- 文章元信息 ---------------- */
.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 48px 0 38px;
    color: var(--color-muted);
    font-family: var(--font-article);
    font-size: 12px;
    line-height: 18px;
}

.meta-left {
    min-width: 0;
}

.meta-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-line a {
    text-decoration: none;
}

.meta-line a:hover {
    color: var(--color-link);
}

.meta-right {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: none;
    color: var(--color-text);
}

.listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.audio-icon {
    width: 24px;
    height: 24px;
    background: url("../images/audio.png") center / cover no-repeat;
}

.font-size-box {
    position: relative;
}

.font-size-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.font-size-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 20;
    min-width: 84px;
    margin: 8px 0 0;
    padding: 4px 0;
    list-style: none;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.font-size-menu button {
    display: block;
    width: 100%;
    padding: 4px 14px;
    border: 0;
    background: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.font-size-menu button:hover,
.font-size-menu button.is-active {
    color: var(--color-link);
}

/* ---------------- 正文 ---------------- */
.article-body {
    color: var(--color-text);
    font-family: var(--font-article);
    font-size: 16px;
    line-height: 30px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-body p {
    margin: 16px 0;
}

.article-body strong {
    font-weight: 700;
}

.article-body img {
    display: block;
    width: auto;
    max-width: min(600px, 100%);
    height: auto;
    margin: 0 auto;
}

.article-body .image-desc {
    margin: 0 0 20px;
    padding-top: 6px;
    color: var(--color-desc);
    font-size: 12px;
    line-height: 20px;
}

/* ---------------- 版权 / 底部操作 ---------------- */
.copyright {
    margin-top: 30px;
    color: var(--color-muted);
    font-family: var(--font-article);
    font-size: 12px;
    line-height: 18px;
}

.copyright-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.article-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 42px;
    font-family: var(--font-article);
    font-size: 14px;
    line-height: 21px;
}

.actions-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.action-like,
.action-collect {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.action-icon {
    width: 21px;
    height: 21px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.action-icon-like {
    background-image: url("../images/icon_like.png");
}

.action-icon-star {
    background-image: url("../images/icon_star.png");
}

.action-report {
    text-decoration: none;
}

.action-like:hover,
.action-collect:hover,
.action-report:hover {
    color: var(--color-link);
}

/* ---------------- 标签 ---------------- */
.recommend {
    margin: 81px 0 80px;
    padding-right: 80px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-left: 38px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--color-bg);
    box-shadow: 1px 1px 2px 0 #dee4e6, -1px -1px 2px 0 #ffffff;
    color: var(--color-text);
    font-family: var(--font-article);
    font-size: 14px;
    line-height: 21px;
    text-decoration: none;
}

.tag:hover {
    color: var(--color-link);
}

/* ---------------- 评论区 ---------------- */
.comments {
    width: 618px;
    margin-left: 107px;
    font-family: var(--font-article);
}

.comment-head {
    color: var(--color-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 26px;
}

.comment-count {
    font-weight: 400;
}

.comment-editor {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.comment-avatar {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #eceff1;
}

.comment-editor-body {
    flex: 1;
    min-width: 0;
}

.comment-textarea-wrap {
    position: relative;
}

.comment-textarea-wrap textarea {
    display: block;
    width: 100%;
    min-height: 88px;
    padding: 10px 12px 26px;
    box-sizing: border-box;
    border: 1px solid #e6eaec;
    border-radius: 4px;
    background: #ffffff;
    color: var(--color-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 22px;
    resize: vertical;
    outline: none;
}

.comment-textarea-wrap textarea:focus {
    border-color: #b9dff0;
}

.comment-counter {
    position: absolute;
    right: 10px;
    bottom: 8px;
    color: #b0b7bb;
    font-size: 12px;
}

.comment-editor-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.comment-submit {
    padding: 4px 16px;
    border-radius: 4px;
    background: var(--color-link);
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.comment-subtitle {
    margin: 24px 0 4px;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 700;
}

.comment-item {
    display: flex;
    gap: 10px;
    padding: 16px 0;
    border-bottom: 1px solid #eceff1;
}

.comment-item .c-avatar {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #eceff1;
}

.comment-item .c-main {
    flex: 1;
    min-width: 0;
}

.c-author {
    color: #666666;
    font-size: 13px;
    line-height: 20px;
}

.c-text {
    margin: 6px 0;
    color: var(--color-text);
    font-size: 14px;
    line-height: 24px;
    word-wrap: break-word;
}

.c-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 20px;
}

.c-actions {
    display: inline-flex;
    gap: 16px;
}

.c-actions span {
    cursor: pointer;
}

.comment-loading {
    padding: 18px 0;
    color: var(--color-muted);
    font-size: 12px;
    text-align: center;
}

.page-toast {
    position: fixed;
    left: 50%;
    bottom: 48px;
    z-index: 2147483600;
    max-width: 80vw;
    padding: 10px 18px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.78);
    color: #ffffff;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}

.page-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------------- 右侧栏 ---------------- */
.side-col {
    flex: 0 0 240px;
    width: 240px;
}

.side-card {
    margin-bottom: 30px;
    background: #ffffff;
    border-radius: 2px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.card-title {
    margin: 0;
    padding: 16px 16px 10px;
    color: var(--color-text);
    font-family: var(--font-article);
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    word-break: break-word;
}

.card-list {
    margin: 0;
    padding: 0 16px 6px;
    list-style: none;
}

.card-list li {
    padding: 7px 0;
    border-bottom: 1px dashed #eef1f3;
    font-size: 13px;
    line-height: 20px;
}

.card-list li:last-child {
    border-bottom: 0;
}

.card-list a {
    display: block;
    color: var(--color-text);
    text-decoration: none;
}

.card-list a:hover {
    color: var(--color-link);
}

.card-more {
    display: block;
    width: calc(100% - 32px);
    margin: 8px 16px 16px;
    padding: 6px 0;
    border: 0;
    border-radius: 2px;
    background: #f0f0f0;
    color: #666666;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.card-link {
    display: block;
    padding: 2px 0 14px;
    color: var(--color-link);
    font-size: 13px;
    text-align: center;
    text-decoration: none;
}

.card-more-link {
    display: block;
    margin: 8px 16px 16px;
    padding: 6px 0;
    background: #f0f0f0;
    color: #666666;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
}

.crossword-intro {
    padding: 0 16px 5px;
    color: #666666;
    font-size: 13px;
    line-height: 20px;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
    padding-top: 6px;
    color: var(--color-text);
    font-size: 12px;
    line-height: 20px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 0;
    margin-bottom: 14px;
}

.footer-links a {
    color: var(--color-text);
    text-decoration: none;
}

.footer-links a:hover,
.footer-block a:hover {
    color: var(--color-link);
}

.footer-block {
    margin-top: 12px;
}

.footer-title {
    display: inline-block;
    margin-bottom: 2px;
    color: var(--color-text);
}

.footer-block ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-block li {
    line-height: 22px;
}

.footer-block a,
.footer-block span {
    color: var(--color-text);
    font-size: 12px;
    text-decoration: none;
}

.footer-block a,
.footer-block span,
.footer-beian p,
.footer-beian a,
.footer-links a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.footer-beian {
    margin-top: 20px;
}

.footer-beian p {
    margin: 0;
    line-height: 20px;
}

.footer-beian a {
    color: var(--color-text);
    text-decoration: none;
}

.footer-badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 16px;
    padding-bottom: 10px;
}

.footer-badges img {
    display: block;
    width: auto;
    max-height: 34px;
}

html[data-vertical="false"] .footer-links {
    grid-template-columns: repeat(2, 1fr);
}

/* ---------------- 反馈 / 返回顶部 ---------------- */
.feedback-fab {
    position: fixed;
    left: 32px;
    bottom: 120px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 50px;
    padding: 12px 0;
    background: var(--color-bg);
    border-radius: 2px;
    box-shadow: var(--shadow-soft);
    color: var(--color-text);
    font-size: 12px;
    text-decoration: none;
}

.feedback-icon {
    width: 24px;
    height: 24px;
    background: url("../images/icon_feedback.png") center / cover no-repeat;
}

.backtop {
    position: fixed;
    right: 32px;
    bottom: 40px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
    color: #666666;
    cursor: pointer;
}

.backtop[hidden] {
    display: none;
}

/* ---------------- 字号切换 ---------------- */
body[data-fontsize="14"] .article-body { font-size: 14px; line-height: 27px; }
body[data-fontsize="16"] .article-body { font-size: 16px; line-height: 30px; }
body[data-fontsize="18"] .article-body { font-size: 18px; line-height: 34px; }
body[data-fontsize="20"] .article-body { font-size: 20px; line-height: 38px; }

/* ---------------- 阿拉伯语 RTL ---------------- */
html[dir="rtl"] body {
    text-align: right;
}

html[dir="rtl"] .article-body,
html[dir="rtl"] .article-title,
html[dir="rtl"] .comments,
html[dir="rtl"] .side-col {
    text-align: right;
}

html[dir="rtl"] .container {
    padding: 82px 107px 80px 16px;
}

html[dir="rtl"] .article-wrap {
    padding-right: 0;
    padding-left: 80px;
}

html[dir="rtl"] .recommend {
    padding-right: 0;
    padding-left: 80px;
}

html[dir="rtl"] .tags {
    margin-left: 0;
    margin-right: 38px;
}

html[dir="rtl"] .comments {
    margin-left: 0;
    margin-right: 107px;
}

html[dir="rtl"] .font-size-menu {
    right: auto;
    left: 0;
}

html[dir="rtl"] .font-size-menu button {
    text-align: right;
}

html[dir="rtl"] .left-bar {
    left: auto;
    right: 33px;
}

html[dir="rtl"] .feedback-fab {
    display: none;
}

html[dir="rtl"] .backtop {
    right: auto;
    left: 32px;
}

/* ---------------- 自适应 ---------------- */
@media (max-width: 1240px) {
    .container {
        width: 100%;
        padding-left: 40px;
        padding-right: 20px;
    }
}

@media (max-width: 1140px) {
    .left-bar {
        display: none;
    }

    .container {
        display: block;
        padding: 40px 24px 60px;
    }

    .main-col {
        width: 100%;
        flex: none;
    }

    .article-wrap {
        padding-right: 0;
    }

    .article {
        width: auto;
        max-width: 760px;
        margin: 0 auto;
    }

    .recommend {
        padding-right: 0;
        margin: 40px auto 40px;
        max-width: 760px;
    }

    .tags {
        margin-left: 0;
    }

    .comments {
        width: auto;
        max-width: 760px;
        margin: 0 auto;
    }

    .side-col {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
        width: 100%;
        max-width: 760px;
        margin: 40px auto 0;
    }

    .side-card {
        margin-bottom: 0;
    }

    .site-footer {
        grid-column: 1 / -1;
    }

    .site-footer {
        max-width: 100%;
    }

    .feedback-fab {
        bottom: 100px;
    }

    html[dir="rtl"] .container {
        padding: 40px 24px 60px;
    }

    html[dir="rtl"] .article-wrap,
    html[dir="rtl"] .recommend {
        padding-left: 0;
    }

    html[dir="rtl"] .comments {
        margin-right: auto;
    }
}

@media (max-width: 900px) {
    .nav {
        padding: 0 16px;
    }

    .nav-menu {
        display: none;
    }

    .search-box {
        display: none;
    }

    .login-menu {
        gap: 2px;
    }

    .downapp {
        width: auto;
        padding: 0 14px;
    }

    .downapp b {
        display: inline;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin: 28px 0 24px;
    }

    .meta-right {
        gap: 24px;
    }

    .article-title {
        font-size: 24px;
        line-height: 34px;
    }

    .article-body {
        font-size: 17px;
        line-height: 32px;
    }

    .article-actions {
        margin-top: 28px;
    }

    .side-col {
        grid-template-columns: 1fr;
    }

    .site-header,
    .nav {
        height: 64px;
    }

    .a11y {
        display: none;
    }

    .feedback-fab {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 24px 14px 40px;
    }

    .downapp {
        display: none;
    }

    .article-title {
        font-size: 22px;
        line-height: 32px;
    }

    .article-body {
        font-size: 16px;
        line-height: 30px;
    }

    .copyright-line {
        gap: 4px 10px;
    }

    .backtop {
        right: 14px;
        bottom: 20px;
    }

    html[dir="rtl"] .backtop {
        left: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
        animation: none !important;
    }
}
