/* ==========================================================================
   5iter 科技资讯 - 前台样式
   科技感 · 响应式 · 深色模式 · 可访问性
   ========================================================================== */

/* ---------- 主题变量 ---------- */
:root {
    --bg: #f6f8fb;
    --bg-soft: #ffffff;
    --bg-elevated: #ffffff;
    --text: #0f172a;
    --text-soft: #64748b;
    --text-faint: #94a3b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --accent: #06b6d4;
    --border: #e2e8f0;
    --border-soft: #eef2f7;
    --card: #ffffff;
    --tag-bg: #eff6ff;
    --tag-text: #1e40af;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 2px 8px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
    --radius: 14px;
    --radius-sm: 10px;
    --maxw: 1120px;
    --grad: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
}
[data-theme="dark"] {
    --bg: #0b1220;
    --bg-soft: #0f172a;
    --bg-elevated: #131c2e;
    --text: #e2e8f0;
    --text-soft: #94a3b8;
    --text-faint: #64748b;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-soft: #1e2f4d;
    --accent: #22d3ee;
    --border: #1e293b;
    --border-soft: #1a2436;
    --card: #131c2e;
    --tag-bg: #1e3a5f;
    --tag-text: #93c5fd;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, .5);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
    transition: background .3s ease, color .3s ease;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--primary); color: #fff; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
    background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border-soft);
    position: sticky; top: 0; z-index: 100;
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo {
    font-size: 21px; font-weight: 800; letter-spacing: -.5px; white-space: nowrap;
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex; align-items: center; gap: 8px;
}
.logo::before {
    content: ""; width: 10px; height: 10px; border-radius: 3px;
    background: var(--grad); display: inline-block; flex-shrink: 0;
}
.logo-img {
    height: 36px; width: auto; display: block;
    object-fit: contain; border-radius: 4px;
}
/* 有图片 logo 时隐藏装饰方块，且不应用文字渐变 */
.logo:has(.logo-img)::before { display: none; }
.logo:has(.logo-img) {
    background: none; -webkit-text-fill-color: initial;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    color: var(--text-soft); font-size: 14px; font-weight: 500;
    padding: 8px 14px; border-radius: 8px; transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: var(--bg); }
.nav a.active { color: var(--primary); background: var(--primary-soft); }

.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input {
    padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg); color: var(--text); font-size: 14px; width: 210px;
    transition: border-color .2s, box-shadow .2s, width .25s;
}
.search-form input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft); width: 250px;
}

.theme-toggle, .font-btn {
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    border-radius: 9px; padding: 8px 11px; cursor: pointer; font-size: 15px; line-height: 1;
    transition: border-color .2s, transform .1s, background .2s;
}
.theme-toggle:hover, .font-btn:hover { border-color: var(--primary); transform: translateY(-1px); }
.theme-toggle:active, .font-btn:active { transform: scale(.95); }

/* 移动端汉堡按钮 */
.nav-toggle {
    display: none; background: var(--bg-soft); border: 1px solid var(--border);
    color: var(--text); border-radius: 9px; padding: 8px 11px; cursor: pointer;
    font-size: 18px; line-height: 1; transition: border-color .2s, transform .1s, background .2s;
}
.nav-toggle:hover { border-color: var(--primary); }
.nav-toggle.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- 语言切换器（下拉框） ---------- */
.lang-dropdown { position: relative; display: inline-block; }
.lang-dropdown-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    background: var(--bg-soft); border: 1px solid var(--border);
    color: var(--text); font-size: 14px; font-weight: 500;
    transition: all .2s;
}
.lang-dropdown-toggle:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.lang-dropdown-toggle .flag { font-size: 16px; }
.lang-dropdown-toggle .caret {
    font-size: 11px; color: var(--text-soft); transition: transform .25s;
}
.lang-dropdown.open .caret { transform: rotate(180deg); }

