:root {
  --bg: #0a0f1e;
  --bg-soft: #111a2e;
  --text: #e8eef5;
  --muted: rgba(232, 238, 245, 0.72);
  --accent: #7ec8c8;
  --glass: rgba(13, 20, 36, 0.42);
  --border: rgba(126, 200, 200, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

.top-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  padding: 14px 5vw;
  background: rgba(10, 15, 30, 0.25);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.35s ease;
}

.top-nav.scrolled {
  background: rgba(10, 15, 30, 0.68);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.2em;
  font-size: 1.45rem;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
}

.nav-links a {
  position: relative;
  font-size: 0.94rem;
  color: var(--muted);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.3s ease;
}

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

.hero {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  background: url("./images/index_1p.JPG")
    center / cover no-repeat;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(3.5px);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 20, 0.54);
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 1;
  padding: 0 1.2rem;
}

.hero-name {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  color: #fff;
  font-size: clamp(3.2rem, 9vw, 8.6rem);
  line-height: 0.95;
}

.hero-name span {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: letterIn 0.65s forwards;
}

.hero-name span:nth-child(1) { animation-delay: 0.08s; }
.hero-name span:nth-child(2) { animation-delay: 0.14s; }
.hero-name span:nth-child(3) { animation-delay: 0.2s; }
.hero-name span:nth-child(4) { animation-delay: 0.26s; }
.hero-name span:nth-child(5) { animation-delay: 0.32s; }
.hero-name span:nth-child(6) { animation-delay: 0.38s; }
.hero-name span:nth-child(7) { animation-delay: 0.44s; }
.hero-name span:nth-child(8) { animation-delay: 0.5s; }
.hero-name span:nth-child(9) { animation-delay: 0.56s; }
.hero-name span:nth-child(10) { animation-delay: 0.62s; }
.hero-name span:nth-child(11) { animation-delay: 0.68s; }

.hero-tagline {
  margin-top: 1.2rem;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  color: rgba(255, 255, 255, 0.84);
  letter-spacing: 0.14em;
}

.scroll-down {
  display: inline-flex;
  margin-top: 2rem;
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.82);
  animation: floatArrow 2s ease-in-out infinite;
}

section {
  padding: 96px 8vw;
}

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

.section-title-wrap h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 400;
}

.section-title-wrap p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.about {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.3fr);
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
}

.about-media img {
  width: 100%;
  max-width: 430px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.about-greet {
  margin: 0 0 0.8rem;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 500;
}

.tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.tags span {
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  background: rgba(126, 200, 200, 0.08);
  font-size: 0.9rem;
}

.gallery {
  padding-top: 74px;
}

.carousel {
  position: relative;
  max-width: 1300px;
  margin: 0 auto;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: 1.2rem;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: pan-y;
  user-select: none;
}

.slide {
  min-width: 80%;
  height: 600px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  transform: scale(0.95);
  opacity: 0.55;
  transition: transform 0.55s ease, opacity 0.55s ease, filter 0.55s ease;
  filter: brightness(0.65);
}

.slide.active {
  transform: scale(1);
  opacity: 1;
  filter: brightness(1);
}

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

.slide-card {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(86%, 540px);
  padding: 0.85rem 1.1rem;
  background: var(--glass);
  backdrop-filter: blur(9px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
}

.slide-card h3 {
  margin: 0;
  font-size: 1.06rem;
}

.slide-card p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(9, 14, 29, 0.35);
  color: #fff;
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
  z-index: 3;
}

.carousel:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }

.carousel-dots {
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
  gap: 0.55rem;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: rgba(232, 238, 245, 0.28);
  transition: all 0.35s ease;
  cursor: pointer;
}

.carousel-dots button.active {
  width: 28px;
  background: var(--accent);
}

.quote {
  background: #070b16;
  text-align: center;
  padding: 88px 1.2rem;
}

.quote blockquote {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(1.7rem, 3vw, 2.8rem);
  font-weight: 300;
}

