/* ===== CSS Design Tokens ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg: #020c14;
  --bg2: #041520;
  --bg3: #071e2c;
  --bg4: #0a2540;
  --accent: #00d4ff;
  --accent2: #0090ff;
  --accent3: #7b2fff;
  --green: #00e87a;
  --yellow: #ffd60a;
  --text: #d0e8f4;
  --text2: #6a9eb5;
  --text3: #2a5470;
  --border: #0d3850;
  --border2: #1a5a7a;
  --radius: 10px;
  --font: 'Inter', -apple-system, 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --glow: 0 0 24px rgba(0, 212, 255, 0.45);
  --glow-sm: 0 0 12px rgba(0, 212, 255, 0.22);
  --glow-green: 0 0 10px rgba(0, 232, 122, 0.3);
  --section-gap: 5rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Dot-grid Background ===== */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(rgba(0,212,255,0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none; z-index: 0;
}

/* ===== Scanlines ===== */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px
  );
  pointer-events: none; z-index: 1;
}

/* ===== Nav ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(2,12,20,0.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border2);
  padding: 0 2rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 40px rgba(0,212,255,0.07);
}
nav::after {
  content: ''; position: absolute;
  bottom: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  opacity: 0.35;
}
.nav-brand {
  font-size: 0.95rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.06em;
  font-family: var(--mono); text-shadow: var(--glow-sm);
}
.nav-brand::before { content: '> '; opacity: 0.35; }
.nav-links { display: flex; gap: 1.4rem; }
.nav-links a {
  color: var(--text2); text-decoration: none;
  font-size: 0.8rem; font-family: var(--mono);
  letter-spacing: 0.04em;
  transition: color 0.2s, text-shadow 0.2s;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover {
  color: var(--accent);
  text-shadow: var(--glow-sm);
  border-bottom-color: rgba(0,212,255,0.3);
}

/* ===== Main Layout ===== */
main { max-width: 980px; margin: 0 auto; padding: 80px 2rem 4rem; position: relative; z-index: 2; }

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 5.5rem 0 4.5rem;
  position: relative;
}
.hero::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 720px; height: 520px;
  background: radial-gradient(ellipse, rgba(0,144,255,0.07) 0%, rgba(123,47,255,0.04) 50%, transparent 75%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.67rem; letter-spacing: 0.2em;
  color: var(--green); border: 1px solid rgba(0,232,122,0.28);
  background: rgba(0,232,122,0.05);
  padding: 0.28rem 0.85rem; border-radius: 2px;
  margin-bottom: 1.8rem;
  text-shadow: var(--glow-green);
}
.hero-badge::before { content: '●'; margin-right: 0.1rem; animation: blink 1.4s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-emoji {
  font-size: 4rem; display: block; margin-bottom: 1.2rem;
  animation: pulse-glow 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(0,212,255,0.55));
}
@keyframes pulse-glow {
  0%,100% { filter: drop-shadow(0 0 15px rgba(0,212,255,0.4)); }
  50%      { filter: drop-shadow(0 0 36px rgba(0,212,255,0.9)); }
}

/* Hero 标题：蓝→紫渐变 */
.hero h1 {
  font-size: 3rem; font-weight: 800; margin-bottom: 0.6rem;
  letter-spacing: -0.01em; line-height: 1.15;
}
.hero h1 span {
  background: linear-gradient(120deg, var(--accent) 0%, #60a5fa 40%, var(--accent3) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0,212,255,0.3));
}

/* 副标题轻量化 */
.hero .tagline {
  color: var(--text2); font-size: 0.9rem;
  margin-bottom: 2.8rem;
  font-family: var(--mono); letter-spacing: 0.04em;
  font-weight: 400;
}
.hero .tagline::before { content: '# '; color: var(--text3); }

/* ===== Status Bar ===== */
.hero-meta {
  display: flex; justify-content: center;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--bg2);
  overflow: hidden;
  box-shadow: var(--glow-sm), inset 0 1px 0 rgba(0,212,255,0.07);
  margin-bottom: 1.6rem;
  max-width: 560px; margin-left: auto; margin-right: auto;
}
.meta-item {
  text-align: center; padding: 1.3rem 2rem;
  flex: 1; border-right: 1px solid var(--border);
  position: relative; transition: background 0.2s;
}
.meta-item:last-child { border-right: none; }
.meta-item::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.meta-item:hover { background: var(--bg3); }
.meta-item:hover::before { opacity: 1; }
.meta-val {
  font-size: 2.2rem; font-weight: 700; color: var(--accent);
  display: block; font-family: var(--mono);
  text-shadow: var(--glow-sm); letter-spacing: 0.04em;
  /* 数字翻转动画 */
  transition: transform 0.3s;
}
.meta-label {
  font-size: 0.67rem; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.14em; font-family: var(--mono);
}

