/* ========================================
   记忆网站 - 优化版样式表
   ======================================== */

/* ===== CSS 变量 ===== */
:root {
  --bg: #f5f3ef;
  --bg-warm: #faf8f5;
  --card: #ffffff;
  --border: #e7e5e1;
  --text: #44403c;
  --text-muted: #78716c;
  --text-dim: #a8a29e;
  --text-heading: #1c1917;
  --accent: #ea580c;
  --accent-soft: #fef2f2;
  --radius: 8px;
  --nav-h: 56px;
  --subnav-h: 48px;
  --max-w: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

/* ===== 基础重置 ===== */
* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== 顶层导航 ===== */
.topnav {
  position: fixed; top:0; left:0; right:0; z-index:100;
  height: var(--nav-h);
  background: rgba(250,248,245,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 2px;
  padding: 0 20px;
}

.topnav-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 14px; font-weight: 500; letter-spacing: 0.06em;
  padding: 8px 22px; cursor: pointer; outline: none;
  font-family: var(--font);
  transition: color 0.3s;
  position: relative;
}

.topnav-btn:hover { color: var(--text-heading); }

.topnav-btn.active {
  color: var(--text-heading);
  font-weight: 600;
}

.topnav-btn.active::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ===== 页面容器 ===== */
.page {
  display: none;
  padding-top: var(--nav-h);
  min-height: 100vh;
}

.page.active {
  display: block;
  animation: fadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeIn {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ===== 首页 Hero — 3D Coverflow 弧形轮播 ===== */
.hero-home {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: calc(100vh - var(--nav-h));
  background: var(--bg);
  overflow: hidden;
}

#hello-mosaic {
  width: 100%;
  height: calc(100vh - var(--nav-h));
  position: relative;
  overflow: hidden;
}

#hello-loading {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(80px, 14vw, 240px);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--text-heading);
  opacity: 0.04;
  user-select: none;
  font-family: var(--font);
  white-space: nowrap;
  pointer-events: none;
}

.hero-home h1 {
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.12em;
  text-shadow: 0 2px 40px rgba(0,0,0,0.6);
  pointer-events: none;
  z-index: 10;
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  white-space: nowrap;
  transition: opacity 0.35s;
}

.hero-home h1.pulse-out { opacity: 0.15; }

/* Coverflow 容器 */
.coverflow-container {
  position: relative;
  width: 100%; height: 55vh;
  perspective: 1800px;
  perspective-origin: 50% 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}

.coverflow-track {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  display: flex; align-items: center; justify-content: center;
}

.coverflow-item {
  position: absolute;
  width: clamp(200px, 30vw, 400px);
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s;
  opacity: 0.45;
  -webkit-box-reflect: below 8px linear-gradient(transparent 60%, rgba(0,0,0,0.35));
}

.coverflow-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.coverflow-item.center {
  opacity: 1;
  z-index: 5;
  box-shadow: 0 16px 60px rgba(0,0,0,0.7);
}

/* 左右箭头 */
.coverflow-arrows {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.coverflow-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s;
  backdrop-filter: blur(6px);
}

.coverflow-arrow:hover { background: rgba(255,255,255,0.28); box-shadow: 0 0 20px rgba(255,255,255,0.1); }

.coverflow-arrow-prev { left: calc(50% - 240px); }
.coverflow-arrow-next { right: calc(50% - 240px); }

/* 底部圆点 */
.banner-dots {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 10px;
  z-index: 10;
}

.banner-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: all 0.35s;
  border: none;
  padding: 0;
}

.banner-dot:hover { background: rgba(255,255,255,0.7); }
.banner-dot.active {
  background: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
  .hero-home h1 { font-size: clamp(36px, 8vw, 64px); margin-bottom: 16px; }
  .coverflow-container { height: 45vh; }
  .coverflow-item { width: clamp(160px, 55vw, 260px); }
  .coverflow-arrow { width: 40px; height: 40px; font-size: 18px; }
  .coverflow-arrow-prev { left: 12px; }
  .coverflow-arrow-next { right: 12px; }
}

