/* =========================================================
   Todous 个人网站 · 赛博朋克风格样式
   配色：深蓝近黑背景 + 电光青蓝(#00c8ff) + 霓虹热粉渐变
   ========================================================= */

:root {
  --bg: #060914;
  --bg-alt: #0a0f1f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(0, 200, 255, 0.18);
  --cyan: #00c8ff;
  --magenta: #ff2a7a;
  --purple: #cc0066;
  --text: #e8eefc;
  --text-dim: #9fb0d0;
  --text-muted: #5f7099;
  --glow-cyan: 0 0 18px rgba(0, 200, 255, 0.45);
  --glow-magenta: 0 0 18px rgba(255, 42, 122, 0.4);
  --radius: 16px;
  --maxw: 1100px;
  --font-sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===================== 顶部导航 ===================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav--scrolled {
  background: rgba(6, 9, 20, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-border);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__logo {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem;
  letter-spacing: 1px; color: var(--text);
}
.nav__logo-dot { color: var(--cyan); text-shadow: var(--glow-cyan); }

.nav__links { display: flex; gap: 28px; }
.nav__link {
  position: relative; font-size: .95rem; color: var(--text-dim);
  transition: color .2s;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  transition: width .25s ease;
}
.nav__link:hover { color: var(--text); }
.nav__link:hover::after { width: 100%; }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none;
  cursor: pointer; padding: 6px;
}
.nav__toggle span {
  width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s;
}

/* ===================== Hero 首屏 ===================== */
.hero {
  position: relative; height: 100vh; min-height: 560px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 70% 20%, rgba(204, 0, 102, 0.22), transparent 60%),
    radial-gradient(900px 500px at 20% 80%, rgba(0, 200, 255, 0.16), transparent 60%),
    var(--bg);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(6, 9, 20, 0.4) 70%, var(--bg));
  pointer-events: none;
}
.hero__content { position: relative; z-index: 2; padding: 0 24px; }
.hero__eyebrow {
  font-family: var(--font-mono); font-weight: 700; letter-spacing: 3px;
  font-size: .85rem; margin-bottom: 12px;
  background: linear-gradient(120deg, #ffffff 10%, var(--cyan) 45%, var(--magenta) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(0, 200, 255, 0.35));
}
.hero__title {
  font-family: var(--font-mono); font-size: clamp(3.2rem, 12vw, 7rem); font-weight: 800;
  letter-spacing: 2px; line-height: 1;
  background: linear-gradient(120deg, #ffffff 10%, var(--cyan) 45%, var(--magenta) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(0, 200, 255, 0.35));
}
.hero__slogan {
  margin: 22px auto 0; max-width: 560px; color: var(--text-dim); font-size: 1.1rem;
}

/* ===================== 首屏标题加载动画 ===================== */
.hero__title { position: relative; z-index: 1; }

/* 首屏加载期间：仅显示「Welcome!」，隐藏其余内容（含标题默认文字与滚动箭头） */
html.intro-loading .hero__eyebrow,
html.intro-loading .hero__slogan,
html.intro-loading .hero__cta,
html.intro-loading .hero__scroll { opacity: 0; }
html.intro-loading .hero__title { opacity: 0; }
.hero__eyebrow, .hero__slogan, .hero__cta, .hero__scroll { transition: opacity 1s ease; }

.hero__title.is-welcome { animation: title-flash .5s ease-out both; }
.hero__title.is-pop     { animation: title-pop .45s ease-in forwards; }
.hero__title.is-todous  { animation: title-fadein 1s ease-out forwards; }

/* 金属掠过光晕：亮带放在最上层(::after)扫过文字形状（背景裁剪到文字），只播一次。 */
.hero__title.intro-shine::after {
  content: "Todous";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font: 800 clamp(3.2rem, 12vw, 7rem)/1 var(--font-mono);
  letter-spacing: 2px;
  background-image: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.9) 50%, transparent 60%);
  background-size: 250% 100%;
  background-position: 160% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: title-sheen 2s ease-out;
  z-index: 1;                 /* 最上层，从文字形上方扫过 */
  pointer-events: none;
}

/* 金属掠过时的渐变光晕：用与主文字「完全相同」的渐变绘制放大/加粗副本，模糊后从文字边缘散出，
   颜色严格跟随 Todous 渐变（左青白→右粉）。仅在 .is-glow（JS 在掠过时添加）时出现。
   回退：reduced-motion / JS 未执行时不进入 runIntro → 无 .is-glow，光晕永久隐藏（opacity:0）。 */
