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

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #fff;
}

.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: url("bkg.jpg") center center / cover no-repeat;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 顶部导航栏 ---------- */

.site-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(18, 18, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.92rem;
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s ease;
}

.nav-item:hover .nav-link,
.nav-item.open .nav-link {
  background: rgba(255, 255, 255, 0.14);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  min-width: 160px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(18, 18, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px) scale(0.92);
  transition: opacity 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.open .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.nav-dropdown a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #cfcfd6;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-dropdown a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: url("topbkg.jpg") center center / cover no-repeat;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.topbar.visible {
  opacity: 1;
  pointer-events: auto;
}

#snow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
}

.hero-content h1 {
  font-size: 2.6rem;
  letter-spacing: 4px;
  margin-bottom: 10px;
}

.hero-content p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

.hero-content .poem {
  font-size: 1.43rem;
  font-weight: 700;
  opacity: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 0, 0, 0.6);
}

.enter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 56px;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  letter-spacing: 3px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.75);
  transition: color 0.3s ease;
}

.enter-btn span {
  position: relative;
  z-index: 2;
}

.enter-btn-border {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.enter-btn-border rect {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 510;
  stroke-dashoffset: 510;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.9));
  animation: enter-btn-draw 3s ease-in-out infinite;
}

@keyframes enter-btn-draw {
  0% {
    stroke-dashoffset: 510;
    opacity: 0.35;
  }
  50% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -510;
    opacity: 0.35;
  }
}

.enter-btn:hover .enter-btn-border rect {
  animation-play-state: paused;
  stroke-dashoffset: 0;
  opacity: 1;
  stroke-width: 3;
}

main {
  min-height: 100vh;
  padding: 130px 10% 80px;
  background: #0c0d12;
  color: #f0f0f2;
}