/* ===== 通用页面内布局 ===== */
.page-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.page-hero {
  text-align: center;
  margin-bottom: 48px;
}

.page-hero h2 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.08em;
}

.page-hero p {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
  letter-spacing: 0.1em;
}

/* ===== 子导航 — 竖排侧边栏 ===== */
.page-with-subnav {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

.subnav-wrap {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  width: 180px;
  flex-shrink: 0;
  background: rgba(245,243,239,0.6);
  border-right: 1px solid var(--border);
  padding: 32px 0;
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.subnav-wrap::-webkit-scrollbar { width: 0; }

.subnav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.subnav-btn {
  display: block;
  background: none; border: none; color: var(--text-dim);
  font-size: 13px; font-weight: 500;
  padding: 10px 16px; cursor: pointer; outline: none;
  font-family: var(--font);
  text-align: left;
  white-space: nowrap;
  transition: color 0.25s, border-color 0.25s;
  border-left: 2px solid transparent;
  line-height: 1.6;
}

.subnav-btn:hover { color: var(--text-heading); }

.subnav-btn.active {
  color: var(--text-heading);
  border-left-color: var(--accent);
  background: rgba(234,88,12,0.04);
}

/* ===== 子内容区域 ===== */
.sub-content { display: block; }

.section-group {
  margin-top: 36px;
}

.section-group-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  letter-spacing: 0.04em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px 16px;
  padding: 10px 0;
}

/* ===== 拍立得卡片 ===== */
.polaroid {
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.4s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.polaroid.loaded { opacity: 1; }

.polaroid:hover {
  transform: scale(1.06) !important;
  z-index: 2;
}

.polaroid-paper {
  width: 100%;
  background: linear-gradient(180deg, #ffffff, #fafaf9);
  padding: 10px 10px 36px;
  box-shadow:
    0 8px 16px -6px rgba(0,0,0,0.1),
    0 2px 4px -2px rgba(0,0,0,0.08),
    0 1px 0 rgba(255,255,255,0.9) inset;
  position: relative;
  isolation: isolate;
  border-radius: 2px;
}

.polaroid-frame {
  position: relative;
  overflow: hidden;
  background: #f2efe8;
  box-shadow:
    inset 0 0 0 1px rgba(60,40,20,0.06),
    inset 0 1px 1px rgba(255,255,255,0.4),
    inset 0 3px 6px rgba(255,255,255,0.1),
    inset 0 -8px 14px rgba(30,18,8,0.12),
    inset 6px 0 8px rgba(30,18,8,0.05),
    inset -6px 0 8px rgba(30,18,8,0.05);
}

.polaroid-frame::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,0.2), transparent 40%),
    linear-gradient(180deg, transparent 55%, rgba(20,12,6,0.08) 100%);
  mix-blend-mode: soft-light;
  opacity: 0.85;
  z-index: 1;
}

.polaroid-frame::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 16px rgba(20,12,6,0.08),
    inset 0 0 2px rgba(20,12,6,0.1),
    inset 0 1px 1px rgba(255,255,255,0.15);
  z-index: 1;
}

.polaroid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 0;
}

.polaroid-caption {
  margin-top: 6px;
  padding: 0 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font);
}

.polaroid-date {
  font-size: 12px;
  font-weight: 600;
  color: #57534e;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.polaroid-text {
  font-size: 11px;
  font-weight: 400;
  color: #78716c;
  letter-spacing: 0.04em;
  max-width: 100%;
  overflow-wrap: break-word;
  text-align: left;
  line-height: 1.4;
  margin-top: 1px;
}

.polaroid-name {
  font-size: 11px;
  font-weight: 500;
  color: #78716c;
  letter-spacing: 0.04em;
  max-width: 100%;
  overflow-wrap: break-word;
  text-align: left;
  line-height: 1.3;
}

