/* ============================================================
   中关村企业巴西代表处 — 编辑部风格 v6
   白底 · 高密度 · 报刊感（版式语言参考 FT / Bloomberg）
   品牌蓝降为点缀色；数据表格优先、来源可追溯的约定不变。
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f6f2;
  --ink: #141414;
  --ink-soft: #333333;
  --text: #222222;
  --text-muted: #6b6b6b;
  --rule: #e2dfd8;
  --rule-dark: #141414;
  --brand: #11407f;          /* 中关村深蓝，仅作点缀 */
  --brand-bright: #1967b7;
  /* 数据涨跌:默认国际惯例绿涨红跌;中文界面按 A 股惯例翻转(见下) */
  --pos: #0a7a3d;
  --neg: #b83227;
  --up: #0a7a3d;
  --down: #b83227;
  --up-dark: #7fd8a5;
  --down-dark: #f0a297;
  --footer-bg: #081a3c;
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

html[lang="zh-CN"] {
  --up: #c04a3d;
  --down: #1f9d57;
  --up-dark: #f0a297;
  --down-dark: #7fd8a5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ============ Header：白底报头 ============ */
.site-header {
  background: var(--bg);
  border-bottom: 2px solid var(--rule-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 20px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 40px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: 0.4px; }
.brand-sub { font-size: 10.5px; color: var(--text-muted); letter-spacing: 1.6px; text-transform: uppercase; }

.site-nav { display: flex; gap: 20px; }
.site-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }

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

.lang-switch { display: flex; border: 1px solid var(--rule); }
.lang-switch button {
  border: 0; background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; padding: 4px 9px; color: var(--text-muted);
}
.lang-switch button.active { background: var(--ink); color: #fff; }

.nav-toggle { display: none; border: 0; background: none; cursor: pointer; padding: 6px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; }

/* ============ Ticker：行情条 ============ */
.ticker { background: var(--bg-alt); border-bottom: 1px solid var(--rule); overflow-x: auto; }
.ticker-inner { display: flex; gap: 26px; padding: 7px 20px; white-space: nowrap; }
.ticker-item { display: inline-flex; align-items: baseline; gap: 7px; font-size: 12.5px; }
.ticker-label { color: var(--text-muted); }
.ticker-value { font-weight: 700; font-family: var(--mono); font-size: 12.5px; }
.ticker-delta { font-size: 11.5px; font-weight: 600; }
.delta-up { color: var(--up); }
.delta-down { color: var(--down); }
.delta-flat { color: var(--text-muted); }

/* ============ 首页：头条区 ============ */
.masthead { border-bottom: 1px solid var(--rule); padding: 26px 0 22px; }
.masthead-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; }

.kicker-line { font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brand); font-weight: 700; margin-bottom: 8px; }

.lead-story-title {
  font-family: var(--serif);
  font-size: 33px;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 12px;
}
.lead-story-title a { text-decoration: none; }
.lead-story-title a:hover { color: var(--brand); }
.lead-story-dek { font-size: 15.5px; color: var(--ink-soft); margin-bottom: 14px; max-width: 62ch; }
.story-meta { font-size: 12px; color: var(--text-muted); }
.story-meta .src-name { font-weight: 600; color: var(--ink-soft); }

.side-briefs { border-left: 1px solid var(--rule); padding-left: 28px; display: flex; flex-direction: column; }
.side-brief { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.side-brief:last-child { border-bottom: 0; }
.side-brief h3 { font-family: var(--serif); font-size: 16px; line-height: 1.35; font-weight: 700; }
.side-brief h3 a { text-decoration: none; }
.side-brief h3 a:hover { color: var(--brand); }
.side-brief p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ============ 首页：资讯流 ============ */
.feed-section { padding: 26px 0 8px; }
.feed-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }

.section-bar {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--rule-dark); padding-bottom: 6px; margin-bottom: 4px;
}
.section-bar h2 { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.section-bar .more-link { font-size: 12.5px; color: var(--brand); text-decoration: none; font-weight: 600; }
.section-bar .more-link:hover { text-decoration: underline; }

.feed-item { display: grid; grid-template-columns: 86px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.feed-date { font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); padding-top: 4px; }
.feed-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  color: var(--brand); text-transform: uppercase; margin-bottom: 1px;
}
.feed-title { font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.feed-title a { text-decoration: none; }
.feed-title a:hover { color: var(--brand); }
.feed-note { font-size: 13.5px; color: var(--ink-soft); margin-top: 3px; }
.feed-src { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* 侧栏 */
.rail-block { border: 1px solid var(--rule); padding: 16px 18px; margin-bottom: 18px; background: var(--bg); }
.rail-block.rail-tint { background: var(--bg-alt); }
.rail-block h3 { font-family: var(--serif); font-size: 16px; font-weight: 700; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.rail-block p { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 8px; }
.rail-block .dlist li { font-size: 13px; }
.rail-link { display: block; font-size: 13.5px; font-weight: 700; color: var(--brand); text-decoration: none; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.rail-link:last-child { border-bottom: 0; }
.rail-link:hover { text-decoration: underline; }

/* ============ 章节通用 ============ */
.section { padding: 32px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-deep { background: var(--bg); border-top: 1px solid var(--rule); }

.section-head { margin-bottom: 20px; max-width: 72ch; }
.section-head-row { margin-bottom: 20px; }
.section-kicker { font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brand); font-weight: 700; margin-bottom: 6px; }
.section-title { font-family: var(--serif); font-size: 25px; line-height: 1.3; font-weight: 700; margin-bottom: 8px; }
h3.section-title { font-size: 20px; }
.section-lead { font-size: 15px; color: var(--ink-soft); }

.block-title {
  font-size: 12.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  border-bottom: 2px solid var(--rule-dark); padding-bottom: 5px; margin-bottom: 10px;
}

/* ============ 数据表 ============ */
.data-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dtable thead th {
  text-align: left; font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 2px solid var(--rule-dark); padding: 6px 10px 6px 0;
}
.dtable td { border-bottom: 1px solid var(--rule); padding: 9px 10px 9px 0; vertical-align: top; }
.t-metric { font-weight: 700; }
.t-num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.t-note { color: var(--ink-soft); }
.up { color: var(--up); font-weight: 600; font-size: 12px; }
.down { color: var(--down); font-weight: 600; font-size: 12px; }

.src { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; }

/* 摘要数字条 */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--rule); border-right: 0; }
.stat-cell { border-right: 1px solid var(--rule); padding: 12px 14px; background: var(--bg); }
.stat-cell .v { display: block; font-family: var(--mono); font-weight: 700; font-size: 17px; }
.stat-cell .k { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* 列表 */
.dlist { list-style: none; }
.dlist li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.dlist li:last-child { border-bottom: 0; }
.dlist .l { font-weight: 700; min-width: 108px; flex-shrink: 0; }
.dlist .r { color: var(--ink-soft); }
.dlist .num { font-family: var(--mono); }

/* 布局 */
.split-side { display: grid; grid-template-columns: 1.5fr 1fr; gap: 36px; align-items: start; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }

/* 提示框 */
.callout, .callout-accent, .callout-deep {
  border: 1px solid var(--rule); border-left: 3px solid var(--brand);
  background: var(--bg-alt); padding: 14px 16px;
}
.callout h4, .callout-accent h4, .callout-deep h4 { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.callout p, .callout-accent p, .callout-deep p { font-size: 13.5px; color: var(--ink-soft); }

/* ============ 卡片 ============ */
.ccard { border: 1px solid var(--rule); padding: 18px 20px; background: var(--bg); display: flex; flex-direction: column; }
.ccard-accent { border-top: 3px solid var(--brand); }
.ccard h3 { font-family: var(--serif); font-size: 18px; font-weight: 700; margin: 6px 0 10px; }
.tag {
  align-self: flex-start; font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--brand); border: 1px solid var(--brand);
  padding: 2px 8px;
}
.card-cta { display: inline-block; margin-top: 12px; font-size: 13.5px; font-weight: 700; color: var(--brand); text-decoration: none; }
.card-cta:hover { text-decoration: underline; }

/* 追踪范围卡（简报覆盖面） */
.intel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.intel-card { border-top: 2px solid var(--rule-dark); padding-top: 10px; }
.intel-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.intel-card ul { list-style: none; }
.intel-card li { font-size: 13.5px; color: var(--ink-soft); padding: 4px 0; border-bottom: 1px solid var(--rule); }
.intel-card li:last-child { border-bottom: 0; }

.intel-meta { display: flex; flex-wrap: wrap; gap: 26px; margin: 18px 0 4px; }
.intel-meta > div { display: flex; flex-direction: column; }
.intel-meta .k { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.intel-meta .v { font-size: 13.5px; font-weight: 600; }

/* 步骤 */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { border-top: 2px solid var(--rule-dark); padding-top: 10px; }
.step-n { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--brand); }
.step h3 { font-size: 15px; font-weight: 700; margin: 4px 0; }
.step p { font-size: 13.5px; color: var(--ink-soft); }

/* 归属行 */
.affil-row { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.affil-tier { font-family: var(--mono); font-size: 12px; color: var(--text-muted); padding-top: 3px; }
.affil-name { font-size: 15px; font-weight: 700; }
.affil-name a { text-decoration: none; }
.affil-name a:hover { color: var(--brand); }
.affil-role { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.affil-here {
  display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 700;
  color: #fff; background: var(--brand); padding: 1px 7px; vertical-align: 2px;
}

.node-list { display: flex; flex-wrap: wrap; gap: 8px; }
.node-list span { border: 1px solid var(--rule); font-size: 12.5px; padding: 3px 10px; color: var(--ink-soft); }
.node-list .is-here { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

.org-chain { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.org-chain a { text-decoration: none; }
.org-chain a:hover { color: var(--brand); text-decoration: underline; }
.org-chain .sep { margin: 0 5px; }
.org-chain .cur { font-weight: 700; color: var(--ink-soft); }

/* ============ 按钮与表单 ============ */
.btn {
  display: inline-block; text-decoration: none; cursor: pointer;
  font-size: 14px; font-weight: 700; padding: 9px 20px; border: 1px solid var(--ink);
  font-family: var(--sans);
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-ghost { background: none; color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.sub-inline { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sub-inline input[type="email"] {
  flex: 1; min-width: 180px; border: 1px solid var(--rule); padding: 9px 12px; font-size: 14px;
  font-family: var(--sans); background: var(--bg);
}
.sub-inline input[type="email"]:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.match-form { border: 1px solid var(--rule); background: var(--bg); padding: 20px; margin-top: 22px; }
.form-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.form-row label, .form-block { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }
.form-block { margin-bottom: 12px; }
.form-row span, .form-block span { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; }
.match-form select, .match-form textarea, .match-form input[type="email"] {
  border: 1px solid var(--rule); padding: 8px 10px; font-size: 14px; font-family: var(--sans); background: var(--bg);
}
.match-form select:focus, .match-form textarea:focus, .match-form input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.form-row-submit { align-items: flex-end; }
.form-grow { flex: 1; }

.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-status { display: none; flex-basis: 100%; margin: 8px 0 0; font-size: 13.5px; color: var(--text-muted); }
.form-status.show { display: block; }
.form-status.ok { color: var(--pos); font-weight: 600; }
.form-status.err { color: var(--neg); }

.section-cta { margin-top: 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.section-cta p { font-size: 15px; font-weight: 600; }

/* ============ 简报文章页 ============ */
.article { max-width: 760px; margin: 0 auto; padding: 32px 20px 50px; }
.article-kicker { font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.article h1 { font-family: var(--serif); font-size: 31px; line-height: 1.25; margin-bottom: 10px; }
.article-meta { font-size: 12.5px; color: var(--text-muted); padding-bottom: 14px; border-bottom: 2px solid var(--rule-dark); margin-bottom: 22px; }
.article h2 { font-family: var(--serif); font-size: 21px; margin: 26px 0 10px; padding-bottom: 5px; border-bottom: 1px solid var(--rule); }
.article h3 { font-size: 15.5px; font-weight: 700; margin: 16px 0 5px; }
.article p { margin-bottom: 12px; font-size: 15px; }
.article ul { margin: 0 0 12px 20px; font-size: 14.5px; }
.article li { margin-bottom: 6px; }
.article .judgment {
  border-left: 3px solid var(--brand); background: var(--bg-alt);
  padding: 10px 14px; font-size: 14px; margin: 10px 0 16px;
}
.article .judgment strong { color: var(--brand); }
.article .src { margin-top: -4px; margin-bottom: 14px; }
.article .dtable { margin: 8px 0 4px; }

/* 语言版块显隐。
   默认让中文可见、葡语隐藏 —— data-lang 由 JS 在运行时写到 <html> 上,
   若默认两块都 display:none,则 JS 未执行/执行失败时简报页会整页空白。
   以「中文可见」为兜底,最坏情况也能读到内容。 */
.lang-pt { display: none; }
.lang-zh { display: block; }
html[data-lang="pt"] .lang-zh,
html[data-lang="en"] .lang-zh { display: none; }
html[data-lang="pt"] .lang-pt,
html[data-lang="en"] .lang-pt { display: block; }

/* ============ Footer：深色收口（背书） ============ */
.site-footer { background: var(--footer-bg); color: rgba(255, 255, 255, 0.85); margin-top: 44px; }
.footer-affil {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 22px 0 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.footer-affil-label { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.footer-logo { height: 24px; width: auto; display: block; }
.footer-affil-sep { color: rgba(255, 255, 255, 0.4); }
.footer-affil-cur { font-size: 13.5px; font-weight: 600; }
.footer-contact { padding: 12px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }
.footer-contact a { color: rgba(255, 255, 255, 0.88); }
.footer-inner { padding: 10px 0 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }
.footer-slogan { font-style: italic; }

/* 联系块（关于页） */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 30px; }
.contact-block { border: 1px solid var(--rule); background: var(--bg); padding: 18px 20px; }
.contact-block h3 { font-family: var(--serif); font-size: 17px; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.contact-line { display: flex; gap: 12px; font-size: 14px; padding: 5px 0; }
.contact-line .k { font-weight: 700; min-width: 76px; }
.contact-line a { color: var(--brand); }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .masthead-grid, .feed-grid, .split-side, .split-2, .contact-grid, .intel-grid { grid-template-columns: 1fr; }
  .side-briefs { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 12px; }
  .steps { grid-template-columns: 1fr; gap: 14px; }
  .lead-story-title { font-size: 25px; }

  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 2px solid var(--rule-dark);
    flex-direction: column; gap: 0; padding: 8px 20px 14px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 9px 0; border-bottom: 1px solid var(--rule); }
  .nav-toggle { display: block; }
}

@media (max-width: 600px) {
  .feed-item { grid-template-columns: 1fr; gap: 2px; }
  .dtable { font-size: 12.5px; }
  .dtable thead th, .dtable td { padding: 7px 8px 7px 0; }
  .brand-name { font-size: 14.5px; }
  .brand-sub { display: none; }
}

/* 渐显动画（保留类名，弱化幅度） */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity 0.45s ease, transform 0.45s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* 页脚法律链接。独立于 footer.copy —— 后者被 applyLang 用 textContent 覆写,
   任何嵌进去的元素都会在切换语言时被抹掉。 */
.footer-legal { margin-top: 6px; font-size: 12.5px; }
.footer-legal a { color: rgba(255,255,255,.72); text-decoration: underline; }
.footer-legal a:hover { color: #fff; }

/* ============ 触控目标尺寸(WCAG 2.2 AA · 2.5.8)============
   要求可点击目标 ≥ 24×24 CSS px。行内链接的实际高度由 line-height 决定,
   资讯流标题 19px、more-link 21px、页脚链接 15px 均不达标。
   用 inline-block + min-height 把命中区撑够,不动字号,视觉不变。 */
.feed-title a,
.section-bar .more-link,
.footer-legal a,
.footer-contact a,
.rail-link,
.side-brief h3 a {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
}

/* 资讯流标题会换行,inline-block 下需保留多行的正常行距 */
.feed-title a,
.side-brief h3 a { line-height: inherit; padding: 3px 0; }

/* 页脚两条短链接:不换行,直接给足高度 */
.footer-legal a,
.footer-contact a { padding: 5px 0; }
