/* 红色科技 · 财经资讯主题 */
:root {
    --brand: #e1242f;
    --brand-dark: #b3141f;
    --brand-light: #fff1f2;
    --accent: #ff7a45;
    --up: #e1242f;
    --down: #15a05a;
    --text: #1d2129;
    --sub: #4e5969;
    --muted: #8a9099;
    --line: #eceef1;
    --bg: #f4f5f7;
    --card: #ffffff;
    --max: 1180px;
    --radius: 10px;
    --shadow: 0 2px 14px rgba(20, 24, 35, .06);
    --shadow-hover: 0 6px 22px rgba(225, 36, 47, .12);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 15px;
}

a { color: var(--brand); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--brand-dark); text-decoration: none; }

img { max-width: 100%; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

/* ============ Header ============ */
.site-header {
    background: var(--card);
    box-shadow: 0 1px 0 var(--line), 0 2px 10px rgba(20, 24, 35, .05);
    position: relative;
}
.site-header::before {
    content: ""; display: block; height: 3px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
}
.header-inner { display: flex; align-items: center; height: 66px; gap: 28px; }
.logo {
    font-size: 22px; font-weight: 800; letter-spacing: .5px;
    color: var(--brand); display: inline-flex; align-items: center; gap: 10px;
}
.logo img { height: 38px; width: auto; display: block; }
.logo .logo-text { background: linear-gradient(90deg, var(--brand), var(--brand-dark)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.main-nav a {
    position: relative; color: var(--text); font-size: 15.5px; font-weight: 500;
    padding: 8px 14px; border-radius: 6px; transition: color .15s, background .15s;
}
.main-nav a::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
    background: var(--brand); transform: scaleX(0); transform-origin: center; transition: transform .2s ease;
}
.main-nav a:hover { color: var(--brand); background: var(--brand-light); }
.main-nav a:hover::after { transform: scaleX(1); }
.nav-btn { display: none; }

/* ============ Layout ============ */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 24px; align-items: start; padding: 24px 16px; }
.site-main { min-width: 0; min-height: 60vh; }
.sidebar { display: flex; flex-direction: column; gap: 20px; }

/* ============ Cards 通用 ============ */
.widget, .headlines, .cat-section, .article-list.big, .page-head,
.article-detail, .single-page, .comments, .related, .bound-list, .prevnext {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ============ 侧栏小部件 ============ */
.widget { padding: 18px 18px; }
.widget-title {
    font-size: 16px; font-weight: 700; margin: 0 0 14px; padding-left: 12px; position: relative;
}
.widget-title::before {
    content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px;
    border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--accent));
}
.rank-list { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.rank-list li { counter-increment: rank; padding: 9px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; align-items: baseline; }
.rank-list li:last-child { border-bottom: none; }
.rank-list li::before {
    content: counter(rank); flex: none; width: 20px; height: 20px; line-height: 20px;
    text-align: center; font-size: 12px; font-weight: 700; border-radius: 4px; background: var(--bg); color: var(--muted);
}
.rank-list li:nth-child(-n+3)::before { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; }
.rank-list a { color: var(--text); font-size: 14px; }
.rank-list a:hover { color: var(--brand); }
.rank-list .rank-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rank-list .li-meta { color: var(--muted); font-size: 12px; }
.rank-list .li-meta time { color: var(--muted); }

/* 相关阅读：标题左、时间/作者右对齐 */
.related .article-list li { align-items: baseline; }
.related .article-list .li-meta { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ============ 标签云 / 文章标签 ============ */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 4px 13px; font-size: 13px; color: var(--sub); }
.tag-cloud a:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.article-tags { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { background: var(--brand-light); border: 1px solid #ffd9dc; border-radius: 14px; padding: 3px 12px; font-size: 12px; color: var(--brand-dark); }

/* ============ 上一篇/下一篇 ============ */
.prevnext { display: flex; justify-content: space-between; gap: 16px; padding: 16px 24px; margin-top: 20px; flex-wrap: wrap; }
.prevnext .pn-item { font-size: 14px; max-width: 48%; }
.prevnext .pn-none { color: var(--muted); }
@media (max-width: 560px) { .prevnext .pn-item { max-width: 100%; flex: 1 1 100%; } }

/* ============ 面包屑 ============ */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

/* ============ 首页头条图文网格 ============ */
.featured {
    display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 132px;
    gap: 14px; margin-bottom: 24px;
}
.feat-card {
    position: relative; display: block; overflow: hidden; border-radius: var(--radius);
    box-shadow: var(--shadow); background: #222;
}
.feat-card:first-child { grid-column: span 2; grid-row: span 2; }
.feat-thumb, .feat-thumb img { display: block; width: 100%; height: 100%; }
.feat-thumb img { object-fit: cover; transition: transform .4s ease; }
.feat-card:hover .feat-thumb img { transform: scale(1.06); }
.feat-body {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 16px 12px; color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,0) 100%);
}
.feat-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 14.5px; font-weight: 600; line-height: 1.45;
}
.feat-card:first-child .feat-title { font-size: 21px; -webkit-line-clamp: 3; }
.feat-body time { display: block; margin-top: 4px; font-size: 11.5px; color: rgba(255,255,255,.7); }
.feat-card:first-child .feat-body { padding-bottom: 16px; }
@media (max-width: 720px) {
    .featured { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 112px; }
    .feat-card:first-child { grid-column: span 2; grid-row: span 2; }
    .feat-card:first-child .feat-title { font-size: 18px; }
}

