/* ==========================================================================
   base.css — 字体、reset、滚动条、通用工具类
   ========================================================================== */

/* ---------- @font-face（字体文件在 static/fonts/） ---------- */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/Geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/Geist-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/Geist-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Geist Fallback"; src: local("Arial"); ascent-override: 95.94%; descent-override: 28.16%; line-gap-override: 0%; size-adjust: 104.76%; }

@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/GeistMono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/GeistMono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/GeistMono-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Geist Mono Fallback"; src: local("Arial"); ascent-override: 74.67%; descent-override: 21.92%; line-gap-override: 0%; size-adjust: 134.59%; }

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/Inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/Inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/Inter-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Inter Fallback"; src: local("Arial"); ascent-override: 90.44%; descent-override: 22.52%; line-gap-override: 0%; size-adjust: 107.12%; }

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/Manrope-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/Manrope-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/Manrope-vietnamese.woff2") format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Manrope Fallback"; src: local("Arial"); ascent-override: 103.31%; descent-override: 29.07%; line-gap-override: 0%; size-adjust: 103.19%; }

@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("../fonts/SourceSerif4-latin.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; font-display: swap; src: url("../fonts/SourceSerif4-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4 Fallback"; src: local("Times New Roman"); ascent-override: 87.87%; descent-override: 28.41%; line-gap-override: 0%; size-adjust: 117.91%; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/JetBrainsMono-latin.woff2") format("woff2"); }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; border: 0 solid; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 16px; line-height: 1.5;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" on, "cv11" on;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; background: none; margin: 0; padding: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
input:focus, textarea:focus, select:focus, button:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
table { border-collapse: collapse; border-spacing: 0; width: 100%; }
hr { border-top: 1px solid var(--divider); }
strong, b { font-weight: 600; }
small { font-size: 12px; }
code, kbd, pre, samp { font-family: var(--font-mono); }
[hidden] { display: none !important; }
::selection { background: rgba(136, 116, 255, 0.35); color: var(--text-1); }
::placeholder { color: var(--field-placeholder); opacity: 1; }

/* 数字列等宽 */
.tnum, td, th, .num, .table td, .kpi__value, .stat { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }

/* ---------- 滚动条 ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 9999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); background-clip: padding-box; }
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.styled-scrollbar { scrollbar-width: thin; }

/* ---------- 文本工具类 ---------- */
.text-1 { color: var(--text-1); } .text-2 { color: var(--text-2); } .text-3 { color: var(--text-3); }
.text-40 { color: var(--text-40); } .text-45 { color: var(--text-45); } .text-subtle { color: var(--text-subtle); } .text-dim { color: var(--text-dim); }
.text-primary { color: var(--primary); } .text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.text-center { text-align: center; } .text-right { text-align: right; } .text-left { text-align: left; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.uppercase { text-transform: uppercase; }
.nowrap { white-space: nowrap; }
.link { color: var(--text-link); transition: color var(--t-fast); }
.link:hover { color: var(--text-link-hover); text-decoration: underline; }

/* 字号阶梯（对应 tokens.json typeScale） */
.t-page-title { font-size: 24px; font-weight: 600; line-height: 32px; }
.t-hero { font-size: 24px; font-weight: 500; line-height: 36px; }
.t-h2 { font-size: 24px; font-weight: 700; line-height: 32px; }
.t-h3 { font-size: 20px; font-weight: 600; line-height: 32px; }
.t-kpi { font-size: 30px; font-weight: 600; line-height: 36px; }
.t-section { font-size: 18px; font-weight: 500; line-height: 27px; }
.t-card-title { font-size: 18px; font-weight: 500; line-height: 28px; }
.t-body { font-size: 16px; font-weight: 400; line-height: 24px; }
.t-stat { font-size: 16px; font-weight: 500; line-height: 24px; }
.t-table { font-size: 15px; font-weight: 400; line-height: 22.5px; letter-spacing: 0.15px; }
.t-name { font-size: 14px; font-weight: 600; line-height: 20px; }
.t-nav { font-size: 14px; font-weight: 500; line-height: 20px; }
.t-sm { font-size: 14px; font-weight: 400; line-height: 20px; }
.t-p { font-size: 14px; font-weight: 400; line-height: 21px; }
.t-tab { font-size: 13px; font-weight: 400; line-height: 19.5px; }
.t-link { font-size: 13px; font-weight: 400; line-height: 20px; }
.t-th { font-size: 12px; font-weight: 500; line-height: 16.5px; text-transform: uppercase; color: var(--table-th-text); }
.t-caption { font-size: 12px; font-weight: 400; line-height: 18px; }
.t-badge { font-size: 12px; font-weight: 600; line-height: 18px; }
.t-label { font-size: 11px; font-weight: 600; line-height: 16.5px; letter-spacing: 0.55px; text-transform: uppercase; color: var(--text-dim); }
.t-tag { font-size: 11px; font-weight: 500; line-height: 16.5px; letter-spacing: 0.275px; text-transform: uppercase; }
.t-ribbon { font-size: 11px; font-weight: 800; line-height: 16.5px; letter-spacing: 0.55px; text-transform: uppercase; }
.t-micro { font-size: 11px; line-height: 16.5px; }
.t-chip { font-size: 10px; font-weight: 500; line-height: 15px; }
.t-stat-label { font-size: 10px; font-weight: 600; line-height: 15px; text-transform: uppercase; color: #94a3b8; }

/* ---------- 布局工具类 ---------- */
.flex { display: flex; } .inline-flex { display: inline-flex; } .grid { display: grid; } .block { display: block; } .hidden-el { display: none; }
.flex-col { flex-direction: column; } .flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1 1 0%; } .shrink-0 { flex-shrink: 0; } .min-w-0 { min-width: 0; }
.items-center { align-items: center; } .items-start { align-items: flex-start; } .items-end { align-items: flex-end; } .items-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; } .justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; } .gap-1_5 { gap: 6px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; } .gap-10 { gap: 40px; }
.w-full { width: 100%; } .h-full { height: 100%; } .relative { position: relative; } .absolute { position: absolute; } .isolate { isolation: isolate; } .overflow-hidden { overflow: hidden; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; } .mx-auto { margin-left: auto; margin-right: auto; }
.p-4 { padding: 16px; } .p-5 { padding: 20px; } .p-6 { padding: 24px; } .px-4 { padding-left: 16px; padding-right: 16px; } .py-2 { padding-top: 8px; padding-bottom: 8px; }
.rounded { border-radius: var(--r-md); } .rounded-lg { border-radius: 8px; } .rounded-2xl { border-radius: 16px; } .rounded-3xl { border-radius: 24px; } .rounded-full { border-radius: 9999px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--grid-gap-m); }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: var(--grid-gap-m); }
.grid-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap-m); }
.grid-7-5 { display: grid; grid-template-columns: 1fr; gap: var(--grid-gap-m); }
.grid-584-480 { display: grid; grid-template-columns: 1fr; gap: var(--grid-gap-m); }
@media (min-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-7-5, .grid-584-480 { gap: var(--grid-gap); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .md\:hidden { display: none !important; }
  .md\:flex { display: flex !important; }
  .md\:block { display: block !important; }
}
@media (min-width: 1024px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-7-5 { grid-template-columns: 7fr 5fr; }
  .grid-584-480 { grid-template-columns: 584fr 480fr; }
  .lg\:hidden { display: none !important; }
  .lg\:flex { display: flex !important; }
}
@media (max-width: 767px) {
  .mobile-hidden { display: none !important; }
}
@media (min-width: 768px) {
  .desktop-hidden { display: none !important; }
}

/* ---------- 动画 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes pulse { 50% { opacity: 0.5; } }
@keyframes livePulseOuter { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes liveBreathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes feedSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes wcFeedFlash { 0% { background: rgba(136, 116, 255, 0.18); } 100% { background: transparent; } }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes errorPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(251, 55, 72, 0.4); } 50% { box-shadow: 0 0 0 4px rgba(251, 55, 72, 0); } }
@keyframes btn-grow-pop { 0% { transform: scale(0.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes nd-tab-liquid { 0% { transform: scaleX(1) scaleY(1); } 42% { transform: scaleX(1.12) scaleY(0.94); } 100% { transform: scaleX(1) scaleY(1); } }
@keyframes checkPop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes skeletonShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes scrollX { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes slotScrollUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes slotScrollDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes drawFlash { 0% { stroke-dashoffset: 1000; } 100% { stroke-dashoffset: 0; } }
.anim-fade { animation: fadeIn 0.25s ease-out both; }
.anim-slide-up { animation: slideUp 0.3s var(--ease-out) both; }
/* 系统开启「减少动态效果」时：只停掉无限循环的装饰动画（呼吸点、跑马灯、光晕），
   功能性过渡（轮播位移、tab 指示条、弹窗、hover）保留但缩短——一刀切归零会让整站看起来是死的。 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.12s !important; scroll-behavior: auto !important; }
  .anim-fade, .anim-slide-up { animation-duration: 0.12s !important; }
  [class*="pulse"], [class*="marquee"], [class*="glow"], [class*="__dot"],
  [class*="shimmer"], [class*="skeleton"], [class*="spin"], [class*="breath"],
  [class*="ticker"], [class*="scrollx"] { animation-iteration-count: 1 !important; animation-duration: 0.12s !important; }
}
