/* 基础变量 */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a25;
  --bg-card-hover: #22222f;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #ff3333;
  --accent-glow: rgba(255, 51, 51, 0.3);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --max-width: 1700px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 60px;
}

/* 导航栏 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
  padding: 15px 0;
  background: rgba(10, 10, 15, 0.95);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
}

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

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  padding: 10px 24px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.85rem;
  transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

/* Hero 全屏首页 */
.hero {
  position: relative;
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0a0a0a;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

#ferrofluid-canvas,
#dotfield-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-subtitle {
  position: absolute;
  top: calc(50% - 160px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.hero-subtitle span {
  display: inline-block;
  padding: 8px 25px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 0.8rem;
  color: #808080;
  letter-spacing: 2px;
}

.hero-title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: 100%;
  text-align: center;
  z-index: 1;
}

.hero-desc {
  position: absolute;
  top: calc(50% + 120px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 0.95rem;
  color: #808080;
  letter-spacing: 1px;
  white-space: nowrap;
}

.title-giant {
  display: block;
  font-size: clamp(2.5rem, 10vw, 12rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #ff3333;
  text-transform: uppercase;
  line-height: 0.85;
  white-space: nowrap;
}

.hero-left-info {
  position: absolute;
  left: 60px;
  bottom: 180px;
  z-index: 2;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
}

.stat-icon {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 4px;
  margin-bottom: 15px;
}

.stat-number {
  font-size: 5rem;
  font-weight: 900;
  color: #ff3333;
  line-height: 1;
}

.stat-text {
  font-size: 1rem;
  color: #cccccc;
  margin-top: 10px;
}

.btn-primary {
  padding: 18px 50px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.btn-primary:hover {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 0 30px var(--accent-glow);
}

.hero-right-slogan {
  position: absolute;
  right: 60px;
  bottom: 100px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
}

.slogan-icon {
  font-size: 4rem;
  font-weight: 900;
  color: #ffffff;
}

.slogan-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ff3333;
  line-height: 1.3;
  text-transform: uppercase;
}

.hero-bottom-label {
  position: absolute;
  bottom: 30px;
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.hero-bottom-label span {
  font-size: 0.75rem;
  color: #666666;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.btn-secondary {
  padding: 14px 36px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.95rem;
  border-radius: 4px;
  transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(255, 51, 51, 0.1);
  color: var(--accent);
}

/* 通用区块标题 */
.section-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* 个人经历模块 */
.about {
  padding: 160px 0;
  background: var(--bg-secondary);
  overflow: visible;
  contain: layout style;
}

.about-card {
  background: var(--bg-card);
}

.about-card .border-glow-inner {
  padding: 40px;
  display: block;
}

.about-header {
  margin-bottom: 60px;
}

.about-header .section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.about-header .arrow-down {
  color: var(--accent);
  margin-left: 10px;
}

.about-header .section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 80px;
  align-items: start;
}

.about-image {
  position: relative;
}

.image-wrapper {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0a0f;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a25 0%, #0a0a0f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.about-label {
  display: block;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.about-name {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.about-intro {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 30px;
}

.about-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.info-value {
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 50px 0;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 精选项目模块 */
.works {
  padding: 160px 0;
  overflow: visible;
  contain: layout style;
}

.works .section-title,
.works .section-subtitle {
  text-align: center;
}

.works .section-subtitle {
  margin-bottom: 80px;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.work-card {
  position: relative;
  background: var(--bg-card);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  cursor: pointer;
  will-change: transform;
}

.work-card:hover {
  transform: translateY(-5px);
}

.work-card.large {
  grid-column: span 2;
}

.work-image {
  width: 100%;
  position: relative;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.work-image img {
  width: 100%;
  height: auto;
  display: block;
}

.work-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.work-info {
  padding: 24px;
}

.work-category {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.work-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 10px 0;
}

.work-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 个人优势模块 */
.skills {
  padding: 160px 0;
  background: var(--bg-secondary);
  overflow: visible;
  contain: layout style;
}

.skills .section-title,
.skills .section-subtitle {
  text-align: center;
}

.skills .section-subtitle {
  margin-bottom: 80px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.skill-card {
  padding: 40px;
  background: var(--bg-card);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  color: var(--accent);
}

.skill-icon svg {
  width: 100%;
  height: 100%;
}

.skill-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.skill-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* 底部联系方式模块 */
.contact {
  padding: 160px 0 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
}

.contact-content {
  text-align: center;
  margin-bottom: auto;
}

.contact-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 15px;
}

.contact-subtitle {
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 30px;
}

.contact-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 60px;
}

.contact-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 900px;
  margin: 0 auto 60px;
}

.contact-link {
  text-decoration: none;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-link:hover {
  transform: translateY(-5px);
}

.contact-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 40px 30px;
}

.contact-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.contact-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  font-weight: 500;
}

.contact-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 400;
}

.qr-code {
  width: 140px;
  height: 140px;
  background: #ffffff;
  border-radius: 8px;
  padding: 10px;
}

.qr-code img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contact-desc-sm {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-social {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.social-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover {
  color: var(--accent);
}

.footer {
  padding: 30px 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer p {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 响应式 */
@media (max-width: 1200px) {
  .container {
    padding: 0 40px;
  }

  .nav-container {
    padding: 0 40px;
  }

  .about-grid {
    gap: 60px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .container {
    padding: 0 24px;
  }

  .nav-container {
    padding: 0 24px;
  }

  .nav-links {
    display: none;
  }

  .hero-content {
    padding: 0 24px;
  }

  .title-giant {
    font-size: clamp(4rem, 15vw, 10rem);
  }

  .hero-left-info {
    left: 24px;
    bottom: 100px;
  }

  .stat-number {
    font-size: 3rem;
  }

  .hero-right-slogan {
    right: 24px;
    bottom: 60px;
  }

  .slogan-icon {
    font-size: 2rem;
  }

  .slogan-text {
    font-size: 0.9rem;
  }

  .hero-bottom-label {
    left: 24px;
    right: 24px;
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-image {
    max-width: 400px;
    margin: 0 auto;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }

  .work-card.large {
    grid-column: span 1;
  }

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

  .contact-links {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .contact-card-inner {
    padding: 30px 20px;
  }
}

/* 首屏进场动画 - 精细时序编排 */
.hero-bg {
  opacity: 0;
  animation: heroBgIn 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0s forwards;
}

@keyframes heroBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-title {
  opacity: 0;
  animation: heroTitleIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
  will-change: transform, opacity;
}

@keyframes heroTitleIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.85) translateY(20px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
    filter: blur(0px);
  }
}

.hero-subtitle {
  opacity: 0;
  animation: heroSubtitleIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
  will-change: transform, opacity;
}

@keyframes heroSubtitleIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    filter: blur(0px);
  }
}

.hero-desc {
  opacity: 0;
  animation: heroDescIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.65s forwards;
  will-change: transform, opacity;
}

@keyframes heroDescIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    filter: blur(0px);
  }
}

.hero-left-info {
  opacity: 0;
  animation: heroLeftIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
  will-change: transform, opacity;
}

@keyframes heroLeftIn {
  from {
    opacity: 0;
    transform: translateX(-40px) translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0px);
  }
}

.hero-right-slogan {
  opacity: 0;
  animation: heroRightIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards;
  will-change: transform, opacity;
}

@keyframes heroRightIn {
  from {
    opacity: 0;
    transform: translateX(40px) translateY(10px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
    filter: blur(0px);
  }
}

.hero-bottom-label {
  opacity: 0;
  animation: heroBottomIn 1s cubic-bezier(0.16, 1, 0.3, 1) 1.1s forwards;
  will-change: transform, opacity;
}

@keyframes heroBottomIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 滚动动画 */
.about,
.works,
.skills,
.contact {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.about.visible,
.works.visible,
.skills.visible,
.contact.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 卡片入场动画 */
.about-card,
.work-card,
.skill-card {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.about.visible .about-card,
.works.visible .work-card,
.skills.visible .skill-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.about-image,
.about-content {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.about.visible .about-image {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.about.visible .about-content {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.works.visible .work-card:nth-child(1) { transition-delay: 0.1s; }
.works.visible .work-card:nth-child(2) { transition-delay: 0.2s; }
.works.visible .work-card:nth-child(3) { transition-delay: 0.3s; }
.works.visible .work-card:nth-child(4) { transition-delay: 0.4s; }
.works.visible .work-card:nth-child(5) { transition-delay: 0.5s; }
.works.visible .work-card:nth-child(6) { transition-delay: 0.6s; }

.skills.visible .skill-card:nth-child(1) { transition-delay: 0.1s; }
.skills.visible .skill-card:nth-child(2) { transition-delay: 0.2s; }
.skills.visible .skill-card:nth-child(3) { transition-delay: 0.3s; }
.skills.visible .skill-card:nth-child(4) { transition-delay: 0.4s; }
.skills.visible .skill-card:nth-child(5) { transition-delay: 0.5s; }
.skills.visible .skill-card:nth-child(6) { transition-delay: 0.6s; }

/* BorderGlow 边框发光效果 */
.border-glow-card {
  --edge-proximity: 0;
  --cursor-angle: 45deg;
  --edge-sensitivity: 30;
  --color-sensitivity: calc(var(--edge-sensitivity) + 20);
  --border-radius: 28px;
  --glow-padding: 40px;
  --cone-spread: 25;

  position: relative;
  border-radius: var(--border-radius);
  isolation: isolate;
  transform: translate3d(0, 0, 0.01px);
  display: block;
  border: 1px solid rgb(255 255 255 / 15%);
  background: var(--card-bg, #120F17);
  box-shadow:
    rgba(0, 0, 0, 0.1) 0px 1px 2px,
    rgba(0, 0, 0, 0.1) 0px 2px 4px,
    rgba(0, 0, 0, 0.1) 0px 4px 8px,
    rgba(0, 0, 0, 0.1) 0px 8px 16px,
    rgba(0, 0, 0, 0.1) 0px 16px 32px,
    rgba(0, 0, 0, 0.1) 0px 32px 64px;
}

.border-glow-card::before,
.border-glow-card::after,
.border-glow-card > .edge-light {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transition: opacity 0.25s ease-out;
  z-index: -1;
}

.border-glow-card:not(:hover):not(.sweep-active)::before,
.border-glow-card:not(:hover):not(.sweep-active)::after,
.border-glow-card:not(:hover):not(.sweep-active) > .edge-light {
  opacity: 0;
  transition: opacity 0.75s ease-in-out;
}

/* colored mesh-gradient border */
.border-glow-card::before {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card-bg, #120F17) 0 100%) padding-box,
    linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box,
    var(--gradient-one, radial-gradient(at 80% 55%, hsla(268, 100%, 76%, 1) 0px, transparent 50%)) border-box,
    var(--gradient-two, radial-gradient(at 69% 34%, hsla(349, 100%, 74%, 1) 0px, transparent 50%)) border-box,
    var(--gradient-three, radial-gradient(at 8% 6%, hsla(136, 100%, 78%, 1) 0px, transparent 50%)) border-box,
    var(--gradient-four, radial-gradient(at 41% 38%, hsla(192, 100%, 64%, 1) 0px, transparent 50%)) border-box,
    var(--gradient-five, radial-gradient(at 86% 85%, hsla(186, 100%, 74%, 1) 0px, transparent 50%)) border-box,
    var(--gradient-six, radial-gradient(at 82% 18%, hsla(52, 100%, 65%, 1) 0px, transparent 50%)) border-box,
    var(--gradient-seven, radial-gradient(at 51% 4%, hsla(12, 100%, 72%, 1) 0px, transparent 50%)) border-box,
    var(--gradient-base, linear-gradient(#c299ff 0 100%)) border-box;

  opacity: calc((var(--edge-proximity) - var(--color-sensitivity)) / (100 - var(--color-sensitivity)));

  mask-image:
    conic-gradient(
      from var(--cursor-angle) at center,
      black calc(var(--cone-spread) * 1%),
      transparent calc((var(--cone-spread) + 15) * 1%),
      transparent calc((100 - var(--cone-spread) - 15) * 1%),
      black calc((100 - var(--cone-spread)) * 1%)
    );
}

/* colored mesh-gradient background fill near edges */
.border-glow-card::after {
  border: 1px solid transparent;
  background:
    var(--gradient-one, radial-gradient(at 80% 55%, hsla(268, 100%, 76%, 1) 0px, transparent 50%)) padding-box,
    var(--gradient-two, radial-gradient(at 69% 34%, hsla(349, 100%, 74%, 1) 0px, transparent 50%)) padding-box,
    var(--gradient-three, radial-gradient(at 8% 6%, hsla(136, 100%, 78%, 1) 0px, transparent 50%)) padding-box,
    var(--gradient-four, radial-gradient(at 41% 38%, hsla(192, 100%, 64%, 1) 0px, transparent 50%)) padding-box,
    var(--gradient-five, radial-gradient(at 86% 85%, hsla(186, 100%, 74%, 1) 0px, transparent 50%)) padding-box,
    var(--gradient-six, radial-gradient(at 82% 18%, hsla(52, 100%, 65%, 1) 0px, transparent 50%)) padding-box,
    var(--gradient-seven, radial-gradient(at 51% 4%, hsla(12, 100%, 72%, 1) 0px, transparent 50%)) padding-box,
    var(--gradient-base, linear-gradient(#c299ff 0 100%)) padding-box;

  mask-image:
    linear-gradient(to bottom, black, black),
    radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%),
    radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%),
    radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%),
    radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%),
    radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%),
    conic-gradient(from var(--cursor-angle) at center, transparent 5%, black 15%, black 85%, transparent 95%);

  mask-composite: subtract, add, add, add, add, add;
  opacity: calc(var(--fill-opacity, 0.5) * (var(--edge-proximity) - var(--color-sensitivity)) / (100 - var(--color-sensitivity)));
  mix-blend-mode: soft-light;
}

/* outer glow layer */
.border-glow-card > .edge-light {
  inset: calc(var(--glow-padding) * -1);
  pointer-events: none;
  z-index: 1;

  mask-image:
    conic-gradient(
      from var(--cursor-angle) at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%
    );

  opacity: calc((var(--edge-proximity) - var(--edge-sensitivity)) / (100 - var(--edge-sensitivity)));
  mix-blend-mode: plus-lighter;
}

.border-glow-card > .edge-light::before {
  content: "";
  position: absolute;
  inset: var(--glow-padding);
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px var(--glow-color, hsl(40deg 80% 80% / 100%)),
    inset 0 0 1px 0 var(--glow-color-60, hsl(40deg 80% 80% / 60%)),
    inset 0 0 3px 0 var(--glow-color-50, hsl(40deg 80% 80% / 50%)),
    inset 0 0 6px 0 var(--glow-color-40, hsl(40deg 80% 80% / 40%)),
    inset 0 0 15px 0 var(--glow-color-30, hsl(40deg 80% 80% / 30%)),
    inset 0 0 25px 2px var(--glow-color-20, hsl(40deg 80% 80% / 20%)),
    inset 0 0 50px 2px var(--glow-color-10, hsl(40deg 80% 80% / 10%)),
    0 0 1px 0 var(--glow-color-60, hsl(40deg 80% 80% / 60%)),
    0 0 3px 0 var(--glow-color-50, hsl(40deg 80% 80% / 50%)),
    0 0 6px 0 var(--glow-color-40, hsl(40deg 80% 80% / 40%)),
    0 0 15px 0 var(--glow-color-30, hsl(40deg 80% 80% / 30%)),
    0 0 25px 2px var(--glow-color-20, hsl(40deg 80% 80% / 20%)),
    0 0 50px 2px var(--glow-color-10, hsl(40deg 80% 80% / 10%));
}

.border-glow-inner {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* 灯箱样式 */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  position: relative;
  width: 90%;
  max-width: 1100px;
  max-height: 85vh;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 28px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-back {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s ease;
  backdrop-filter: blur(10px);
}

.lightbox-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-back svg {
  width: 18px;
  height: 18px;
}

.lightbox-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 80px 60px 60px;
  overflow-y: auto;
  max-height: 85vh;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.lightbox-body::-webkit-scrollbar {
  display: none;
}

.lightbox-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  will-change: transform;
}

.lightbox-item:hover {
  transform: scale(1.03);
}

.lightbox-item span {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.lightbox-item-arrow {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 51, 51, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox-item:hover .lightbox-item-arrow {
  opacity: 1;
  transform: scale(1);
}

.lightbox-item-arrow svg {
  width: 18px;
  height: 18px;
  color: white;
}

@media (max-width: 768px) {
  .lightbox-body {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 16px;
  }

  .lightbox-item {
    aspect-ratio: 4/3;
    border-radius: 16px;
  }
}

/* 详情弹窗 */
.detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.detail-modal.active {
  opacity: 1;
  visibility: visible;
}

.detail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
}

.detail-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 85vh;
  background: #111;
  border-radius: 24px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  padding: 0;
}

.detail-modal.active .detail-content {
  transform: scale(1);
}

.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  backdrop-filter: blur(10px);
}

.detail-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.detail-back {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s ease;
  backdrop-filter: blur(10px);
}

.detail-back:hover {
  background: rgba(255, 255, 255, 0.2);
}

.detail-back svg {
  width: 16px;
  height: 16px;
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 60px 20px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 85vh;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: 24px;
}

.detail-body::-webkit-scrollbar {
  display: none;
}

.detail-item {
  width: 100%;
  background: #1a1a1a;
}

.detail-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.detail-item span {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
  .detail-content {
    width: 95%;
    max-height: 90vh;
  }

  .detail-body {
    padding: 50px 16px 16px;
    gap: 8px;
  }

  .detail-item {
    min-height: 300px;
    border-radius: 10px;
  }
}
