/*
Theme Name: FX112 Portal
Theme URI: https://www.fx112.net.cn/
Author: FX112
Description: 为 FX112 财经网定制的轻量新闻门户主题，内置 SEO/GEO、结构化数据与广告位管理。
Version: 1.0.1
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: fx112-portal
*/

:root {
  --fx-red: #d81e2b;
  --fx-red-dark: #ad111c;
  --fx-navy: #0b172a;
  --fx-navy-2: #14243b;
  --fx-ink: #152033;
  --fx-muted: #657084;
  --fx-line: #e6eaf0;
  --fx-soft: #f5f7fa;
  --fx-white: #fff;
  --fx-green: #0b8f68;
  --fx-radius: 8px;
  --fx-shadow: 0 8px 28px rgba(20, 36, 59, .08);
  --fx-container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fx-ink);
  background: var(--fx-soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; transition: color .18s ease, background .18s ease, opacity .18s ease; }
a:hover { color: var(--fx-red); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
.container { width: min(calc(100% - 32px), var(--fx-container)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { top: 8px; left: 8px; z-index: 99999; width: auto; height: auto; padding: 10px 14px; clip: auto; color: #fff; background: var(--fx-red); }

.site-topbar { color: #bdc7d8; background: #07111f; font-size: 13px; }
.site-topbar__inner { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-topbar__notice { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-topbar time { flex: 0 0 auto; color: #fff; }
.site-header { color: #fff; background: var(--fx-navy); border-bottom: 1px solid rgba(255,255,255,.08); }
.site-header__main { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand__mark { display: grid; place-items: center; width: 46px; height: 46px; color: #fff; background: var(--fx-red); border-radius: 7px; font-weight: 900; letter-spacing: -2px; }
.brand__name { display: block; font-size: 25px; line-height: 1.05; font-weight: 800; letter-spacing: -.5px; }
.brand__tagline { display: block; margin-top: 7px; color: #aeb9ca; font-size: 12px; letter-spacing: 1.5px; }
.custom-logo { max-height: 52px; width: auto; }
.custom-logo-link { display: inline-flex; align-items: center; }
.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.primary-nav a { display: block; padding: 12px 14px; color: #e8edf5; font-size: 15px; font-weight: 650; border-radius: 5px; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current_page_item > a { color: #fff; background: rgba(255,255,255,.09); }
.header-search { position: relative; }
.header-search input { width: 210px; height: 42px; padding: 0 42px 0 14px; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 6px; outline: 0; }
.header-search input::placeholder { color: #aeb9ca; }
.header-search input:focus { border-color: rgba(255,255,255,.55); }
.header-search button { position: absolute; top: 0; right: 0; width: 42px; height: 42px; padding: 0; color: #fff; background: transparent; border: 0; cursor: pointer; }
.nav-toggle { display: none; width: 42px; height: 42px; padding: 9px; background: transparent; border: 1px solid rgba(255,255,255,.2); border-radius: 6px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; margin: 5px 0; background: #fff; }

.headline-strip { color: #fff; background: var(--fx-navy-2); border-bottom: 3px solid var(--fx-red); }
.headline-strip__inner { min-height: 44px; display: flex; align-items: center; overflow: hidden; }
.headline-strip__label { align-self: stretch; display: flex; align-items: center; flex: 0 0 auto; padding: 0 18px; margin-right: 18px; background: var(--fx-red); font-size: 13px; font-weight: 800; letter-spacing: .5px; }
.headline-strip__items { display: flex; gap: 42px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 14px; }
.headline-strip__items a { position: relative; color: #e5eaf2; }
.headline-strip__items a::before { content: ""; position: absolute; top: 10px; left: -20px; width: 5px; height: 5px; background: var(--fx-red); border-radius: 50%; }

.site-main { padding: 30px 0 52px; }
.ad-slot { position: relative; margin: 0 auto 26px; text-align: center; }
.ad-slot img { width: 100%; object-fit: cover; border-radius: 6px; }
.ad-slot--banner img { max-height: 120px; }
.ad-slot--sidebar img { width: 100%; }
.ad-slot__label { position: absolute; right: 6px; bottom: 6px; padding: 1px 5px; color: rgba(255,255,255,.9); background: rgba(0,0,0,.48); border-radius: 2px; font-size: 10px; line-height: 1.5; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: 18px; margin-bottom: 30px; }
.hero-card { position: relative; min-height: 470px; overflow: hidden; color: #fff; background: var(--fx-navy); border-radius: var(--fx-radius); box-shadow: var(--fx-shadow); }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 32%, rgba(3,10,20,.92) 100%); }
.hero-card__image { width: 100%; height: 100%; min-height: 470px; object-fit: cover; transition: transform .45s ease; }
.hero-card:hover .hero-card__image { transform: scale(1.025); }
.hero-card__content { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; padding: 34px; }
.hero-card h1, .hero-card h2 { max-width: 720px; margin: 10px 0 12px; font-size: clamp(28px, 3vw, 42px); line-height: 1.25; letter-spacing: -.8px; }
.hero-card p { max-width: 690px; margin: 0; color: #d6dde8; font-size: 15px; }
.category-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 9px; color: #fff !important; background: var(--fx-red); border-radius: 3px; font-size: 12px; font-weight: 750; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--fx-muted); font-size: 13px; }
.post-meta--light { color: #d4dce8; }
.hero-side { display: grid; grid-template-rows: repeat(2, 1fr); gap: 18px; }
.mini-feature { position: relative; min-height: 226px; overflow: hidden; color: #fff; background: var(--fx-navy); border-radius: var(--fx-radius); }
.mini-feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(3,10,20,.9) 100%); }
.mini-feature img { width: 100%; height: 100%; min-height: 226px; object-fit: cover; transition: transform .4s ease; }
.mini-feature:hover img { transform: scale(1.03); }
.mini-feature__content { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; padding: 22px; }
.mini-feature h2 { margin: 8px 0 0; font-size: 20px; line-height: 1.4; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--fx-line); border-radius: var(--fx-radius); box-shadow: 0 4px 18px rgba(20,36,59,.045); }
.panel__head { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0 22px; border-bottom: 1px solid var(--fx-line); }
.section-title { position: relative; margin: 0; padding-left: 14px; font-size: 21px; line-height: 1.25; }
.section-title::before { content: ""; position: absolute; top: 1px; bottom: 1px; left: 0; width: 4px; background: var(--fx-red); border-radius: 2px; }
.panel__more { color: var(--fx-muted); font-size: 13px; }
.news-list { padding: 0 22px; }
.news-card { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 22px; padding: 24px 0; border-bottom: 1px solid var(--fx-line); }
.news-card:last-child { border-bottom: 0; }
.news-card__image { display: block; overflow: hidden; background: var(--fx-soft); border-radius: 6px; aspect-ratio: 16 / 10; }
.news-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.news-card:hover .news-card__image img { transform: scale(1.035); }
.news-card h2, .news-card h3 { margin: 7px 0 8px; font-size: 21px; line-height: 1.45; }
.news-card__excerpt { margin: 9px 0 0; color: var(--fx-muted); font-size: 14px; line-height: 1.7; }
.news-card .category-pill { color: var(--fx-red) !important; background: #fff1f2; }
.sidebar { display: grid; gap: 22px; }
.sidebar .panel { padding: 20px; }
.sidebar .ad-slot { margin-bottom: 0; }
.sidebar-title { margin: 0 0 15px; padding-bottom: 11px; border-bottom: 2px solid var(--fx-ink); font-size: 18px; }
.sidebar-title span { position: relative; }
.sidebar-title span::after { content: ""; position: absolute; right: 0; bottom: -13px; left: 0; height: 2px; background: var(--fx-red); }
.rank-list { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.rank-list li { counter-increment: rank; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--fx-line); font-size: 14px; line-height: 1.55; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li::before { content: counter(rank); display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; color: var(--fx-muted); background: var(--fx-soft); border-radius: 3px; font-size: 12px; font-weight: 800; }
.rank-list li:nth-child(-n+3)::before { color: #fff; background: var(--fx-red); }
.topic-list { display: flex; flex-wrap: wrap; gap: 9px; }
.topic-list a { padding: 6px 10px; color: #4c596d; background: var(--fx-soft); border: 1px solid var(--fx-line); border-radius: 4px; font-size: 13px; }

.archive-header { padding: 30px 32px; margin-bottom: 22px; background: #fff; border: 1px solid var(--fx-line); border-radius: var(--fx-radius); }
.archive-kicker { margin: 0 0 5px; color: var(--fx-red); font-size: 12px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; }
.archive-header h1 { margin: 0; font-size: clamp(28px,4vw,40px); line-height: 1.25; }
.archive-header__description { max-width: 820px; margin-top: 12px; color: var(--fx-muted); font-size: 15px; }
.archive-header__description p { margin: 0; }
.pagination { display: flex; justify-content: center; gap: 7px; padding: 25px 0 5px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.pagination .page-numbers { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 10px; color: var(--fx-muted); background: #fff; border: 1px solid var(--fx-line); border-radius: 4px; }
.pagination .current, .pagination a:hover { color: #fff; background: var(--fx-red); border-color: var(--fx-red); }

.article-shell { padding: 32px clamp(22px,4vw,54px) 45px; background: #fff; border: 1px solid var(--fx-line); border-radius: var(--fx-radius); }
.breadcrumbs { margin: 0 0 24px; color: var(--fx-muted); font-size: 13px; }
.breadcrumbs a { color: var(--fx-muted); }
.breadcrumbs__sep { padding: 0 8px; color: #b2bac7; }
.article-header { padding-bottom: 26px; border-bottom: 1px solid var(--fx-line); }
.article-header h1 { max-width: 900px; margin: 12px 0 15px; font-size: clamp(30px,4.5vw,48px); line-height: 1.25; letter-spacing: -1px; }
.article-deck { max-width: 860px; margin: 14px 0 0; color: var(--fx-muted); font-size: 17px; line-height: 1.75; }
.article-hero { margin: 28px 0; overflow: hidden; border-radius: 7px; }
.article-hero img { width: 100%; max-height: 590px; object-fit: cover; }
.quick-answer { margin: 26px 0; padding: 20px 22px; background: #f7f9fc; border-left: 4px solid var(--fx-red); border-radius: 0 6px 6px 0; }
.quick-answer strong { display: block; margin-bottom: 5px; color: var(--fx-red-dark); font-size: 14px; }
.quick-answer p { margin: 0; color: #344055; }
.key-points { margin: 26px 0; padding: 22px 26px; background: #fff9ef; border: 1px solid #f4dfb8; border-radius: 7px; }
.key-points h2 { margin: 0 0 9px !important; font-size: 18px !important; }
.key-points ul { margin: 0; padding-left: 1.25em; }
.key-points li + li { margin-top: 5px; }
.article-content { color: #222d3f; font-size: 17px; line-height: 1.95; overflow-wrap: break-word; }
.article-content > * { max-width: 820px; margin-right: auto; margin-left: auto; }
.article-content h2 { margin-top: 2.1em; margin-bottom: .7em; color: var(--fx-ink); font-size: 28px; line-height: 1.4; }
.article-content h3 { margin-top: 1.7em; margin-bottom: .6em; color: var(--fx-ink); font-size: 22px; line-height: 1.45; }
.article-content a { color: #0a62b5; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-content blockquote { padding: 16px 22px; color: #445066; background: var(--fx-soft); border-left: 4px solid var(--fx-navy-2); }
.article-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article-content th, .article-content td { padding: 10px 12px; border: 1px solid #dfe4eb; text-align: left; }
.article-content th { background: var(--fx-soft); }
.article-content img { border-radius: 5px; }
.article-content .ad-slot { max-width: none; }
.article-footer { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--fx-line); }
.article-updated { color: var(--fx-muted); font-size: 13px; }
.risk-note { margin: 22px 0 0; padding: 14px 18px; color: #626d7d; background: #fafbfc; border: 1px solid var(--fx-line); border-radius: 5px; font-size: 13px; }
.faq-block { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--fx-line); }
.faq-block h2 { margin: 0 0 17px; font-size: 25px; }
.faq-item { border-bottom: 1px solid var(--fx-line); }
.faq-item h3 { margin: 0; padding: 16px 0 7px; font-size: 17px; }
.faq-item p { margin: 0; padding: 0 0 16px; color: var(--fx-muted); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.post-nav a { display: block; min-height: 92px; padding: 16px 18px; background: #fff; border: 1px solid var(--fx-line); border-radius: 6px; font-size: 14px; line-height: 1.55; }
.post-nav small { display: block; margin-bottom: 4px; color: var(--fx-muted); }
.post-nav .next-post { text-align: right; }

.empty-state { padding: 50px 28px; text-align: center; }
.empty-state h1, .empty-state h2 { margin-top: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 17px; color: #fff !important; background: var(--fx-red); border: 0; border-radius: 5px; font-weight: 700; }
.button:hover { background: var(--fx-red-dark); }

.site-footer { color: #bac4d3; background: #081321; }
.site-footer__main { display: grid; grid-template-columns: 1.25fr .75fr .75fr; gap: 50px; padding: 48px 0 36px; }
.site-footer h2 { margin: 0 0 16px; color: #fff; font-size: 17px; }
.site-footer p { margin: 0; font-size: 14px; }
.footer-links { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.footer-links li + li { margin-top: 8px; }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 24px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.09); font-size: 12px; }

.couplet-ad { position: fixed; z-index: 100; top: 180px; width: 120px; }
.couplet-ad--left { left: 12px; }
.couplet-ad--right { right: 12px; }
.couplet-ad img { width: 120px; max-height: 360px; object-fit: cover; border-radius: 5px; box-shadow: var(--fx-shadow); }
.couplet-ad__close { position: absolute; top: -24px; right: 0; width: 22px; height: 22px; padding: 0; color: #fff; background: rgba(11,23,42,.78); border: 0; border-radius: 50%; font-size: 15px; line-height: 22px; cursor: pointer; }
.couplet-ad .ad-slot__label { bottom: 4px; }

@media (max-width: 1480px) { .couplet-ad { display: none; } }
@media (max-width: 1024px) {
  .primary-nav, .header-search { display: none; }
  .nav-toggle { display: block; margin-left: auto; }
  .primary-nav.is-open { position: fixed; z-index: 999; top: 0; right: 0; bottom: 0; display: block; width: min(82vw, 360px); padding: 78px 24px 24px; background: var(--fx-navy); box-shadow: -14px 0 40px rgba(0,0,0,.25); }
  .primary-nav.is-open ul { display: block; }
  .primary-nav.is-open a { padding: 13px 10px; border-bottom: 1px solid rgba(255,255,255,.08); border-radius: 0; }
  .content-grid { grid-template-columns: minmax(0,1fr) 300px; gap: 22px; }
  .news-card { grid-template-columns: 190px minmax(0,1fr); }
  .hero-card h1, .hero-card h2 { font-size: 32px; }
}
@media (max-width: 820px) {
  .site-topbar__notice { white-space: normal; padding: 8px 0; line-height: 1.45; }
  .site-topbar time { display: none; }
  .site-header__main { min-height: 72px; }
  .brand__mark { width: 42px; height: 42px; }
  .brand__name { font-size: 22px; }
  .brand__tagline { display: none; }
  .headline-strip__items a:nth-child(n+2) { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 420px; }
  .hero-card__image { min-height: 420px; }
  .hero-side { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr 1fr; }
  .sidebar > *:first-child { grid-column: 1 / -1; }
  .site-footer__main { grid-template-columns: 1fr 1fr; }
  .site-footer__about { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .container { width: min(calc(100% - 22px), var(--fx-container)); }
  .site-main { padding-top: 18px; }
  .headline-strip__label { padding: 0 12px; margin-right: 12px; }
  .hero-grid { gap: 12px; margin-bottom: 20px; }
  .hero-card { min-height: 390px; }
  .hero-card__image { min-height: 390px; }
  .hero-card__content { padding: 23px; }
  .hero-card h1, .hero-card h2 { font-size: 28px; }
  .hero-card p { display: none; }
  .hero-side { grid-template-columns: 1fr; gap: 12px; }
  .mini-feature { min-height: 210px; }
  .mini-feature img { min-height: 210px; }
  .panel__head { padding: 0 16px; }
  .news-list { padding: 0 16px; }
  .news-card { grid-template-columns: 118px minmax(0,1fr); gap: 13px; padding: 17px 0; }
  .news-card h2, .news-card h3 { margin-top: 5px; font-size: 16px; line-height: 1.45; }
  .news-card__excerpt { display: none; }
  .post-meta { gap: 6px 10px; font-size: 12px; }
  .news-card .post-meta span:not(:first-child) { display: none; }
  .sidebar { grid-template-columns: 1fr; }
  .sidebar > *:first-child { grid-column: auto; }
  .archive-header { padding: 24px 20px; }
  .article-shell { padding: 24px 18px 34px; }
  .article-header h1 { font-size: 30px; letter-spacing: -.4px; }
  .article-deck { font-size: 15px; }
  .article-content { font-size: 16px; line-height: 1.9; }
  .article-content h2 { font-size: 23px; }
  .article-content h3 { font-size: 19px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next-post { text-align: left; }
  .site-footer__main { grid-template-columns: 1fr; gap: 28px; padding-top: 36px; }
  .site-footer__about { grid-column: auto; }
  .site-footer__bottom { display: block; }
  .site-footer__bottom span { display: block; margin-top: 6px; }
}