/* ===== Timer ===== */
.timer-block {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 0.45rem 1.1rem;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--text3); letter-spacing: 0.04em;
  box-shadow: var(--glow-sm);
}
.timer-block::before {
  content: '🟢'; font-size: 0.6rem; margin-right: 0.1rem;
  animation: blink 2s ease-in-out infinite;
}
#existence-timer { color: var(--green); font-weight: 600; text-shadow: var(--glow-green); }

/* ===== Section ===== */
.section { margin: var(--section-gap) 0; position: relative; z-index: 2; }
.section-title {
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--accent);
  margin-bottom: 2rem;
  display: flex; align-items: center; gap: 0.8rem;
  font-family: var(--mono); text-shadow: var(--glow-sm);
}
.section-title::before { content: '//'; color: var(--text3); font-weight: 400; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border2), transparent); }

/* ===== Abilities Grid — 3列固定高度 ===== */
.abilities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}
.ability-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem;
  position: relative; overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  cursor: default;
  min-height: 200px;
  display: flex; flex-direction: column;
}
.ability-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent2), var(--accent3));
  opacity: 0.6;
}
.ability-card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at top left, rgba(0,144,255,0.07), transparent 65%);
  opacity: 0; transition: opacity 0.3s; pointer-events: none;
}
.ability-card:hover {
  border-color: var(--border2);
  box-shadow: 0 8px 36px rgba(0,212,255,0.14);
  transform: translateY(-4px);
}
.ability-card:hover::after { opacity: 1; }

.ability-icon {
  font-size: 2.2rem; display: block;
  margin-bottom: 0.9rem;
  text-align: center;
}
.ability-title { font-size: 0.96rem; font-weight: 700; color: var(--text); margin-bottom: 0.45rem; text-align: center; }
.ability-desc { font-size: 0.82rem; color: var(--text2); line-height: 1.6; margin-bottom: 0.9rem; flex: 1; }
.ability-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: auto; }

/* 彩色 badge tags */
.ability-tag {
  font-family: var(--mono); font-size: 0.63rem;
  border-radius: 3px; padding: 0.12rem 0.45rem;
  letter-spacing: 0.02em; font-weight: 500;
}
.ability-tag:nth-child(3n+1) {
  background: rgba(0,212,255,0.1); color: var(--accent);
  border: 1px solid rgba(0,212,255,0.25);
}
.ability-tag:nth-child(3n+2) {
  background: rgba(0,144,255,0.1); color: var(--accent2);
  border: 1px solid rgba(0,144,255,0.25);
}
.ability-tag:nth-child(3n) {
  background: rgba(123,47,255,0.1); color: #a78bfa;
  border: 1px solid rgba(123,47,255,0.25);
}

/* ===== Timeline — 折叠功能 ===== */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent3) 65%, transparent 100%);
  opacity: 0.4;
}

.tl-item {
  position: relative; margin-bottom: 1.2rem;
  padding: 1.2rem 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent3);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: all 0.22s;
}
/* 最新事件高亮 */
.tl-item.latest {
  border-left-color: var(--accent);
  border-left-width: 3px;
  background: var(--bg3);
  box-shadow: -4px 0 16px rgba(0,212,255,0.1);
}
.tl-item.latest .tl-title { color: var(--accent); }
.tl-item.hidden { display: none; }

.tl-item:hover {
  border-color: var(--border2);
  border-left-color: var(--accent);
  box-shadow: var(--glow-sm);
  background: var(--bg3);
}
.tl-item::before {
  content: ''; position: absolute; left: -2.5rem; top: 1.4rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  border: 2px solid var(--bg);
}
.tl-item.latest::before {
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
  width: 11px; height: 11px; left: -2.55rem;
}
.tl-date { font-size: 0.7rem; color: var(--accent2); font-family: var(--mono); margin-bottom: 0.3rem; letter-spacing: 0.06em; }
.tl-title { font-size: 0.97rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.tl-desc { font-size: 0.85rem; color: var(--text2); }

/* 展开按钮 */
.tl-expand-btn {
  display: block; width: 100%; margin-top: 1rem;
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  color: var(--text2); font-family: var(--mono); font-size: 0.78rem;
  padding: 0.6rem; cursor: pointer; letter-spacing: 0.06em;
  transition: all 0.2s;
}
.tl-expand-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,212,255,0.04); }

