/* 行情分析平台主题：与企业管理系统视觉统一 */

:root {
  --ap-primary: #4f6ef7;
  --ap-primary-hover: #3d5ce5;
  --ap-primary-soft: #eef2ff;
  --ap-bg: #f5f7fb;
  --ap-card: #ffffff;
  --ap-border: #e7ebf3;
  --ap-border-strong: #d9dfea;
  --ap-text: #1f2937;
  --ap-text-2: #4b5563;
  --ap-muted: #8a94a6;
  --ap-radius: 14px;
  --ap-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
  --ap-ring: 0 0 0 3px rgba(79, 110, 247, .14);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif !important;
  background: var(--ap-bg) !important;
  color: var(--ap-text);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd3e1; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab5c9; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ── 登录页 ── */
#login-page {
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(79, 110, 247, .28), transparent 60%),
    radial-gradient(700px 500px at 95% 100%, rgba(124, 94, 247, .22), transparent 60%),
    linear-gradient(160deg, #101827 0%, #1b2740 55%, #22314f 100%) !important;
  padding: 24px;
}
#login-page > div {
  border-radius: 20px !important;
  box-shadow: 0 32px 80px rgba(4, 10, 24, .45) !important;
  padding: 40px 36px 34px !important;
}
#login-page input {
  border: 1px solid var(--ap-border-strong) !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  transition: border-color .15s, box-shadow .15s;
}
#login-page input:focus {
  border-color: var(--ap-primary) !important;
  box-shadow: var(--ap-ring) !important;
  outline: none !important;
}
#login-page button {
  background: var(--ap-primary) !important;
  border-radius: 10px !important;
  padding: 12px !important;
  box-shadow: 0 8px 18px rgba(79, 110, 247, .28);
}
#login-page button:hover { background: var(--ap-primary-hover) !important; }
.login-mark {
  width: 56px; height: 56px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  background: var(--ap-primary-soft);
  color: var(--ap-primary);
}
.login-mark svg { width: 28px; height: 28px; }

/* ── 顶栏 ── */
.app-header {
  background: #fff !important;
  height: 60px !important;
  padding: 0 24px !important;
  border-bottom: 1px solid var(--ap-border) !important;
  box-shadow: none !important;
}
.app-header > div:first-child > span:last-child {
  font-size: 15px;
  letter-spacing: -.01em;
}
.app-header .hdr-quota {
  background: #f5f7fb;
  border: 1px solid #eef1f7;
  border-radius: 999px;
  padding: 4px 12px;
}

/* ── 侧边栏 ── */
.app-sidebar {
  background: linear-gradient(180deg, #1d2836 0%, #151f2c 100%) !important;
  border-right: 0 !important;
  padding: 14px 10px !important;
  gap: 2px !important;
}
#sidebar .nav-item {
  color: #9fb0c5 !important;
  border-radius: 10px !important;
  padding: 11px 14px !important;
  font-size: 14px;
  transition: background .15s, color .15s;
}
#sidebar .nav-item:hover {
  background: rgba(255, 255, 255, .06) !important;
  color: #fff !important;
}
#sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(79, 110, 247, .32), rgba(79, 110, 247, .12)) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 #6b86ff;
}
#sidebar .nav-item > span:first-child {
  width: 22px;
  text-align: center;
  flex: none;
}
#sidebar .nav-item.active span.text-sm,
#sidebar .nav-item:hover span.text-sm { color: #fff !important; }

/* ── 手机底部导航 ── */
.mobile-nav-item { color: #8a94a6; border-radius: 10px; margin: 4px 2px; }
.mobile-nav-item:hover { color: var(--ap-primary); background: var(--ap-primary-soft); }
.mobile-nav-item.active { color: var(--ap-primary); background: var(--ap-primary-soft); }
.mobile-nav-item.active span.text-xs { color: var(--ap-primary); font-weight: 600; }

/* ── 内容卡片 ── */
main .bg-white.rounded-xl.shadow-sm,
main .bg-white.rounded-xl.shadow,
main .bg-white.rounded-xl {
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-radius) !important;
  box-shadow: var(--ap-shadow) !important;
}

