/* =============================================
 * 道得投资 cn_v2 — 全新设计系统
 * 对标美国顶尖私募机构官网设计语言
 * Blackstone / KKR / Apollo / Carlyle 风格
 * ============================================= */

/* --- 设计令牌（Design Tokens） --- */
:root {
  /* 品牌核心色（保留 v2 品牌色） */
  --brand: #0d1a2d;              /* 深海军蓝主色 */
  --brand-light: #1a3050;        /* 海军蓝浅色 */
  --brand-surface: #f9f9f7;      /* 米白背景 */
  --brand-accent: #a83635;       /* 朱砂红强调色 */
  --brand-accent-light: #c94a49; /* 朱砂红浅色 */
  --brand-muted: #717975;        /* 辅助灰文字 */
  --brand-border: #e0ddd8;       /* 边框/分隔色 */
  --brand-text: #1b1c1a;         /* 正文色 */

  /* 中性色阶 — 更丰富的黑白灰层次 */
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-950: #0a0a0a;

  /* 字号系统 — 超大标题，编辑式排版 */
  --text-display: clamp(3rem, 7vw, 7.5rem);     /* 首页 Hero 主标题 */
  --text-headline: clamp(2rem, 4.5vw, 4.5rem);  /* 页面大标题 */
  --text-title: clamp(1.5rem, 2.5vw, 2.5rem);   /* Section 标题 */
  --text-subtitle: clamp(1.125rem, 1.5vw, 1.5rem); /* 副标题 */
  --text-body: clamp(1rem, 1.1vw, 1.125rem);    /* 正文 */
  --text-small: 0.875rem;                        /* 辅助文字 */
  --text-caption: 0.75rem;                       /* 标签/元信息 */

  /* 字体 — 衬线+无衬线极致对比 */
  --font-serif: 'Noto Serif SC', 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* 间距 — 超大留白系统 */
  --section-padding: clamp(6rem, 12vw, 12rem);
  --section-padding-sm: clamp(4rem, 8vw, 8rem);
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-wide: 1400px;
  --container-padding: clamp(1.5rem, 4vw, 3rem);

  /* 动画 */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast: 0.4s;
  --duration-reveal: 1s;
  --duration-slow: 1.4s;
  --duration-slower: 1.8s;
}

/* --- 基础重置 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* 隐藏滚动条（水平滚动区域） */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }
body {
  font-family: var(--font-sans);
  background: var(--brand-surface);
  color: var(--brand-text);
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--text-body);
}

/* 选中态 */
::selection { background: var(--brand-accent); color: white; }

/* Material Icons */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* --- 滚动揭示动效 --- */

