/* FinAI Hub 共享主题 —— 深浅双主题 + 立体商务背景 + 顶部导航条 */

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

/* ── 深色主题（默认） ── */
:root,
:root[data-theme="dark"] {
  --bg: #1e2538;
  --bg-2: #141a2b;
  --card: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #eef2f9;
  --muted: #aeb9cc;
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --success: #34d399;
  --error: #f87171;
  --halo-a: rgba(56, 189, 248, 0.14);
  --halo-b: rgba(129, 140, 248, 0.12);
  --grid-line: rgba(255, 255, 255, 0.035);
  --topbar-bg: rgba(20, 26, 43, 0.6);
}

/* ── 浅色主题 ── */
:root[data-theme="light"] {
  --bg: #eef1f7;
  --bg-2: #e2e7f1;
  --card: rgba(255, 255, 255, 0.85);
  --card-border: rgba(15, 23, 42, 0.1);
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0ea5e9;
  --accent-2: #6366f1;
  --success: #059669;
  --error: #dc2626;
  --halo-a: rgba(56, 189, 248, 0.22);
  --halo-b: rgba(129, 140, 248, 0.18);
  --grid-line: rgba(15, 23, 42, 0.04);
  --topbar-bg: rgba(255, 255, 255, 0.7);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  color: var(--text);
  background:
    /* 顶部两道高光，营造立体纵深感 */
    radial-gradient(1100px 560px at 12% -12%, var(--halo-a), transparent 60%),
    radial-gradient(900px 500px at 100% -4%, var(--halo-b), transparent 55%),
    /* 左下微光，呼应顶部 */
    radial-gradient(700px 600px at -6% 108%, var(--halo-b), transparent 60%),
    /* 主底色：垂直渐变 + 网格纹理 */
    linear-gradient(180deg, var(--bg), var(--bg-2)),
    repeating-linear-gradient(0deg, transparent 0 39px, var(--grid-line) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--grid-line) 39px 40px);
  background-attachment: fixed;
}

/* ── 顶部导航条（固定） ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 品牌标识 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* 返回链接 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* 主题切换按钮 */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