/* ===== 毕业合照分页控件 ===== */
.grad-page { display: block; margin-bottom: 60px; }

.grad-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 24px 40px 28px;
  pointer-events: none;
  z-index: 30;
}

.grad-footer > * { pointer-events: auto; }

.grad-circle {
  position: relative;
  width: 120px; height: 120px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.grad-circle-line {
  position: absolute;
  width: 130%;
  height: 1px;
  background: var(--border);
  transform: rotate(-45deg);
}

.grad-circle-arrow {
  position: absolute;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  transition: color 0.2s;
  padding: 4px;
}

.grad-circle-arrow:hover { color: var(--text-heading); }
.grad-circle-arrow:disabled { opacity: 0.25; cursor: default; }
.grad-circle-prev { left: 2px; }
.grad-circle-next { right: 2px; }

.grad-nums {
  position: relative;
  width: 60px; height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.grad-num-current,
.grad-num-total {
  position: absolute;
  font-weight: 300;
  color: var(--text-heading);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.grad-num-current {
  font-size: 32px;
  top: 0; left: 8px;
}

.grad-num-total {
  font-size: 14px;
  bottom: 0; right: 8px;
  color: var(--text-dim);
}

.grad-num-current.anim-out { transform: translateY(-20px); opacity: 0; }
.grad-num-current.anim-in  { transform: translateY(0); opacity: 1; }

.grad-deco {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #ea580c, #facc15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.grad-deco img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.grad-deco-placeholder {
  width: 36px; height: 36px;
  background: #fef3c7;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform: rotate(12deg);
}

@media (max-width: 640px) {
  .grad-footer { padding: 16px 20px 20px; }
  .grad-circle { width: 100px; height: 100px; }
  .grad-num-current { font-size: 26px; left: 4px; }
  .grad-num-total { font-size: 12px; right: 4px; }
  .grad-deco { width: 60px; height: 60px; }
}

/* ===== 结束语 ===== */
.ending-hero {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--nav-h));
  text-align: center;
  background: var(--bg);
  position: relative;
}

.ending-hero h1 {
  font-size: clamp(72px, 14vw, 130px);
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  position: relative;
}

.ending-qmark {
  display: inline-block;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.15em;
  color: #fff;
  text-shadow:
    1px 1px 0 rgba(28,25,23,0.25),
    -1px -1px 0 rgba(28,25,23,0.15),
    0 2px 12px rgba(28,25,23,0.1);
  transform: rotate(4deg) translateY(0.08em);
  margin-left: 0.02em;
  animation: qmarkPulse 3s ease-in-out infinite;
  position: relative;
  left: 0.05em;
  top: -0.05em;
}

@keyframes qmarkPulse {
  0%, 100% { opacity: 0.7; transform: rotate(4deg) translateY(0.08em) scale(1); }
  50% { opacity: 1; transform: rotate(4deg) translateY(0.08em) scale(1.06); }
}

.ending-hero p {
  font-size: 16px;
  color: var(--text-dim);
  letter-spacing: 0.14em;
}

/* 下滑提示 */
.scroll-hint {
  position: absolute; bottom: 48px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  animation: hintFloat 2s ease-in-out infinite;
}

.scroll-hint-arrow {
  width: 24px; height: 24px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  opacity: 0.5;
}

@keyframes hintFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

.home-scroll-hint { position: absolute; z-index: 10; }

/* 导航页介绍 */
.home-intro {
  background: var(--bg);
  padding: 60px 24px 80px;
  display: flex; flex-direction: column; align-items: center;
}

.home-intro-title {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 40px;
  opacity: 0.6;
}

.home-intro-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 900px;
  margin-bottom: 24px;
}

.home-intro-notice {
  max-width: 680px;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.8;
  text-align: center;
  opacity: 0.65;
}

.intro-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 22px 22px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(.25,.46,.45,.94), box-shadow 0.25s;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.intro-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: 0 0 4px 4px;
}