.quote-author {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.chat {
  max-width: 980px;
  margin: 0 auto;
}

.chat-card {
  background: rgba(11, 18, 34, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
}

.file-open-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(5, 9, 20, 0.92);
  backdrop-filter: blur(8px);
}

.file-open-overlay[hidden] {
  display: none;
}

.file-open-card {
  max-width: 420px;
  padding: 1.4rem 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(126, 200, 200, 0.35);
  background: rgba(11, 18, 34, 0.95);
  text-align: center;
}

.file-open-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 500;
}

.file-open-card p {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.file-open-sub {
  font-size: 0.82rem !important;
}

.file-open-card code {
  font-size: 0.8rem;
  color: var(--accent);
}

body.file-open-waiting > :not(#fileOpenOverlay) {
  visibility: hidden;
}

.chat-history {
  height: 420px;
  overflow-y: auto;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.bubble {
  max-width: 78%;
  padding: 0.75rem 0.95rem;
  border-radius: 16px;
  font-size: 0.94rem;
  white-space: pre-wrap;
}

.bubble.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border-top-left-radius: 4px;
}

.bubble.user {
  align-self: flex-end;
  background: rgba(126, 200, 200, 0.28);
  border-top-right-radius: 4px;
}

.typing {
  display: inline-flex;
  gap: 0.22rem;
  align-items: center;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  animation: dot 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0 1.2rem 1rem;
}

.chat-card .prompt-btn {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
  border: 1px solid rgba(126, 200, 200, 0.55);
  background: rgba(126, 200, 200, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-card .prompt-btn:hover {
  background: rgba(126, 200, 200, 0.22);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(126, 200, 200, 0.25);
}

.chat-input-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chat-input-wrap textarea {
  flex: 1;
  resize: none;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(7, 11, 22, 0.8);
  color: var(--text);
  padding: 0.74rem 1rem;
  min-height: 44px;
  max-height: 120px;
  font: inherit;
}

.chat-input-wrap textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(126, 200, 200, 0.17);
}

.chat-input-wrap.is-loading textarea,
.chat-input-wrap.is-loading .send-btn {
  opacity: 0.55;
  cursor: not-allowed;
}

.send-btn {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #081018;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(126, 200, 200, 0.45);
}

.contact {
  max-width: 1160px;
  margin: 0 auto;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 760px;
  margin: 0 auto;
}

.social-card {
  width: 100%;
  min-height: 158px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(13, 20, 37, 0.75);
  color: var(--text);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.social-card:hover {
  transform: translateY(-7px);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 22px rgba(0, 0, 0, 0.25);
}

.social-card i {
  font-size: 1.55rem;
}

.social-card h3 {
  margin: 0.35rem 0 0;
  font-size: 1rem;
}

.social-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer {
  text-align: center;
  color: rgba(232, 238, 245, 0.5);
  font-size: 0.8rem;
  padding: 32px 1rem 42px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1200;
}

.modal.active {
  display: block;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #0f182d;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 1rem 1rem 1.2rem;
  width: min(92vw, 320px);
  text-align: center;
}

.modal-content h3 {
  margin: 0.3rem 0 0.8rem;
}

.modal-content img {
  width: 100%;
  border-radius: 8px;
}

.modal-content button {
  position: absolute;
  top: 7px;
  right: 7px;
  border: none;
  background: transparent;
  color: #d8e3f0;
  cursor: pointer;
  font-size: 1rem;
}

.section-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: transform 0.7s ease, opacity 0.7s ease;
}

.section-fade.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left,
.reveal-right {
  opacity: 0;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.reveal-left {
  transform: translateX(-36px);
}

.reveal-right {
  transform: translateX(36px);
}

.about.visible .reveal-left,
.about.visible .reveal-right {
  opacity: 1;
  transform: translateX(0);
}

@keyframes letterIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@keyframes dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 820px) {
  .about {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .tags {
    justify-content: center;
  }

  .slide {
    height: 460px;
    min-width: 88%;
  }

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

}

@media (max-width: 560px) {
  section {
    padding: 78px 1rem;
  }

  .top-nav {
    padding: 12px 1rem;
  }

  .nav-links {
    gap: 0.7rem;
  }

  .nav-links a {
    font-size: 0.86rem;
  }

  .brand {
    font-size: 1.2rem;
  }

  .slide {
    min-width: 92%;
    height: 360px;
  }

  .bubble {
    max-width: 88%;
  }

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

}
