/* 使用国内镜像加速字体加载 */
@import url('https://fonts.font.im/css2?family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;600;800&display=swap');

/* design-system.css - 财税金融科技风格 (Finance Tech Elegant) */
:root {
  /* 品牌色：靛蓝科技 + 金色灵动 */
  --brand-blue: #4F46E5;
  /* 品牌蓝 - 与首页一致 */
  --brand-cyan: #06B6D4;
  /* 品牌青 */
  --brand-gold: #F59E0B;
  /* 品牌金 */
  --primary: #4F46E5;
  /* 靛蓝 - 科技专业 */
  --primary-hover: #4338CA;
  /* 悬停深靛蓝 */
  --primary-light: #EEF2FF;
  /* 浅靛蓝背景 */
  --primary-soft: rgba(79, 70, 229, 0.08);

  /* 强调色：金色活力 */
  --accent-gold: #F59E0B;
  /* 金色 - 灵动点缀 */
  --accent-gold-light: #FEF3C7;
  --accent-emerald: #10B981;
  /* 翠绿 - 成功状态 */
  --accent-cyan: #06B6D4;
  /* 青色 - 科技感 */

  /* 亮色背景系统 */
  --bg-page: #F8FAFC;
  /* 浅灰主背景 - 专业干净 */
  --bg-secondary: #F1F5F9;
  /* 次级背景 */
  --surface: #FFFFFF;
  /* 卡片纯白 */
  --glass-border: #E2E8F0;
  /* 边框灰 */

  /* 文字系统：深色专业 */
  --text-main: #1E293B;
  /* 主文字 - 深板岩蓝 */
  --text-primary: #0F172A;
  /* 标题文字 - 更深 */
  --text-slate: #475569;
  /* 舒适阅读灰 */
  --text-secondary: #64748B;
  /* 次要文字 */
  --text-muted: #64748B;
  /* 弱化文字 */

  /* 阴影：轻盈层次 */
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 24px -4px rgba(79, 70, 229, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.04);

  /* 物理参数 */
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* ========== 兼容旧变量名 ========== */
  --primary-color: #4F46E5;
  --border-color: #E2E8F0;
  --muted-color: #64748B;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  /* 强制显示滚动条，防止页面跳转抖动 */
}