/* ============ 头条（旧版兼容） ============ */
.headlines { padding: 22px 26px; margin-bottom: 24px; }
.headline-item { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.headline-item:last-child { border-bottom: none; }
.headline-item h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; transition: color .15s; }
.headline-item a:hover h2 { color: var(--brand); }
.headline-item:first-child { padding-top: 4px; }
.headline-item:first-child h2 { font-size: 24px; }
.headline-item:first-child h2::before {
    content: "头条"; display: inline-block; vertical-align: middle; margin-right: 10px;
    font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent));
    padding: 2px 9px; border-radius: 4px;
}
.headline-item .summary { margin: 4px 0; color: var(--sub); }
.headline-item time { color: var(--muted); font-size: 12px; }

/* ============ 首页栏目块 ============ */
.cat-section { padding: 18px 26px 22px; margin-bottom: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--line); padding-bottom: 10px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 700; padding-left: 12px; position: relative; }
.section-head h2::before {
    content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px;
    border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--accent));
}
.section-head h2 a { color: var(--text); }
.section-head h2 a:hover { color: var(--brand); }
.section-head .more { font-size: 13px; color: var(--muted); }
.section-head .more:hover { color: var(--brand); }
.cat-body { display: flex; gap: 22px; align-items: flex-start; }
/* 栏目固定题图：每栏目 3 张，竖排、固定 4:3 长宽比，不随列表高度拉伸 */
.cat-covers { flex: none; width: 210px; display: flex; flex-direction: column; gap: 10px; }
.cat-covers a { display: block; border-radius: 8px; overflow: hidden; background: var(--bg); aspect-ratio: 4 / 3; }
.cat-covers img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.cat-covers a:hover img { transform: scale(1.05); }
.cat-body .article-list { flex: 1; min-width: 0; align-self: stretch; }
@media (max-width: 640px) {
    .cat-body { flex-direction: column; gap: 14px; }
    .cat-covers { flex-direction: row; width: 100%; gap: 8px; }
    .cat-covers a { flex: 1; }
}

/* ============ 文章列表 ============ */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.article-list li:last-child { border-bottom: none; }
.article-list li a { color: var(--text); }
.article-list li a:hover { color: var(--brand); }
.article-list time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* 首页栏目列表：标题行 + 内容片段（两行截断） */
.article-list.with-sum li { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px 0; }
.article-list.with-sum .li-row { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.article-list.with-sum .li-title {
    flex: 1; min-width: 0; font-size: 15.5px; font-weight: 600; color: var(--text); line-height: 1.5;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    position: relative; padding-left: 14px;
}
.article-list.with-sum .li-title::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
}
.article-list.with-sum li:hover .li-title { color: var(--brand); }
.article-list.with-sum .li-meta { flex: none; color: var(--muted); font-size: 12px; white-space: nowrap; }
.article-list.with-sum .li-meta time { color: var(--muted); }
.article-list.with-sum .li-sum {
    margin: 0; padding-left: 14px; color: var(--sub); font-size: 13px; line-height: 1.65;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-list.with-sum .li-sum a { color: var(--sub); }
.article-list.with-sum li:hover .li-sum a { color: var(--sub); }

.article-list.big { padding: 6px 26px; }
.article-list.big li { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0; transition: transform .15s ease; }
.article-list.big .thumb { flex: none; width: 168px; height: 104px; border-radius: 8px; overflow: hidden; background: var(--bg); }
.article-list.big .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.article-list.big li:hover .thumb img { transform: scale(1.06); }
.article-list.big .item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.article-list.big .title {
    font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.article-list.big li:hover .title { color: var(--brand); }
.article-list.big .summary {
    color: var(--sub); margin: 8px 0 0; font-size: 14px; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-list.big time { margin-top: auto; padding-top: 10px; color: var(--muted); font-size: 12.5px; }
.article-list .empty { color: var(--muted); justify-content: center; }
@media (max-width: 640px) {
    .article-list.big { padding: 6px 16px; }
    .article-list.big .thumb { width: 112px; height: 74px; }
    .article-list.big .title { font-size: 16px; }
}

/* ============ 页头（栏目/标签） ============ */
.page-head { padding: 20px 26px; margin-bottom: 16px; border-left: 4px solid var(--brand); }
.page-head h1 { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
.cat-desc { color: var(--muted); margin: 0; }

/* ============ 文章详情 ============ */
.article-detail { padding: 30px 34px; }
.article-detail h1 { font-size: 28px; line-height: 1.4; margin: 0 0 14px; font-weight: 800; }
.article-detail .meta { color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 22px; }
.article-content { font-size: 16.5px; color: #33373f; }
.article-content p { margin: 0 0 16px; }
.article-content img, .article-img img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: 14px auto; }

/* ============ 单页 ============ */
.single-page { padding: 30px 34px; }
.single-page h1 { font-size: 26px; line-height: 1.4; margin: 0 0 18px; font-weight: 800; }

/* ============ 股票组件 ============ */
.stock-box { margin: 16px 0; }
.stock-widgets { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stock-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fafbfc; padding: 4px; }
.stock-item img { display: block; width: 100%; height: auto; border-radius: 4px; }
/* 走势图随机插入正文段落之间时的间距 */
.article-content .stock-box { margin: 18px 0; }

/* ============ 评论 / 相关 ============ */
.comments, .related, .bound-list { padding: 22px 28px; margin-top: 20px; }
.comments h2, .related h2, .bound-list h2 { font-size: 18px; font-weight: 700; padding-left: 12px; margin: 0 0 16px; position: relative; }
.comments h2::before, .related h2::before, .bound-list h2::before {
    content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px;
    border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--accent));
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.comment-list li:last-child { border-bottom: none; }
.comment-list .nick { font-weight: 700; color: var(--brand); }
.comment-list .time { color: var(--muted); font-size: 12px; margin-left: 10px; }
.comment-list p { margin: 6px 0 0; }

/* ============ 分页 ============ */
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 26px 0; }
.pager a, .pager .cur { min-width: 40px; text-align: center; padding: 7px 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: 14px; }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .cur { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; border-color: var(--brand); font-weight: 700; }
.pager .gap { padding: 7px 4px; color: var(--muted); }

/* ============ HTML 站点地图 ============ */
.sitemap { display: flex; flex-direction: column; gap: 16px; }
.sitemap-block { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 24px; }
.sitemap-block h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; padding-left: 12px; position: relative; }
.sitemap-block h2::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--accent)); }
.sitemap-block h2 a { color: var(--text); }
.sitemap-block h2 a:hover { color: var(--brand); }
.sitemap-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 18px; }
.sitemap-links li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.sitemap-links a { color: var(--sub); font-size: 14px; }
.sitemap-links a:hover { color: var(--brand); }
.sitemap-links .empty { color: var(--muted); }

