/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --radius: 0.625rem;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-handwriting: "Ma Shan Zheng", cursive;
  --background: #000000;
  --foreground: oklch(0.98 0 0);
  --card: oklch(0.12 0.03 280);
  --card-foreground: oklch(0.98 0 0);
  --primary: oklch(0.7 0.15 280);
  --primary-foreground: oklch(0.98 0 0);
  --secondary: oklch(0.15 0.03 280);
  --muted: oklch(0.15 0.03 280);
  --muted-foreground: oklch(0.7 0.05 280);
  --border: oklch(0.25 0.05 280);
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* ===== Floating Animation ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px) var(--rotation, rotate(0deg)); }
  50% { transform: translateY(-20px) var(--rotation, rotate(0deg)); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ===== Star Background ===== */
.star-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #e9d5ff, transparent),
    radial-gradient(2px 2px at 40px 70px, #fbcfe8, transparent),
    radial-gradient(1.5px 1.5px at 90px 40px, #f0abfc, transparent),
    radial-gradient(2px 2px at 160px 120px, #c084fc, transparent),
    radial-gradient(1.5px 1.5px at 230px 80px, #f0abfc, transparent),
    radial-gradient(2px 2px at 300px 150px, #e9d5ff, transparent),
    radial-gradient(1.5px 1.5px at 350px 50px, #fbcfe8, transparent),
    radial-gradient(2px 2px at 420px 180px, #f0abfc, transparent),
    radial-gradient(1.5px 1.5px at 500px 90px, #c084fc, transparent),
    radial-gradient(2px 2px at 580px 200px, #e9d5ff, transparent),
    radial-gradient(1.5px 1.5px at 120px 250px, #fbcfe8, transparent),
    radial-gradient(2px 2px at 280px 300px, #f0abfc, transparent);
  background-size: 600px 350px;
}

/* ===== Floating Planet ===== */
.floating-planet {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
  animation: float var(--duration, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  z-index: 1;
}

/* ===== Floating Text ===== */
.floating-text {
  position: absolute;
  font-family: var(--font-handwriting);
  opacity: 0.8;
  animation: float var(--duration, 7s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  z-index: 10;
}

/* ===== Profile Header ===== */
.profile-container {
  position: absolute;
  top: 33%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  text-align: center;
  z-index: 10;
}

.avatar-wrapper {
  display: inline-block;
  margin-bottom: 1.5rem;
  animation: float 6s ease-in-out infinite;
}

.avatar {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: linear-gradient(to bottom right, #a855f7, #ec4899);
  border: 4px solid rgba(192, 132, 252, 0.3);
  box-shadow: 0 0 40px rgba(192,132,252,0.5), 0 0 60px rgba(240,171,252,0.3);
  overflow: hidden;
  transition: transform 0.3s;
}

.avatar:hover {
  transform: scale(1.05);
}

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

.profile-name {
  font-family: var(--font-handwriting);
  font-size: 3.5rem;
  background: linear-gradient(to right, #d8b4fe, #f9a8d4, #e879f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(192,132,252,0.7), 0 0 50px rgba(240,171,252,0.4);
  transition: all 0.3s;
}

.profile-name:hover {
  background: linear-gradient(to right, #e9d5ff, #fbcfe8);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ===== Scroll Arrow ===== */
.scroll-arrow {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 10;
}

.scroll-arrow-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.scroll-hint {
  font-size: 0.875rem;
  color: rgba(192, 132, 252, 0.7);
  font-family: var(--font-handwriting);
  letter-spacing: 0.2em;
  opacity: 0;
  transition: opacity 0.3s;
}

.scroll-arrow:hover .scroll-hint {
  opacity: 1;
}

.scroll-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: rgba(192, 132, 252, 0.8);
  animation: bounce 2s ease-in-out infinite;
  transition: color 0.3s;
}

.scroll-arrow:hover .scroll-icon {
  color: rgba(192, 132, 252, 1);
}

/* ===== Sections ===== */
.section {
  min-height: 100vh;
  position: relative;
  z-index: 10;
  padding: 4rem 1rem;
}

.section-home {
  display: flex;
  align-items: center;
  padding-left: 2rem;
  padding-right: 2rem;
}

@media (min-width: 768px) {
  .section-home {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

@media (min-width: 1024px) {
  .section-home {
    padding-left: 6rem;
    padding-right: 6rem;
  }
}

.section-content {
  max-width: 72rem;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  background: linear-gradient(to right, #d8b4fe, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 20px rgba(192,132,252,0.5), 0 0 35px rgba(240,171,252,0.3);
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 3rem;
  }
}

/* ===== Bento Grid ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .bento-grid {
    gap: 1.5rem;
  }
}

.bento-module {
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2px solid;
  transition: all 0.3s;
  text-decoration: none;
}

.bento-module:hover {
  transform: scale(1.02) translateY(-0.25rem);
}

.bento-module:active {
  transform: scale(0.98);
}

.bento-horizontal {
  grid-column: 1 / -1;
  height: 12rem;
}

.bento-vertical {
  grid-column: span 2;
  height: 24rem;
}

.bento-square {
  grid-column: span 1;
  height: 12rem;
}

.bento-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bento-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.3), transparent);
}

.bento-content {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
}

.bento-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: white;
}

.bento-description {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ===== Text Box ===== */
.text-box {
  margin-top: 4rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(192, 132, 252, 0.2);
  border-radius: 0.75rem;
  padding: 1.5rem;
  backdrop-filter: blur(8px);
}

.text-box p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.75;
}

/* ===== Dialog Modal ===== */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.dialog-overlay.active {
  opacity: 1;
  visibility: visible;
}

.dialog-content {
  background: #1a0f2e;
  border: 1px solid rgba(192, 132, 252, 0.3);
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 28rem;
  width: 90%;
  transform: scale(0.95);
  transition: transform 0.3s;
  position: relative;
}

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

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-section {
  text-align: center;
  margin-bottom: 2rem;
}

.dialog-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #d8b4fe;
  margin-bottom: 1rem;
}

.qr-code-wrapper {
  width: 12rem;
  height: 12rem;
  margin: 0 auto 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-wrapper img {
  width: 10rem;
  height: 10rem;
  object-fit: contain;
}

.wechat-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.wechat-name {
  font-size: 1.125rem;
  color: #d8b4fe;
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-copy {
  background: #9333ea;
  color: white;
}

.btn-copy:hover {
  background: #a855f7;
}

.btn-bilibili {
  width: 100%;
  background: linear-gradient(to right, #ec4899, #9333ea);
  color: white;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.btn-bilibili:hover {
  background: linear-gradient(to right, #f472b6, #a855f7);
}

.icon {
  width: 1rem;
  height: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .profile-name {
    font-size: 2.5rem;
  }

  .avatar {
    width: 5rem;
    height: 5rem;
  }

  .bento-vertical {
    grid-column: span 4;
    height: 16rem;
  }

  .bento-square {
    grid-column: span 2;
  }

  .section-title {
    font-size: 2rem;
  }
}