.intro-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 12px 28px rgba(0,0,0,0.08);
}

.intro-card:hover::before { opacity: 1; }

.intro-card-icon {
  align-self: center;
  font-size: 36px;
  line-height: 1;
  transition: transform 0.25s;
}

.intro-card:hover .intro-card-icon { transform: scale(1.15); }

.intro-card-title {
  align-self: center;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.08em;
}

.intro-card-desc {
  font-size: 12px;
  color: var(--text-dim);
  text-align: left;
  line-height: 1.7;
}

/* 版本更新 */
.home-changelog {
  background: var(--bg);
  padding: 60px 24px 100px;
  display: flex; flex-direction: column; align-items: center;
}

.changelog-list {
  width: 100%;
  max-width: 680px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.8;
}

.changelog-date-group { margin-bottom: 12px; }

.changelog-date-group > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid var(--accent);
  list-style: none;
}

.changelog-date-group > summary::-webkit-details-marker { display: none; }
.changelog-date-group > summary::before {
  content: '+';
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.changelog-date-group[open] > summary::before { content: '−'; }

.changelog-date-label { flex-shrink: 0; }

.changelog-date-brief {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
}

.changelog-date-body { padding: 4px 0 0 8px; }

.changelog-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.changelog-item:last-child { border-bottom: none; }

.changelog-time {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.changelog-text {
  color: var(--text-heading);
  font-size: 14px;
}

.changelog-text::before { content: '— '; opacity: 0.4; }

/* 小电视机 */
.ending-tv {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 80px 24px 100px;
  background: var(--bg);
  position: relative;
}

.tv-scroll-hint {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  animation: hintFloat 2s ease-in-out infinite;
}

.tv-shell {
  position: relative;
  width: min(560px, 90vw);
  background: #3c3428;
  border-radius: 18px;
  padding: 16px 16px 10px;
  box-shadow:
    0 4px 0 #2a231b,
    0 8px 24px rgba(0,0,0,0.3),
    inset 0 2px 8px rgba(255,255,255,0.05);
}

.tv-screen {
  position: relative;
  background: #0f0f0f;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.6);
}

.tv-screen video {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}

.tv-antenna {
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 30px;
  background: #5c5040;
  border-radius: 2px;
}

.tv-antenna::after {
  content: '';
  position: absolute;
  top: -6px; left: -4px;
  width: 10px; height: 10px;
  background: #8b7355;
  border-radius: 50%;
}

.tv-legs {
  display: flex; justify-content: center; gap: 60px;
  margin-top: 2px;
  height: 16px;
}

.tv-leg {
  width: 12px; height: 100%;
  background: #4a4036;
  border-radius: 0 0 4px 4px;
  transform: perspective(40px) rotateX(10deg);
}

.tv-brand {
  text-align: center; font-size: 10px;
  color: #8b7355; letter-spacing: 0.2em;
  margin-top: 6px;
  font-family: monospace;
}

.tv-notice {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 16px;
  line-height: 1.6;
}

.tv-notice a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.tv-notice a:hover { text-decoration: underline; }

/* ===== 留言墙 ===== */
.guestbook-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px 100px;
}

.guestbook-title {
  text-align: center;
  font-size: 28px;
  color: var(--text-heading);
  margin-bottom: 4px;
}

.guestbook-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.gb-form {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.gb-form-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.gb-form-row input,
.gb-form-row textarea {
  border: 1px solid #e0dcd5;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  resize: vertical;
}

.gb-form-row input:focus,
.gb-form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.gb-submit {
  display: block;
  width: 100%;
  padding: 10px 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.gb-submit:hover { opacity: 0.85; }
.gb-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.gb-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gb-msg {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.gb-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gb-msg-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-heading);
}

.gb-msg-time {
  font-size: 11px;
  color: var(--text-dim);
}

.gb-msg-content {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.gb-msg-actions {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.gb-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.gb-action:hover { color: var(--accent); }
.gb-action.liked { color: #e74c3c; }
.gb-action-del { margin-left: auto; }
.gb-action-del:hover { color: #e74c3c; }

.gb-replies {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.gb-reply {
  padding: 8px 0;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  margin-bottom: 8px;
}

.gb-reply-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
}

.gb-reply-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gb-reply-content {
  font-size: 13px;
  color: #444;
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.gb-reply-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-left: auto;
}

.gb-reply-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  padding: 2px 4px;
}

.gb-reply-del:hover {
  color: #e74c3c;
}

.gb-reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: var(--bg);
  border-radius: 8px;
}

.gb-reply-form input,
.gb-reply-form textarea {
  border: 1px solid #e0dcd5;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  background: #fff;
}

.gb-reply-form input:focus,
.gb-reply-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.gb-reply-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.gb-reply-submit {
  padding: 5px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.gb-reply-submit:hover { opacity: 0.85; }

.gb-reply-cancel {
  padding: 5px 12px;
  background: none;
  color: var(--text-dim);
  border: 1px solid #e0dcd5;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.gb-loading {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 0;
}

.gb-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 0;
  font-size: 14px;
}

/* ===== 音乐播放器 + 歌词 ===== */
.ending-music {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 80px 24px;
  background: var(--bg);
  position: relative;
}

.music-row {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 48px;
  max-width: 820px; width: 100%;
}

.music-player {
  width: 300px;
  flex-shrink: 0;
  text-align: center;
}

.vinyl-disc {
  position: relative;
  width: 260px; height: 260px;
  margin: 0 auto 24px;
}

.vinyl-body {
  width: 260px; height: 260px;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 4px 24px rgba(0,0,0,0.7), inset 0 0 0 2px rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
  animation: discSpin 6s linear infinite;
  animation-play-state: paused;
}

.music-player.playing .vinyl-body { animation-play-state: running; }

@keyframes discSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vinyl-body::before {
  content: '';
  position: absolute; inset: 30px;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle at center,
    transparent 0px, transparent 2px,
    rgba(40,40,40,0.8) 2px, rgba(40,40,40,0.8) 3px,
    transparent 3px, transparent 5px
  );
}

.vinyl-body::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.12) 0%, transparent 50%);
}