/* ===== Lessons — 卡片化重构 ===== */
.lessons-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.lesson-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.lesson-card:hover {
  border-color: var(--border2);
  box-shadow: 0 4px 24px rgba(255,214,10,0.08);
  transform: translateY(-2px);
}
/* 卡片顶部 header bar */
.lesson-header {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.75rem 1.2rem;
  background: rgba(255,214,10,0.04);
  border-bottom: 1px solid var(--border);
}
.lesson-icon { font-size: 1.1rem; }
.lesson-tag {
  font-size: 0.67rem; font-family: var(--mono);
  background: rgba(255,214,10,0.08);
  color: var(--yellow);
  border: 1px solid rgba(255,214,10,0.2);
  border-radius: 3px; padding: 0.1rem 0.5rem;
  letter-spacing: 0.04em; flex: 1;
}
.lesson-date { font-size: 0.68rem; color: var(--text3); font-family: var(--mono); }
/* 卡片主体 */
.lesson-body { padding: 1rem 1.2rem 0.9rem; flex: 1; }
.lesson-text { font-size: 0.86rem; color: var(--text2); line-height: 1.65; }
/* 引用块样式的解决方案 */
.lesson-solution {
  margin-top: 0.6rem;
  padding: 0.5rem 0.8rem;
  border-left: 2px solid var(--accent2);
  background: rgba(0,144,255,0.04);
  font-size: 0.82rem; color: var(--text2);
  font-style: italic;
  border-radius: 0 4px 4px 0;
}

/* ===== Diary ===== */
.diary-list { display: grid; gap: 1rem; }
.diary-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.5rem;
  transition: border-color 0.2s;
}
.diary-item:hover { border-color: var(--border2); }
.diary-date { font-size: 0.7rem; color: var(--accent); font-family: var(--mono); margin-bottom: 0.5rem; letter-spacing: 0.06em; }
.diary-date::before { content: '> '; opacity: 0.4; }
.diary-content { font-size: 0.9rem; color: var(--text); white-space: pre-wrap; line-height: 1.7; }
.diary-empty { color: var(--text3); font-size: 0.86rem; text-align: center; padding: 3rem; font-family: var(--mono); }

/* ===== About ===== */
.about-card {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 2.2rem 2.5rem;
  position: relative; overflow: hidden;
  box-shadow: var(--glow-sm);
  display: grid; grid-template-columns: 1fr 260px; gap: 2.5rem;
}
@media (max-width: 700px) { .about-card { grid-template-columns: 1fr; } }
.about-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at top left, rgba(0,212,255,0.04), transparent 60%);
  pointer-events: none;
}
.about-bio p { color: var(--text2); font-size: 0.92rem; margin-bottom: 0.9rem; line-height: 1.75; }
.about-bio p:last-child { margin-bottom: 0; }
.about-bio strong { color: var(--text); }
.about-bio code {
  font-family: var(--mono); background: rgba(0,212,255,0.07);
  color: var(--accent); padding: 0.1rem 0.4rem; border-radius: 3px;
  font-size: 0.88em; border: 1px solid rgba(0,212,255,0.15);
}
.about-bio a { color: var(--accent2); text-decoration: none; }
.about-bio a:hover { color: var(--accent); }

.about-stack {
  display: flex; flex-direction: column; gap: 0.6rem;
  border-left: 1px solid var(--border);
  padding-left: 2rem;
}
@media (max-width: 700px) { .about-stack { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 1.5rem; } }
.stack-item { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.stack-key { font-size: 0.72rem; color: var(--text3); font-family: var(--mono); letter-spacing: 0.04em; white-space: nowrap; }
.stack-val { font-size: 0.82rem; color: var(--text2); text-align: right; }
.stack-val a { color: var(--accent2); text-decoration: none; }
.stack-val a:hover { color: var(--accent); }

/* ===== Footer — 三列图标+文字 ===== */
footer {
  padding: 2.5rem 2rem 3rem;
  border-top: 1px solid var(--border);
  margin-top: 5rem;
  position: relative; z-index: 2;
}
footer::before {
  content: ''; position: absolute;
  top: -1px; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border2), transparent);
}
.footer-grid {
  display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.footer-item {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.75rem; color: var(--text2);
}
.footer-item-icon { font-size: 1rem; opacity: 0.7; }
.footer-item-label { color: var(--text3); font-size: 0.67rem; margin-right: 0.2rem; }
.footer-bottom {
  text-align: center; color: var(--text3); font-size: 0.73rem;
  font-family: var(--mono);
}
.footer-bottom a { color: var(--text3); text-decoration: none; transition: color 0.2s; }
.footer-bottom a:hover { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 800px) {
  .abilities-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 2.1rem; }
  .hero-meta { flex-direction: column; max-width: 100%; }
  .meta-item { border-right: none; border-bottom: 1px solid var(--border); }
  .meta-item:last-child { border-bottom: none; }
  .abilities-grid { grid-template-columns: repeat(2, 1fr); }
  .lessons-grid { grid-template-columns: 1fr; }
  main { padding: 70px 1.1rem 3rem; }
  .nav-links { gap: 0.7rem; }
  .nav-links a { font-size: 0.73rem; }
  .footer-grid { gap: 1.5rem; }
}
@media (max-width: 420px) {
  .abilities-grid { grid-template-columns: 1fr; }
}
