:root {
  color-scheme: light;
  --ink: #091638;
  --muted: #546883;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #edf6fa;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: url("./assets/matrix-v3-page.png") center top / cover fixed; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
p, h1, h2 { margin: 0; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1em; height: 1em; flex: none; fill: currentColor; }
.page-shell { width: min(100%, 1920px); min-height: 700px; height: 100svh; margin: auto; padding: 20px 30px 18px; display: grid; grid-template-rows: 102px minmax(0, 1fr) 56px; gap: 20px; }
.site-header, .masthead, .masthead-brand, .header-aside { display: flex; align-items: center; }
.site-header { justify-content: space-between; gap: 24px; padding: 0 16px 10px; }
.masthead { gap: 22px; min-width: 0; }
.masthead-brand { gap: 24px; flex: none; }
.matrix-logo-frame { display: block; width: 80px; height: 80px; flex: none; border-radius: 18px; overflow: hidden; background: #faf7f1; }
.matrix-logo { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.35); }
h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(34px, 3.9vw, 64px); line-height: 1.15; white-space: nowrap; letter-spacing: -.025em; }
.masthead-caption { padding-left: 22px; border-left: 1px solid #9faec1; color: #445570; font-family: var(--serif); font-size: clamp(18px, 1.6vw, 26px); letter-spacing: .04em; white-space: nowrap; }
.header-aside { align-self: stretch; gap: 35px; padding-top: 16px; align-items: flex-start; }
.header-motto { font-family: var(--serif); font-size: 16px; line-height: 1.65; letter-spacing: .18em; color: #567398; white-space: nowrap; }
.header-motto::after, .chapter-motto::after { content: ""; display: block; width: 30px; border-bottom: 1px solid currentColor; margin-top: 12px; }
.theme-switch { display: flex; gap: 3px; padding: 3px; border-radius: 28px; background: #d5e5f8; }
.theme-switch button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #365986; cursor: pointer; font-size: 25px; }
.theme-switch button[aria-pressed="true"] { background: #fff; box-shadow: 0 2px 5px #536d9a24; }
.theme-switch button[data-theme="light"][aria-pressed="true"] { color: #fb942c; }
.project-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 20px; min-height: 0; }
.chapter { position: relative; isolation: isolate; overflow: hidden; border-radius: 15px; border: 1px solid #ffffffdf; box-shadow: 0 3px 12px #799caf0b; container-type: size; --accent: #0056db; --soft: #cee4ffeb; --pill: #d3e4fc; --pill-ink: #23496d; --button-from: #0073da; --button-to: #0055ed; background: #eaf6ff; }
.chapter-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.chapter-inner { display: flex; flex-direction: column; align-items: flex-start; height: 100%; padding: 8.8cqh 4.5cqw 6cqh; }
.chapter-category { display: inline-flex; align-items: center; justify-content: center; min-height: 10cqh; padding: 0 23px; border-radius: 30px; background: var(--pill); color: var(--pill-ink); font-size: clamp(13px, 5.1cqh, 19px); font-weight: 550; line-height: 1.4; white-space: nowrap; }
.chapter-identity { display: flex; align-items: center; gap: 3cqw; margin-top: 5.5cqh; min-height: 23cqh; }
.chapter-logo { width: clamp(54px, 23cqh, 88px); height: clamp(54px, 23cqh, 88px); object-fit: contain; flex: none; }
.chapter-logo-wish { border-radius: 24%; }
h2 { font-family: var(--serif); font-size: clamp(28px, 13.1cqh, 50px); font-weight: 900; line-height: 1.15; letter-spacing: -.045em; white-space: nowrap; }
.chapter-description { font-size: clamp(14px, 6.2cqh, 24px); line-height: 1.5; margin-top: 1.5cqh; font-weight: 400; color: #183454; }
.chapter-feisuohuo .chapter-logo, .chapter-website .chapter-logo { transform: scale(1.2); }
.chapter-wordmark { margin-top: 1.2cqh; font-size: clamp(12px, 4.6cqh, 18px); letter-spacing: .22em; font-weight: 550; }
.chapter-motto { position: absolute; top: 8.6cqh; left: 54%; font-family: var(--serif); font-size: clamp(13px, 4.55cqh, 18px); line-height: 1.6; letter-spacing: .13em; color: #527da5; }
.chapter-links { display: flex; gap: 2.5cqw; margin-top: auto; margin-bottom: 7cqh; width: 66%; }
.chapter-links a { display: flex; align-items: center; justify-content: center; gap: .65em; min-height: 16.5cqh; padding: 0 1em; border: 1px solid #ffffff85; border-radius: 14px; color: var(--accent); background: var(--soft); font-size: clamp(14px, 5.4cqh, 21px); text-decoration: none; font-weight: 500; white-space: nowrap; box-shadow: inset 0 1px 1px #ffffff50; transition: transform .18s ease, box-shadow .18s ease, filter .18s ease; }
.chapter-links a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px #14355722, inset 0 1px 1px #ffffff50; filter: brightness(1.04); }
.chapter-links a:active { transform: translateY(0); }
.chapter-links .entry-primary { color: #fff; background: linear-gradient(155deg, var(--button-from), var(--button-to)); border-color: #ffffffb8; }
.chapter-links .entry-icon { font-size: 1.25em; }
.chapter-links .entry-arrow { font-size: .8em; margin-left: auto; }
.chapter-links-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.8cqh 2.5cqw; width: 61%; margin-bottom: 0; }
.chapter-links-grid a { min-height: 14.8cqh; }
.chapter-website { --accent: #aa441b; --pill: #fae7de; --pill-ink: #9d4d31; --button-from: #c6511f; --button-to: #cd381b; background: #fff5eb; }
.chapter-website .chapter-motto { left: 61%; color: #bb532b; }
.chapter-website .chapter-links { width: 34%; }
.chapter-website .chapter-links a { width: 100%; min-height: 18cqh; font-size: clamp(16px, 6.4cqh, 24px); padding: 0 1.25em; }
.chapter-website .entry-arrow { font-size: 1em; }
.chapter-yuanshitong { --accent: #124f3c; --soft: #c2e3d4ed; --pill: #d0e5d9; --pill-ink: #164b3b; --button-from: #117561; --button-to: #093c2d; background: #edf5ec; }
.chapter-yuanshitong .chapter-motto { left: 58%; color: #39746b; }
.chapter-yuanshitong .chapter-links { width: 65%; }
.chapter-yuanshitong .chapter-links a { flex: 1; }
.chapter-tradeisle { --accent: #00695d; --soft: #a4ecd8f2; --pill: #a7daf7; --pill-ink: #124764; --button-from: #007bbb; --button-to: #007d8c; background: #def6ff; }
.chapter-tradeisle .chapter-motto { left: 59%; color: #087caf; }
.chapter-tradeisle .chapter-links { width: 59%; gap: 1.4cqw; margin-bottom: 0; }
.chapter-tradeisle .chapter-links a { min-height: 16cqh; padding: 0 .85em; }
.chapter-tradeisle .chapter-links a:last-child { flex: 1; }
.chapter-note { margin-top: 2.7cqh; font-size: clamp(12px, 4.6cqh, 18px); color: #416781; letter-spacing: .1em; line-height: 1.4; }
.site-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 20px; }
.footer-motto { display: flex; align-items: center; gap: 20px; color: #697e95; font-size: 12px; white-space: nowrap; }
.footer-motto .icon { font-size: 26px; color: #8b9eae; }
.footer-company { text-align: center; }
.footer-company p { display: flex; align-items: center; gap: 24px; font-family: var(--serif); font-size: 20px; letter-spacing: .08em; font-weight: 700; }
.footer-company p::before, .footer-company p::after { content: ""; height: 1px; width: 120px; background: #9cabc0; }
.footer-company span { display: block; margin-top: 8px; font-size: 10px; letter-spacing: .12em; color: #617797; }
.footer-values { text-align: right; font-size: 12px; color: #697e95; white-space: nowrap; }
:is(a, button):focus-visible { outline: 3px solid #514be8; outline-offset: 4px; }
a[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
/* Keep the selected company mark's original purple and lime in both themes. */
.dark { color-scheme: dark; --ink: #edf4ff; --muted: #b5c9dc; background: #0b1524; }
.dark body { background-color: #0b1524; background-blend-mode: multiply; }
.dark .chapter { border-color: #aac9e029; background: #122237; --soft: #1a385aee; --pill: #233e5d; --pill-ink: #c9e0ff; --accent: #c0dfff; }
.dark .chapter-art { opacity: .24; }
.dark .chapter-description, .dark .chapter-note { color: #d3e3f5; }
.dark .chapter-motto, .dark .header-motto, .dark .masthead-caption { color: #b8cce3; }
.dark .chapter-yuanshitong { background: #122a24; --soft: #244e3eee; --pill: #274a3c; --pill-ink: #c9e8d7; --accent: #d4f0e0; }
.dark .chapter-website { background: #2c251f; --pill: #5a3c2b; --pill-ink: #ffe0c6; }
.dark .chapter-tradeisle { background: #0d2b36; --soft: #1c584dee; --pill: #174f67; --pill-ink: #bceaff; --accent: #c5f6e7; }
.dark .chapter-links a { border-color: #ffffff2e; }
.dark .theme-switch { background: #203651; }
.dark .theme-switch button { color: #bdd6fa; }
.dark .theme-switch button[aria-pressed="true"] { background: #405b7a; color: white; }
.dark .footer-motto, .dark .footer-values, .dark .footer-company span { color: #a2b8ce; }
@media (min-width: 980px) and (max-height: 800px) {
  .page-shell { grid-template-rows: 76px minmax(0, 1fr) 42px; padding: 14px 24px; gap: 14px; }
  .project-index { gap: 14px; }
  .matrix-logo-frame { width: 64px; height: 64px; }
  h1 { font-size: clamp(34px, 3.5vw, 50px); }
  .header-aside { padding-top: 6px; }
  .footer-company p { font-size: 17px; }
  .footer-company p::before, .footer-company p::after { width: 55px; }
}
@media (max-width: 1250px) {
  .header-motto { display: none; }
  .masthead, .masthead-brand { gap: 14px; }
  .masthead-caption { padding-left: 14px; font-size: 18px; }
  .site-header { padding-left: 4px; padding-right: 4px; gap: 14px; }
  .chapter-motto { display: none; }
  .chapter-identity { gap: 14px; }
  h2 { font-size: clamp(28px, 6cqw, 45px); }
  .chapter-description { font-size: clamp(14px, 3cqw, 21px); max-width: 80%; }
  .chapter-links { width: 85% !important; gap: 10px; }
  .chapter-links a { padding: 0 .7em; font-size: clamp(14px, 3cqw, 18px); }
  .chapter-links-grid { width: 74% !important; gap: 9px; }
  .chapter-website .chapter-links { width: 44% !important; }
  .footer-company p::before, .footer-company p::after { width: 40px; }
  .footer-motto span { max-width: 170px; white-space: normal; line-height: 1.6; }
  .footer-motto { gap: 10px; }
}
@media (max-width: 979px) {
  .page-shell { padding: 16px; gap: 14px; grid-template-rows: 82px minmax(0, 1fr) 48px; }
  .site-header { padding: 0; }
  .masthead { display: block; }
  .masthead-brand { gap: 10px; }
  .matrix-logo-frame { width: 52px; height: 52px; border-radius: 12px; }
  h1 { font-size: clamp(28px, 4.8vw, 42px); }
  .masthead-caption { border: 0; margin: 5px 0 0 62px; padding: 0; font-family: inherit; font-size: 13px; }
  .header-aside { align-self: center; padding: 0; }
  .theme-switch button { width: 36px; height: 36px; font-size: 21px; }
  .project-index { gap: 14px; }
  .chapter { border-radius: 14px; }
  .chapter-inner { padding: 20px; }
  .chapter-art { object-position: 63% center; opacity: .3; }
  .chapter-category { font-size: 13px; min-height: 28px; padding: 0 15px; }
  .chapter-identity { margin-top: 20px; min-height: 54px; gap: 10px; }
  .chapter-logo { width: 54px; height: 54px; }
  h2 { font-size: clamp(24px, 7.5cqw, 36px); }
  .chapter-description { max-width: 100%; font-size: 15px; margin-top: 10px; }
  .chapter-links, .chapter-links-grid { width: 100% !important; gap: 9px; margin-bottom: 8px; }
  .chapter-links a { min-height: 46px; padding: 0 10px; font-size: 14px; border-radius: 10px; gap: 6px; }
  .chapter-links-grid a { min-height: 42px; }
  .chapter-links .entry-icon { display: none; }
  .chapter-links .entry-arrow { font-size: 11px; }
  .chapter-website .chapter-links { width: 68% !important; }
  .chapter-website .chapter-links a { min-height: 50px; font-size: 17px; }
  .chapter-yuanshitong .chapter-links, .chapter-tradeisle .chapter-links { flex-wrap: wrap; }
  .chapter-yuanshitong .chapter-links a, .chapter-tradeisle .chapter-links a { flex: 1 0 100%; min-height: 42px; justify-content: flex-start; }
  .chapter-note { margin-top: 8px; font-size: 12px; }
  .chapter-wordmark { margin-top: 5px; font-size: 12px; }
  .site-footer { display: flex; justify-content: space-between; padding: 0 4px; gap: 12px; }
  .footer-motto { display: none; }
  .footer-company { text-align: left; }
  .footer-company p { font-family: inherit; font-size: 14px; letter-spacing: 0; }
  .footer-company p::before, .footer-company p::after { display: none; }
  .footer-company span { margin-top: 5px; font-size: 8px; }
  .footer-values { font-size: 11px; }
}
@media (max-width: 979px) and (min-width: 560px) and (max-height: 780px) {
  .page-shell { grid-template-rows: 66px minmax(0, 1fr) 38px; padding: 12px; gap: 10px; }
  .project-index { gap: 10px; }
  .chapter-inner { padding: 14px; }
  .chapter-category { min-height: 25px; }
  .chapter-identity { margin-top: 10px; min-height: 44px; }
  .chapter-logo { width: 44px; height: 44px; }
  .chapter-description { margin-top: 6px; font-size: 14px; }
  .chapter-links { gap: 6px; margin-bottom: 0; }
  .chapter-links a, .chapter-links-grid a, .chapter-yuanshitong .chapter-links a, .chapter-tradeisle .chapter-links a { min-height: 36px; }
}
@media (max-width: 559px) {
  .page-shell { height: auto; min-height: 100svh; padding: 16px 12px; gap: 18px; grid-template-rows: auto auto auto; }
  .site-header { gap: 8px; }
  .masthead-brand { gap: 8px; }
  .matrix-logo-frame { width: 42px; height: 42px; border-radius: 10px; }
  h1 { font-size: clamp(22px, 5.8vw, 31px); }
  .masthead-caption { margin-left: 50px; font-size: 12px; }
  .theme-switch { gap: 0; padding: 2px; }
  .theme-switch button { width: 30px; height: 34px; font-size: 19px; }
  .project-index { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(4, 310px); gap: 14px; }
  .chapter-inner { padding: 22px; }
  .chapter-art { object-position: center; opacity: .4; }
  .chapter-identity { margin-top: 18px; }
  h2 { font-size: 32px; }
  .chapter-description { font-size: 15px; }
  .chapter-links a, .chapter-links-grid a, .chapter-yuanshitong .chapter-links a, .chapter-tradeisle .chapter-links a { min-height: 44px; }
  .chapter-links .entry-icon { display: block; font-size: 19px; }
  .chapter-yuanshitong .chapter-links, .chapter-tradeisle .chapter-links { flex-wrap: nowrap; }
  .chapter-yuanshitong .chapter-links a, .chapter-tradeisle .chapter-links a { flex: 1; padding: 0 10px; font-size: 13px; }
  .chapter-yuanshitong .chapter-links .entry-icon, .chapter-tradeisle .chapter-links .entry-icon { display: none; }
  .site-footer { display: block; text-align: center; padding: 4px 0; }
  .footer-company { text-align: center; }
  .footer-company p { display: block; }
  .footer-values { text-align: center; margin-top: 12px; }
}
@media (max-width: 359px) {
  .matrix-logo-frame { width: 34px; height: 34px; }
  h1 { font-size: 20px; }
  .masthead-caption { margin-left: 42px; }
  .theme-switch button { width: 27px; }
  .chapter-inner { padding: 18px; }
  h2 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