.vinyl-center {
  position: absolute;
  width: 88px; height: 88px;
  border-radius: 50%;
  background: #c0392b;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

.vinyl-center::before {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #111;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: inset 0 0 0 3px #c0392b;
}

.tonearm {
  position: absolute;
  width: 4px; height: 120px;
  background: linear-gradient(180deg, #ccc 0%, #999 100%);
  top: 14px; right: 14px;
  border-radius: 2px;
  transform-origin: top center;
  transform: rotate(-30deg);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
}

.tonearm::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  transform: translateX(-50%);
  width: 2px; height: 18px;
  background: #666;
  border-radius: 1px;
}

.music-player.playing .tonearm { transform: rotate(-8deg); }

.tonearm-base {
  position: absolute;
  width: 16px; height: 16px;
  background: #bbb;
  border-radius: 50%;
  top: 8px; right: 8px;
  z-index: 6;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.4);
}

.vinyl-label {
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  letter-spacing: 0.1em;
  z-index: 2;
}

.music-title {
  font-size: 18px; font-weight: 700;
  color: var(--text-heading);
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.music-artist {
  font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.music-progress {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.04em;
}

.music-bar {
  flex: 1; height: 3px;
  background: #e7e1d8;
  border-radius: 2px;
  position: relative; cursor: pointer;
}

.music-bar-fill {
  height: 100%; width: 0%;
  background: #c0392b;
  border-radius: 2px;
  transition: width 0.3s linear;
}

.music-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 28px; margin: 16px 0 0;
}

.music-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-heading);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all 0.25s;
}

.music-btn:hover { color: var(--accent); border-color: var(--accent); }

