/* ============================================
   DataLens — 金融科技风格官网
   严格还原 Ardot 设计稿 (#04050A 深色金融风)
   ============================================ */

:root {
  /* 背景层级 */
  --bg-base: #04050A;          /* 页面主背景 */
  --bg-alt: #0A0E1A;           /* 服务区背景 */
  --bg-card: #0D1117;          /* 卡片背景 */
  --bg-btn-secondary: #111827; /* 次级按钮背景 */

  /* 边框 */
  --border-card: #262E47;
  --border-footer: #1A1F33;
  --border-btn-secondary: #33405A;

  /* 品牌色 */
  --brand-start: #0052D9;
  --brand-end: #366EF4;
  --brand-blue: #366EF4;
  --brand-glow: rgba(0, 82, 217, 0.4);

  /* 文本 */
  --text-primary: #FFFFFF;
  --text-secondary: #8B95A5;
  --text-tertiary: #5E6470;

  /* 行情色（A股惯例：红涨绿跌） */
  --up: #EF4444;
  --down: #22C55E;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;

  /* 阴影 */
  --shadow-card: 0 4px 24px -4px rgba(0, 0, 0, 0.3);
  --shadow-card-sm: 0 4px 24px -4px rgba(0, 0, 0, 0.2);
  --shadow-btn: 0 4px 24px var(--brand-glow);
  --shadow-btn-lg: 0 8px 32px var(--brand-glow);

  /* 间距 */
  --gap-lg: 40px;
  --gap-md: 24px;
  --gap-sm: 16px;
  --page-pad: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 头部导航 ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 72px;
  background: var(--bg-base);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(200px, 1fr);
  align-items: center;
  column-gap: 24px;
  padding: 0 48px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  min-width: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon svg {
  display: block;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  justify-self: center;
  min-width: 0;
}

.header-nav a {
  font-size: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-nav a:hover {
  color: var(--text-primary);
}

.header-nav a.active {
  color: var(--text-primary);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
  min-width: 0;
}

.login-link {
  font-size: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-link:hover {
  color: var(--text-primary);
}

.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  color: var(--text-primary);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-gradient:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-header {
  padding: 8px 20px;
  font-size: 14px;
}

/* ========== Hero 区域 ========== */
.hero {
  padding: 160px 64px 64px;
  background: linear-gradient(180deg, #05080A 0%, #0A1229 50%, #05080A 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1312px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid rgba(0, 82, 217, 0.4);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--brand-blue);
}

.badge-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.hero-title {
  font-size: 52px;
  font-weight: 700;
  line-height: 64px;
  text-align: center;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 28px;
  line-height: 40px;
  font-weight: 400;
  color: var(--text-secondary);
  text-align: center;
}

.hero-desc {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-secondary);
  text-align: center;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-hero-primary {
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-btn);
}

.btn-hero-secondary {
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 500;
  background: var(--bg-btn-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-btn-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-hero-secondary:hover {
  border-color: var(--brand-blue);
  background: #1a2332;
}

/* ========== 数据卡片 ========== */
.data-cards {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 1312px;
}

.data-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.card-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-more {
  font-size: 12px;
  color: var(--brand-blue);
  text-decoration: none;
  white-space: nowrap;
}

.card-more:hover {
  text-decoration: underline;
}

.card-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--up);
}

.card-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.card-values {
  display: flex;
  gap: 16px;
}

.card-value-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-value-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.card-value-big {
  font-size: 24px;
  font-weight: 700;
}

.text-up { color: var(--up); }
.text-down { color: var(--down); }

.flow-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-row svg {
  flex-shrink: 0;
}

.flow-text {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 通用区块 ========== */
.section {
  padding: 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 1440px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid rgba(0, 82, 217, 0.3);
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-blue);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.5px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
}

/* ========== 热门工具 ========== */
.tools-section {
  background: var(--bg-base);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 82, 217, 0.5);
}

.tool-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.tool-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.tool-desc {
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
  flex: 1;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 82, 217, 0.5);
  color: var(--brand-blue);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
  align-self: flex-start;
}

.btn-outline:hover {
  background: rgba(0, 82, 217, 0.1);
}

/* ========== 核心服务 ========== */
.services-section {
  background: var(--bg-alt);
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-item {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 16px -4px rgba(0, 0, 0, 0.15);
}

.service-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.service-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-title {
  font-size: 20px;
  font-weight: 600;
}

.service-desc {
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
}

/* ========== 核心优势 ========== */
.advantages-section {
  background: var(--bg-base);
}

.adv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.adv-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.adv-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 82, 217, 0.5);
}

.adv-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.adv-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.adv-title {
  font-size: 24px;
  font-weight: 700;
}

.adv-desc {
  font-size: 15px;
  line-height: 24px;
  color: var(--text-secondary);
}

/* ========== CTA 区域 ========== */
.cta-section {
  padding: 80px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  background: linear-gradient(180deg, #05080A 0%, #001A4D 50%, #05080A 100%);
}

.cta-title {
  font-size: 44px;
  font-weight: 700;
  line-height: 56px;
  text-align: center;
  letter-spacing: -0.5px;
}

.cta-subtitle {
  font-size: 17px;
  line-height: 26px;
  color: var(--text-secondary);
  text-align: center;
}

.btn-cta {
  padding: 16px 40px;
  font-size: 17px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-btn-lg);
}