.lang-dropdown-menu {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 200;
    min-width: 180px; max-height: 360px; overflow-y: auto;
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-lg); padding: 6px; list-style: none; margin: 0;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.lang-dropdown.open .lang-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-dropdown-menu li { margin: 0; }
.lang-dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 8px; font-size: 14px;
    color: var(--text); transition: background .15s;
}
.lang-dropdown-menu a:hover { background: var(--bg); }
.lang-dropdown-menu a.active {
    background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.lang-dropdown-menu .flag { font-size: 16px; }
.lang-dropdown-menu .lang-name { flex: 1; }

/* 菜单在右侧时向左对齐（防止超出视口） */
.lang-dropdown.align-right .lang-dropdown-menu { left: auto; right: 0; }

/* 移动端：菜单铺满一定宽度，避免过窄 */
@media (max-width: 768px) {
    .lang-dropdown-menu { min-width: 160px; }
}

/* ---------- 主区域 ---------- */
.main { padding: 28px 0 64px; min-height: 60vh; }
.page-title {
    font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 24px;
    position: relative; padding-left: 16px;
}
.page-title::before {
    content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
    width: 5px; border-radius: 3px; background: var(--grad);
}

/* ---------- 文章卡片 ---------- */
.article-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px;
}
.article-card {
    background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.article-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border);
}
.article-cover {
    width: 100%; height: 176px; object-fit: cover; background: var(--bg);
    transition: transform .4s ease;
}
.article-card:hover .article-cover { transform: scale(1.04); }
.article-cover-wrap { overflow: hidden; position: relative; }
.article-card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.article-card-date {
    font-size: 12px; color: var(--text-faint); margin-bottom: 8px;
    display: flex; align-items: center; gap: 4px;
}
.article-card-title {
    font-size: 17px; font-weight: 700; line-height: 1.45; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card-title a { transition: color .2s; }
.article-card-title a:hover { color: var(--primary); }
.article-excerpt {
    color: var(--text-soft); font-size: 14px; line-height: 1.7; flex: 1; margin-bottom: 14px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.article-meta {
    font-size: 12px; color: var(--text-faint); display: flex; align-items: center;
    justify-content: space-between; gap: 8px; padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}
.article-meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
    display: inline-block; padding: 3px 11px; border-radius: 999px;
    background: var(--tag-bg); color: var(--tag-text); font-size: 12px; font-weight: 500;
    transition: all .2s;
}
.tag:hover { background: var(--primary); color: #fff; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span {
    min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px;
    transition: all .2s;
}
.pagination .current {
    background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* ---------- 标签云 ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud .tag {
    font-size: 14px; padding: 7px 16px; background: var(--bg-soft);
    border: 1px solid var(--border); color: var(--text);
}
.tag-cloud .tag:hover { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- 文章详情 ---------- */
.article-detail { max-width: 1120px; margin: 0 auto; }
.article-detail h1 {
    font-size: 32px; font-weight: 800; line-height: 1.35; margin-bottom: 16px; letter-spacing: -.5px;
}
.detail-meta {
    color: var(--text-faint); font-size: 14px; margin-bottom: 24px;
    display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
    padding-bottom: 20px; border-bottom: 1px solid var(--border-soft);
}
.detail-meta .meta-item { display: inline-flex; align-items: center; gap: 5px; }
.share-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.share-label { font-size: 14px; color: var(--text-soft); font-weight: 600; }
.share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
    font-size: 13px; font-weight: 500; text-decoration: none;
    transition: all .18s ease;
}
.share-btn:hover {
    border-color: var(--share-color, var(--primary));
    background: var(--share-color, var(--primary));
    color: #fff; transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.share-icon { font-size: 15px; }
.article-content { font-size: 17px; line-height: 1.9; color: var(--text); }
.article-content img {
    max-width: 100%; height: auto; border-radius: 12px; margin: 20px 0;
    box-shadow: var(--shadow);
}
.article-content p { margin-bottom: 20px; }
.article-content h2, .article-content h3 { margin: 32px 0 16px; line-height: 1.4; }
.article-content h2 { font-size: 24px; }
.article-content h3 { font-size: 20px; }
.article-content a { color: var(--primary); border-bottom: 1px dashed var(--primary); }
.article-content a:hover { border-bottom-style: solid; }
.article-content blockquote {
    border-left: 4px solid var(--primary); padding: 12px 20px;
    background: var(--primary-soft); border-radius: 0 12px 12px 0;
    color: var(--text-soft); margin: 20px 0;
}
.article-content ul, .article-content ol { margin: 0 0 20px 26px; }
.article-content li { margin-bottom: 8px; }
.article-content code {
    background: var(--bg); padding: 2px 7px; border-radius: 6px; font-size: .9em;
    font-family: "SF Mono", "JetBrains Mono", Consolas, monospace; color: #e11d48;
}
[data-theme="dark"] .article-content code { color: #fbbf24; }
.article-content pre {
    background: #0f172a; color: #e2e8f0; padding: 18px 20px; border-radius: 12px;
    overflow-x: auto; margin: 20px 0; font-size: 14px; line-height: 1.6;
}
.article-content pre code { background: none; padding: 0; color: inherit; }

/* 阅读工具栏 */
.reading-tools {
    display: flex; gap: 8px; align-items: center; margin: 20px 0;
    padding: 12px 16px; background: var(--bg-soft); border: 1px solid var(--border-soft);
    border-radius: 12px;
}

/* ---------- 评论 ---------- */
.comments-section { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 32px; }
.comments-section h2 { font-size: 22px; font-weight: 700; margin-bottom: 22px; }
.comment {
    padding: 18px 0; border-bottom: 1px solid var(--border-soft);
}
.comment:last-child { border-bottom: none; }
.comment-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.comment-nick { font-weight: 700; font-size: 15px; }
.comment-date { font-size: 12px; color: var(--text-faint); }
.comment-location { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-faint); }
.comment-ip { font-size: 12px; color: var(--text-faint); }
.comment-body { font-size: 15px; line-height: 1.8; }
.comment-vote { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.vote-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 13px;
    background: var(--bg); border: 1px solid var(--border); color: var(--text-soft);
    transition: all .15s; user-select: none;
}
.vote-btn:hover { border-color: var(--primary); color: var(--primary); }
.vote-btn.voted { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.vote-btn .count { font-weight: 600; }
.comment-form {
    background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-sm);
}
.form-field { margin-bottom: 16px; position: relative; }
.comment-form textarea {
    width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.7;
    min-height: 120px; resize: vertical;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.comment-form input {
    padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg); color: var(--text); font-size: 14px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.comment-form input::placeholder, .comment-form textarea::placeholder { color: var(--text-faint); }
.comment-form input:focus, .comment-form textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
    background: var(--bg-elevated);
}
.char-count {
    position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: var(--text-faint);
    pointer-events: none;
}

/* 底部一行：昵称 + 验证码 + 验证码图片 + 提交按钮 */
.form-row { display: flex; align-items: stretch; gap: 10px; }
.form-row input#nickname { flex: 1 1 auto; min-width: 0; }
.form-row input#captchaInput {
    flex: 0 0 110px; width: 110px; text-align: center;
    font-size: 18px; font-weight: 700; letter-spacing: 4px;
}
.captcha-img {
    flex: 0 0 110px; width: 110px; height: 45px; border-radius: 10px;
    border: 1px solid var(--border); cursor: pointer; object-fit: cover;
    transition: opacity .15s, transform .1s;
}
.captcha-img:hover { opacity: .85; }
.captcha-img:active { transform: scale(.97); }
.comment-form .btn { flex: 0 0 auto; padding: 0 22px; font-size: 15px; white-space: nowrap; }
.comment-form .btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
[data-theme="dark"] .alert-error { background: #2c0a0a; color: #fca5a5; border-color: #7f1d1d; }

/* 移动端：底部一行换行排列 */
@media (max-width: 640px) {
    .comment-form { padding: 18px; }
    .form-row { flex-wrap: wrap; }
    .form-row input#nickname { flex: 1 1 100%; }
    .form-row input#captchaInput { flex: 1 1 100px; }
    .captcha-img { flex: 1 1 100px; }
    .comment-form .btn { flex: 1 1 100%; padding: 12px; }
}
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--grad); color: #fff; border: none; padding: 11px 26px;
    border-radius: 10px; font-size: 14px; cursor: pointer; font-weight: 600;
    transition: transform .15s, box-shadow .2s, opacity .2s;
    box-shadow: var(--shadow-sm);
}
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
[data-theme="dark"] .alert-success { background: #052e16; color: #86efac; border-color: #166534; }

/* ---------- 空状态 ---------- */
.empty {
    text-align: center; color: var(--text-faint); padding: 80px 0; font-size: 15px;
}
.empty::before { content: "◌"; display: block; font-size: 40px; margin-bottom: 12px; opacity: .5; }

/* ---------- 页脚 ---------- */
.site-footer {
    border-top: 1px solid var(--border-soft); padding: 36px 0; text-align: center;
    color: var(--text-faint); font-size: 13px; background: var(--bg-soft);
}
.site-footer .footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 12px; flex-wrap: wrap; }
.site-footer .footer-links a { color: var(--text-soft); transition: color .2s; }
.site-footer .footer-links a:hover { color: var(--primary); }

/* ---------- 字体大小调节 ---------- */
/* 通过 CSS 变量控制正文字号，字体调节按钮切换该变量 */
html { --content-font-size: 17px; }
html.font-small { --content-font-size: 15px; }
html.font-medium { --content-font-size: 17px; }
html.font-large { --content-font-size: 20px; }
.font-small .article-content, html.font-small .article-content { font-size: 15px; }
.font-medium .article-content, html.font-medium .article-content { font-size: 17px; }
.font-large .article-content, html.font-large .article-content { font-size: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .article-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .topbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 10px; position: relative; }
    .logo { font-size: 19px; margin-right: auto; }
    /* 导航改为下拉菜单：绝对定位、垂直排列、从右侧展开 */
    .nav {
        position: absolute; top: calc(100% + 6px); right: 0; z-index: 300;
        min-width: 160px; flex-direction: column; gap: 2px;
        background: var(--card); border: 1px solid var(--border); border-radius: 12px;
        box-shadow: var(--shadow-lg); padding: 6px;
        opacity: 0; visibility: hidden; transform: translateY(-6px);
        transition: opacity .2s, transform .2s, visibility .2s;
    }
    .nav.open { opacity: 1; visibility: visible; transform: translateY(0); }
    .nav a {
        display: block; white-space: nowrap; padding: 10px 14px;
        border-radius: 8px; font-size: 14px;
    }
    .search-form { flex: 1; }
    .search-form input { width: 100%; }
    .search-form input:focus { width: 100%; }
    .nav-toggle { display: inline-flex; }
    .article-list { grid-template-columns: 1fr; gap: 16px; }
    .article-detail h1 { font-size: 26px; }
    .article-content { font-size: 16px; }
    .page-title { font-size: 24px; }
    .reading-tools { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .article-cover { height: 160px; }
    .article-card-body { padding: 16px; }
    .article-detail h1 { font-size: 23px; }
    .btn { width: 100%; }
    .search-form input { width: 130px; }
}

/* ==========================================================================
   电报页（7x24 快讯）
   ========================================================================== */
.telegraph-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.telegraph-controls { display: flex; gap: 10px; flex-wrap: wrap; }
/* 开关按钮（switch 样式） */
.tg-switch {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 13px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg-soft);
    font-size: 13px; font-weight: 500; color: var(--text-soft);
    transition: all .2s; user-select: none;
}
.tg-switch:hover { border-color: var(--primary); color: var(--primary); }
.tg-switch input { display: none; }
.tg-switch-track {
    position: relative; display: inline-block; width: 36px; height: 20px;
    background: var(--border); border-radius: 999px; transition: background .25s;
    flex: 0 0 auto;
}
.tg-switch-thumb {
    position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
    background: #fff; border-radius: 50%; transition: transform .25s;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tg-switch input:checked + .tg-switch-track { background: var(--primary); }
.tg-switch input:checked + .tg-switch-track .tg-switch-thumb { transform: translateX(16px); }
.tg-switch:has(input:checked) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* 加载中 / 到底提示 */
.tg-loading { display: flex; justify-content: center; padding: 20px 0; }
.tg-spinner {
    width: 26px; height: 26px; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--primary);
    animation: tgSpin .7s linear infinite;
}
@keyframes tgSpin { to { transform: rotate(360deg); } }
.tg-end { text-align: center; color: var(--text-faint); font-size: 13px; padding: 18px 0; }

