/* ================================================================
   base.css —— 设计变量 / 全局基础 / 通用按钮与动画
   ================================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #0a1020;
  --bg-deep: #080d1a;
  --card: #101a2e;
  --card-2: #0d1626;
  --border: rgba(255, 255, 255, 0.07);
  --text: #eaf0fc;
  --text-2: #9dabc9;
  --text-3: #66759a;
  --blue: #4f7cff;
  --blue-light: #7fa0ff;
  --blue-2: #6a5cff;
  --gradient: linear-gradient(135deg, #3d7bff, #6a5cff);
  --bar-track: #1a2540;

  /* 半透明表面（深色主题下为白色罩层，浅色主题下自动翻转） */
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.09);
  --chip-bg: rgba(255, 255, 255, 0.03);
  --card-grad: linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  --nav-solid: rgba(8, 13, 26, 0.85);
  --side-bg: rgba(13, 22, 38, 0.72);
  --tooltip-bg: rgba(13, 22, 38, 0.95);

  --nav-h: 76px;
  /* 顶部导航高度 */
  --radius: 14px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

body {
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

/* ---------- 全站背景：雪山夜景图 + 深色雾面遮罩 ----------
   遮罩压暗背景，保证文字可读；首页 Hero 有自己的整屏背景不受影响 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.5;
  background: url("https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=snow%20mountain%20range%20under%20deep%20blue%20starry%20night%20sky%2C%20faint%20aurora%2C%20dark%20navy%20cinematic%20minimal&image_size=landscape_16_9") center / cover no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(64, 92, 180, 0.16), rgba(64, 92, 180, 0) 55%),
    linear-gradient(180deg, rgba(10, 16, 32, 0.9) 0%, rgba(9, 14, 27, 0.94) 50%, rgba(8, 12, 24, 0.97) 100%);
}

/* ---------- 蓝调主题（即原"浅色"按钮切换的第二主题）
   不使用纯白：背景为与首页同源的雪山冷调画面 + 深蓝遮罩，
   卡片为深蓝玻璃、文字保持浅色，保证可读性与首页的统一感 ---------- */
:root[data-theme="light"] {
  --bg: #111a30;
  --bg-deep: #0e1628;
  --card: rgba(27, 38, 66, 0.72);
  --card-2: rgba(22, 32, 56, 0.7);
  --border: rgba(188, 204, 255, 0.13);
  --text: #edf2ff;
  --text-2: #b2c0dd;
  --text-3: #8291b3;
  --blue: #6f9bff;
  --blue-light: #93b4ff;
  --bar-track: rgba(255, 255, 255, 0.1);

  --surface: rgba(255, 255, 255, 0.07);
  --surface-hover: rgba(255, 255, 255, 0.13);
  --chip-bg: rgba(255, 255, 255, 0.05);
  --card-grad: linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  --nav-solid: rgba(15, 23, 46, 0.78);
  --side-bg: rgba(21, 31, 55, 0.68);
  --tooltip-bg: rgba(25, 35, 61, 0.96);
}

/* 蓝调主题：固定的雪山背景层 + 深蓝雾面遮罩（虚化降透，不压内容） */
:root[data-theme="light"] body {
  background-color: transparent;
}

:root[data-theme="light"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 1;
  background: url("https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=snow%20mountain%20peaks%20above%20sea%20of%20clouds%20at%20blue%20hour%20twilight%2C%20misty%20dark%20navy%20blue%20atmosphere%2C%20cinematic%20minimal&image_size=landscape_16_9") center / cover no-repeat;
}

:root[data-theme="light"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(74, 108, 200, 0.22), rgba(74, 108, 200, 0) 55%),
    linear-gradient(180deg, rgba(15, 22, 44, 0.84) 0%, rgba(16, 23, 43, 0.92) 45%, rgba(13, 19, 37, 0.96) 100%);
}

/* 蓝调主题下图标悬停仍为浅色（体系未反色） */
:root[data-theme="light"] .icon-btn:hover {
  color: #fff;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

/* 通用：按钮内的 SVG 必须限定尺寸，否则内联 SVG 默认 300px 会撑爆按钮 */
.btn svg {
  flex: none;
  width: 17px;
  height: 17px;
}

.btn-sm {
  padding: 9px 20px;
  font-size: 14px;
}

.btn-primary {
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 8px 24px rgba(77, 109, 255, 0.35);
}

.btn-outline {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
  color: #fff;
  background: var(--surface-hover);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- 板块标题通用 ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-title h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.section-title h2::before {
  content: "";
  width: 5px;
  height: 22px;
  border-radius: 3px;
  background: var(--gradient);
}

.section-title p {
  margin: 8px 0 0 15px;
  font-size: 14px;
  color: var(--text-3);
}

.section-more {
  font-size: 14px;
  color: var(--blue-light);
  transition: color 0.2s;
}

.section-more:hover {
  color: #fff;
}

/* ---------- Tab 面板切换动画（由 JS 切换 .is-active）
   注意：使用 :not() 提高选择器优先级，
   避免被 .about 等组件自身的 display 声明覆盖导致面板无法隐藏 ---------- */
.tabpage:not(.is-active) {
  display: none;
}

.tabpage.is-active {
  display: block;
  animation: tab-in 0.45s var(--ease) both;
}

/* Hero 是 flex 布局，激活时需要恢复为 flex（个人资料页现为「子tab+子页」结构，用默认 block） */
#home.tabpage.is-active {
  display: flex;
}

@keyframes tab-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

@media (prefers-reduced-motion: reduce) {
  .tabpage.is-active {
    animation: none;
  }
}