/* ═══════════════════════════════════════
   个人名片 — 暗夜糖果主题
   ═══════════════════════════════════════ */

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: #0f0f23;
  color: #e0e0e0;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Selection & Scrollbar ── */
::selection {
  background: rgba(255, 107, 157, 0.35);
  color: #fff;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0f0f23;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  border: 2px solid #0f0f23;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── Aurora Background Blobs ── */
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

body::before {
  width: 60vmax;
  height: 60vmax;
  top: -20vmax;
  left: -15vmax;
  background: radial-gradient(circle, rgba(132, 94, 247, 0.16), transparent 65%);
  animation: aurora-drift-1 26s ease-in-out infinite alternate;
}

body::after {
  width: 50vmax;
  height: 50vmax;
  bottom: -18vmax;
  right: -12vmax;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.12), transparent 65%);
  animation: aurora-drift-2 32s ease-in-out infinite alternate;
}

@keyframes aurora-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(9vmax, 6vmax) scale(1.15); }
}

@keyframes aurora-drift-2 {
  from { transform: translate(0, 0) scale(1.1); }
  to   { transform: translate(-8vmax, -5vmax) scale(0.95); }
}

/* ── Color Variables ── */
:root {
  --pink: #ff6b9d;
  --purple: #845ef7;
  --green: #00d4aa;
  --yellow: #ffd93d;
  --bg: #0f0f23;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e0e0e0;
  --text-secondary: #888;
  --glow-pink: rgba(255, 107, 157, 0.4);
  --glow-purple: rgba(132, 94, 247, 0.4);
  --glow-green: rgba(0, 212, 170, 0.4);
}

/* ── ═══ Hero Section ═══ ── */
#hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
}

/* OC 头像 */
.oc-frame {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 30px var(--glow-purple);
}

.oc-frame::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  z-index: -1;
  background: conic-gradient(from 0deg, var(--pink), var(--purple), var(--green), var(--yellow), var(--pink));
  animation: ring-spin 8s linear infinite;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

.oc-frame svg,
.oc-frame .oc-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 60px;
}


.hero-name {
  font-size: clamp(32px, 7vw, 52px);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--green), var(--pink));
  background-size: 400% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: name-flow 8s linear infinite;
}

@keyframes name-flow {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-name {
    background: none;
    color: #fff;
    animation: none;
  }
}

.hero-title {
  font-size: clamp(16px, 3.5vw, 22px);
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}

.hero-slogan {
  font-size: clamp(14px, 2.5vw, 18px);
  color: var(--pink);
  letter-spacing: 0.1em;
  opacity: 0.85;
}

/* Scroll Hint */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.scroll-arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  opacity: 0.5;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ── ═══ Content Sections ═══ ── */
.content-section {
  padding: 16px 16px 0;
  max-width: 520px;
  margin: 0 auto;
}

/* ── ═══ Cards ═══ ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 16px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 30px rgba(132, 94, 247, 0.06);
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon {
  font-size: 22px;
}

/* ── About ── */
.about-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.8;
  letter-spacing: 0.02em;
}

/* ── ═══ Social Links — Bento Grid ═══ ── */
.social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "gh gh x dy"
    "gh gh hf hf";
  gap: 12px;
}