main h2 {
  font-size: 1.6rem;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.articles {
  margin-top: 100px;
}

.articles p {
  color: #a4a4ad;
}

.article-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: inherit;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.article-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.article-card-thumb {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  background: linear-gradient(160deg, #3a3f58, #14151d);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.article-card-date {
  display: block;
  font-size: 0.78rem;
  color: #8a8a92;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.article-card-body h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.article-card-body p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.no-articles {
  margin-top: 24px;
  padding: 40px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  color: #7a7a82;
  text-align: center;
  font-size: 0.95rem;
}

/* ---------- 背景音乐选择器 ---------- */

.music-picker {
  text-align: center;
}

.music-hint {
  color: #a4a4ad;
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.music-carousel {
  position: relative;
  width: 100%;
  height: 260px;
  perspective: 1400px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.music-carousel.dragging {
  cursor: grabbing;
}

.music-track {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.music-item {
  position: absolute;
  width: 150px;
  height: 190px;
  left: 50%;
  top: 50%;
  margin-left: -75px;
  margin-top: -95px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 4px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, #3a3f58, #14151d);
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.music-item::after {
  content: attr(data-title);
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
}

.music-item.active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 16px 36px rgba(0, 0, 0, 0.6);
}

.music-player {
  margin-top: 50px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.now-playing-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.now-playing-artist {
  display: block;
  font-size: 0.85rem;
  color: #a4a4ad;
}

/* ---------- 自定义音乐播放器 ---------- */

.custom-player {
  width: 420px;
  max-width: 90vw;
  padding: 18px 22px;
  border-radius: 18px;
  background: rgba(24, 24, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.custom-player audio {
  display: none;
}

.cp-seek-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.cp-time {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #d4d4da;
  font-variant-numeric: tabular-nums;
  width: 34px;
}

#cpDuration {
  text-align: right;
}

.cp-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cp-play {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cp-play:hover {
  background: rgba(255, 255, 255, 0.22);
}

.cp-play svg {
  transform: translateX(1px);
}

.cp-skip {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #d4d4da;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.cp-skip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cp-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d4d4da;
}

.cp-volume-bar {
  width: 70px;
}

.cp-speed {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.cp-speed button {
  border: none;
  background: transparent;
  color: #a4a4ad;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.cp-speed button:hover {
  color: #fff;
}

.cp-speed button.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* 统一的滑条样式（进度条 / 音量条共用） */

.cp-seek,
.cp-volume-bar {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 18px;
  background: transparent;
  cursor: pointer;
}

/* 轨道本身画细一点，但 input 整体保留 18px 高的可点击/可拖动区域 */

.cp-seek::-webkit-slider-runnable-track,
.cp-volume-bar::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.cp-seek::-webkit-slider-thumb,
.cp-volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.cp-seek::-moz-range-track,
.cp-volume-bar::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.cp-seek::-moz-range-thumb,
.cp-volume-bar::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

/* ---------- 关于我 页面 ---------- */

.page-banner {
  position: relative;
  height: 40vh;
  min-height: 280px;
  width: 100%;
  background: url("topbkg.jpg") center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(12, 13, 18, 0.85));
}

.page-banner-overlay {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.page-banner-overlay h1 {
  font-size: 2.2rem;
  letter-spacing: 4px;
  margin-bottom: 10px;
}

.page-banner-overlay p {
  font-size: 0.95rem;
  opacity: 0.85;
}

.about-main {
  min-height: 100vh;
  padding: 70px 10% 100px;
  background: #0c0d12;
  color: #f0f0f2;
}

.about-intro {
  max-width: 640px;
  margin: 0 auto 90px;
  text-align: center;
}

.about-intro .avatar {
  width: 130px;
  height: 130px;
  margin-bottom: 20px;
}

.about-intro h2 {
  font-size: 1.6rem;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.about-role {
  color: #a4a4ad;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.about-bio {
  line-height: 1.9;
  color: #d4d4da;
  font-size: 0.98rem;
  text-align: left;
}

.about-block {
  max-width: 800px;
  margin: 0 auto 70px;
}

.about-block h2 {
  font-size: 1.4rem;
  letter-spacing: 2px;
  margin-bottom: 24px;
  text-align: center;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.skill-tags span {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.card-grid.single {
  grid-template-columns: 1fr;
}

.info-card {
  padding: 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.28);
}

.info-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.info-card p {
  font-size: 0.85rem;
  line-height: 1.75;
  color: #a4a4ad;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.contact-label {
  flex-shrink: 0;
  width: 56px;
  color: #a4a4ad;
  font-size: 0.82rem;
}

.contact-item a {
  color: #e4e4ea;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contact-item a:hover {
  color: #fff;
  text-decoration: underline;
}

.contact-item span:not(.contact-label) {
  color: #d4d4da;
}

.about-quote {
  max-width: 600px;
  margin: 0 auto 70px;
  text-align: center;
}

.about-quote blockquote {
  font-size: 1.2rem;
  font-style: italic;
  letter-spacing: 1px;
  color: #e4e4ea;
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding-left: 20px;
  display: inline-block;
  text-align: left;
}

.back-home {
  display: block;
  width: fit-content;
  margin: 0 auto;
  color: #a4a4ad;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.25s ease;
}

.back-home:hover {
  color: #fff;
}

#tech-notes,
#essay-notes,
#photography {
  scroll-margin-top: 120px;
  padding-top: 40px;
}

/* ---------- 文章内容页 ---------- */

.article-content {
  max-width: 800px;
  margin: 0 auto 70px;
  line-height: 1.85;
  color: #d4d4da;
  font-size: 0.95rem;
}

.article-content h1 {
  font-size: 1.5rem;
  color: #f0f0f2;
  margin: 50px 0 18px;
  letter-spacing: 1px;
}

.article-content h2 {
  font-size: 1.25rem;
  color: #e4e4ea;
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.article-content h3 {
  font-size: 1.08rem;
  color: #e4e4ea;
  margin: 28px 0 10px;
}

.article-content p {
  margin: 12px 0;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
  margin: 12px 0;
}

.article-content li {
  margin: 6px 0;
}

.article-content blockquote {
  border-left: 3px solid rgba(255, 255, 255, 0.3);
  padding: 10px 20px;
  margin: 16px 0;
  color: #e4e4ea;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 8px 8px 0;
}

.article-content pre {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 14px 0;
  font-size: 0.88rem;
  line-height: 1.65;
}

.article-content code {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  color: #e4e4ea;
}

.article-content p code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

.article-content th,
.article-content td {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.article-content th {
  background: rgba(255, 255, 255, 0.08);
  color: #f0f0f2;
}

.article-content hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 30px 0;
}

.article-content strong {
  color: #f0f0f2;
}

.article-content a {
  color: #8ab4f8;
  text-decoration: none;
}

.article-content a:hover {
  text-decoration: underline;
}

.article-meta {
  text-align: center;
  color: #a4a4ad;
  font-size: 0.85rem;
  margin-bottom: 40px;
}

.article-meta span {
  margin: 0 10px;
}

/* ---------- 随笔 / 图文页 ---------- */

.essay-banner {
  height: 56vh;
  min-height: 360px;
  background-size: cover;
  background-position: center;
}

.essay-content {
  max-width: 720px;
  margin: 0 auto 70px;
  line-height: 2;
  color: #d4d4da;
  font-size: 1.02rem;
}

.essay-content p {
  margin: 28px 0;
  text-indent: 2em;
}

.essay-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 50px;
  color: #a4a4ad;
  font-size: 0.88rem;
}

.essay-tag {
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  letter-spacing: 1px;
}

.essay-photo {
  margin: 36px 0;
}

.essay-photo img {
  width: 100%;
  border-radius: 10px;
  display: block;
}