/* 从下方淡入（默认） */
.reveal {
  opacity: 0; transform: translateY(60px);
  transition: opacity var(--duration-reveal) var(--ease-out-expo),
              transform var(--duration-reveal) var(--ease-out-expo);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* 从左侧滑入 */
.reveal-left {
  opacity: 0; transform: translateX(-60px);
  transition: opacity var(--duration-reveal) var(--ease-out-expo),
              transform var(--duration-reveal) var(--ease-out-expo);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

/* 从右侧滑入 */
.reveal-right {
  opacity: 0; transform: translateX(60px);
  transition: opacity var(--duration-reveal) var(--ease-out-expo),
              transform var(--duration-reveal) var(--ease-out-expo);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* 缩放淡入 */
.reveal-scale {
  opacity: 0; transform: scale(0.9);
  transition: opacity var(--duration-reveal) var(--ease-out-expo),
              transform var(--duration-reveal) var(--ease-out-expo);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* 文字逐行揭示 — 从底部翻转出现 */
.reveal-text {
  opacity: 0; transform: translateY(100%);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}
.reveal-text.visible { opacity: 1; transform: translateY(0); }

/* 交错延迟 */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }
.stagger-7 { transition-delay: 0.7s; }
.stagger-8 { transition-delay: 0.8s; }

/* --- 语言切换动画 --- */
@keyframes textFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lang-fade { animation: textFadeIn 0.4s ease-out forwards; }

/* --- 路由切换淡入 --- */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-enter { animation: pageFadeIn 0.7s var(--ease-out-expo) forwards; }

/* --- Hero 视差背景 --- */
.hero-bg { transition: transform 0.1s linear; }

/* --- 装饰线条生长 --- */
.line-grow {
  width: 0;
  transition: width var(--duration-slow) var(--ease-out-expo) 0.3s;
}
.line-grow.visible { width: 100%; }

/* --- 卡片悬浮效果 --- */
.card-lift {
  transition: transform 0.6s var(--ease-out-expo),
              box-shadow 0.6s var(--ease-out-expo);
}
.card-lift:hover {
  transform: translateY(-12px);
  box-shadow: 0 32px 64px rgba(13, 26, 45, 0.1);
}

/* --- 图片悬浮缩放 --- */
.img-zoom { overflow: hidden; }
.img-zoom img {
  transition: transform 0.8s var(--ease-out-expo);
}
.img-zoom:hover img { transform: scale(1.08); }

/* --- 导航栏 --- */
.nav-glass {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: background-color 0.5s ease, box-shadow 0.5s ease;
}
.nav-scrolled {
  background-color: rgba(249, 249, 247, 0.92);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* --- 导航下拉 --- */
.nav-dropdown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}
.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* --- 全屏覆盖菜单（移动端） --- */
@keyframes overlaySlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mobile-overlay {
  animation: overlaySlideIn 0.4s var(--ease-out-expo) forwards;
}

/* --- 滚动指示器 --- */
@keyframes gentleBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(12px); }
}
.scroll-indicator { animation: gentleBounce 2.4s ease-in-out infinite; }

/* --- 脉冲线条动画（Hero 底部） --- */
@keyframes lineExpand {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
.line-expand {
  transform: scaleX(0);
  transform-origin: left;
  animation: lineExpand 1.2s var(--ease-out-expo) 0.6s forwards;
}

/* --- 渐变分隔线 --- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-border) 20%, var(--brand-border) 80%, transparent);
}

/* --- 图片占位 --- */
.img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-100);
  color: var(--neutral-400);
}

/* --- 页面 Banner --- */
.page-banner {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.page-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13, 26, 45, 0.92), rgba(13, 26, 45, 0.4));
}
.page-banner > * { position: relative; z-index: 1; }

/* --- 文章内容排版 --- */
.article-content {
  line-height: 2;
  font-size: 1.0625rem;
}
.article-content p {
  margin-bottom: 1.5rem;
}
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 2rem 0;
}

/* --- 表单输入 --- */
.form-input {
  border: none;
  border-bottom: 1px solid var(--brand-border);
  background: transparent;
  padding: 1rem 0;
  font-size: 1rem;
  font-family: var(--font-sans);
  color: var(--brand-text);
  transition: border-color 0.3s ease;
  outline: none;
  width: 100%;
}
.form-input:focus {
  border-bottom-color: var(--brand);
}
.form-input::placeholder {
  color: var(--neutral-400);
}

/* --- 超大数字样式（By the Numbers） --- */
.stat-number {
  font-size: clamp(3.5rem, 8vw, 8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* --- 杂志式卡片 hover 线条 --- */
.editorial-card {
  position: relative;
}
.editorial-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand-accent);
  transition: width 0.5s var(--ease-out-expo);
}
.editorial-card:hover::after {
  width: 100%;
}

/* --- 时间线 --- */
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--brand-border) 10%, var(--brand-border) 90%, transparent);
}
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--brand-accent);
  background: var(--brand-surface);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* --- 水纹装饰 --- */
.water-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200'%3E%3Cpath d='M0 100 Q50 80 100 100 T200 100 T300 100 T400 100' fill='none' stroke='%23fff' stroke-width='0.8'/%3E%3Cpath d='M0 130 Q50 110 100 130 T200 130 T300 130 T400 130' fill='none' stroke='%23fff' stroke-width='0.5'/%3E%3Cpath d='M0 160 Q50 140 100 160 T200 160 T300 160 T400 160' fill='none' stroke='%23fff' stroke-width='0.3'/%3E%3C/svg%3E");
  background-size: 400px 200px;
  pointer-events: none;
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .page-banner { min-height: 300px; }
  :root {
    --section-padding: clamp(4rem, 8vw, 6rem);
    --section-padding-sm: clamp(3rem, 6vw, 5rem);
    --container-padding: clamp(1rem, 3vw, 1.5rem);
  }
  /* 移动端时间线居左 */
  .timeline-line { left: 20px; }
  .timeline-dot { left: 20px; }
}