.social-icon {
  /* --brand: RGB 分量，供图标着色/光晕/描边复用 */
  --brand: 255, 255, 255;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background:
    radial-gradient(120% 100% at 50% 115%, rgba(var(--brand), 0.10), transparent 62%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
}

.social-icon--github {
  --brand: 255, 255, 255;
  grid-area: gh;
  gap: 6px;
  padding: 24px 20px;
}

.social-icon--x {
  --brand: 29, 155, 240;
  grid-area: x;
}

.social-icon--douyin {
  --brand: 254, 44, 85;
  grid-area: dy;
}

.social-icon--hf {
  --brand: 255, 210, 30;
  grid-area: hf;
  flex-direction: row;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px 20px;
}

.social-icon svg {
  display: block;
  width: 30px;
  height: 30px;
  color: rgb(var(--brand));
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.social-icon--github svg {
  width: 46px;
  height: 46px;
  margin-bottom: 6px;
}

.social-icon--hf svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.social-icon .social-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
  position: relative;
  z-index: 1;
}

.social-icon--github .social-name {
  font-size: 17px;
}

.social-icon .social-handle {
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.social-icon .social-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.social-icon--hf .social-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

/* 常亮品牌光晕（呼吸） */
.social-icon::after {
  content: '';
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -55%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(50% 55% at 50% 60%, rgba(var(--brand), 0.18), transparent 70%);
  animation: brand-breathe 4.5s ease-in-out infinite alternate;
  pointer-events: none;
}

.social-icon--x::after { animation-delay: -1.1s; }
.social-icon--douyin::after { animation-delay: -2.2s; }
.social-icon--hf::after { animation-delay: -3.3s; }

@keyframes brand-breathe {
  from { opacity: 0.45; }
  to   { opacity: 1; }
}

/* 扫光 */
.social-icon::before {
  content: '';
  position: absolute;
  top: -70%;
  bottom: -70%;
  left: 0;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.13), transparent);
  transform: translateX(-160%) skewX(-18deg);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.social-icon:hover::before {
  transform: translateX(340%) skewX(-18deg);
}

.social-icon:hover {
  border-color: rgba(var(--brand), 0.55);
  box-shadow: 0 0 22px rgba(var(--brand), 0.22), 0 0 44px rgba(var(--brand), 0.1);
}

.social-icon:hover svg {
  transform: scale(1.12);
}

/* ── ═══ Project Grid ═══ ── */
.project-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-item {
  position: relative;
  display: block;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
}

.project-item:hover {
  border-color: var(--green);
  box-shadow: 0 0 20px var(--glow-green);
  background: rgba(0, 212, 170, 0.04);
}

a.project-item:hover {
  transform: translateY(-2px);
}

a.project-item::after {
  content: '↗';
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 14px;
  color: var(--text-secondary);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
  pointer-events: none;
}

a.project-item:hover::after {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--green);
}

.project-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}

.project-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.project-desc code {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 12px;
  color: var(--pink);
  background: rgba(255, 107, 157, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
}

/* ── Project Tags ── */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  font-size: 11px;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.03em;
}

.tag:first-child {
  color: var(--green);
  border-color: rgba(0, 212, 170, 0.35);
  background: rgba(0, 212, 170, 0.06);
}

/* ── ═══ Contact ═══ ── */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.contact-icon {
  font-size: 20px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.contact-value {
  color: var(--text);
  letter-spacing: 0.02em;
  word-break: break-all;
}

/* vCard Button */
.vcard-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  border: 1px solid var(--pink);
  background: rgba(255, 107, 157, 0.1);
  color: var(--pink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  width: 100%;
  justify-content: center;
}

.vcard-btn:hover {
  background: rgba(255, 107, 157, 0.2);
  box-shadow: 0 0 25px var(--glow-pink);
  transform: translateY(-1px);
}

.vcard-btn:active {
  transform: translateY(0);
}

/* ── ═══ Footer ═══ ── */
.site-footer {
  text-align: center;
  padding: 32px 16px 40px;
}

.footer-text {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.heart {
  color: var(--pink);
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ── ═══ Fade-in Animations ═══ ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── ═══ Responsive ── */
@media (min-width: 768px) {
  .content-section {
    padding: 24px 24px 0;
    max-width: 640px;
  }

  .card {
    padding: 32px 28px;
    border-radius: 20px;
  }

  .project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .project-item:last-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .content-section {
    max-width: 720px;
  }
}

/* ── ═══ Reduced Motion ═══ ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ── Bento: 窄屏堆叠布局 ── */
@media (max-width: 600px) {
  .social-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-areas:
      "gh gh"
      "x dy"
      "hf hf";
    gap: 10px;
  }

  .social-icon {
    padding: 16px 12px;
  }

  .social-icon--github {
    padding: 20px 16px;
  }

  .social-icon--github svg {
    width: 40px;
    height: 40px;
  }

  .social-icon--hf {
    padding: 14px 16px;
  }
}
