/* 首页 Hero 公式走马灯与滚动显现（纯 CSS，无 JS 依赖） */
.formula-strip {
  overflow: hidden;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(16, 24, 48, 0.55);
  padding: 13px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.formula-track {
  display: flex;
  width: -moz-max-content;
  width: max-content;
  will-change: transform;
  animation: ylaoshi-marquee 26s linear infinite;
}
.formula-track span {
  font-family: Georgia, "Times New Roman", "STIX Two Math", serif;
  font-style: italic;
  font-size: 17px;
  color: rgba(103, 232, 249, 0.62);
  padding: 0 34px;
  white-space: nowrap;
}
.formula-track span i {
  font-style: normal;
  color: rgba(148, 163, 184, 0.5);
  padding-left: 68px;
  margin-right: -34px;
}
@keyframes ylaoshi-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes ylaoshi-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-rise { animation: ylaoshi-rise 0.7s ease-out both; }
.hero-rise-1 { animation-delay: 0.12s; }
.hero-rise-2 { animation-delay: 0.24s; }
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .formula-track { animation: none; }
  .hero-rise { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
/* 点阵波 CSS 驱动兜底版样式：追加到 Home.css 末尾（与 DotMatrixWaveCSS.tsx 配套）。
   关键点：脉冲只用 opacity + transform 的 keyframes，不经过 requestAnimationFrame；
   每颗点的相位由行内 --delay（负值起步）、亮度上限由行内 --fade 给出。
   悬停光晕用 box-shadow（不与动画抢 transform），所以 hover 时点会发光但不放大。 */
.dot-wave-css-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #2dd4ee;
  opacity: 0.12;
  will-change: opacity, transform;
  animation: dot-wave-pulse 2.9s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.dot-wave-css-dot:hover {
  box-shadow: 0 0 12px 3px rgba(45, 212, 238, 0.9);
  z-index: 1;
}
@keyframes dot-wave-pulse {
  0%, 100% { opacity: calc(var(--fade, 1) * 0.12); transform: scale(0.55); }
  50% { opacity: var(--fade, 1); transform: scale(1.5); }
}
@media (prefers-reduced-motion: reduce) {
  .dot-wave-css-dot { animation: none; opacity: calc(var(--fade, 1) * 0.35); transform: none; }
}
*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}
::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}
.container {
  width: 100%;
}
@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}
@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}
@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}
@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}
.visible {
  visibility: visible;
}
.collapse {
  visibility: collapse;
}
.static {
  position: static;
}
.absolute {
  position: absolute;
}
.relative {
  position: relative;
}
.sticky {
  position: sticky;
}
.\!block {
  display: block !important;
}
.block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.inline {
  display: inline;
}
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.table {
  display: table;
}
.grid {
  display: grid;
}
.hidden {
  display: none;
}
.min-h-screen {
  min-height: 100vh;
}
.max-w-none {
  max-width: none;
}
.shrink {
  flex-shrink: 1;
}
.flex-grow {
  flex-grow: 1;
}
.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.border {
  border-width: 1px;
}
.italic {
  font-style: italic;
}
.tabular-nums {
  --tw-numeric-spacing: tabular-nums;
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}
.underline {
  text-decoration-line: underline;
}
.outline {
  outline-style: solid;
}
.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* 全局基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #0f0f1a;
  color: #e0e0e0;
}

/* 自定义滚动条 - 深色护眼主题 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
  background: #3a3a5e;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a4a6e;
}

/* TipTap 编辑器样式 */
.ProseMirror {
  outline: none;
  min-height: 300px;
  padding: 16px;
}

.ProseMirror p.is-editor-empty:first-child::before {
  color: #9e9e9e;
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}

.ProseMirror img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}

.ProseMirror a {
  color: #1976d2;
  text-decoration: underline;
}

/* 卡片悬停效果 */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ===== KaTeX 深色主题适配 ===== */
/* 内联公式 */
.katex { 
  color: #e0e0e0; 
}
/* 块级公式 */
.katex-display { 
  color: #e0e0e0;
  background: #1a1a2e;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
  overflow-x: auto;
}
.katex-display > .katex {
  color: #e0e0e0;
}
/* 数学公式括号、运算符等颜色 */
.katex .mord { color: #e0e0e0; }
.katex .mbin { color: #4895ef; }
.katex .mrel { color: #4895ef; }
.katex .mop { color: #f4a261; }
.katex .mopen, .katex .mclose { color: #c0c0d0; }

/* ===== Markdown 渲染内容样式（深色主题） ===== */
.markdown-content {
  color: #e0e0e0;
  line-height: 1.7;
  word-break: break-word;
}
.markdown-content h1 { color: #e0e0e0; font-size: 1.5em; margin: 16px 0 8px; border-bottom: 1px solid #2a2a4e; padding-bottom: 6px; }
.markdown-content h2 { color: #e0e0e0; font-size: 1.3em; margin: 14px 0 6px; }
.markdown-content h3 { color: #e0e0e0; font-size: 1.15em; margin: 12px 0 6px; }
.markdown-content h4 { color: #c0c0d0; font-size: 1.05em; margin: 10px 0 4px; }
.markdown-content p { margin: 8px 0; }
.markdown-content ul, .markdown-content ol { padding-left: 24px; margin: 8px 0; }
.markdown-content li { margin: 4px 0; }
.markdown-content li::marker { color: #4895ef; }
.markdown-content code {
  background: #2a2a4e;
  color: #c0c0d0;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}
.markdown-content pre {
  background: #0f0f1a;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid #2a2a4e;
}
.markdown-content pre code {
  background: none;
  padding: 0;
  color: #c0c0d0;
}
.markdown-content blockquote {
  border-left: 3px solid #4895ef;
  padding: 8px 16px;
  margin: 12px 0;
  background: rgba(72, 149, 239, 0.08);
  border-radius: 0 8px 8px 0;
  color: #a0a0b0;
}
.markdown-content a {
  color: #4895ef;
  text-decoration: none;
}
.markdown-content a:hover {
  text-decoration: underline;
}
.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9em;
}
.markdown-content th {
  background: #1a1a2e;
  color: #4895ef;
  padding: 8px 12px;
  border: 1px solid #2a2a4e;
  text-align: left;
}
.markdown-content td {
  padding: 8px 12px;
  border: 1px solid #2a2a4e;
  color: #c0c0d0;
}
.markdown-content tr:nth-child(even) td {
  background: rgba(26, 26, 46, 0.5);
}
.markdown-content hr {
  border: none;
  border-top: 1px solid #2a2a4e;
  margin: 16px 0;
}
.markdown-content strong { color: #e0e0e0; font-weight: 600; }
.markdown-content em { color: #c0c0d0; }

/* 响应式容器 */
.container-app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container-app {
    padding: 0 24px;
  }
}
