/* ==========================================================================
   duasweb · 暗色科技风个人主页
   设计原则：深色为主 · 少量亮色点缀 · 简约清晰
   ========================================================================== */

/* ---------- 变量与重置 ---------- */
:root {
  --bg: #0a0e14;
  --bg-alt: #111722;
  --bg-card: #131a27;
  --border: #1c2534;
  --text: #e6edf3;
  --text-dim: #8b98a9;
  --accent: #38bdf8;
  --accent-alt: #a78bfa;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow-glow: 0 0 24px rgba(56, 189, 248, 0.25);
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- 通用布局 ---------- */
.container {
  width: min(1120px, 90%);
  margin-inline: auto;
}

.section {
  padding: 5rem 0;
}

.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section__subtitle {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.section__title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.section__title-accent {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 1.2rem;
}

.section__lead {
  color: var(--text-dim);
  max-width: 56ch;
  margin-bottom: 2.5rem;
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  background: transparent;
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(10, 14, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}

.navbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.navbar__logo span {
  color: var(--accent);
}

.navbar__menu {
  display: flex;
  gap: 2rem;
}

.navbar__link {
  font-size: 0.95rem;
  color: var(--text-dim);
  transition: color 0.25s ease;
  position: relative;
  padding: 0.25rem 0;
}

.navbar__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.navbar__link:hover {
  color: var(--text);
}

.navbar__link:hover::after {
  width: 100%;
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.navbar__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.navbar__toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar__toggle.open span:nth-child(2) {
  opacity: 0;
}
.navbar__toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: var(--nav-h) 0 4rem;
}

/* 科技感网格 + 光斑背景 */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 100%);
  pointer-events: none;
}

.hero__bg::before,
.hero__bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
}

.hero__bg::before {
  width: 420px;
  height: 420px;
  background: var(--accent);
  top: -120px;
  right: -80px;
  animation: float 9s ease-in-out infinite;
}

.hero__bg::after {
  width: 360px;
  height: 360px;
  background: var(--accent-alt);
  bottom: -140px;
  left: -60px;
  animation: float 12s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(24px, 20px); }
}

.hero__inner {
  position: relative;
  z-index: 1;
}

.hero__tag {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.hero__name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.hero__name-accent {
  color: var(--accent);
}

.hero__role {
  font-family: var(--mono);
  color: var(--accent-alt);
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 1.5rem;
}

.hero__desc {
  color: var(--text-dim);
  max-width: 58ch;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.hero__meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-family: var(--mono);
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn--primary {
  background: var(--accent);
  color: #06121a;
}

.btn--primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- 项目卡片 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: var(--shadow-glow);
}

.card__media {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--text-dim);
  background:
    linear-gradient(rgba(56, 189, 248, 0.06), rgba(167, 139, 250, 0.06));
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.25rem;
}

/* 精选项目卡片（nextster） */
.card--featured {
  position: relative;
  border-image: linear-gradient(135deg, var(--accent), var(--accent-alt)) 1;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(167, 139, 250, 0.4)) border-box;
}

.card__media-bar {
  color: var(--accent);
  margin-inline: 0.4rem;
  animation: blink 1.2s steps(2, start) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.card__badge {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.card__link {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  transition: letter-spacing 0.25s ease;
}

.card__link:hover {
  letter-spacing: 0.08em;
}

.card__title {
  font-size: 1.05rem;
  font-weight: 600;
}

.card__desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  flex: 1;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
}

/* ---------- 技能 ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.skill-group__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.skill {
  margin-bottom: 1.25rem;
}

.skill__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.skill__value {
  font-family: var(--mono);
  color: var(--accent);
}

.skill__bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.skill__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-alt));
  transition: width 1.2s cubic-bezier(0.25, 1, 0.4, 1);
}

/* ---------- 联系 ---------- */
.contact__inner {
  text-align: center;
}

.contact__inner .section__subtitle,
.contact__inner .section__lead {
  margin-inline: auto;
}

.contact__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer__social {
  display: flex;
  gap: 0.75rem;
}

.footer__social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.8rem;
  transition: all 0.25s ease;
}

.footer__social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ---------- 回到顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s ease;
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* ---------- 滚动渐显 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   响应式适配
   ========================================================================== */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .section {
    padding: 3.5rem 0;
  }

  /* 移动端导航抽屉 */
  .navbar__toggle {
    display: flex;
  }

  .navbar__menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 14, 20, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .navbar__menu.open {
    max-height: 320px;
  }

  .navbar__link {
    padding: 1rem 5%;
    border-bottom: 1px solid var(--border);
  }

  .navbar__link::after {
    display: none;
  }

  .navbar__link:hover {
    background: rgba(56, 189, 248, 0.06);
    color: var(--accent);
  }

  .grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero__actions,
  .contact__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    text-align: center;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- 减少动态：无障碍偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   resume.html · 个人详细介绍页
   ========================================================================== */
.bio-hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 2rem) 0 3rem;
  overflow: hidden;
}

.bio-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 30%, transparent 100%);
  pointer-events: none;
}

.bio-hero__bg::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  background: var(--accent);
  top: -120px;
  right: -60px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  animation: float 10s ease-in-out infinite;
}

.bio-hero__inner {
  position: relative;
  z-index: 1;
}

.bio-hero__tag {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.bio-hero__name {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.bio-hero__name-accent {
  color: var(--accent);
}

.bio-hero__role {
  font-family: var(--mono);
  color: var(--accent-alt);
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin-bottom: 1.5rem;
}

.bio-hero__lead {
  color: var(--text-dim);
  max-width: 62ch;
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.bio-hero__meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 1.75rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.bio-hero__meta a {
  color: var(--accent);
  transition: color 0.25s ease;
}

.bio-hero__meta a:hover {
  color: var(--text);
}

/* 简历区块与面板 */
.r-section {
  padding: 4rem 0;
}

.r-section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.skill-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: var(--shadow-glow);
}

.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
}

.panel__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.panel__meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.panel__text {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 0.6rem;
  line-height: 1.75;
}

.panel__text strong {
  color: var(--text);
}

.panel__list {
  list-style: none;
  margin: 0.75rem 0 0;
}

.panel__list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.panel__list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
}

.panel__list strong {
  color: var(--text);
}

.panel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.25rem;
}

.panel__result {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.06);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.9rem;
}

.panel__label {
  font-family: var(--mono);
  color: var(--accent-alt);
  margin-right: 0.5rem;
}

.honor-list {
  list-style: none;
}

.honor {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.honor strong {
  color: var(--text);
}

@media (min-width: 768px) {
  .skill-groups {
    grid-template-columns: repeat(2, 1fr);
  }
}