/* ================================================================
   CYBER TERMINAL · 深色科技风个人主页样式
   ================================================================ */

:root {
  --bg: #05080f;
  --bg-2: #0a0f1c;
  --card: rgba(16, 24, 42, 0.72);
  --card-solid: #10182a;
  --border: rgba(148, 163, 184, 0.16);
  --accent: #22d3ee;      /* 青色 */
  --accent-2: #818cf8;    /* 靛蓝 */
  --magenta: #e879f9;     /* 品红 */
  --text: #e5e7eb;
  --text-dim: #8b94a7;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --mono: "Consolas", "JetBrains Mono", "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: rgba(34, 211, 238, 0.3); }

/* ===== 粒子背景 ===== */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

/* ===== 扫描线覆盖 ===== */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: overlay;
  opacity: 0.35;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(5, 8, 15, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.navbar.scrolled { background: rgba(5, 8, 15, 0.92); }

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 26px;
  align-items: center;
}

.nav-sep { width: 1px; height: 22px; background: var(--border); }

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-family: var(--mono);
  transition: color 0.2s, text-shadow 0.2s;
  position: relative;
  letter-spacing: 0.5px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--gradient);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
  transition: width 0.25s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.menu-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

/* ===== 首页横幅 ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 140px 24px 60px;
  z-index: 1;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  pointer-events: none;
}
.hero-grid-bg::before {
  content: "";
  position: absolute;
  width: 460px; height: 460px;
  left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(34, 211, 238, 0.16), transparent 65%);
  filter: blur(36px);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  width: 100%;
}

.hero-prompt {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 18px;
  letter-spacing: 1px;
  text-align: left;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.prompt-sym { color: var(--accent); }
.prompt-caret {
  color: var(--magenta);
  animation: blink 0.9s step-end infinite;
}

.hero-greet {
  color: var(--text-dim);
  font-size: 17px;
  letter-spacing: 6px;
  margin-bottom: 10px;
  font-family: var(--mono);
}

/* ---- 名字故障闪烁 ---- */
.hero-name {
  position: relative;
  font-size: clamp(52px, 10vw, 92px);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: 4px;
  animation: glitch-skew 4s infinite;
}
.hero-name::before,
.hero-name::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  overflow: hidden;
}
.hero-name::before {
  left: 2px;
  text-shadow: -2px 0 var(--magenta);
  clip-path: inset(0 0 55% 0);
  animation: glitch-a 3.2s infinite linear alternate-reverse;
}
.hero-name::after {
  left: -2px;
  text-shadow: 2px 0 var(--accent);
  clip-path: inset(55% 0 0 0);
  animation: glitch-b 2.7s infinite linear alternate-reverse;
}

@keyframes glitch-a {
  0%, 86%, 100% { clip-path: inset(0 0 55% 0); transform: translate(0); }
  88% { clip-path: inset(8% 0 40% 0); transform: translate(-4px, 2px); }
  92% { clip-path: inset(30% 0 20% 0); transform: translate(3px, -1px); }
  96% { clip-path: inset(55% 0 5% 0); transform: translate(-2px, 1px); }
}
@keyframes glitch-b {
  0%, 84%, 100% { clip-path: inset(55% 0 0 0); transform: translate(0); }
  88% { clip-path: inset(45% 0 15% 0); transform: translate(4px, -2px); }
  93% { clip-path: inset(65% 0 8% 0); transform: translate(-3px, 1px); }
  97% { clip-path: inset(20% 0 45% 0); transform: translate(2px, 2px); }
}
@keyframes glitch-skew {
  0%, 90%, 100% { transform: skewX(0); }
  92% { transform: skewX(3deg); }
  94% { transform: skewX(-3deg); }
  96% { transform: skewX(1.5deg); }
}

.hero-title {
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 400;
  color: var(--text);
  min-height: 1.5em;
  font-family: var(--mono);
}
.cursor { color: var(--accent); animation: blink 0.8s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 620px;
  margin: 18px auto 0;
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 13px 34px;
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--mono);
  text-decoration: none;
  letter-spacing: 1px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--gradient);
  color: #05080f;
  font-weight: 700;
  box-shadow: 0 6px 26px rgba(34, 211, 238, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 8px 36px rgba(34, 211, 238, 0.55);
}

.btn-outline {
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover {
  background: rgba(34, 211, 238, 0.12);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.25);
}