@media (max-width: 480px) {
  .page-banner { min-height: 240px; }
}

/* --- Preloader（品牌加载屏） --- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--neutral-950);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#preloader.hide {
  opacity: 0;
  visibility: hidden;
}
#preloader .preloader-logo {
  opacity: 0;
  transform: translateY(10px);
  animation: preloaderReveal 1s var(--ease-out-expo) 0.2s forwards;
}
#preloader .preloader-line {
  width: 40px;
  height: 1px;
  background: var(--brand-accent);
  margin-top: 24px;
  transform: scaleX(0);
  animation: preloaderLine 1.2s var(--ease-out-expo) 0.5s forwards;
}
@keyframes preloaderReveal {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes preloaderLine {
  to { transform: scaleX(1); }
}

/* --- 页面路由过渡（纯透明度，无位移，避免触发滚动动画） --- */
.page-transition-out {
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}
.page-transition-in {
  animation: pageTransitionIn 0.5s ease forwards;
}
@keyframes pageTransitionIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- 自定义光标（桌面端深色区域） --- */
.custom-cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              border-color 0.3s ease,
              background 0.3s ease;
  mix-blend-mode: difference;
  background: transparent;
}
.custom-cursor.hover {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}
.custom-cursor.hidden {
  opacity: 0;
  width: 0;
  height: 0;
}
/* 移动端/触屏不显示自定义光标 */
@media (hover: none), (max-width: 1024px) {
  .custom-cursor { display: none; }
}

/* --- 滚动视差辅助类 --- */
.parallax-slow {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* --- 无限滚动 Marquee（品牌关键词无限循环） --- */
@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 30s linear infinite;
  will-change: transform;
}
.marquee-track:hover {
  animation-play-state: paused;
}
/* 反向滚动（第二行） */
.marquee-track-reverse {
  animation-direction: reverse;
}

/* --- 描边大字装饰（超大空心字 section 背景） --- */
.stroke-text {
  -webkit-text-stroke: 1px rgba(0, 0, 0, 0.04);
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.04em;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}
/* 深色背景上的描边文字 */
.stroke-text-light {
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.04);
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.04em;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

/* --- 逐字符揭示动画（Hero 标题） --- */
@keyframes charReveal {
  from {
    opacity: 0;
    transform: translateY(40px) rotateX(40deg);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
    filter: blur(0);
  }
}
.char-reveal {
  display: inline-block;
  opacity: 0;
  animation: charReveal 0.8s var(--ease-out-expo) forwards;
}
/* 空格字符保留宽度 */
.char-space {
  display: inline-block;
  width: 0.3em;
}

/* --- Clip-path 图片展开揭示 --- */
@keyframes clipReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.clip-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.4s var(--ease-out-expo);
}
.clip-reveal.visible {
  clip-path: inset(0 0 0 0);
}
/* RTL 模式从右向左展开 */
[dir="rtl"] .clip-reveal {
  clip-path: inset(0 0 0 100%);
}
[dir="rtl"] .clip-reveal.visible {
  clip-path: inset(0 0 0 0);
}

/* =============================================
 * RTL（阿拉伯语）支持
 * ============================================= */

[dir="rtl"] {
  --font-serif: 'Noto Naskh Arabic', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif;
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .flex-row-reverse { flex-direction: row; }
[dir="rtl"] .ml-auto { margin-left: unset; margin-right: auto; }
[dir="rtl"] .mr-auto { margin-right: unset; margin-left: auto; }
[dir="rtl"] .material-symbols-outlined[style*="rotate"] { transform: scaleX(-1); }
[dir="rtl"] .reveal-left { transform: translateX(60px); }
[dir="rtl"] .reveal-right { transform: translateX(-60px); }
[dir="rtl"] .reveal-left.visible { transform: translateX(0); }
[dir="rtl"] .reveal-right.visible { transform: translateX(0); }
[dir="rtl"] .line-expand { transform-origin: right; }
[dir="rtl"] .timeline-line { left: auto; right: 50%; }
[dir="rtl"] .timeline-dot { left: auto; right: 50%; transform: translateX(50%); }

@media (max-width: 768px) {
  [dir="rtl"] .timeline-line { left: auto; right: 20px; }
  [dir="rtl"] .timeline-dot { left: auto; right: 20px; }
}
