/* ============================================================
   豪K · 个人主页
   深色玻璃拟态 / 纯手写 CSS / 无外部依赖
   ============================================================ */

:root {
  --bg: #06060b;
  --ink: #eceef6;
  --ink-2: #b9bfd4;
  --muted: #8b91a8;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --card: rgba(255, 255, 255, .035);
  --card-hover: rgba(255, 255, 255, .055);
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --radius: 22px;
  --max: 1060px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 背景光斑 ---------- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  opacity: .55;
}
.orb-a {
  width: 560px; height: 560px;
  background: radial-gradient(circle, #6d4bff 0%, transparent 68%);
  top: -240px; left: -160px;
}
.orb-b {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #0e7490 0%, transparent 68%);
  top: 28%; right: -220px;
  opacity: .45;
}
.orb-c {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #9d174d 0%, transparent 70%);
  bottom: -200px; left: 32%;
  opacity: .32;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  /* 背景通栏，内容与正文同宽对齐 */
  padding: 16px max(28px, calc((100vw - var(--max)) / 2));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: linear-gradient(to bottom, rgba(6, 6, 11, .82), rgba(6, 6, 11, .35));
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: .01em;
}
.brand-dot {
  width: 9px; height: 9px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 0 14px rgba(139, 92, 246, .8);
}

.nav {
  display: flex;
  gap: 26px;
  font-size: 14.5px;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color .22s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s ease;
}
.nav a:hover,
.nav a.active { color: var(--ink); }
.nav a:hover::after,
.nav a.active::after { transform: scaleX(1); }

/* ---------- 通用 ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px 100px;
}

.grad {
  background: linear-gradient(100deg, #a78bfa 0%, #67e8f9 55%, #f9a8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dim { color: var(--muted); font-size: 13.5px; }

/* ---------- 首屏 ---------- */
.hero {
  padding: 88px 0 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 26px;
  padding: 7px 15px 7px 12px;
  font-size: 13px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

h1 {
  margin: 0 0 26px;
  font-size: clamp(34px, 6.2vw, 62px);
  line-height: 1.18;
  letter-spacing: -.03em;
  font-weight: 700;
}

.lead {
  max-width: 620px;
  margin: 0 0 36px;
  font-size: 17px;
  color: var(--ink-2);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 60px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
}
.btn-primary {
  color: #0b0b13;
  background: linear-gradient(120deg, #c4b5fd, #a5f3fc);
  box-shadow: 0 10px 30px -12px rgba(139, 92, 246, .85);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -14px rgba(139, 92, 246, 1);
}
.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--line-2);
  background: var(--card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats > div {
  padding: 22px 0;
}
.stats > div + div {
  border-left: 1px solid var(--line);
  padding-left: 26px;
}
.stats dt {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.stats dd {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
}

/* ---------- 章节 ---------- */
.section {
  padding: 76px 0 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 30px;
}
.section-no {
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--violet);
  letter-spacing: .12em;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(23px, 3.2vw, 30px);
  letter-spacing: -.02em;
  font-weight: 650;
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset,
              0 24px 50px -30px rgba(0, 0, 0, .9);
}

/* ---------- 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
  align-items: start;
}

.prose p {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 15.5px;
}
.prose p:last-child { margin-bottom: 0; }

.facts h3 {
  margin: 0 0 18px;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.facts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  padding-bottom: 13px;
  border-bottom: 1px dashed rgba(255, 255, 255, .07);
}
.facts li:last-child { border-bottom: 0; padding-bottom: 0; }
.facts span { color: var(--muted); }
.facts strong { font-weight: 600; }

/* ---------- 技能 ---------- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.skill h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 650;
}
.skill p {
  margin: 0 0 18px;
  font-size: 14.5px;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags span {
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
}

/* ---------- 作品 ---------- */
.work-list {
  display: grid;
  gap: 16px;
}
.work {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  transition: transform .28s ease, border-color .28s ease, background .28s ease;
}
.work:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  background: var(--card-hover);
}
.work-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.pill {
  font-size: 12px;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 999px;
  color: #ddd6fe;
  background: rgba(139, 92, 246, .16);
  border: 1px solid rgba(139, 92, 246, .32);
}
.work h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.work p {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 56ch;
}
.work-link {
  flex: 0 0 auto;
  margin-top: 30px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .03);
  transition: background .2s ease, border-color .2s ease;
}
.work-link:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .3);
}

/* ---------- 联系 ---------- */
.contact-lead {
  margin: 0 0 24px;
  font-size: 16px;
  color: var(--ink-2);
  max-width: 52ch;
}
.contact-list {
  display: grid;
  gap: 10px;
}
.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.contact-item:hover {
  background: rgba(255, 255, 255, .06);
  border-color: var(--line-2);
  transform: translateX(3px);
}
.ci-label {
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ci-value {
  font-size: 14.5px;
  font-weight: 600;
  word-break: break-all;
  text-align: right;
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 34px 28px 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s cubic-bezier(.22, .61, .36, 1),
              transform .7s cubic-bezier(.22, .61, .36, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 56px; }
  .work { flex-direction: column; gap: 18px; }
  .work-link { margin-top: 0; }
}

@media (max-width: 620px) {
  main { padding: 0 18px 80px; }
  .topbar { padding: 13px 18px; }
  .nav { gap: 16px; font-size: 13.5px; }
  .card { padding: 22px; border-radius: 18px; }
  .stats { grid-template-columns: 1fr; }
  .stats > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
  }
  .section { padding: 56px 0 0; }
  .foot { padding: 28px 18px 44px; }
}

/* ---------- 无障碍 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}