/* ============ Footer ============ */
.site-footer { background: #1a1d24; color: #9aa1ad; padding: 0; margin-top: 36px; font-size: 13.5px; border-top: 3px solid var(--brand); }
.site-footer .container { padding-top: 34px; padding-bottom: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; padding-bottom: 26px; border-bottom: 1px solid #2a2e37; }
.footer-brand .footer-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: #fff; }
.footer-brand .footer-logo img { height: 34px; width: auto; }
.footer-desc { margin: 12px 0 0; color: #7f8794; line-height: 1.8; max-width: 460px; }
.footer-col h4 { margin: 0 0 14px; font-size: 15px; color: #fff; font-weight: 600; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #9aa1ad; }
.footer-col a:hover { color: #fff; }
.footer-bottom { padding-top: 18px; text-align: center; color: #71798a; }
.footer-bottom .footer-links { margin: 0 0 10px; }
.footer-bottom .footer-links a { color: #9aa1ad; }
.footer-bottom .footer-links a:hover { color: #fff; }
.footer-bottom .copyright { margin: 0 0 6px; }
.footer-bottom .beian { margin: 0; }
.footer-bottom a { color: #71798a; }
.footer-bottom a:hover { color: #fff; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    /* H5 顶部：logo 居左 + 右侧汉堡按钮，导航默认折叠、点击展开 */
    .header-inner { height: auto; flex-wrap: wrap; align-items: center; gap: 0; padding: 0 12px; }
    .logo { margin-right: auto; gap: 8px; padding: 12px 0; font-size: 18px; }
    .logo img { height: 30px; }

    .nav-btn {
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        width: 44px; height: 44px; margin-left: 8px; cursor: pointer;
    }
    .nav-btn span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
    .nav-toggle:checked ~ .nav-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle:checked ~ .nav-btn span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked ~ .nav-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .main-nav {
        display: none; flex-direction: column; gap: 0; margin-left: 0;
        flex-basis: 100%; width: 100%;
        border-top: 1px solid var(--line);
    }
    .nav-toggle:checked ~ .main-nav { display: flex; }
    .main-nav a { font-size: 15px; padding: 13px 4px; border-radius: 0; border-bottom: 1px solid var(--line); }
    .main-nav a::after { display: none; }
    .main-nav a:last-child { border-bottom: 0; }
    .main-nav a:active { background: var(--brand-light); }

    .layout { padding: 16px 12px; gap: 16px; }
    .article-detail, .single-page { padding: 20px 18px; }
    .article-detail h1, .single-page h1 { font-size: 22px; }
    .headlines, .cat-section { padding: 18px 16px; }
    .headline-item:first-child h2 { font-size: 20px; }
    .comments, .related, .bound-list { padding: 18px 16px; }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    body { font-size: 15px; }
}

/* 辅助工具类：保证零视觉影响（双保险） */
.is-hidden { display: none !important; }
.t { font: inherit; color: inherit; background: transparent; letter-spacing: inherit; }