/* ===== HUD 实时数据面板 ===== */
.hud-stats {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.hud-cell {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px 12px;
  backdrop-filter: blur(6px);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.hud-cell:hover {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
}

/* HUD 四角刻度 */
.hud-cell::before, .hud-cell::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  border-color: var(--accent);
  border-style: solid;
}
.hud-cell::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud-cell::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.hud-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.hud-value {
  display: block;
  font-family: var(--mono);
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-unit {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ===== 通用板块 ===== */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 96px 24px;
  position: relative;
  z-index: 1;
}

.section-head { text-align: center; margin-bottom: 56px; }

.section-head h2 {
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 700;
  font-family: var(--mono);
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text);
  text-shadow: 0 0 24px rgba(34, 211, 238, 0.3);
}
.section-head h2::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -10px;
  transform: translateX(-50%);
  width: 60px; height: 3px;
  border-radius: 2px;
  background: var(--gradient);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.8);
}
.section-head p { color: var(--text-dim); font-size: 15px; }

/* ===== 终端窗口 ===== */
.terminal {
  max-width: 760px;
  margin: 0 auto;
  background: rgba(4, 8, 16, 0.85);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 34px rgba(34, 211, 238, 0.12), inset 0 0 60px rgba(34, 211, 238, 0.04);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(20, 30, 50, 0.8);
  border-bottom: 1px solid var(--border);
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; }
.term-dot.red { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green { background: #28c840; }
.term-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.term-body {
  padding: 18px 20px 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
}
.term-body p { color: var(--text); }
.term-ok { color: #34d399; text-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.term-warn { color: #fbbf24; text-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }
.term-dim { color: var(--text-dim); }
.term-cmd { color: var(--accent); margin-top: 8px; }
.term-out { color: var(--text-dim); }

/* ===== 技能 ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 22px 20px;
  backdrop-filter: blur(6px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 12px 32px rgba(34, 211, 238, 0.14);
}

.skill-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.skill-icon { font-size: 24px; }
.skill-head h3 { font-size: 16px; flex: 1; }
.skill-pct {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}

.skill-bar {
  height: 6px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.skill-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: var(--gradient);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.skill-bar i.fill { width: var(--w, 0%); }

.skill-card p { color: var(--text-dim); font-size: 13px; }

/* ===== 成长轨迹 ===== */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 34px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 10px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--magenta));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
  opacity: 0.7;
}

.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  position: absolute;
  left: -31px; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.9);
  animation: dot-pulse 2.4s ease-out infinite;
}
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

.tl-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tl-card:hover {
  transform: translateX(6px);
  border-color: rgba(232, 121, 249, 0.5);
  box-shadow: 0 0 24px rgba(232, 121, 249, 0.12);
}

.tl-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--magenta);
  border: 1px solid rgba(232, 121, 249, 0.4);
  background: rgba(232, 121, 249, 0.08);
  border-radius: 5px;
  padding: 2px 9px;
}
.tl-card h3 { font-size: 17px; margin: 8px 0 6px; }
.tl-card p { color: var(--text-dim); font-size: 14px; }

/* ===== 项目 ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.project-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(6px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(129, 140, 248, 0.55);
  box-shadow: 0 12px 32px rgba(129, 140, 248, 0.16);
}
.project-card::before, .project-card::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-color: rgba(129, 140, 248, 0.8);
  border-style: solid;
}
.project-card::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; }
.project-card::after  { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; }

.project-top { display: flex; justify-content: space-between; align-items: center; }
.project-top h3 { font-size: 18px; }
.project-link {
  color: var(--accent);
  font-size: 22px;
  text-decoration: none;
  transition: transform 0.2s, text-shadow 0.2s;
}
.project-link:hover {
  transform: translate(2px, -2px);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
}

.project-card p { color: var(--text-dim); font-size: 14px; flex: 1; }

.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.project-tags span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
  border-radius: 5px;
  padding: 3px 10px;
}

/* ===== 联系 ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 30px 24px;
  text-align: center;
  color: var(--text);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.contact-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 12px 32px rgba(34, 211, 238, 0.14);
}
.contact-icon { font-size: 30px; display: block; margin-bottom: 10px; }
.contact-card h3 { font-size: 16px; margin-bottom: 4px; }
.contact-card p {
  color: var(--text-dim);
  font-size: 14px;
  font-family: var(--mono);
  word-break: break-all;
}

/* ===== 页脚 ===== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
}
.footer span { color: var(--accent); }

/* ===== 滚动出现动画 ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .hud-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 64px; right: 0;
    width: 230px;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    background: rgba(5, 8, 15, 0.97);
    border-left: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    transform: translateX(100%);
    transition: transform 0.3s;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-sep { width: auto; height: 1px; margin: 8px 24px; }
  .nav-links li { text-align: center; }
  .nav-links a { display: block; padding: 13px 0; }

  .hud-stats { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: 120px; }
}