/* ── 表单控件 ── */
input[type="text"], input[type="search"], input[type="password"], input[type="number"],
input[type="date"], input[type="month"], input[type="email"], select, textarea {
  border-color: var(--ap-border-strong) !important;
  border-radius: 9px !important;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ap-primary) !important;
  box-shadow: var(--ap-ring) !important;
}
::placeholder { color: #a7b0c0; }

/* ── 表格 ── */
thead th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
  border-bottom: 1px solid var(--ap-border) !important;
}
tbody td { color: var(--ap-text-2); }
tbody tr:hover { background: #f8faff !important; }
main thead th { white-space: nowrap; }
main td button { white-space: nowrap; }

/* ── 贵金属分析按钮 ── */
.futures-model-btn-gold, .futures-model-btn-silver {
  background: #f5f7fb !important;
  color: #6b7688 !important;
  border-color: var(--ap-border) !important;
  border-radius: 8px !important;
}
.futures-model-btn-gold:hover, .futures-model-btn-silver:hover {
  background: var(--ap-primary-soft) !important;
  color: var(--ap-primary) !important;
  border-color: #d5ddfb !important;
}
.futures-model-btn-gold.active, .futures-model-btn-silver.active {
  background: var(--ap-primary) !important;
  color: #fff !important;
  border-color: var(--ap-primary) !important;
}
#page-gold button[onclick*="agentAnalyzeFutures"],
#page-silver button[onclick*="agentAnalyzeFutures"] {
  background-image: none !important;
  background-color: var(--ap-primary) !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 14px rgba(79, 110, 247, .22);
}
#page-gold button[onclick*="agentAnalyzeFutures"]:hover,
#page-silver button[onclick*="agentAnalyzeFutures"]:hover {
  background-color: var(--ap-primary-hover) !important;
}

/* ── 主色统一（覆盖 Tailwind indigo 工具类）── */
.bg-indigo-600, .bg-indigo-500 { background-color: var(--ap-primary) !important; }
.hover\:bg-indigo-700:hover, .hover\:bg-indigo-600:hover { background-color: var(--ap-primary-hover) !important; }
.text-indigo-600, .text-indigo-500 { color: var(--ap-primary) !important; }
.text-indigo-700, .text-indigo-800 { color: #3d55c9 !important; }
.bg-indigo-100 { background-color: #eef2ff !important; }
.bg-indigo-50 { background-color: #f5f7ff !important; }
.border-indigo-200, .border-indigo-300 { border-color: #d5ddfb !important; }
.ring-indigo-500 { --tw-ring-color: rgba(79, 110, 247, .45) !important; }

/* 排名/标签小徽章 */
main .rounded-full.bg-indigo-100 { background: #eef2ff !important; color: #4258d6 !important; }

/* ── 侧栏品牌区 / 底部账号区 ── */
.sb-brand {
  padding: 8px 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 10px;
}
.sb-brand-title { color: #f2f6fc; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.sb-brand-sub { color: #6f8299; font-size: 10.5px; margin-top: 3px; letter-spacing: .14em; text-transform: uppercase; }
.sb-footer {
  margin-top: auto;
  padding: 14px 8px 6px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.sb-user { color: #7f8fa4; font-size: 12px; }
.sb-user span { color: #c9d6e6; font-weight: 500; }
.sb-logout {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: #9fb0c5;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sb-logout:hover { background: rgba(239, 68, 68, .14); color: #fca5a5; }

/* ── 顶栏页标题 ── */
.app-title-block { display: flex; flex-direction: column; justify-content: center; line-height: 1.25; min-width: 0; }
.app-title-block h1 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ap-text); letter-spacing: -.01em; }
.app-title-block span { font-size: 10.5px; color: var(--ap-muted); letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }
@media (min-width: 768px) { .app-title-block h1 { font-size: 17px; } }

/* ── 侧栏/移动端线性图标 ── */
#sidebar .nav-item .nav-icon { width: 22px; display: flex; align-items: center; justify-content: center; opacity: .82; }
#sidebar .nav-item.active .nav-icon,
#sidebar .nav-item:hover .nav-icon { opacity: 1; }
#sidebar .nav-item .nav-icon svg { width: 18px; height: 18px; }
.nav-icon-m { display: flex; align-items: center; justify-content: center; }
.nav-icon-m svg { width: 17px; height: 17px; }