/* ==========================================================================
   绷大的主页 · 共享设计基础
   Design tokens + 站点骨架 (reset / nav / logo / footer) + 无障碍与细节打磨
   每页原先重复内联的基础样式统一收敛到这里，便于全站一致与后续维护。
   ========================================================================== */

/* ----- 设计令牌 (Design Tokens) ---------------------------------------- */
:root {
  /* 背景层级 */
  --bg-0: #0b0f18;
  --bg-1: #121826;
  --bg-2: #1b2334;
  --bg-3: #253046;

  /* 边框 */
  --border: #2a3850;
  --border-soft: #1c2636;

  /* 文字 */
  --text: #e6edf3;
  --text-strong: #f5f9ff;
  --text-muted: #8a95a8;
  --text-faint: #46536a;

  /* 品牌主色（冷色调家族） */
  --accent-cyan: #4dc8f5;
  --accent-blue: #38a4f8;
  --accent-violet: #8b7bff;
  --accent-teal: #2fd4c6;

  /* 暖色点缀（正宗强调，仅少量使用） */
  --accent-amber: #f4c04d;
  --accent-red: #ff7a7a;
  --accent-green: #3ecf8e;
  --accent-danger: #f4515c;

  /* 主交互色 */
  --accent: var(--accent-cyan);
  --focus: #4dc8f5;

  /* 圆角与阴影 */
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.5);
}

/* 金色主题（CS2 / 游戏区块）覆盖令牌 */
.theme-gold {
  --bg-0: #0a0d16;
  --bg-1: #111726;
  --bg-2: #192233;
  --border: #28364e;
  --border-soft: #1b2638;
  --text: #eaeef5;
  --text-strong: #ffffff;
  --text-muted: #8a94a8;
  --text-faint: #515d75;
  --accent: #ffb750;
  --accent-2: #ff8f2b;
  --focus: #ffb750;
}

/* ----- 基础重置 -------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI",
    system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, var(--bg-0) 0%, var(--bg-1) 50%, var(--bg-0) 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

::selection {
  background: rgba(77, 200, 245, 0.3);
  color: #fff;
}

/* ----- 无障碍：键盘焦点 ------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--focus, #48dbfb);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- 站点骨架：导航条 ------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(13, 17, 23, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 21px;
  font-weight: bold;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue), var(--accent-violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 24px;
  font-size: 15px;
  transition: color 0.3s, transform 0.2s;
}

.nav-links a:hover {
  color: var(--accent-cyan);
}

.nav-links a.active {
  color: var(--text-strong);
  font-weight: bold;
  position: relative;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -8px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
}

/* 学习资料高亮入口 */
.nav-links a.study-nav {
  background: linear-gradient(90deg, var(--accent-blue), #0984e3);
  color: #fff !important;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: bold;
  box-shadow: 0 0 16px rgba(56, 164, 248, 0.4);
}

/* ----- 站点骨架：页脚 --------------------------------------------------- */
.footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-soft);
  line-height: 1.8;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.footer a:hover {
  color: var(--text-strong);
}

/* ----- 通用按钮 -------------------------------------------------------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 20px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

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

/* ----- 通用输入框 ------------------------------------------------------ */
input,
textarea,
select {
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* ----- 自定义滚动条 ---------------------------------------------------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-0);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-2);
  border-radius: 6px;
  border: 2px solid var(--bg-0);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-3);
}

/* ----- 减少动态效果（无障碍） ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----- 移动端适配 ------------------------------------------------------ */
@media (max-width: 600px) {
  .nav {
    padding: 14px 16px;
    flex-wrap: wrap;
  }

  .nav-links {
    display: flex;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    margin-left: 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .footer {
    font-size: 12px;
    padding: 20px 12px;
  }
}