.cta-trust {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ========== 页脚 ========== */
.footer {
  padding: 48px 64px 0;
  background: var(--bg-base);
  border-top: 1px solid var(--border-footer);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 64px;
}

.footer-brand {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-start), var(--brand-end));
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo svg {
  display: block;
}

.footer-logo-text {
  font-size: 20px;
  font-weight: 700;
}

.footer-tagline {
  font-size: 13px;
  line-height: 22px;
  color: var(--text-tertiary);
  white-space: pre-line;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-col a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--text-primary);
}

/* ========== 下拉菜单（一级导航展开） ========== */
.header-nav {
  list-style: none;
}

.header-nav > li {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-nav > li > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dropdown-caret {
  width: 10px;
  height: 10px;
  opacity: 0.72;
  transition: transform 0.18s ease;
}

.header-nav > li:hover > a > .dropdown-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  max-height: 72vh;
  overflow-y: auto;
  background: #0A0E1A;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
  padding: 10px 0;
  list-style: none;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  transform-origin: top center;
  transition: opacity 280ms ease-out, visibility 0s linear 280ms, transform 280ms ease-out;
}

.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 0;
  right: 0;
  height: 24px;
}

.header-nav > li:hover > .dropdown-menu,
.header-nav > li.is-open > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transition: opacity 280ms ease-out, visibility 0s linear 0s, transform 280ms ease-out;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li a {
  display: block;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease;
}

.dropdown-menu li a:hover {
  color: var(--text-primary);
  background: rgba(54, 110, 244, 0.10);
}

/* 移动端 汉堡按钮 */
.nav-mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-card);
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 移动端适配 */
@media (max-width: 1200px) {
  .header {
    padding: 0 28px;
    display: flex !important;
    grid-template-columns: none !important;
    column-gap: 0 !important;
    justify-content: space-between !important;
  }

  .header-nav {
    gap: 22px;
  }

  .nav-mobile-toggle {
    display: inline-flex;
    order: 2;
    margin-left: 12px;
  }

  .header-left {
    order: 1;
  }

  .header-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 24px 28px;
    background: #05080F;
    border-bottom: 1px solid var(--border-card);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    display: none;
    order: 99;
  }

  .header-nav.is-open {
    display: flex;
  }

  .header-nav > li {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .header-nav > li > a {
    width: 100%;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(38, 46, 71, 0.55);
    justify-content: space-between;
  }

  .dropdown-menu,
  #header .dropdown-menu {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    padding: 4px 0 12px 14px;
    display: none;
    background: transparent;
    min-width: 0;
    max-height: none;
    overflow: visible;
    transform-origin: initial;
    transition: none;
    height: auto;
    min-height: 0;
  }

  .header-nav > li.is-open > .dropdown-menu,
  #header .header-nav > li.has-dropdown.is-open > .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .header-right {
    gap: 8px;
    order: 3;
  }

  .login-link,
  #header .login-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 38px;
    color: #A2ACC6;
    text-decoration: none;
    white-space: nowrap;
    margin: 0;
  }

  .btn-header {
    padding: 8px 14px;
  }
}

.footer-bottom {
  margin-top: 40px;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-footer);
}

.copyright {
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-bottom-links a {
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom-links a:hover {
  color: var(--text-primary);
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .data-cards {
    flex-wrap: wrap;
  }

  .data-card {
    flex: 1 1 calc(33.333% - 12px);
    min-width: 260px;
  }
}

@media (max-width: 900px) {
  .section,
  .hero {
    padding: 48px 24px;
  }

  .header {
    padding: 0 24px;
  }

  .header-nav {
    display: none;
  }

  .header-nav.is-open {
    display: flex;
  }

  .header-nav > li {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .header-nav > li > a {
    width: 100%;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(38, 46, 71, 0.55);
    justify-content: space-between;
  }

  .dropdown-menu,
  #header .dropdown-menu {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    padding: 4px 0 12px 14px;
    display: none;
    background: transparent;
    min-width: 0;
    max-height: none;
    overflow: visible;
    transform-origin: initial;
    transition: none;
    height: auto;
    min-height: 0;
  }

  .header-nav > li.is-open > .dropdown-menu,
  #header .header-nav > li.has-dropdown.is-open > .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  .header-right {
    gap: 8px;
    order: 3;
  }

  .login-link,
  #header .login-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 10px;
    font-size: 12.5px;
    line-height: 36px;
    color: #A2ACC6;
    text-decoration: none;
    white-space: nowrap;
    margin: 0;
  }

  .adv-grid {
    grid-template-columns: 1fr;
  }

  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .hero-title {
    font-size: 36px;
    line-height: 48px;
  }

  .hero-subtitle {
    font-size: 20px;
    line-height: 30px;
  }

  .cta-title {
    font-size: 32px;
    line-height: 44px;
  }
}

@media (max-width: 600px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 32px;
  }
}