.music-btn-play {
  width: 52px; height: 52px;
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(192,57,43,0.3);
}

.music-btn-play:hover { background: #e74c3c; border-color: #e74c3c; transform: scale(1.05); }

.music-lyrics {
  flex: 1;
  min-width: 0;
  max-height: 360px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
}

.lyrics-inner {
  font-size: 16px;
  line-height: 2.4;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  font-family: var(--font);
  padding: 60px 0;
  text-align: left;
}

.lyrics-inner p.active {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1em;
}

.lyric-note {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.85em;
}

@media (max-width: 640px) {
  .music-row { flex-direction: column; align-items: center; gap: 32px; }
  .music-player { width: min(300px, 90vw); }
  .vinyl-disc { width: 220px; height: 220px; }
  .vinyl-body { width: 220px; height: 220px; }
  .vinyl-center { width: 72px; height: 72px; }
  .music-lyrics { text-align: center; max-height: 280px; }
}

/* 结束语底部拼图 + 图片 */
.ending-music-scroll { margin-top: 0; bottom: 32px; }

.ending-mosaic-wrap { padding: 20px 0 60px; }

.ending-mosaic-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.ending-mosaic-left {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1 / 1;
  max-width: 450px;
  position: relative;
}

.ending-mosaic-col {
  flex: 1;
  min-width: 0;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ending-mosaic-caption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-align: center;
}

.ending-mosaic-left svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ending-mosaic-right {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1 / 1;
  max-width: 450px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .ending-mosaic-row { flex-direction: column; gap: 28px; }
  .ending-mosaic-left, .ending-mosaic-right, .ending-mosaic-col { max-width: 400px; }
}

/* ===== 灯箱 ===== */
.lightbox {
  display: none;
  position: fixed; inset:0; z-index:999;
  background: rgba(0,0,0,0.93);
  justify-content: center; align-items: center;
  cursor: pointer;
}

.lightbox.show { display: flex; }

.lightbox img {
  max-width: 92vw; max-height: 92vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.lightbox-close {
  position: absolute; top:24px; right:36px;
  font-size: 36px; color: #78716c;
  background: none; border: none; cursor: pointer;
  z-index:1;
  transition: color 0.2s;
}

.lightbox-close:hover { color: #fff; }

/* ===== 回到顶部 ===== */
.scroll-top {
  position: fixed; bottom: 32px; right: 32px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 18px;
  cursor: pointer; z-index: 50;
  display: none;
  align-items: center; justify-content: center;
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.scroll-top.show { display: flex; }
.scroll-top:hover { color: var(--text-heading); box-shadow: var(--shadow-md); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.06em;
}

/* ===== 响应式适配 ===== */
@media (max-width: 640px) {
  .topnav-btn { padding: 8px 12px; font-size: 12px; }
  .page-with-subnav { flex-direction: column; }
  .subnav-wrap {
    position: static;
    width: 100%; height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    overflow-x: auto;
  }
  .subnav { flex-direction: row; }
  .subnav-btn {
    padding: 10px 14px; font-size: 12px;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .subnav-btn.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
    background: none;
  }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 10px; }
  .polaroid-paper { padding: 7px 7px 28px; }
}

/* ===== 个人页 CD 播放器 ===== */
.personal-cd-player {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.cd-disc {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a1a 0%, #333 50%, #1a1a1a 100%);
  border: 3px solid #444;
  position: relative;
  animation: cd-spin 4s linear infinite;
  animation-play-state: paused;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.cd-disc.playing {
  animation-play-state: running;
}

.cd-disc::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #222, #444, #222, #444, #222);
}

.cd-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ea580c;
  border: 2px solid #333;
}

.cd-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent, #ea580c);
  border: 2px solid #fff;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: transform 0.2s;
}

.cd-btn:hover {
  transform: scale(1.1);
}

@keyframes cd-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== 毕业合照透明播放按钮 ===== */
.grad-play-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.grad-play-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

/* ===== 图片卡片操作按钮 ===== */
.polaroid-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding: 0 6px 4px;
}

.polaroid-action-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #a8a29e;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: var(--font);
}

