/* ═══════════════════════════════════════════════════════
   个人主页样式
   想改配色：改下面 :root 里的几个变量即可
   ═══════════════════════════════════════════════════════ */

:root {
  --bg: #f7f6f3;            /* 页面背景（米白） */
  --surface: #ffffff;       /* 卡片背景 */
  --ink: #23272f;           /* 正文文字 */
  --muted: #6b7280;         /* 次要文字 */
  --accent: #6366f1;        /* 主题色（靛蓝），按钮/高亮用它 */
  --accent-dark: #4f46e5;
  --border: #e8e6e0;        /* 边框 */
  --cover-bg1: #0f172a;     /* 封面渐变起始色 */
  --cover-bg2: #312e81;     /* 封面渐变结束色 */
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

.hidden { display: none !important; }

/* ══════════════════════ 封面页 ══════════════════════ */

#cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cover-bg1), var(--cover-bg2));
  overflow: hidden;
  transition: opacity 0.8s ease, visibility 0.8s;
}

body.entered #cover {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 封面背景上的两个柔和光斑 */
.cover-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: float 14s ease-in-out infinite;
}
.cover-blob-1 {
  width: 420px; height: 420px;
  background: #6366f1;
  top: -80px; left: -80px;
}
.cover-blob-2 {
  width: 360px; height: 360px;
  background: #22d3ee;
  bottom: -60px; right: -60px;
  animation-delay: -7s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 20px) scale(1.08); }
}

.cover-inner {
  position: relative;
  text-align: center;
  color: #fff;
  padding: 24px;
}

.cover-name {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.cover-tagline {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 40px;
}

.enter-btn {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  padding: 14px 48px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45);
  transition: transform 0.25s, box-shadow 0.25s;
  animation: pulse 2.4s ease-in-out infinite;
}
.enter-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 34px rgba(99, 102, 241, 0.6);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45); }
  50% { box-shadow: 0 8px 40px rgba(99, 102, 241, 0.75); }
}

.cover-hint {
  margin-top: 22px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* 封面期间禁止滚动页面 */
body:not(.entered) { overflow: hidden; }

/* ══════════════════════ 导航栏 ══════════════════════ */

#navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-dark);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  white-space: nowrap;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover {
  color: var(--accent-dark);
  background: rgba(99, 102, 241, 0.08);
}

/* ══════════════════════ 主页头部 ══════════════════════ */

.hero {
  text-align: center;
  padding: 72px 24px 56px;
  background: linear-gradient(160deg, #eef0ff 0%, #f7f6f3 70%);
}

.hero-name {
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: 0.05em;
  background: linear-gradient(120deg, var(--accent-dark), #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ══════════════════════ 通用板块 ══════════════════════ */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

section { padding: 36px 0 12px; scroll-margin-top: 72px; }

.section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::before {
  content: "";
  width: 6px;
  height: 26px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #22d3ee);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(35, 39, 47, 0.04);
}

.card p + p { margin-top: 10px; }

/* 教育经历 */
.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.timeline-date { color: var(--muted); font-size: 0.9rem; }
.timeline-sub { color: var(--accent-dark); font-weight: 600; margin: 6px 0 10px; }

/* 技能标签 */
.skill-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-dark);
  font-size: 0.95rem;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.chip-small { font-size: 0.8rem; padding: 4px 12px; }

/* 项目卡片 */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.project-card h3 { margin-bottom: 8px; color: var(--accent-dark); }
.project-card p { font-size: 0.95rem; color: var(--muted); }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ══════════════════════ 照片墙 ══════════════════════ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 56px 24px;
  font-size: 0.95rem;
}

.gallery-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  background: #eceae4;
  border: 1px solid var(--border);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.06); }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* ══════════════════════ 联系方式 ══════════════════════ */

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
}
.contact-item {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.98rem;
  transition: color 0.2s;
}
a.contact-item:hover { color: var(--accent-dark); }

/* ══════════════════════ 音乐播放器 ══════════════════════ */

.player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
}

.player-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.player-btn:hover { background: var(--accent-dark); transform: scale(1.08); }

.player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.song-title {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 30vw;
}
.time-label { font-size: 0.75rem; color: rgba(255, 255, 255, 0.6); }

.player-range {
  flex: 1;
  min-width: 80px;
  accent-color: var(--accent);
  cursor: pointer;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.volume-icon { font-size: 0.9rem; }
.volume-range { width: 80px; flex: none; }

/* ══════════════════════ 页脚 ══════════════════════ */

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 40px 24px 96px; /* 底部多留空间，避免挡住播放器 */
}

/* 板块滚动淡入动画 */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ══════════════════════ 管理页（/admin.html） ══════════════════════ */

.admin-body {
  background: #f1f0ec;
  min-height: 100vh;
}

.admin-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.admin-panel,
.admin-login {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(35, 39, 47, 0.06);
}

.admin-login {
  max-width: 420px;
  margin: 15vh auto 0;
  text-align: center;
}
.admin-login h1 { font-size: 1.4rem; margin-bottom: 8px; }
.admin-login .sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

.admin-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.admin-input:focus { border-color: var(--accent); }

.admin-btn {
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}
.admin-btn:hover { background: var(--accent-dark); }
.admin-btn:active { transform: scale(0.97); }
.admin-btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.admin-btn.danger { background: #dc2626; }
.admin-btn.danger:hover { background: #b91c1c; }
.admin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.admin-head h1 { font-size: 1.3rem; }

.admin-section { margin-top: 30px; }
.admin-section h2 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
}

.dropzone {
  border: 2px dashed #c9c6bd;
  border-radius: 14px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}
.dropzone .big { font-size: 1.05rem; color: var(--ink); }

.admin-progress { font-size: 0.9rem; color: var(--accent-dark); margin-top: 10px; }
.admin-error { font-size: 0.9rem; color: #dc2626; margin-top: 10px; }

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.admin-photo {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
  background: #eceae4;
}
.admin-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-photo .del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.admin-photo:hover .del { opacity: 1; }

.music-status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.music-status .status-text { font-size: 0.95rem; }
.music-status .ok { color: #16a34a; }
.music-status .empty { color: var(--muted); }

/* ══════════════════════ 手机适配 ══════════════════════ */

@media (max-width: 640px) {
  #navbar { padding: 10px 14px; }
  .hero { padding: 52px 20px 40px; }
  .container { padding: 16px; }
  section { padding: 28px 0 8px; }
  .player { padding: 8px 12px; gap: 10px; }
  .song-title { max-width: 36vw; }
  /* 小屏幕上隐藏进度条和音量，保持简洁 */
  #progressBar, .player-volume { display: none; }
  .admin-panel, .admin-login { padding: 24px 18px; }
}
