/* =========================================================
   今日头条文章落地页 · 主样式
   适配 16 语种（含阿拉伯语 RTL）与移动端
   ========================================================= */

:root {
    --red: #f04142;
    --text: #222;
    --text-2: #444;
    --muted: #999;
    --line: #eee;
    --bg-soft: #f2f3f5;
    --content-width: 1260px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding-top: 64px;
    background: #fff;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans SC", "Noto Sans TC", "Noto Sans Arabic", "Noto Sans Devanagari",
        Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

button,
input {
    font: inherit;
}

/* ============ 顶部导航 ============ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 64px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: 1440px;
    height: 100%;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.logo {
    flex: none;
    color: var(--red);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1px;
    white-space: nowrap;
}

.nav {
    flex: 1;
    min-width: 0;
}

.nav ul {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav a {
    display: block;
    font-size: 16px;
    color: var(--text-2);
    white-space: nowrap;
    transition: color .2s;
}

.nav a:hover,
.nav a.active {
    color: var(--red);
}

.header-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    width: 240px;
    height: 38px;
    border-radius: 4px;
    background: var(--bg-soft);
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 100%;
    padding: 0 40px 0 14px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    display: flex;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: var(--text-2);
    white-space: nowrap;
}

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

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 74px;
    padding: 0 16px;
    border-radius: 4px;
    background: var(--red);
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
}

.login-btn:hover {
    background: #d93436;
}

/* ============ 左侧互动条 ============ */
.action-bar {
    position: fixed;
    left: max(16px, calc(50% - 690px));
    top: 260px;
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    z-index: 90;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #222;
    text-align: center;
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s;
}

.action-item:hover .action-icon {
    transform: scale(1.1);
    color: var(--red);
}

.action-num {
    font-size: 13px;
    font-weight: 500;
    color: #222;
}

.action-label {
    font-size: 12px;
    color: #666;
}

/* ============ 主体布局 ============ */
.wrap {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 52px 24px 72px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 72px;
    align-items: start;
}

.article-col {
    min-width: 0;
    max-width: 830px;
}

.article {
    min-width: 0;
}

.article-title {
    margin: 0 0 26px;
    font-size: 40px;
    line-height: 1.36;
    font-weight: 700;
    letter-spacing: .4px;
    color: #1a1a1a;
    word-wrap: break-word;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 16px;
    color: var(--muted);
}

.meta-author:hover {
    color: var(--red);
}

.article-source {
    margin: 0 0 18px;
    padding: 14px 18px;
    background: var(--bg-soft);
    border-radius: 6px;
}

.source-line {
    margin: 0;
    font-size: 15px;
    color: var(--text-2);
    line-height: 1.9;
}

.source-line:first-child {
    font-weight: 600;
    color: var(--text);
}

.summary-box {
    margin: 0 0 20px;
    padding: 16px 18px;
    border-left: 3px solid var(--red);
    background: #fdf3f3;
    border-radius: 0 6px 6px 0;
}

.summary-label {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--red);
}

.summary-text {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.8;
    color: #333;
}

.article-declare {
    margin: 0 0 26px;
    font-size: 15px;
    color: var(--muted);
}

.article-body p {
    margin: 0 0 28px;
    font-size: 18px;
    line-height: 1.9;
    color: #222;
    text-align: justify;
    word-wrap: break-word;
}

.article-body p.hl {
    font-weight: 700;
    color: #111;
}

.article-body .sec-title {
    margin: 44px 0 24px;
    padding-left: 14px;
    border-left: 4px solid var(--red);
    font-size: 26px;
    line-height: 1.5;
    font-weight: 700;
    color: #1a1a1a;
}

.article-body figure {
    margin: 0 0 30px;
}

.article-body figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    background: var(--bg-soft);
}

.article-body figcaption {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    text-align: center;
}

/* ============ 右侧栏 ============ */
.sidebar {
    position: sticky;
    top: 96px;
    width: 300px;
    font-size: 14px;
}

.author-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 22px;
    text-align: center;
}

.author-avatar {
    display: block;
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-soft);
}

.author-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    margin-bottom: 14px;
    font-size: 16px;
    color: var(--text);
}