.hero__title::before {
  content: "Todous";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(1.02);
  font: 800 clamp(3.2rem, 12vw, 7rem)/1 var(--font-mono);
  letter-spacing: 2px;
  background: linear-gradient(120deg, #ffffff 10%, var(--cyan) 45%, var(--magenta) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  -webkit-text-stroke: 8px transparent;   /* 加粗，粗出部分显示渐变色 → 光晕来源 */
  filter: blur(5px);                        /* 更聚拢的柔光晕，围绕文字形状 */
  opacity: 0;
  z-index: -1;                              /* 主文字之下，光晕仅从边缘散出 */
  pointer-events: none;
  transition: opacity .35s ease;
}
.hero__title.is-glow::before { opacity: 1; }

@keyframes title-flash {
  0%   { opacity: 0; transform: scale(.96); filter: brightness(2.2); }
  35%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}
@keyframes title-pop {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25); }
}
@keyframes title-fadein {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes title-sheen {
  0%   { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}
.hero__cta { margin-top: 34px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 26px; height: 42px; border: 2px solid var(--text-muted); border-radius: 14px;
  display: flex; justify-content: center;
}
.hero__scroll-arrow {
  width: 4px; height: 8px; margin-top: 7px; border-radius: 2px; background: var(--cyan);
  box-shadow: var(--glow-cyan);
  animation: scroll-bounce 1.6s infinite;
}
@keyframes scroll-bounce { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(10px); opacity: .3; } }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; cursor: pointer; transition: transform .2s, box-shadow .2s;
  border: 1px solid transparent;
}
.btn--primary {
  background:
    linear-gradient(120deg, var(--cyan), var(--magenta)) padding-box,
    linear-gradient(120deg, var(--cyan), var(--magenta)) border-box;
  color: #04121a;
  box-shadow: var(--glow-cyan), 0 0 22px rgba(255, 42, 122, 0.35);
}
.btn--ghost { border-color: var(--surface-border); color: var(--text); }
.btn:hover { transform: translateY(-2px); }
.btn--primary:hover { box-shadow: 0 0 28px rgba(0, 200, 255, 0.6), 0 0 30px rgba(255, 42, 122, 0.45); }
.btn--ghost:hover { border-color: var(--cyan); box-shadow: var(--glow-cyan); }

/* ===================== 点击粒子迸发 ===================== */
#click-particles {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 9999;
}

/* ===================== 通用区块 ===================== */
.section { padding: 100px 0; }
.section--alt { background: var(--bg-alt); }
.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; text-align: center;
  margin-bottom: 12px; position: relative; display: inline-block; left: 50%; transform: translateX(-50%);
}
.section__title::after {
  content: ""; display: block; width: 56px; height: 3px; margin: 14px auto 0;
  background: linear-gradient(90deg, var(--cyan), var(--magenta)); border-radius: 3px;
  box-shadow: var(--glow-cyan);
}
.section__sub { text-align: center; color: var(--text-dim); margin: 10px 0 40px; }

/* ===================== About ===================== */
.about { display: flex; gap: 48px; align-items: center; flex-wrap: wrap; justify-content: center; }
.about__avatar { flex: 0 0 auto; }
.avatar-placeholder, .card__cover {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); color: var(--text-dim);
  background: linear-gradient(135deg, rgba(0,200,255,.12), rgba(255,42,122,.12));
  border: 1px solid var(--surface-border);
}
.avatar-placeholder {
  width: 180px; height: 180px; border-radius: 50%; font-size: 1rem;
  box-shadow: var(--glow-cyan);
}
.avatar-img {
  width: 180px; height: 180px; border-radius: 50%;
  object-fit: cover; object-position: center;
  display: block; box-shadow: var(--glow-cyan);
  border: 2px solid rgba(0, 200, 255, 0.5);
}
.about__body { flex: 1 1 360px; max-width: 560px; }
.about__bio { color: var(--text-dim); font-size: 1.05rem; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.tag {
  font-family: var(--font-mono); font-size: .82rem; padding: 6px 14px;
  border: 1px solid var(--surface-border); border-radius: 999px;
  color: var(--cyan); background: rgba(0, 200, 255, 0.06);
}

/* ===================== 卡片网格 ===================== */
.cards-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  display: block; position: relative; padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(8px);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); padding: 1px;
  background: linear-gradient(120deg, var(--cyan), transparent 40%, transparent 60%, var(--magenta));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 36px rgba(0, 200, 255, 0.18); border-color: transparent; }
.card:hover::before { opacity: 1; }

