:root {
  color-scheme: dark;
  --bg-0: #080a0c;
  --bg-1: #101316;
  --surface: #161a1e;
  --surface-hover: #1b2025;
  --border: #2a3036;
  --border-strong: #3a424a;
  --text-1: #f2f4f5;
  --text-2: #b8bec4;
  --text-3: #929aa2;
  --finance: #f04452;
  --it: #6b9cff;
  --diving: #42cada;
  --positive-cn: #f04452;
  --negative-cn: #18b982;
  --accent: var(--finance);
  --channel-accent: #e51d3e;
  --maxw: 1200px;
  --article: 820px;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .18);
  --background: var(--bg-0);
  --card: var(--surface);
  --line: var(--border);
  --fg: var(--text-1);
  --fg-mute: var(--text-2);
  --fg-dim: var(--text-3);
  --pos: var(--positive-cn);
  --neg: var(--negative-cn);
  --channel-finance: var(--finance);
  --channel-it: var(--it);
  --channel-diving: var(--diving);
}

body[data-channel="finance"] { --channel-accent: var(--finance); }
body[data-channel="it"] { --channel-accent: var(--it); }
body[data-channel="diving"] { --channel-accent: var(--diving); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -20%, rgba(77, 141, 255, .09), transparent 30rem),
    var(--bg-0);
  color: var(--text-1);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text-1); }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
p { color: var(--text-2); }
ul, ol { color: var(--text-2); }
::selection { background: color-mix(in srgb, var(--channel-accent) 38%, transparent); }

:focus-visible {
  outline: 2px solid var(--channel-accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--text-1);
  color: var(--bg-0);
  transform: translateY(-150%);
  transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }

/* Header: always one row */
.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  width: 100%;
  height: 56px;
  border-bottom: 1px solid rgba(58, 66, 74, .7);
  background: rgba(8, 10, 12, .94);
  backdrop-filter: blur(14px);
}
.topbar-inner {
  width: min(100%, var(--maxw));
  height: 56px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  white-space: nowrap;
}
.brand {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-1);
  letter-spacing: -.02em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  clip-path: polygon(0 0, 100% 0, 100% 76%, 76% 100%, 0 100%);
  background: #cf1738;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}
.brand-name { font-size: 16px; font-weight: 850; letter-spacing: .02em; }
.brand-owner {
  padding-left: 10px;
  border-left: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}
.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.main-nav {
  height: 56px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  white-space: nowrap;
}
.main-nav a,
.search-link {
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 650;
  transition: color .15s ease, background .15s ease;
}
.main-nav a:hover,
.search-link:hover {
  background: rgba(255,255,255,.035);
  color: var(--text-1);
}
.main-nav a[aria-current="page"] { color: var(--text-1); }
.main-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  background: var(--channel-accent);
}
.search-link {
  gap: 5px;
  border-left: 1px solid var(--border);
}
.search-link > span:first-child { font-size: 22px; line-height: 1; transform: rotate(-12deg); }
.search-label { font-size: 13px; }
.menu-btn {
  width: 44px;
  height: 44px;
  padding: 11px;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
}
.menu-btn span {
  width: 100%;
  height: 2px;
  display: block;
  border-radius: 99px;
  background: currentColor;
  transition: transform .16s ease, opacity .16s ease;
}
.nav-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .menu-btn span:nth-child(2) { opacity: 0; }
.nav-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-main { width: 100%; flex: 1 0 auto; }
body > main {
  width: min(100%, var(--maxw));
  margin-right: auto !important;
  margin-left: auto !important;
}
main:not(.post-article) { padding-right: 24px !important; padding-left: 24px !important; }

