/* 高顺环球 GOOSUN FX 全局样式 */
* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--page-bg, #f8fafc);
  color: var(--page-fg, #1e2844);
  transition: background-color 0.3s, color 0.3s;
}

/* ========== 双主题 CSS 变量 ========== */
/* 默认：深色（黑夜）模式 */
html.theme-dark {
  --page-bg: #0f172a;
  --page-fg: #e2e8f0;
  --card-bg: rgba(30, 40, 68, 0.6);
  --card-border: rgba(255,255,255,0.1);
  --nav-bg: #ffffff;
  --nav-fg: #1e2844;
  --topbar-bg: #1e2844;
  --topbar-fg: #ffffff;
  --footer-bg: #1e2844;
  --footer-fg: #cbd5e1;
  --ticker-bg: #ffffff;
  --ticker-fg: #1e2844;
  --accent-gold: #e5a83a;
}

/* 浅色（白天）模式 - 米色 + 金色（参考用户给的图） */
html.theme-light {
  --page-bg: #f8f6f0;           /* 米色背景（参考图） */
  --page-fg: #2b2416;           /* 深棕色文字 */
  --card-bg: #ffffff;
  --card-border: rgba(214, 148, 31, 0.2);
  --nav-bg: rgba(255, 253, 245, 0.95);
  --nav-fg: #2b2416;
  --topbar-bg: #f0e9d6;
  --topbar-fg: #6b4423;
  --footer-bg: #f0e9d6;
  --footer-fg: #4d3a1a;
  --ticker-bg: #fffef8;
  --ticker-fg: #2b2416;
  --accent-gold: #c8941e;
}

/* 浅色模式下若底图为深色 Hero：保留深色渲染但加米色边框点缀可选 */
/* 浅色模式下强制深色的文字映射（覆盖 Tailwind 的 bg-white / text-slate-800 等） */
html.theme-light body { background: #f8f6f0 !important; color: #2b2416; }

/* 导航栏浅色：米色半透明背景 + 深棕文字 */
html.theme-light header.site-nav {
  background: rgba(255, 253, 245, 0.96) !important;
  border-bottom-color: rgba(214, 148, 31, 0.25) !important;
  backdrop-filter: blur(12px);
}
html.theme-light header.site-nav a { color: #4d3a1a; }
html.theme-light header.site-nav a:hover { color: #c8941e; }

/* 顶部公告条浅色 */
html.theme-light .site-topbar {
  background: #f0e9d6 !important;
  color: #6b4423 !important;
  border-bottom-color: rgba(214, 148, 31, 0.3) !important;
}

/* 实时行情条浅色 */
html.theme-light .site-ticker {
  background: #fffef8 !important;
  border-bottom-color: rgba(214, 148, 31, 0.2) !important;
  color: #2b2416;
}

/* 页脚浅色 */
html.theme-light .site-footer {
  background: #f0e9d6 !important;
  color: #4d3a1a !important;
  border-top-color: #c8941e !important;
}
html.theme-light .site-footer h4 { color: #2b2416 !important; }
html.theme-light .site-footer a { color: #6b4423 !important; }
html.theme-light .site-footer a:hover { color: #c8941e !important; }
html.theme-light .site-footer p { color: #6b4423 !important; }
html.theme-light .site-footer .text-slate-400,
html.theme-light .site-footer .text-slate-300,
html.theme-light .site-footer .text-slate-200 { color: #6b4423 !important; }

/* ========== 语言下拉菜单 ========== */
.lang-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; cursor: pointer; font-size: 13px;
  transition: background-color 0.15s;
}
.lang-menu-item:hover { background: rgba(229, 168, 58, 0.12); }
.lang-menu-item .flag-emoji {
  font-size: 18px; line-height: 1;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

/* RTL 适配（阿拉伯语） */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .text-left { text-align: right; }
html[dir="rtl"] .ml-1, html[dir="rtl"] .ml-2, html[dir="rtl"] .ml-3 { margin-left: 0; margin-right: 0.25rem; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.5); }

/* 实时行情滚动 */
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
#ticker-track {
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}
#ticker-track:hover { animation-play-state: paused; }

/* 价格变化高亮闪烁 */
.flash-up {
  background-color: rgba(22, 163, 74, 0.2) !important;
  transition: background-color 0.6s ease-out;
}
.flash-down {
  background-color: rgba(220, 38, 38, 0.2) !important;
  transition: background-color 0.6s ease-out;
}
.price-up { color: #16a34a; }
.price-down { color: #dc2626; }

/* 表格行 hover */
.market-row { transition: background-color 0.15s; }
.market-row:hover { background-color: rgba(241, 245, 249, 0.6); }

/* 交易终端品种列表 */
.symbol-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  cursor: pointer; transition: background-color 0.15s;
}
.symbol-row:hover { background-color: rgba(51, 65, 85, 0.5); }
.symbol-row.active { background-color: rgba(10, 77, 171, 0.4); }

/* 隐藏 input number 的默认箭头 */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* line-clamp polyfill */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* fade in */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }

/* ========== Hero 装饰动画 ========== */
/* 浮动动画（上下缓慢漂浮） */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.animate-float { animation: floatY 4s ease-in-out infinite; }
.animate-float-slow { animation: floatY 6s ease-in-out infinite; }

/* 光晕脉冲 */
@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.08); }
}
.animate-glow { animation: glowPulse 4s ease-in-out infinite; }

/* 闪烁（星光） */
@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.1); }
}
.animate-sparkle { animation: sparkle 2.5s ease-in-out infinite; }