.card__cover {
  height: 130px; border-radius: 12px; margin-bottom: 14px; font-size: .9rem;
  background:
    repeating-linear-gradient(45deg, rgba(0,200,255,.06) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, rgba(0,200,255,.12), rgba(204,0,102,.14));
}
.card__meta { font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); margin-bottom: 6px; }
.card__title { font-size: 1.12rem; margin-bottom: 8px; }
.card__summary { color: var(--text-dim); font-size: .92rem; }
.card__more { display: inline-block; margin-top: 12px; color: var(--cyan); font-size: .88rem; font-weight: 600; }
.rating { display: block; margin-top: 12px; color: var(--magenta); font-family: var(--font-mono); font-size: .85rem; }

/* ===================== 文章详情页 ===================== */
.article { padding-top: 120px; }
.article__back {
  display: inline-block; margin-bottom: 22px;
  font-family: var(--font-mono); font-size: .85rem; color: var(--cyan);
  transition: transform .2s, color .2s;
}
.article__back:hover { color: var(--magenta); transform: translateX(-3px); }
.article__cover {
  height: 220px; border-radius: 16px; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); color: var(--text-dim); font-size: 1rem;
  background:
    repeating-linear-gradient(45deg, rgba(0,200,255,.06) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, rgba(0,200,255,.12), rgba(204,0,102,.14));
  border: 1px solid var(--surface-border);
}
.article__meta { font-family: var(--font-mono); font-size: .82rem; color: var(--text-muted); margin-bottom: 8px; }
.article__title {
  font-family: var(--font-mono); font-weight: 700; line-height: 1.2;
  font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 24px;
  background: linear-gradient(120deg, #ffffff 10%, var(--cyan) 45%, var(--magenta) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.article__body { color: var(--text-dim); font-size: 1.05rem; line-height: 1.9; max-width: 760px; }
.article__body p { margin-bottom: 18px; }
.article__body h2 { color: var(--text); font-size: 1.4rem; margin: 32px 0 14px; }
.article__body h3 { color: var(--text); font-size: 1.2rem; margin: 26px 0 12px; }
.article__body a { color: var(--cyan); text-decoration: underline; }
.article__body img { max-width: 100%; border-radius: 12px; margin: 18px 0; border: 1px solid var(--surface-border); }
.article__body pre {
  background: rgba(0,0,0,.35); border: 1px solid var(--surface-border);
  border-radius: 12px; padding: 16px; overflow-x: auto; margin: 18px 0;
}
.article__body code { font-family: var(--font-mono); font-size: .9rem; color: var(--cyan); }
.article__body pre code { color: var(--text); }
.article__body blockquote {
  border-left: 3px solid var(--cyan); padding: 6px 18px; margin: 18px 0;
  color: var(--text); background: rgba(0,200,255,.05);
}

/* ===================== 兴趣 Tab ===================== */
.tabs { display: flex; gap: 12px; justify-content: center; margin-bottom: 36px; }
.tab {
  padding: 10px 26px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--surface-border);
  color: var(--text-dim); font-size: .95rem; transition: .2s;
}
.tab--active {
  color: #04121a; font-weight: 700;
  background:
    linear-gradient(120deg, var(--cyan), var(--magenta)) padding-box,
    linear-gradient(120deg, var(--cyan), var(--magenta)) border-box;
  box-shadow: var(--glow-cyan), 0 0 22px rgba(255, 42, 122, 0.35);
  border-color: transparent;
}
.tab-panel { display: none; }
.tab-panel--active { display: block; animation: fade-in .4s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ===================== 社交 ===================== */
.socials { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; align-items: stretch; }
.social {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 108px; min-height: 100px; padding: 16px 0; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--surface-border);
  color: var(--text-dim); transition: .25s; text-decoration: none;
}
.social:hover { color: var(--cyan); transform: translateY(-4px); box-shadow: var(--glow-cyan); border-color: transparent; }
.social svg { width: 26px; height: 26px; }
.social span { font-size: .88rem; }
.social__hint {
  display: block; margin-top: 0;
  font-family: var(--font-mono); font-size: .6rem; line-height: 1;
  color: var(--text-dim);
}

/* ===================== Footer ===================== */
.footer { padding: 40px 0; text-align: center; border-top: 1px solid var(--surface-border); background: var(--bg-alt); }
.footer__text { font-size: .9rem; color: var(--text-dim); }
.footer__text--muted { color: var(--text-muted); margin-top: 6px; font-family: var(--font-mono); font-size: .8rem; }

/* ===================== 滚动淡入 ===================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 2.2s ease, transform 2.2s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ===================== 响应式 ===================== */
@media (max-width: 768px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; gap: 0; padding: 8px 24px 16px;
    background: rgba(6, 9, 20, 0.96); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--surface-border);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .25s;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__link { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
  .nav__link::after { display: none; }
  .section { padding: 72px 0; }
  .about { gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