/* Home */
body[data-channel="home"] main > section:first-child {
  padding: 76px 0 52px !important;
  text-align: left !important;
  border-bottom: 1px solid var(--border);
}
body[data-channel="home"] main > section:first-child h1 {
  max-width: 920px;
  margin: 0 0 16px !important;
  font-size: clamp(38px, 6vw, 68px) !important;
  line-height: 1.1 !important;
  letter-spacing: -.045em;
}
body[data-channel="home"] main > section:first-child p {
  max-width: 760px !important;
  margin: 0 0 10px !important;
  color: var(--text-2) !important;
}
body[data-channel="home"] main > section:first-child p:last-child {
  color: var(--text-3) !important;
  font-size: 13px !important;
}
.section-title,
.sec-title {
  margin: 0 0 24px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -.025em;
}
.section-title::after {
  content: "";
  width: 38px;
  height: 2px;
  margin-top: 12px;
  display: block;
  background: var(--channel-accent);
}
.indices-panel {
  margin-top: 32px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-1);
}
.indices-panel-head {
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}
.indices-panel-kicker {
  margin-bottom: 6px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
}
.indices-panel-title { margin: 0; font-size: clamp(20px, 3vw, 28px); }
.indices-panel-grid,
.indices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.idx {
  min-width: 0;
  padding: 20px 22px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.idx:last-child { border-right: 0; }
.idx-name { color: var(--text-3); font-size: 12px; }
.idx-val { margin-top: 5px; font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; }
.idx-chg { font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.pos, .up { color: var(--positive-cn) !important; }
.neg, .down { color: var(--negative-cn) !important; }
.finance-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.btn, .pdf-link, .read-more {
  min-height: 42px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-1);
  font-size: 13px;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover, .pdf-link:hover, .read-more:hover {
  border-color: var(--channel-accent);
  background: color-mix(in srgb, var(--channel-accent) 12%, transparent);
}
.unavailable-link {
  color: var(--text-3) !important;
  cursor: not-allowed;
  opacity: .72;
}
.unavailable-link::after {
  content: " · 整理中";
  font-size: 11px;
}
.updates-grid,
.featured-grid,
.channel-cards,
.card-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
}
.update-card,
.featured-card,
.channel-card,
.card-grid > article,
.note-card {
  min-width: 0;
  min-height: 100%;
  padding: 22px !important;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border) !important;
  border-left: 3px solid var(--channel-accent) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.update-card:hover,
.featured-card:hover,
.channel-card:hover,
.card-grid > article:hover,
.note-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong) !important;
  background: var(--surface-hover) !important;
}
.update-card.finance, .featured-card.finance, .channel-card.finance { --channel-accent: var(--finance); }
.update-card.it, .featured-card.it, .channel-card.it { --channel-accent: var(--it); }
.update-card.diving, .featured-card.diving, .channel-card.diving { --channel-accent: var(--diving); }
.update-card-meta,
.featured-card-tag,
.channel-card-tag,
.note-card-tag {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--channel-accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.update-card h3,
.featured-card h3,
.channel-card h3,
.card-grid h3,
.note-card h2 {
  margin: 0 0 10px !important;
  color: var(--text-1);
  font-size: 19px !important;
  line-height: 1.45;
}
.update-card p,
.featured-card p,
.channel-card p,
.card-grid p,
.note-card p {
  color: var(--text-2) !important;
  font-size: 14px !important;
  line-height: 1.75;
}
.update-card .pdf-link,
.featured-card .read-more { align-self: flex-start; margin-top: auto; }
.channel-card-meta {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ch-latest-title { color: var(--text-2); font-size: 13px; }
.ch-latest-date { margin-top: 6px; color: var(--text-3); font-size: 11px; }
body[data-channel="home"] main > section { margin-top: 64px !important; }
body[data-channel="home"] main > section:first-child { margin-top: 0 !important; }

/* Channel pages and simple pages */
.channel-hero {
  margin: 42px 0 36px;
  padding: 42px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface), var(--bg-1));
}
.channel-hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background: var(--channel-accent);
}
.channel-hero h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -.035em;
}
.channel-hero p { max-width: 780px; margin: 0; font-size: 16px; }
main > section { scroll-margin-top: 76px; }
main:not(.post-article) > section { margin-bottom: 48px; }
main:not(.post-article) > section:first-child:not(.channel-hero) { padding-top: 48px; }