.telegraph-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tg-chip {
    padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
    border: 1px solid var(--border); color: var(--text-soft); transition: all .2s;
}
.tg-chip:hover { border-color: var(--primary); color: var(--primary); }
.tg-chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.tg-filter-label { font-size: 13px; color: var(--text-soft); font-weight: 600; margin-right: 2px; }

.telegraph-list { display: flex; flex-direction: column; }
.tg-item {
    display: flex; gap: 12px; padding: 16px 18px; position: relative;
    border-bottom: 1px solid var(--border-soft);
    animation: tgIn .35s ease;
}
.tg-item:first-child { border-top: 1px solid var(--border-soft); }
@keyframes tgIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.tg-level {
    flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff; margin-top: 2px;
}
.tg-item.level-A .tg-level { background: #e11d48; }
.tg-item.level-B .tg-level { background: #64748b; }
.tg-item.level-A { background: var(--primary-soft); }
.tg-top {
    position: absolute; top: 8px; right: 12px; font-size: 11px;
    background: #e11d48; color: #fff; padding: 1px 8px; border-radius: 4px;
}
.tg-body { flex: 1; min-width: 0; }
.tg-content {
    font-size: 15px; line-height: 1.8; color: var(--text); word-break: break-word;
    display: block; text-decoration: none; transition: color .15s;
}
a.tg-content:hover { color: var(--primary); }
.tg-item.level-A .tg-content { font-weight: 600; }
.tg-meta {
    display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
    margin-top: 8px; font-size: 12px; color: var(--text-faint);
}
.tg-source {
    color: var(--primary); background: var(--primary-soft);
    padding: 1px 9px; border-radius: 4px; font-weight: 500;
}
.tg-tag {
    color: var(--tag-text); background: var(--tag-bg);
    padding: 1px 9px; border-radius: 999px; font-size: 12px;
    text-decoration: none; transition: all .15s;
}
.tg-tag:hover { background: var(--primary); color: #fff; }
.tg-time { font-family: "SF Mono", Consolas, monospace; }
.tg-read { }

/* 电报详情页 */
.tg-detail {
    max-width: 1120px; margin: 0 auto;
    background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius);
    padding: 28px 32px; box-shadow: var(--shadow-sm);
}
.tg-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.tg-level-lg {
    display: inline-flex; align-items: center; padding: 5px 14px;
    border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff;
}
.tg-level-lg.level-A { background: #e11d48; }
.tg-level-lg.level-B { background: #64748b; }
.tg-top-inline { font-size: 13px; color: var(--text-soft); }
.tg-detail-content {
    font-size: 19px; line-height: 1.9; color: var(--text);
    margin-bottom: 24px; word-break: break-word;
}
.tg-detail-meta {
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
    font-size: 14px; color: var(--text-soft);
    padding-top: 20px; border-top: 1px solid var(--border-soft); margin-bottom: 20px;
}
.tg-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tg-detail-actions .share-bar { margin: 0; }
.tg-detail-tags {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding-bottom: 20px; margin-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}
.tg-detail-tags .tg-tag { font-size: 13px; padding: 4px 12px; }

@media (max-width: 640px) {
    .tg-item { padding: 14px 12px; }
    .tg-content { font-size: 14px; }
    .tg-detail { padding: 20px 16px; }
    .tg-detail-content { font-size: 16px; }
}

/* 减少动效（无障碍） */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
}

/* ===== 上下文（上一篇/下一篇）+ 相似推荐 ===== */
.prev-next {
    display: flex; gap: 16px; align-items: stretch;
    max-width: 1120px; margin-left: auto; margin-right: auto;
}
.pn-item {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 12px;
    padding: 16px 18px; border-radius: var(--radius);
    background: var(--card); border: 1px solid var(--border-soft);
    text-decoration: none; transition: all .18s;
}
.pn-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.pn-prev { justify-content: flex-start; text-align: left; }
.pn-next { justify-content: flex-end; text-align: right; }
.pn-arrow {
    flex: 0 0 auto; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--primary-soft); color: var(--primary);
    font-size: 18px; font-weight: 700;
}
.pn-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pn-label { font-size: 12px; color: var(--primary); font-weight: 600; }
.pn-title {
    font-size: 14px; color: var(--text); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pn-disabled { opacity: .5; cursor: default; }
.pn-disabled:hover { border-color: var(--border-soft); box-shadow: none; transform: none; }

.similar-section { max-width: 1120px; margin-left: auto; margin-right: auto; }
.similar-title {
    font-size: 17px; font-weight: 700; margin-bottom: 16px;
    color: var(--text); padding-left: 12px; border-left: 4px solid var(--primary);
    display: flex; align-items: center; gap: 8px;
}
.similar-list {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.similar-card {
    display: flex; gap: 12px; align-items: center;
    padding: 14px 16px; border-radius: var(--radius);
    background: var(--card); border: 1px solid var(--border-soft);
    text-decoration: none; transition: all .18s;
}
.similar-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.similar-cover { flex: 0 0 88px; height: 60px; border-radius: 8px; overflow: hidden; }
.similar-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.similar-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.similar-title-text {
    font-size: 14px; color: var(--text); line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.similar-date { font-size: 12px; color: var(--text-soft); }
.similar-card-telegraph .similar-title-text { -webkit-line-clamp: 3; }

@media (max-width: 640px) {
    .prev-next { flex-direction: column; }
    .similar-list { grid-template-columns: 1fr; }
    .pn-next { justify-content: flex-start; text-align: left; }
}