body {
  margin: 0;
  padding-top: 100px;
  /* 导航栏高度 + 浮动间距 */
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 确保所有基础元素颜色正确 */
html {
  background-color: var(--bg-page);
}

* {
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
li,
a,
label,
th,
td {
  color: var(--text-main);
}

h1,
h2,
h3 {
  color: var(--text-primary);
}

/* 背景色工具类 */
.bg-white {
  background-color: #fff !important;
}

.bg-page {
  background-color: var(--bg-page) !important;
}

/* 氛围光效：科技感点缀 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(79, 70, 229, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* 现代卡片：轻盈悬浮 */
.modern-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.modern-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(79, 70, 229, 0.2);
}

/* 卡片标签 */
.card-marker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(79, 70, 229, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* 标题系统 */
h1,
h2,
h3 {
  color: var(--text-primary);
  font-weight: 700;
  margin: 0;
}

h1 {
  font-weight: 800;
}

/* 页面核心容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* 导航：毛玻璃效果 - 固定在顶部 */
.glass-nav {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 12px 24px;
  z-index: 1000;
  box-shadow: 0 4px 24px -6px rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  color: var(--text-primary) !important;
  text-decoration: none !important;
  font-size: 1.5rem !important;
  font-weight: 900 !important;
  letter-spacing: -1px !important;
  display: inline-flex;
  align-items: center;
  transition: var(--transition-fast);
}

.brand-logo:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.brand-logo span {
  color: var(--brand-blue);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  padding: 6px 12px;
  border-radius: 8px;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.data-font {
  font-family: 'JetBrains Mono', monospace;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* 间距工具类 */

/* 页脚 */
.page-footer {
  padding: 40px 24px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-slate);
  background: var(--surface);
}

.footer-links {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

/* 卡片通用样式 */
.card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card.p-3 {
  padding: 24px;
}

.card h2 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.card h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-slate);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* 表单标签行：支持内联 info 图标 */
.form-field label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

/* info 图标按钮 */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border: none;
  padding: 0;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.info-icon:hover,
.info-icon:focus-visible {
  background: var(--primary);
  color: #fff;
}

/* tooltip 浮窗 */
.info-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 260px;
  max-width: calc(100vw - 48px);
  padding: 10px 14px;
  background: var(--text-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  z-index: 100;
  pointer-events: none;
  word-break: break-word;
}

.info-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 12px;
  width: 10px;
  height: 10px;
  background: var(--text-primary);
  transform: rotate(45deg);
  border-radius: 2px;
}

/* tooltip 显示状态 */
.info-icon.active .info-tooltip {
  display: block;
  animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 移动端 tooltip 优化：避免溢出屏幕 */
@media (max-width: 768px) {
  .info-icon {
    position: relative;
  }

  .info-tooltip {
    /* 居中显示，避免溢出 */
    left: 50%;
    width: auto;
    min-width: 200px;
    max-width: calc(100vw - 32px);
    right: auto;
    transform: translateX(-50%) !important;
  }

  .info-icon.active .info-tooltip {
    animation: tooltipFadeInMobile 0.2s ease;
  }

  @keyframes tooltipFadeInMobile {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .info-tooltip::before {
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
  }

  /* 表格移动端优化 */
  .table-responsive {
    margin: 0 -24px;
    padding: 0 16px;
  }

  table {
    font-size: 0.85rem;
  }

  table th,
  table td {
    padding: 8px 10px;
    white-space: nowrap;
  }
}

/* 超小屏幕进一步优化 */
@media (max-width: 480px) {
  .form-field label {
    font-size: 0.875rem;
  }

  .info-tooltip {
    min-width: 160px;
    max-width: calc(100vw - 24px);
    font-size: 0.75rem;
    padding: 8px 12px;
  }
}

/* 表单网格布局 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
}

@media (max-width: 576px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* 表单样式 */
.form-field {
  display: flex;
  flex-direction: column;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text-main);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-field input::placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* 间距工具类 */
.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 16px;
}

.mt-4 {
  margin-top: 24px;
}

.mt-5 {
  margin-top: 48px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 16px;
}

.mb-4 {
  margin-bottom: 24px;
}

.p-3 {
  padding: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
  .glass-nav {
    padding: 10px 12px;
    top: 8px;
    left: 8px;
    right: 8px;
    border-radius: 12px;
  }

  .nav-container {
    padding: 0;
    gap: 8px;
  }

  .brand-logo {
    font-size: 1.1rem !important;
    flex-shrink: 0;
  }

  .nav-links {
    gap: 2px;
    flex-wrap: nowrap;
    flex-shrink: 1;
  }

  .nav-link {
    font-size: 0.7rem;
    padding: 4px 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }

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

  .footer-links .nav-link {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--brand-blue, #4F46E5);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  background-color: var(--primary-hover, #4338CA);
}

.back-to-top.show {
  display: flex;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
}

/* ========== 悬浮礼包按钮 ========== */
.gift-float-btn {
  position: fixed;
  bottom: 95px;
  right: 30px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 1001;
  transition: all 0.3s ease;
  animation: giftFloat 2.5s ease-in-out infinite;
}

.gift-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.gift-float-btn .gift-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  animation: badgePulse 1.5s ease-in-out infinite;
}

/* 礼包关闭按钮（长按显示） */
.gift-close-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #374151;
  color: white;
  border: 2px solid white;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 1002;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}

.gift-close-btn.show {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.gift-close-btn:hover {
  background: #EF4444;
}

@keyframes giftFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

/* 礼包浮层 */
.gift-popup {
  position: fixed;
  bottom: 160px;
  right: 30px;
  width: 320px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1002;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.25s ease;
}

.gift-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.gift-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #E5E7EB;
}

.gift-popup-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1F2937;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gift-popup-title i {
  color: #F59E0B;
}

.gift-popup-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #F3F4F6;
  color: #6B7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.gift-popup-close:hover {
  background: #E5E7EB;
  color: #374151;
}

.gift-popup-content {
  padding: 16px 20px;
}

.gift-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #F9FAFB;
  transition: all 0.2s ease;
  text-decoration: none;
}

.gift-item:last-child {
  margin-bottom: 0;
}

.gift-item:hover {
  background: #FEF3C7;
  transform: translateX(4px);
}

.gift-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

/* 三个礼物项的不同配色 */
.gift-item:nth-child(1) .gift-item-icon {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.gift-item:nth-child(2) .gift-item-icon {
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
}

.gift-item:nth-child(3) .gift-item-icon {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.gift-item-info {
  flex: 1;
}

.gift-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 2px;
}

.gift-item-desc {
  font-size: 0.75rem;
  color: #6B7280;
}

.gift-popup-footer {
  padding: 16px 20px;
  border-top: 1px solid #E5E7EB;
}

.gift-popup-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.gift-popup-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* 关闭提示 */
.gift-close-tip {
  text-align: center;
  font-size: 0.75rem;
  color: #9CA3AF;
  margin: 12px 0 0 0;
  display: block;
  line-height: 1.6;
}

/* 手机端适配 */
@media (max-width: 768px) {
  .gift-float-btn {
    bottom: 75px;
    right: 20px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .gift-popup {
    right: 16px;
    left: 16px;
    width: auto;
    bottom: 135px;
  }
}

/* ========== 自定义下拉选择器 ========== */
.custom-selector {
  position: relative;
}

.custom-selector-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 1rem;
}

.custom-selector-trigger:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.custom-selector-trigger.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.custom-selector-trigger .selected-value {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-selector-trigger .selected-value i {
  color: var(--primary);
  font-size: 1.1rem;
}

.custom-selector-trigger .arrow {
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.custom-selector-trigger.active .arrow {
  transform: rotate(180deg);
}

.custom-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.custom-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-option-list {
  overflow-y: auto;
  padding: 8px;
}

.custom-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.custom-option:hover {
  background: var(--primary-light);
}

.custom-option.selected {
  background: var(--primary);
  color: #fff;
}

.custom-option.selected i {
  color: #fff;
}

.custom-option i {
  color: var(--primary);
  width: 20px;
  text-align: center;
}

.custom-option .option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.custom-option.selected .option-desc {
  color: rgba(255, 255, 255, 0.7);
}