/* 按钮金色 shimmer 光带 */
.btn-shimmer {
  position: relative; overflow: hidden;
}
.btn-shimmer::after {
  content: ''; position: absolute; top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(
    120deg, transparent 0%, rgba(255,255,255,0.35) 50%, transparent 100%
  );
  transform: skewX(-20deg);
  animation: btnShimmer 2.8s ease-in-out infinite;
}
@keyframes btnShimmer {
  0%   { left: -75%; }
  60%  { left: 125%; }
  100% { left: 125%; }
}

/* 金色文字渐变动画（水平流动） */
.gold-text-gradient {
  background: linear-gradient(90deg, #f5c542, #e5a83a, #d4941f, #f5c542);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: goldFlow 4s linear infinite;
}
@keyframes goldFlow {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ========== 品牌字体工具类 ========== */
.font-serif-cn { font-family: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', 'SimSun', serif; }
.font-cinzel  { font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif; letter-spacing: 0.12em; }

/* ========== 品牌金色（纯色，去除渐变，统一专业质感） ========== */
.gold-metal {
  color: #e5a83a;
  text-shadow: 0 2px 8px rgba(229, 168, 58, 0.25), 0 1px 0 rgba(0,0,0,0.25);
}
/* 略轻版金色（副标题/英文用） */
.gold-metal-light {
  color: #f0c14a;
  text-shadow: 0 1px 4px rgba(240, 193, 74, 0.2);
}
/* 白天模式下金色加深，保证对比度 */
html.theme-light .gold-metal      { color: #b8801c; text-shadow: 0 1px 2px rgba(0,0,0,0.08); }
html.theme-light .gold-metal-light { color: #c8941e; text-shadow: none; }

/* 金色细分隔线 */
.gold-divider {
  display: inline-block;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e5a83a, transparent);
  width: 100%;
}

/* 网格装饰底 */
.hero-grid {
  background-image:
    linear-gradient(rgba(245, 197, 66, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 197, 66, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* 公告条自动滚动 */
@keyframes noticeSlide {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.notice-scroll {
  animation: noticeSlide 40s linear infinite;
  will-change: transform;
}
.notice-scroll:hover { animation-play-state: paused; }

/* 放射光纹（克制的单点金色光晕，去除土气多层渐变） */
.hero-rays::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(229, 168, 58, 0.12), transparent 55%);
  pointer-events: none;
}

/* 隐藏横向滚动条（Tabs 区） */
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* 涨绿跌红全局强化（兼容 Tailwind CDN 未生成类的情形） */
.text-up, .color-up { color: #16a34a !important; }
.text-down, .color-down { color: #dc2626 !important; }
.bg-up { background-color: #16a34a !important; }
.bg-down { background-color: #dc2626 !important; }
.border-up { border-color: #16a34a !important; }
.border-down { border-color: #dc2626 !important; }

/* 主打行情卡价格跳动 */
@keyframes priceBeat {
  0%, 100% { text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
  50%      { text-shadow: 0 2px 18px rgba(245,197,66,0.4), 0 2px 10px rgba(0,0,0,0.5); }
}
#main-price { animation: priceBeat 3s ease-in-out infinite; }

/* 价格闪烁升级：上下整条涨跌色条 */
.flash-up  { background-color: rgba(22, 163, 74, 0.25) !important; transition: background-color 0.6s ease-out; }
.flash-down{ background-color: rgba(220, 38, 38, 0.25) !important; transition: background-color 0.6s ease-out; }

/* Toast */
.toast {
  position: fixed; top: 80px; right: 20px; z-index: 9999;
  padding: 12px 20px; border-radius: 8px;
  background: white; box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  animation: slideInRight 0.3s ease-out;
  max-width: 360px;
}
.toast.success { border-left: 4px solid #16a34a; }
.toast.error { border-left: 4px solid #dc2626; }
.toast.info { border-left: 4px solid #0a4dab; }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
 *  🏆 Hero 四层金属质感大标题（奢华升级版）
 * ========================================================================== */

/* 金属质感主标题（纯金箔刻字感 + 阴影立体 + 边缘镀光） */
.metal-gold-heading {
  /* 金属质感金色（多层色阶 + 高光 + 阴影） */
  background: linear-gradient(
    180deg,
    #fff5cc 0%,     /* 顶部高光白金 */
    #ffd966 18%,    /* 浅金 */
    #e5a83a 42%,    /* 主金色 */
    #b8801c 68%,    /* 深金阴影 */
    #8b5f13 88%,    /* 底部深褐金 */
    #d4941f 100%    /* 底部反光 */
  );
  background-size: 100% 200%;
  background-position: 0 50%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 0 1px rgba(245, 197, 66, 0.3),
    0 4px 20px rgba(229, 168, 58, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.4);
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.3));
  animation: metalShine 5s ease-in-out infinite;
}
@keyframes metalShine {
  0%, 100% { background-position: 0 50%; }
  50% { background-position: 0 80%; }
}

/* 银镀色副标题（英文衬线） */
.metal-silver-heading {
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #e2e8f0 25%,
    #94a3b8 60%,
    #cbd5e1 90%,
    #e5a83a 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 8px rgba(148, 163, 184, 0.2);
}

/* 浅色模式下：金属标题需要更深色以保证对比度 */
html.theme-light .metal-gold-heading {
  background: linear-gradient(
    180deg,
    #d4941f 0%,
    #b8801c 25%,
    #8b5f13 55%,
    #6b4423 85%,
    #b8801c 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 1px 1px rgba(255,255,255,0.6), 0 2px 6px rgba(184, 128, 28, 0.2);
  filter: none;
}
html.theme-light .metal-silver-heading {
  background: linear-gradient(
    180deg,
    #475569 0%,
    #334155 50%,
    #b8801c 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
}

/* 金色水平流光分隔线（主标题中段） */
.gold-line-shimmer {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(229, 168, 58, 0.2) 20%,
    #e5a83a 50%,
    rgba(229, 168, 58, 0.2) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: lineFlow 4s linear infinite;
}
@keyframes lineFlow {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ==========================================================================
 *  📱 WhatsApp 全局悬浮按钮
 * ========================================================================== */
.fab-whatsapp {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45), 0 2px 6px rgba(0,0,0,0.15);
  z-index: 9998;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fabPulse 2.4s ease-in-out infinite;
}
.fab-whatsapp::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.55);
  animation: fabRing 2.4s ease-out infinite;
}
.fab-whatsapp:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 14px 35px rgba(37, 211, 102, 0.6), 0 2px 6px rgba(0,0,0,0.15);
}
.fab-whatsapp .fab-label {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  color: #25D366;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.fab-whatsapp:hover .fab-label { opacity: 1; }

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.5); }
  50%      { box-shadow: 0 14px 30px rgba(37, 211, 102, 0.6),  0 0 0 14px rgba(37, 211, 102, 0);   }
}
@keyframes fabRing {
  0%   { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.4);  opacity: 0; }
}

/* 移动端稍小一点 */
@media (max-width: 640px) {
  .fab-whatsapp { width: 52px; height: 52px; font-size: 24px; right: 14px; bottom: 14px; }
  .fab-whatsapp .fab-label { display: none; }
}

/* RTL 适配：阿拉伯语时按钮放到左下角 */
html[dir="rtl"] .fab-whatsapp { right: auto; left: 18px; }
html[dir="rtl"] .fab-whatsapp .fab-label { right: auto; left: calc(100% + 10px); }
@media (max-width: 640px) {
  html[dir="rtl"] .fab-whatsapp { right: auto; left: 14px; }
}

/* ==========================================================================
 *  🔁 涨跌色最终兜底（所有 Tailwind 红绿类都强制映射到统一的 #16a34a / #dc2626）
 *  这样即便某处遗漏了 text-up / text-down，绿红色调也保持一致。
 * ========================================================================== */
.text-green-300, .text-green-400, .text-green-500, .text-green-600, .text-green-700, .text-green-800, .text-green-900 { color: #16a34a !important; }
.text-red-300,   .text-red-400,   .text-red-500,   .text-red-600,   .text-red-700,   .text-red-800,   .text-red-900   { color: #dc2626 !important; }
.bg-green-50  { background-color: rgba(22,163,74,0.08) !important; }
.bg-green-100 { background-color: rgba(22,163,74,0.12) !important; }
.bg-green-500, .bg-green-600, .bg-green-700 { background-color: #16a34a !important; }
.bg-red-50    { background-color: rgba(220,38,38,0.08) !important; }
.bg-red-100   { background-color: rgba(220,38,38,0.12) !important; }
.bg-red-500, .bg-red-600, .bg-red-700 { background-color: #dc2626 !important; }
.border-green-100, .border-green-200, .border-green-300, .border-green-400, .border-green-500 { border-color: rgba(22,163,74,0.4) !important; }
.border-red-100, .border-red-200, .border-red-300, .border-red-400, .border-red-500 { border-color: rgba(220,38,38,0.4) !important; }

/* ==========================================================================
 *  ✨ 移动端 Hero 紧凑补丁（进一步压缩上下空间）
 * ========================================================================== */
@media (max-width: 767px) {
  .hero-rays { padding-top: 1.75rem; padding-bottom: 1.5rem; }
  .hero-rays .metal-gold-heading { letter-spacing: 0.04em !important; }
  .hero-rays .metal-silver-heading { letter-spacing: 0.15em !important; }
  /* Hero 里右侧的卡片与左侧 CTA 之间的间距收紧 */
  .hero-rays > div.grid { gap: 1.25rem !important; }
}