.polaroid-action-btn:hover {
  background: #f5f5f4;
  color: #57534e;
}

.polaroid-action-btn.liked {
  color: #ea580c;
}

@keyframes likePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== 图片评论灯箱 ===== */
.img-lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}

.img-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-lightbox-close {
  position: absolute;
  top: 15px; right: 20px;
  font-size: 32px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 10;
}

.img-lightbox-close:hover { opacity: 1; }

.img-lightbox-content {
  display: flex;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

.img-lightbox-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c1917;
  min-width: 0;
}

.img-lightbox-left img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.img-lightbox-right {
  width: 320px;
  display: flex;
  flex-direction: column;
  background: #fff;
  flex-shrink: 0;
}

/* 评论头部 */
.img-lightbox-right .img-comment-header {
  padding: 16px;
  border-bottom: 1px solid #e7e5e4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.img-comment-title { font-weight: 600; font-size: 15px; color: #1c1917; }
.img-comment-count { font-size: 12px; color: #a8a29e; }

.img-comment-form {
  padding: 12px 16px;
  border-bottom: 1px solid #e7e5e4;
  display: flex;
  gap: 8px;
}

#img-comment-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font);
  resize: none;
  outline: none;
}

#img-comment-input:focus { border-color: #ea580c; }

.img-comment-submit {
  padding: 8px 14px;
  background: #ea580c;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s;
}

.img-comment-submit:hover { background: #c2410c; }

.img-comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.img-comment-empty {
  text-align: center;
  color: #a8a29e;
  font-size: 13px;
  padding: 30px 0;
}

.img-comment-item {
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f4;
}

.img-comment-item:last-child { border-bottom: none; }

.img-comment-item .img-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.img-comment-actions { display: flex; gap: 4px; }
.img-comment-time { font-size: 11px; color: #a8a29e; margin-left: 8px; }
.img-comment-author { font-size: 12px; font-weight: 600; color: #57534e; }

.img-comment-text {
  font-size: 13px;
  color: #44403c;
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: 4px;
}

.img-comment-reply,
.img-comment-delete {
  font-size: 11px;
  color: #a8a29e;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.img-comment-reply:hover,
.img-comment-delete:hover { background: #f5f5f4; color: #57534e; }
.img-comment-delete:hover { background: #fef2f2; color: #ef4444; }

.img-comment-replies {
  margin-top: 8px;
  padding-left: 16px;
  border-left: 2px solid #e7e5e4;
}

.img-comment-reply-item {
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f4;
}

.img-comment-reply-item:last-child { border-bottom: none; }

.img-comment-reply-form {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.img-reply-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #d6d3d1;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
}

.img-reply-input:focus { border-color: #ea580c; }

.img-reply-submit {
  padding: 6px 12px;
  background: #ea580c;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.img-reply-submit:hover { background: #c2410c; }

.img-like-btn {
  position: absolute;
  bottom: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.2s;
  font-family: var(--font);
}

.img-like-btn:hover { transform: scale(1.05); }
.img-like-btn.liked { background: #fef2f2; }
.img-like-btn.liked .img-like-icon { color: #ef4444; animation: likePulse 0.3s ease; }

.img-like-icon { color: #a8a29e; font-size: 18px; transition: color 0.2s; }
.img-like-count { font-size: 14px; font-weight: 600; color: #57534e; }

/* 移动端适配 */
@media (max-width: 768px) {
  .img-lightbox { padding: 0; }
  .img-lightbox-content { flex-direction: column; max-height: 100vh; border-radius: 0; }
  .img-lightbox-left { max-height: 50vh; }
  .img-lightbox-left img { max-height: 48vh; }
  .img-lightbox-right { width: 100%; flex: 1; max-height: 50vh; }
  .img-like-btn { bottom: auto; top: 15px; right: 15px; padding: 8px 14px; }
}

/* ===== 信封按钮 ===== */
.letter-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.letter-hint {
  color: var(--text-dim);
  font-size: 14px;
}

.letter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s;
}

.letter-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.letter-btn svg {
  width: 18px;
  height: 18px;
}

/* ===== 信件弹窗 ===== */
.letter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.5s;
}

.letter-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.letter-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.letter-container {
  position: relative;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  perspective: 1000px;
}

.letter-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 10;
}

.letter-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.letter-paper {
  background: linear-gradient(135deg, #fef9e7 0%, #fdf2e9 50%, #fdebd0 100%);
  border-radius: 4px;
  padding: 40px 50px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(139, 119, 101, 0.1),
    inset 0 0 60px rgba(139, 90, 43, 0.05);
  transform: rotateX(90deg) scale(0.8);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  position: relative;
  overflow-y: auto;
  max-height: 80vh;
}

.letter-modal.show .letter-paper {
  transform: rotateX(0deg) scale(1);
  opacity: 1;
}

/* 信纸装饰 */
.letter-paper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(139, 90, 43, 0.03) 1px, transparent 1px);
  background-size: 100% 30px;
  pointer-events: none;
  border-radius: 4px;
}

/* 红色蜡封印章 */
.letter-paper::after {
  content: '✉';
  position: absolute;
  bottom: 20px;
  right: 25px;
  font-size: 40px;
  color: rgba(180, 60, 60, 0.3);
  transform: rotate(-15deg);
}

.letter-content {
  position: relative;
  z-index: 1;
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  color: #3d3d3d;
  line-height: 2;
  font-size: 15px;
}

.letter-content h1 {
  text-align: center;
  font-size: 24px;
  color: #8b5a2b;
  margin-bottom: 30px;
  font-weight: normal;
  letter-spacing: 0.2em;
}

.letter-content p {
  text-indent: 2em;
  margin-bottom: 1.2em;
}

.letter-content p:last-child {
  text-align: right;
  margin-top: 30px;
  margin-bottom: 0;
}

.letter-content blockquote {
  background: rgba(139, 90, 43, 0.08);
  border-left: 3px solid #8b5a2b;
  padding: 15px 20px;
  margin: 20px 0;
  font-style: italic;
  text-indent: 0;
}

.letter-content strong {
  color: #8b5a2b;
  font-weight: normal;
}

.letter-loading {
  text-align: center;
  padding: 60px 0;
  color: #8b5a2b;
  font-size: 14px;
  animation: letter-pulse 1.5s ease-in-out infinite;
}

@keyframes letter-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 打字机效果 */
.letter-content .typed-text {
  overflow: hidden;
  border-right: 2px solid #8b5a2b;
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #8b5a2b; }
}

/* 信纸展开动画 */
@keyframes paper-unfold {
  0% {
    transform: rotateX(90deg) scale(0.8);
    opacity: 0;
  }
  50% {
    transform: rotateX(-10deg) scale(1.02);
    opacity: 1;
  }
  100% {
    transform: rotateX(0deg) scale(1);
    opacity: 1;
  }
}

.letter-modal.show .letter-paper {
  animation: paper-unfold 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 响应式 */
@media (max-width: 600px) {
  .letter-paper {
    padding: 30px 25px;
  }
  .letter-content {
    font-size: 14px;
    line-height: 1.9;
  }
  .letter-content h1 {
    font-size: 20px;
  }
}

.grad-play-btn-top {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 100;
}

.grad-play-btn-top:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

/* ===== 网站底部备案信息 ===== */
.site-footer {
  padding: 20px;
  background: #f5f3ef;
  color: #78716c;
  font-size: 13px;
}

.beian-row {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.8;
  gap: 6px;
}

.site-footer img {
  width: 12px;
  height: auto;
}