.follow-btn {
    width: 96px;
    height: 36px;
    border: 0;
    border-radius: 4px;
    background: var(--red);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.follow-btn:hover {
    background: #d93436;
}

.hot-head {
    padding: 18px 0 14px;
    border-top: 1px solid var(--line);
}

.hot-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.hot-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hot-list li {
    display: flex;
    gap: 12px;
    padding: 10px 0;
}

.hot-thumb {
    flex: none;
    width: 112px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-soft);
}

.hot-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hot-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
    color: #222;
}

.hot-title:hover {
    color: var(--red);
}

.hot-meta {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.hot-more {
    display: block;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.hot-more:hover {
    color: var(--red);
}

/* ============ 页脚 ============ */
.site-footer {
    border-top: 1px solid var(--line);
    background: #fafafa;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 26px 24px 30px;
    text-align: center;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 26px;
    margin-bottom: 14px;
}

.footer-nav a {
    font-size: 14px;
    color: var(--text-2);
    white-space: nowrap;
}

.footer-nav a:hover {
    color: var(--red);
}

.footer-copy {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

/* ============ 右下悬浮按钮 ============ */
.float-bar {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 90;
}

.float-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 54px;
    height: 58px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    color: #555;
    font-size: 11px;
    transition: color .2s, border-color .2s;
}

.float-item:hover {
    color: var(--red);
    border-color: #f5c2c2;
}

.float-icon {
    display: flex;
}

/* ============ 阿拉伯语 RTL ============ */
html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .article-body p,
html[dir="rtl"] .article-meta {
    text-align: right;
}

html[dir="rtl"] .article-meta {
    justify-content: flex-start;
}

html[dir="rtl"] .search-input {
    padding: 0 14px 0 40px;
}

html[dir="rtl"] .search-icon {
    right: auto;
    left: 12px;
}

html[dir="rtl"] .action-bar {
    left: auto;
    right: max(16px, calc(50% - 690px));
}

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

html[dir="rtl"] .hot-title {
    text-align: right;
}

html[dir="rtl"] .article-body .sec-title {
    border-left: 0;
    border-right: 4px solid var(--red);
    padding-left: 0;
    padding-right: 14px;
}

html[dir="rtl"] .summary-box {
    border-left: 0;
    border-right: 3px solid var(--red);
    border-radius: 6px 0 0 6px;
}

/* ============ 自适应 ============ */
@media (max-width: 1280px) {
    .action-bar {
        display: none;
    }

    html[dir="rtl"] .float-bar {
        display: none;
    }

    :root {
        --content-width: 1140px;
    }
}

@media (max-width: 1100px) {
    .search-box {
        width: 180px;
    }

    .nav ul {
        gap: 18px;
    }

    .wrap {
        gap: 48px;
    }
}

@media (max-width: 960px) {
    body {
        padding-top: 60px;
    }

    .site-header {
        height: 60px;
    }

    .nav,
    .header-link span,
    .search-box {
        display: none;
    }

    .wrap {
        display: block;
        max-width: 760px;
        padding: 32px 20px 56px;
    }

    .article-col {
        max-width: none;
    }

    .sidebar,
    .float-bar {
        display: none;
    }

    .article-title {
        font-size: 30px;
    }

    .article-body p {
        font-size: 17px;
    }

    .article-body .sec-title {
        font-size: 22px;
    }
}

@media (max-width: 640px) {
    .header-inner {
        padding: 0 16px;
        gap: 12px;
    }

    .logo {
        font-size: 22px;
    }

    .logo {
        flex: 1;
    }

    .login-btn {
        min-width: 62px;
        padding: 0 12px;
        font-size: 14px;
    }

    .header-actions {
        gap: 12px;
    }

    .header-link {
        display: none;
    }

    .wrap {
        padding: 24px 16px 48px;
    }

    .article-title {
        font-size: 25px;
        line-height: 1.4;
        margin-bottom: 18px;
    }

    .article-meta {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .article-source {
        padding: 12px 14px;
    }

    .source-line {
        font-size: 14px;
    }

    .summary-text {
        font-size: 16px;
    }

    .article-declare {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .article-body p {
        font-size: 16px;
        line-height: 1.85;
        margin-bottom: 22px;
    }

    .article-body .sec-title {
        font-size: 20px;
        margin: 32px 0 18px;
    }

    .article-body figure {
        margin-bottom: 24px;
    }

    .footer-nav {
        gap: 8px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
