/*
Theme Name: Shanghai Finance Portal
Theme URI: https://www.shanghaizixun021.com/
Author: 外汇110资讯网
Description: A fast, accessible finance portal theme built for Google SEO, AI search and Chinese financial publishing.
Version: 1.1.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: shzx-finance
License: GPL-2.0-or-later
*/

:root {
  --ink: #0b1730;
  --ink-2: #172744;
  --muted: #64748b;
  --line: #dfe7ef;
  --soft: #f4f7fa;
  --paper: #ffffff;
  --teal: #087f78;
  --teal-dark: #06645f;
  --gold: #c7983b;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(11, 23, 48, .09);
  --radius: 18px;
  --wrap: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--gold); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
.shzx-wrap { width: min(calc(100% - 40px), var(--wrap)); margin-inline: auto; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed !important; z-index: 99999; top: 12px; left: 12px; width: auto; height: auto;
  padding: 10px 16px; clip: auto; background: var(--paper); color: var(--ink); border-radius: 8px;
}

/* Header */
.site-topbar { background: var(--ink); color: #c9d4e3; font-size: 13px; }
.site-topbar__inner { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.site-topbar p { margin: 0; }
.site-header { position: relative; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.site-branding-row { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.site-branding { display: flex; align-items: center; gap: 14px; min-width: 0; }
.custom-logo-link img { width: 54px; height: 54px; object-fit: contain; }
.site-title { margin: 0; color: var(--ink); font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(25px, 3vw, 38px); line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.site-title a { color: inherit; }
.site-description { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-search { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--soft); }
.header-search input[type="search"] { width: 220px; border: 0; outline: 0; padding: 10px 4px 10px 16px; background: transparent; color: var(--ink); }
.header-search button { border: 0; padding: 10px 14px; background: transparent; color: var(--ink); cursor: pointer; }
.header-risk-link { display: inline-flex; align-items: center; padding: 10px 16px; color: #fff; background: var(--teal); border-radius: 999px; font-weight: 700; font-size: 14px; }
.header-risk-link:hover { color: #fff; background: var(--teal-dark); }
.mobile-menu-toggle { display: none; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.primary-navigation { background: var(--paper); border-top: 1px solid var(--line); }
.primary-navigation ul { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.primary-navigation li { position: relative; }
.primary-navigation a { display: block; padding: 14px 18px; color: var(--ink-2); font-size: 15px; font-weight: 700; }
.primary-navigation .current-menu-item > a,
.primary-navigation .current-menu-ancestor > a,
.primary-navigation a:hover { color: var(--teal); }
.primary-navigation .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.primary-navigation li:hover > .sub-menu,
.primary-navigation li:focus-within > .sub-menu { display: block; }
.primary-navigation .sub-menu a { padding: 9px 12px; }

/* Homepage */
.portal-hero { padding: 36px 0 20px; background: linear-gradient(135deg, #07162e 0%, #102b4e 62%, #0a6a65 100%); color: #fff; }
.portal-hero__grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 22px; }
.hero-lead, .hero-side-card { position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); border-radius: 22px; }
.hero-lead { min-height: 480px; }
.hero-lead__media, .hero-lead__media img { width: 100%; height: 100%; min-height: 480px; object-fit: cover; }
.hero-lead__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(4,12,27,.9) 100%); }
.hero-lead__body { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 34px; }
.hero-lead h2 { margin: 12px 0 10px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(29px, 4vw, 48px); line-height: 1.2; letter-spacing: -.03em; }
.hero-lead h2 a { color: #fff; }
.hero-lead p { max-width: 780px; margin: 0; color: #d9e4ef; }
.hero-side { display: grid; gap: 18px; }
.hero-side-card { min-height: 231px; display: flex; align-items: flex-end; }
.hero-side-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.hero-side-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(4,12,27,.92)); }
.hero-side-card__body { position: relative; z-index: 2; padding: 24px; }
.hero-side-card h2 { margin: 8px 0 0; font-size: 21px; line-height: 1.35; }
.hero-side-card h2 a { color: #fff; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 20px; height: 2px; background: currentColor; }
.portal-category-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.portal-category-nav a { padding: 15px 18px; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.13); border-radius: 14px; font-weight: 750; backdrop-filter: blur(8px); }
.portal-category-nav small { display: block; margin-top: 2px; color: #b8c7d9; font-weight: 400; }
.portal-main { padding: 40px 0 64px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 20px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.02em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); }
.section-heading a { font-size: 14px; font-weight: 750; }
.content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.portal-section { margin-top: 54px; }
.category-panel { display: grid; grid-template-columns: .82fr 2fr; gap: 24px; padding: 28px; background: var(--ink); color: #fff; border-radius: 22px; overflow: hidden; }
.category-panel__intro h2 { margin: 8px 0 12px; font-family: Georgia, "Noto Serif SC", serif; font-size: 31px; }
.category-panel__intro p { color: #b8c7d9; }
.category-panel__intro a { color: #fff; font-weight: 700; }
.category-panel .content-grid { grid-template-columns: repeat(3, 1fr); }
.category-panel .post-card { box-shadow: none; }

/* Cards and archive */
.post-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 26px rgba(11,23,48,.055); transition: transform .2s ease, box-shadow .2s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #dfe8ee, #eff4f7); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card__media img { transform: scale(1.035); }
.post-card__placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--teal); font-family: Georgia, serif; font-size: 22px; font-weight: 800; }
.post-card__body { padding: 21px; }
.post-card__body h3 { margin: 8px 0 10px; font-size: 20px; line-height: 1.4; letter-spacing: -.01em; }
.post-card__body h3 a { color: var(--ink); }
.post-card__body h3 a:hover { color: var(--teal); }
.post-card__excerpt { margin: 0; color: var(--muted); font-size: 14px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 13px; }
.archive-hero { padding: 42px 0; color: #fff; background: linear-gradient(135deg, var(--ink), #163b62); }
.archive-hero h1 { margin: 0 0 8px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(32px, 5vw, 52px); }
.archive-hero .taxonomy-description { max-width: 780px; color: #d7e1ed; }
.archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; padding: 42px 0 64px; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; }
.pagination { margin-top: 34px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { min-width: 42px; padding: 8px 12px; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.page-numbers.current { color: #fff; background: var(--teal); border-color: var(--teal); }

/* Single content */
.singular-shell { padding: 34px 0 72px; }
.breadcrumbs { margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--muted); }
.single-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.article-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.article-header { padding: clamp(28px, 5vw, 54px) clamp(24px, 6vw, 64px) 28px; }
.article-header h1 { margin: 12px 0 18px; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(34px, 5vw, 56px); line-height: 1.18; letter-spacing: -.035em; }
.article-deck { max-width: 850px; margin: 0 0 20px; color: var(--muted); font-size: 18px; }
.article-featured img { width: 100%; max-height: 610px; object-fit: cover; }
.article-content { padding: 38px clamp(24px, 6vw, 64px) 56px; font-size: 17px; }
.article-content > * { max-width: 820px; margin-left: auto; margin-right: auto; }
.article-content h2 { margin-top: 2.4em; padding-top: .2em; color: var(--ink); font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(25px, 3vw, 33px); line-height: 1.35; scroll-margin-top: 24px; }
.article-content h3 { margin-top: 1.8em; color: var(--ink-2); font-size: 21px; scroll-margin-top: 24px; }
.article-content p, .article-content li { color: #253754; }
.article-content a { text-decoration: underline; text-decoration-color: rgba(8,127,120,.35); text-underline-offset: 3px; }
.article-content blockquote { padding: 18px 22px; margin-top: 28px; margin-bottom: 28px; background: #f0f8f7; border-left: 4px solid var(--teal); border-radius: 0 12px 12px 0; }
.article-content table { width: 100%; border-collapse: collapse; margin-top: 28px; margin-bottom: 28px; font-size: 15px; }
.article-content th, .article-content td { padding: 12px 14px; text-align: left; vertical-align: top; border: 1px solid var(--line); }
.article-content th { color: #fff; background: var(--ink-2); }
.article-content tr:nth-child(even) td { background: #f7fafc; }
.article-content ul, .article-content ol { padding-left: 1.35em; }
.article-content li + li { margin-top: .5em; }
.shzx-toc { max-width: 820px; margin: 0 auto 34px; padding: 18px 22px; background: #f7fafc; border: 1px solid var(--line); border-radius: 14px; }
.shzx-toc summary { cursor: pointer; color: var(--ink); font-weight: 800; }
.shzx-toc ol { columns: 2; gap: 28px; margin: 14px 0 0; }
.shzx-toc a { color: var(--ink-2); text-decoration: none; }
.shzx-toc a:hover { color: var(--teal); }
.article-trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.article-disclaimer { margin: 0 0 28px !important; padding: 16px 18px; color: #7a271a; background: #fff6ed; border: 1px solid #fed7aa; border-radius: 12px; font-size: 14px; }
.related-posts { margin-top: 34px; }
.related-posts h2 { margin-bottom: 18px; font-family: Georgia, "Noto Serif SC", serif; font-size: 29px; }
.related-posts .content-grid { grid-template-columns: repeat(3, 1fr); }

/* Sidebar and utility pages */
.portal-sidebar { position: sticky; top: 22px; display: grid; gap: 20px; }
.sidebar-card, .widget { padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.sidebar-card h2, .widget-title { margin: 0 0 14px; font-size: 18px; }
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.sidebar-list li:first-child { padding-top: 0; border-top: 0; }
.sidebar-list a { color: var(--ink-2); font-weight: 650; line-height: 1.45; }
.search-form { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.search-form label { flex: 1; }
.search-form input { width: 100%; padding: 11px 13px; border: 0; outline: 0; background: #fff; }
.search-form button { border: 0; padding: 10px 14px; color: #fff; background: var(--teal); cursor: pointer; }
.page-card { padding: clamp(28px, 6vw, 64px); background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.page-card h1 { margin-top: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(34px, 5vw, 52px); }
.not-found { max-width: 760px; margin: 50px auto; text-align: center; }
.not-found__code { color: var(--teal); font-family: Georgia, serif; font-size: 110px; font-weight: 900; line-height: 1; }

/* Advertising */
.ad-band-wrap { padding-top: 6px; }
.ad-slot { position: relative; width: 100%; margin: 28px auto; padding: 24px 18px 16px; overflow: hidden; text-align: center; background: #f3f6f9; border: 1px solid var(--line); border-radius: 16px; }
.ad-slot__label { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); color: #76859a; font-size: 10px; line-height: 1; letter-spacing: .12em; }
.ad-slot__inner, .ad-slot__widget { width: 100%; margin: 0; }
.ad-slot__widget > :first-child { margin-top: 0; }
.ad-slot__widget > :last-child { margin-bottom: 0; }
.ad-slot img, .ad-slot iframe, .ad-slot video, .ad-slot ins { max-width: 100%; }
.ad-slot iframe { display: block; margin-inline: auto; border: 0; }
.ad-slot--leaderboard .ad-slot__inner { display: grid; min-height: 90px; place-items: center; }
.ad-slot--rectangle { margin-top: 0; }
.ad-slot--rectangle .ad-slot__inner { display: grid; min-height: 250px; place-items: center; }
.ad-slot--article { width: calc(100% - clamp(48px, 12vw, 128px)); margin-top: 30px; margin-bottom: 0; }
.ad-slot--inline { max-width: 820px !important; margin-top: 34px !important; margin-bottom: 34px !important; }
.ad-slot--inline .ad-slot__inner { display: grid; min-height: 180px; place-items: center; }
.ad-slot--single-bottom { margin-top: 28px; margin-bottom: 34px; }
.ad-slot--archive { margin-top: 0; }

/* Footer */
.site-footer { color: #c4d0df; background: #071226; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 54px 0 38px; }
.footer-brand { color: #fff; font-family: Georgia, "Noto Serif SC", serif; font-size: 28px; font-weight: 800; }
.site-footer h2 { margin: 0 0 14px; color: #fff; font-size: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 8px; }
.site-footer a { color: #d5dfeb; }
.footer-disclaimer { padding: 18px 0; border-top: 1px solid rgba(255,255,255,.1); color: #94a3b8; font-size: 12px; }
.footer-bottom { padding: 16px 0; border-top: 1px solid rgba(255,255,255,.1); color: #8291a6; font-size: 13px; }

@media (max-width: 1020px) {
  .portal-hero__grid, .single-layout, .archive-layout { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; grid-template-columns: repeat(2, 1fr); }
  .hero-lead { min-height: 430px; }
  .category-panel { grid-template-columns: 1fr; }
  .header-search input[type="search"] { width: 160px; }
}

@media (max-width: 760px) {
  .shzx-wrap { width: min(calc(100% - 28px), var(--wrap)); }
  .site-topbar__inner { min-height: 34px; }
  .site-topbar__inner p:last-child { display: none; }
  .site-branding-row { min-height: 76px; }
  .site-description, .header-search, .header-risk-link { display: none; }
  .mobile-menu-toggle { display: inline-flex; }
  .primary-navigation { display: none; }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { display: block; padding: 8px 0 12px; }
  .primary-navigation a { padding: 11px 4px; }
  .primary-navigation .sub-menu { display: block; position: static; padding-left: 18px; border: 0; box-shadow: none; }
  .portal-hero { padding-top: 20px; }
  .portal-hero__grid { gap: 14px; }
  .hero-lead, .hero-lead__media, .hero-lead__media img { min-height: 390px; }
  .hero-lead__body { padding: 24px; }
  .hero-side { grid-template-columns: 1fr; }
  .portal-category-nav { grid-template-columns: repeat(2, 1fr); }
  .content-grid, .archive-grid, .category-panel .content-grid, .related-posts .content-grid { grid-template-columns: 1fr; }
  .portal-sidebar, .footer-grid { grid-template-columns: 1fr; }
  .article-header h1 { font-size: 34px; }
  .article-content { font-size: 16px; }
  .article-content table { display: block; overflow-x: auto; white-space: nowrap; }
  .shzx-toc ol { columns: 1; }
  .ad-slot { margin-top: 22px; margin-bottom: 22px; padding-inline: 10px; }
  .ad-slot--leaderboard .ad-slot__inner { min-height: 100px; }
  .ad-slot--article { width: calc(100% - 28px); }
  .ad-slot--inline .ad-slot__inner { min-height: 140px; }
  .footer-grid { gap: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