.archive-list, .post-list { margin: 0; padding: 0; list-style: none; }
.archive-list li, .post-item {
  border-bottom: 1px solid var(--border);
}
.archive-list a, .post-link {
  min-height: 58px;
  padding: 14px 4px;
  display: grid;
  grid-template-columns: 118px 1fr auto;
  align-items: center;
  gap: 18px;
  color: var(--text-2);
}
.archive-list a:hover, .post-link:hover { color: var(--text-1); }
.archive-date, .post-date { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.archive-title { color: var(--text-1); font-weight: 650; }

/* Articles */
.post-header {
  width: 100%;
  padding: 70px 24px 56px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
.post-header-inner { width: min(100%, var(--maxw)); margin: 0 auto; }
.post-tag {
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--channel-accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .06em;
}
.post-title {
  max-width: 1050px;
  margin: 0 0 20px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.12;
  letter-spacing: -.04em;
}
.post-summary {
  max-width: var(--article);
  margin: 0 0 26px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.85;
}
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag, .ch-pill {
  padding: 4px 9px;
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
}
.badge-latest {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--channel-accent);
  color: #fff;
}
.post-article { width: 100% !important; max-width: none !important; }
.post-article .section {
  width: min(calc(100% - 48px), var(--article));
  margin: 0 auto;
  padding: 46px 0;
  border-bottom: 1px solid var(--border);
}
.post-article .section:last-child { border-bottom: 0; }
.section-desc { margin-bottom: 22px; color: var(--text-2); font-size: 16px; line-height: 1.9; }
.post-article p,
.post-article li {
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.9;
}
.post-article h2, .post-article h3 { margin-top: 1.8em; }
.post-nav {
  margin-top: 36px;
  padding-top: 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.post-nav a {
  min-height: 44px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
}
.post-nav a:last-child { justify-self: end; text-align: right; }
.post-nav-home { justify-self: center; }
.post-nav a:hover { border-color: var(--channel-accent); color: var(--text-1); }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table, table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td,
table th, table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table th, table th {
  background: var(--surface);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 750;
}
.data-table td, table td { color: var(--text-2); }
.data-table tr:last-child td, table tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; }
.dim, .mute, .small { color: var(--text-3) !important; }
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.sec-list { margin: 0; padding: 0; list-style: none; }
.sec-list li {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.bar-wrap { flex: 1; height: 4px; position: relative; overflow: hidden; background: var(--border); }
.bar { height: 100%; display: block; background: var(--channel-accent); }
.reason-item, .conclusion-item, .core-data-item, .stat-card, .note, .disclaimer {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--channel-accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
}
.core-data-grid, .conclusion-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Search and forms */
#q, input[type="search"], input[type="text"] {
  width: 100%;
  min-height: 50px;
  padding: 12px 15px !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: 7px;
  background: var(--surface) !important;
  color: var(--text-1) !important;
}
#results a { color: var(--text-1) !important; }

/* Footer */
.site-footer {
  width: 100%;
  margin-top: 76px;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
}
.footer-inner {
  width: min(100%, var(--maxw));
  margin: 0 auto;
  padding: 46px 24px 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 42px;
}
.footer-grid h2 {
  margin: 0 0 13px;
  color: var(--text-1);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}
.footer-intro h2 { font-size: 16px; }
.footer-intro h2 span { color: var(--text-2); font-weight: 600; }
.footer-intro p { max-width: 350px; margin: 0 0 5px; color: var(--text-3); font-size: 13px; }
.footer-positioning { color: var(--text-2) !important; }
.footer-group { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.footer-group a { min-height: 26px; color: var(--text-3); font-size: 13px; }
.footer-group a:hover { color: var(--text-1); }
.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
}
.footer-bottom p { margin: 0; color: inherit; }
.footer-bottom p:nth-child(2) { text-align: center; }
.footer-bottom a { color: var(--text-2); }

@media (max-width: 980px) {
  .brand-owner { display: none; }
  .main-nav a, .search-link { padding-right: 10px; padding-left: 10px; }
  .updates-grid, .featured-grid, .channel-cards, .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .footer-grid { grid-template-columns: 1.7fr repeat(3, 1fr); gap: 26px; }
  .footer-bottom { grid-template-columns: 1fr auto; }
  .footer-bottom p:nth-child(2) { grid-column: 1 / -1; grid-row: 2; text-align: left; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 68px; }
  .topbar, .topbar-inner { height: 56px; }
  .topbar-inner { padding: 0 16px; gap: 10px; }
  .brand-owner { display: none; }
  .search-link { border-left: 0; padding: 0 9px; }
  .search-label { display: none; }
  .menu-btn { display: flex; }
  .main-nav {
    position: fixed;
    z-index: 99;
    top: 56px;
    right: 0;
    left: 0;
    height: auto;
    padding: 10px 16px 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 10, 12, .98);
    box-shadow: var(--shadow);
  }
  .nav-open { overflow: hidden; }
  .nav-open .main-nav { display: flex; }
  .main-nav a {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    border-radius: 6px;
  }
  .main-nav a[aria-current="page"]::after {
    top: 10px;
    right: auto;
    bottom: 10px;
    left: 0;
    width: 2px;
    height: auto;
  }
  main:not(.post-article) { padding-right: 16px !important; padding-left: 16px !important; }
  body[data-channel="home"] main > section:first-child { padding: 48px 0 36px !important; }
  body[data-channel="home"] main > section { margin-top: 46px !important; }
  .indices-panel-head { align-items: flex-start; flex-direction: column; }
  .finance-hero-actions { justify-content: flex-start; }
  .indices-panel-grid, .indices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .idx { border-bottom: 1px solid var(--border); }
  .idx:nth-child(2n) { border-right: 0; }
  .updates-grid, .featured-grid, .channel-cards, .card-grid {
    grid-template-columns: 1fr !important;
  }
  .channel-hero { margin-top: 24px; padding: 28px 22px; }
  .post-header { padding: 46px 16px 38px; }
  .post-article .section { width: calc(100% - 32px); padding: 34px 0; }
  .post-article p, .post-article li { font-size: 16px; }
  .two-col, .core-data-grid, .conclusion-list { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr 1fr; }
  .post-nav-home { display: none !important; }
  .archive-list a, .post-link { grid-template-columns: 88px 1fr; gap: 12px; }
  .footer-inner { padding: 36px 16px 24px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 22px; }
  .footer-intro { grid-column: 1 / -1; }
  .footer-bottom { grid-template-columns: 1fr; gap: 8px; }
  .footer-bottom p:nth-child(2) { grid-column: auto; grid-row: auto; }
}

@media (max-width: 430px) {
  .brand-name { font-size: 15px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-intro { grid-column: auto; }
  .indices-panel-grid, .indices { grid-template-columns: 1fr; }
  .idx { border-right: 0; }
  .post-title { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
