/* ============================================================
   个人博客网站 - 样式表
   ============================================================ */
:root {
  --bg: #faf3e9;
  --bg-top: #ffe8d0;
  --card: #fffdf8;
  --text: #453529;
  --muted: #8f735a;
  --accent: #ef7a4a;
  --accent-2: #f0a63c;
  --border: #f1e3d0;
  --shadow: 0 10px 30px rgba(120, 72, 30, 0.1);
  --glass: linear-gradient(135deg, rgba(255, 251, 243, 0.2) 0%, rgba(255, 251, 243, 0.02) 45%, rgba(255, 251, 243, 0.1) 100%);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-border-hover: rgba(255, 255, 255, 1);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(214, 158, 92, 0.16), 0 8px 32px rgba(150, 90, 40, 0.14);
  --liquid-light: rgba(255, 243, 226, 0.55);
  --liquid-ripple: rgba(255, 243, 226, 0.65);
  --radius: 18px;
  --maxw: 1100px;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 240px);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100svh; /* iOS 动态工具栏高度适配 */
  display: flex;
  flex-direction: column;
  overflow-x: clip; /* 照片墙通栏出曲时不产生横向滚动条 */
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; } /* 去除移动端点按灰色高亮 */

/* ---------- 滚动条：细窄主题色，空闲时自动隐藏 ---------- */
html {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--accent) transparent;
}
html.scroll-idle { scrollbar-color: transparent transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 999px;
  transition: background 0.4s ease;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
html.scroll-idle::-webkit-scrollbar-thumb { background: transparent; }

/* ---------- 背景极光光斑（毛玻璃背后的流动色彩） ---------- */
body::before, body::after {
  content: ''; position: fixed; border-radius: 50%;
  pointer-events: none; z-index: -1;
}
body::before {
  width: 520px; height: 520px; top: -140px; left: -100px;
  background: radial-gradient(circle, rgba(240, 130, 70, 0.5) 0%, rgba(240, 130, 70, 0.2) 40%, transparent 70%);
  animation: aurora-a 18s ease-in-out infinite alternate;
}
body::after {
  width: 640px; height: 640px; bottom: -180px; right: -140px;
  background: radial-gradient(circle, rgba(245, 180, 80, 0.45) 0%, rgba(245, 180, 80, 0.18) 40%, transparent 70%);
  animation: aurora-b 24s ease-in-out infinite alternate;
}
@keyframes aurora-a { from { transform: translate(0, 0) scale(1); } to { transform: translate(70px, 50px) scale(1.08); } }
@keyframes aurora-b { from { transform: translate(0, 0) scale(1); } to { transform: translate(-80px, -60px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  /* 关闭页面切换动画 */
  .slide [data-stagger] { opacity: 1; transform: none; transition: none; }
  .scroll-down .chev { animation: none; }
  .hero-info h1.pressed { animation: none; }
  .name-rainbow { animation: none; }
  .hero-avatar img { transition: none; }
  /* 照片墙：停止自动滚动，改为可横向滑动浏览 */
  .gallery { overflow-x: auto; }
  .gallery-track { animation: none; }
}

/* ---------- 顶栏 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; max-width: var(--maxw); width: 100%; margin: 0 auto;
  background: rgba(255, 251, 243, 0.5);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 20px 20px;
  box-shadow: var(--glass-shadow);
  transition: background-color 0.25s ease, opacity 0.9s ease, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.navbar .logo { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; }
.navbar .logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { font-weight: 500; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); }
.nav-links a.nav-ai { color: var(--accent); font-weight: 600; }
.lang-switch {
  position: relative;
  display: flex; border: 1px solid var(--glass-border); border-radius: 999px; overflow: hidden;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.lang-switch button {
  position: relative; z-index: 1;
  border: none; background: transparent; padding: 6px 14px; cursor: pointer;
  font-size: 14px; color: var(--muted); transition: color 0.2s;
}
.lang-switch button.active { background: transparent; color: #fff; }

/* 主题切换（浅色 / 深色 / 跟随系统） */
.nav-tools { display: flex; align-items: center; gap: 8px; }
.theme-switch {
  position: relative;
  display: flex; border: 1px solid var(--glass-border); border-radius: 999px; overflow: hidden;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.theme-switch button {
  position: relative; z-index: 1;
  border: none; background: transparent; padding: 6px 10px; cursor: pointer;
  font-size: 13px; line-height: 1; opacity: 0.55; transition: opacity 0.2s;
}
.theme-switch button.active { background: transparent; opacity: 1; }

/* 胶囊指示器：选中时平滑滑动到位，带流光扫过 */
.pill-indicator {
  position: absolute;
  top: 1px; bottom: 1px; left: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}
.pill-indicator::after {
  content: '';
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.7) 50%, transparent 58%);
  background-size: 240% 100%;
  background-position: 220% 0;
}
.pill-indicator.shine::after { animation: pill-shine 0.55s ease; }
@keyframes pill-shine {
  from { background-position: 220% 0; }
  to { background-position: -120% 0; }
}

/* 左下角液态玻璃小胶囊（深浅色 + 中英切换，开场全程可见） */
.corner-tools {
  position: fixed;
  left: 16px; bottom: 16px;
  z-index: 98;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 退出登录按钮（顶栏） */
#logout-btn {
  padding: 6px 14px; font-size: 14px; background: var(--glass);
  color: var(--muted); border: 1px solid var(--glass-border); border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
#logout-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 布局 ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 28px 24px; flex: 1; }
.section-title { font-size: 26px; font-weight: 800; margin: 8px 0 4px; }
.section-subtitle { color: var(--muted); margin-bottom: 24px; }

/* ---------- 名片 Hero ---------- */
.hero {
  display: flex; flex-direction: column; flex-wrap: nowrap;
  align-items: center; justify-content: center;
  gap: 16px; text-align: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: 24px; padding: 52px 40px; margin-bottom: 40px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(3px) saturate(135%);
  -webkit-backdrop-filter: blur(3px) saturate(135%);
}
.hero-avatar { flex: 0 0 auto; }
.hero-avatar img {
  width: 160px; height: 160px; border-radius: 50%; object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.6); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}
/* 悬停小放大 + 阴影加深；按压微缩，更灵动 */
.hero-avatar img:hover { transform: scale(1.1); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28); }
.hero-avatar img:active { transform: scale(0.97); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); }
.hero-info { flex: none; }
.hero-info .hello { font-size: 16px; opacity: 0.9; }
.hero-info h1 {
  position: relative;
  font-size: 38px; font-weight: 800; margin: 4px 0 4px;
  /* 文字景深：细描边轮廓 + 底部高光 + 柔和投影 */
  -webkit-text-stroke: 0.6px rgba(69, 53, 41, 0.28);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55), 0 3px 10px rgba(0, 0, 0, 0.14);
}
/* 名字按压压扁回弹 */
.hero-info h1.pressed {
  animation: name-press 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes name-press {
  0% { transform: scale(1, 1); }
  40% { transform: scale(1.06, 0.82); }
  70% { transform: scale(0.98, 1.03); }
  100% { transform: scale(1, 1); }
}
/* 名字彩虹流光覆盖层（ARGB 流光溢彩） */
.name-rainbow {
  position: absolute;
  inset: 0;
  display: block;
  background: linear-gradient(90deg,
    #ff0040, #ff8000, #ffee00, #00e04b, #00a3ff, #8a2be2, #ff0080);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: rainbow-flow 3s linear infinite;
  opacity: 0;
  pointer-events: none;
}
@keyframes rainbow-flow {
  from { background-position: 0% 50%; }
  to { background-position: 300% 50%; }
}
[data-theme="dark"] .hero-info h1 {
  -webkit-text-stroke: 0.6px rgba(230, 234, 242, 0.32);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 3px 12px rgba(0, 0, 0, 0.5);
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .hero-info h1 {
    -webkit-text-stroke: 0.6px rgba(230, 234, 242, 0.32);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 3px 12px rgba(0, 0, 0, 0.5);
  }
}
.hero-info .title { font-size: 18px; opacity: 0.95; margin-bottom: 10px; }
.hero-info .bio { font-size: 15px; opacity: 0.9; max-width: 560px; margin: 0 auto; }
.hero-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px;
  border-radius: 999px; font-weight: 600; cursor: pointer; border: none; font-size: 15px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: #fff; color: var(--accent); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  background: rgba(255,255,255,0.18); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.3); }
.btn-outline {
  background: var(--glass); color: var(--accent); border: 1px solid var(--accent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.1); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

/* ---------- 联系人卡片 ---------- */
.contact {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin: 28px auto 40px;
  max-width: 720px;
}
.contact-hint {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin: 8px 0 22px;
}
.contact-item {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--glass-shadow);
  text-align: center;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s;
}
.contact-item:hover { transform: translateY(-3px); }
.contact-item .label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.contact-item .value { font-size: 17px; font-weight: 600; word-break: break-all; }
.contact-item a.value:hover { color: var(--accent); }

/* ---------- 照片墙：横向无缝滚动 + 左右渐隐（真正通栏） ---------- */
.gallery {
  width: 100vw;
  margin-left: calc((100% - 100vw) / 2);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}
/* 第二条照片墙：反向（从左到右）+ 与第一条的间距 */
.gallery-reverse { margin-top: 64px; }
.gallery-reverse .gallery-track { animation-direction: reverse; }
/* 照片墙页标题/副标题居中，与通栏照片带呼应 */
#slide-photos .section-title,
#slide-photos .section-subtitle {
  text-align: center;
}
.gallery-track {
  display: flex;
  width: max-content;
  animation: gallery-scroll 60s linear infinite;
  will-change: transform;
}
.gallery:hover .gallery-track { animation-play-state: paused; }
@keyframes gallery-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.gallery-item {
  flex: 0 0 auto;
  width: 300px;
  margin-right: 18px;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--glass-shadow); cursor: zoom-in;
  transition: transform 0.2s, background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.gallery-item:hover { transform: translateY(-4px); }
.gallery-item img { width: 100%; height: 190px; object-fit: cover; display: block; }
.gallery-item .meta { padding: 14px 16px; }
.gallery-item .meta h3 { font-size: 16px; margin-bottom: 2px; }
.gallery-item .meta p { font-size: 13px; color: var(--muted); }

/* 作品区不再占满整屏，紧贴下方图片集 */
#slide-photos { min-height: auto; }

/* ---------- 图片集：小红书式瀑布流（兼容竖屏照片） ---------- */
.album-section { padding: 8px 0 70px; }
.album-section .section-title,
.album-section .section-subtitle { text-align: center; }
.album-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  padding: 12px 0;
  width: 100vw;
  margin-left: calc((100% - 100vw) / 2);
}
.album-item {
  position: relative;
  width: clamp(160px, 42vw, 230px);
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.album-item:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  z-index: 5;
}
.album-item.dragging {
  cursor: grabbing;
  z-index: 20;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
}
.album-item img { width: 100%; height: auto; display: block; }
.album-item figcaption { padding: 10px 12px; }
.album-item figcaption b { display: block; font-size: 14px; margin-bottom: 2px; }
.album-item figcaption span { font-size: 12.5px; color: var(--muted); }

/* ---------- 回到顶部按钮 ---------- */
.back-top {
  position: fixed; right: 20px; bottom: 22px; z-index: 98;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glass-shadow);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.2s ease, border-color 0.2s ease;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 与你一起页面 ---------- */
.withyou-bg {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 100vw;
  transform: translateX(-50%) scale(1.05);
  z-index: -1;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0.5;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.3s ease-out;
}
.withyou-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 40%, transparent 60%, var(--bg) 100%);
}
.with-hero { text-align: center; padding: 70px 0 34px; }
.with-hero-title {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: clamp(30px, 5vw, 46px); font-weight: 900; margin: 16px 0 6px; line-height: 1.25;
}
.with-hero-title .ds-hero-logo {
  width: 96px; height: 96px;
  filter: drop-shadow(0 8px 22px rgba(77, 107, 254, 0.45));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.with-hero-title .ds-hero-logo:hover { transform: scale(1.15); }
.with-hero-title .with-slogan {
  font-size: 17px; font-weight: 700; letter-spacing: 0.14em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-fill-color: transparent;
}
.with-sub { color: var(--muted); font-size: 16px; margin-bottom: 22px; }
.type-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--text);
  animation: type-blink 0.75s step-end infinite;
}
@keyframes type-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.deepseek-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--glass-border);
  color: var(--text); font-weight: 600; font-size: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.deepseek-badge:hover { transform: translateY(-2px); border-color: var(--cyan); }
.deepseek-badge .ds-logo { width: 22px; height: 22px; }
.deepseek-badge .ds-text { height: 16px; width: auto; filter: brightness(0) invert(1); }
.with-card { margin: 24px 0; }
.with-card .section-title { font-size: 24px; margin-bottom: 18px; }
.with-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 22px 0 28px;
}
.with-item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 16px 12px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.with-dot {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px rgba(46, 232, 223, 0.3);
}
.with-item b { display: block; font-size: 15.5px; margin: 0; }
.with-item p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }
.with-closing { text-align: center; font-size: 16px; font-weight: 600; margin-top: 8px; }

@media (max-width: 700px) {
  .with-timeline { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .with-timeline { grid-template-columns: 1fr; }
}

/* ---------- 朋友卡片（Apple 高管介绍风） ---------- */
.friends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; margin-bottom: 40px; }
.friend-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.25s ease;
}
.friend-card:hover { transform: translateY(-5px); }
.friend-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
}
.friend-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.friend-card:hover .friend-photo img { transform: scale(1.05); }
.friend-info { padding: 18px 20px 22px; text-align: left; }
.friend-info .name { font-size: 22px; font-weight: 800; letter-spacing: 0.2px; }
.friend-info .nick { font-size: 13px; color: var(--accent); font-weight: 600; margin: 2px 0 8px; }
.friend-info .desc { font-size: 13px; color: var(--muted); line-height: 1.55; }
.friend-info .visit {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}
.friend-info .visit::after { content: '→'; transition: transform 0.25s ease; }
.friend-info .visit:hover::after { transform: translateX(3px); }

/* ---------- 编辑页 ---------- */
.admin-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--glass-shadow);
  padding: 26px; margin-bottom: 28px;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tabs { display: flex; gap: 8px; margin: 20px 0; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--glass-border);
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; font-weight: 500; color: var(--muted);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.form-field { display: flex; flex-direction: column; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.form-field input, .form-field textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; transition: border 0.15s, background-color 0.25s ease, color 0.25s ease;
  background: var(--card); color: var(--text);
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--accent); }
.form-field textarea { resize: vertical; min-height: 80px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.preview-img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; margin-top: 8px; }

.item-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.item-row:last-child { border-bottom: none; }
.item-row .drag-handle { cursor: grab; color: var(--muted); font-size: 18px; padding: 0 4px; user-select: none; flex: 0 0 auto; }
.item-row.dragging { opacity: 0.45; }
.item-row img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; }
.item-row .info { flex: 1; min-width: 0; }
.item-row .info .t { font-weight: 600; }
.item-row .info .d { font-size: 12px; color: var(--muted); }
.item-row .actions { display: flex; gap: 8px; }
.item-row .btn { padding: 6px 12px; font-size: 13px; }

/* ---------- 弹窗 / 提示 ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: rgba(22, 163, 74, 0.85); color: #fff; padding: 12px 22px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2); opacity: 0; transition: all 0.3s; z-index: 200; font-weight: 500;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: rgba(239, 68, 68, 0.88); }

/* ---------- 后台登录遮罩 ---------- */
.login-overlay {
  position: fixed; inset: 0; background: rgba(45, 28, 12, 0.5); z-index: 150;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.login-overlay.show { display: flex; }
.login-card {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--glass-shadow);
  padding: 30px 28px; width: 100%; max-width: 360px; text-align: center;
  transition: background-color 0.25s ease;
}
.login-card h3 { margin-bottom: 6px; font-size: 20px; }
.login-card .hint { margin-bottom: 16px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; font-family: inherit; margin-bottom: 16px;
  background: var(--card); color: var(--text);
  transition: border 0.15s, background-color 0.25s ease, color 0.25s ease;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

/* 登录卡片右上角小关闭按钮 */
.login-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: var(--glass);
  color: var(--muted);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.login-close:hover { color: var(--accent); background: rgba(0, 0, 0, 0.06); }
[data-theme="dark"] .login-close:hover { background: rgba(255, 255, 255, 0.08); }

/* 关闭提示文案 */
.login-close-hint { margin: 14px 0 0; opacity: 0.7; }

/* ---------- 灯箱 Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(2,6,23,0.88); z-index: 100;
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 78vh; border-radius: 12px; }
.lightbox .lb-caption { color: #fff; font-size: 15px; }
.lightbox .lb-close {
  position: absolute; top: 24px; right: 28px; color: #fff; font-size: 34px;
  cursor: pointer; background: none; border: none; line-height: 1;
}

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; padding: 26px; color: var(--muted); font-size: 14px;
  border-top: 1px solid var(--glass-border); margin-top: 30px;
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ============================================================
   液态玻璃：光标折光高光 + 点击折射涟漪
   ============================================================ */
.contact-item, .gallery-item, .friend-card, .admin-card, .login-card, .hero {
  position: relative;
  overflow: hidden;
}

/* 光标折射高光（跟随光标移动） */
.contact-item::before, .gallery-item::before, .friend-card::before,
.admin-card::before, .login-card::before, .hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
    var(--liquid-light) 0%, transparent 65%);
  opacity: var(--glow, 0);
  transition: opacity 0.35s ease;
}

/* 点击折射涟漪（从按点向外荡开） */
.contact-item::after, .gallery-item::after, .friend-card::after,
.admin-card::after, .login-card::after, .hero::after {
  content: '';
  position: absolute; z-index: 1; pointer-events: none;
  left: var(--px, 50%); top: var(--py, 50%);
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--liquid-ripple) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
}
.glass-ripple::after { animation: glass-ripple 0.65s ease-out; }
@keyframes glass-ripple {
  0% { transform: scale(0.15); opacity: 1; }
  100% { transform: scale(7); opacity: 0; }
}

/* 悬停时玻璃描边提亮（光线折射感） */
.contact-item:hover, .gallery-item:hover, .friend-card:hover,
.admin-card:hover, .login-card:hover, .hero:hover {
  border-color: var(--glass-border-hover);
}

/* ============================================================
   首页 PPT 式整页滚动 + 切换动画
   ============================================================ */
.slide {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}
.slide-inner { width: 100%; }
.slide .footer { width: 100%; }

/* 作品区可更换背景：整页铺满，随页面切换渐出渐入 */
.slide-bg {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0.5;
  pointer-events: none;
}
.slide-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 38%, transparent 62%, var(--bg) 100%);
}

/* 页面切换渐入渐出：进入时交错渐入，离开时渐出 */
.slide [data-stagger] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.slide.in-view [data-stagger] {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--i, 0) * 90ms);
}

/* 向下滚动引导标识（大号﹀，白/灰随主题，呼吸浮动） */
.scroll-down {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 48px 0 10px;
  color: var(--muted);
  font-size: 46px;
  line-height: 1;
  text-decoration: none;
  transition: color 0.25s ease;
}
.scroll-down:hover { color: var(--accent); }
.scroll-down .chev {
  display: inline-block;
  animation: scroll-down-float 2.2s ease-in-out infinite;
}
@keyframes scroll-down-float {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(12px); opacity: 1; }
}
[data-theme="dark"] .scroll-down { color: rgba(255, 255, 255, 0.9); }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .scroll-down { color: rgba(255, 255, 255, 0.9); }
}

/* ============================================================
   电影式开场动画（首页：名片全屏 → 缩小回位）
   ============================================================ */
.intro-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: var(--bg);
  opacity: 0; /* 默认隐藏：只有开场动画进行中才显示，避免 JS 异常时黑屏 */
  pointer-events: none;
  transition: opacity 0.6s ease;
  cursor: pointer;
}
body.intro-active .intro-backdrop {
  opacity: 1;
  pointer-events: auto;
}
.intro-backdrop.fading { opacity: 0; pointer-events: none; }

body.intro-active { overflow: hidden; }

body.intro-active .hero {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 95;
  /* 与最终布局一致的纵向居中排列：缩小过程内容自然回流，居中无变形 */
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 22px;
  padding: 60px;
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}
body.intro-active .hero.hero-shown {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.9s ease, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
/* 防止 flex:1 撑开导致整体不居中 */
body.intro-active .hero .hero-info { flex: none; }
/* 分层缓入：卡片先浮现，头像与名片信息稍后渐入 */
body.intro-active .hero .hero-avatar,
body.intro-active .hero .hero-info {
  opacity: 0;
}
body.intro-active .hero.hero-shown .hero-avatar,
body.intro-active .hero.hero-shown .hero-info {
  opacity: 1;
  transition: opacity 0.7s ease 0.3s;
}
/* 开场期间隐藏顶栏，结束后从上方滑入 */
body.intro-active .navbar { opacity: 0; transform: translateY(-100%); }
/* 中段揭示：缩小进行到一半时顶栏提前滑入 */
body.intro-reveal .navbar { opacity: 1; transform: translateY(0); }
/* 开场期间占位：保留名片布局空间（落地时联系方式不跳动） */
.hero-ghost { display: none; }
body.intro-active .hero-ghost { display: block; }
/* 全屏名片内容放大，更有片头感 */
body.intro-active .hero .hero-avatar img { width: 210px; height: 210px; }
body.intro-active .hero .hero-info .hello { font-size: 18px; }
body.intro-active .hero .hero-info h1 { font-size: 54px; }
body.intro-active .hero .hero-info .title { font-size: 20px; }
body.intro-active .hero .hero-info .bio { font-size: 17px; max-width: 720px; }

/* 缩小过程：盒体 + 内容同步过渡到最终尺寸（连续、无变形） */
body.intro-active .hero.hero-morphing {
  transition:
    top 1.15s cubic-bezier(0.22, 1, 0.36, 1),
    left 1.15s cubic-bezier(0.22, 1, 0.36, 1),
    width 1.15s cubic-bezier(0.22, 1, 0.36, 1),
    height 1.15s cubic-bezier(0.22, 1, 0.36, 1),
    padding 1.15s cubic-bezier(0.22, 1, 0.36, 1),
    gap 1.15s ease,
    border-radius 1.15s ease;
}
body.intro-active .hero.hero-morphing .hero-avatar img {
  transition: width 1.15s cubic-bezier(0.22, 1, 0.36, 1), height 1.15s cubic-bezier(0.22, 1, 0.36, 1);
}
body.intro-active .hero.hero-morphing .hero-info .hello,
body.intro-active .hero.hero-morphing .hero-info h1,
body.intro-active .hero.hero-morphing .hero-info .title,
body.intro-active .hero.hero-morphing .hero-info .bio {
  transition: font-size 1.15s cubic-bezier(0.22, 1, 0.36, 1);
}
body.intro-active .hero.hero-morphing .hero-info .bio {
  transition: font-size 1.15s cubic-bezier(0.22, 1, 0.36, 1), max-width 1.15s ease;
}

/* 开场落地后：联系方式等从网页下方平滑弹出（PPT 丝滑切换） */
body.intro-landed .slide [data-stagger] {
  opacity: 0;
  transform: translateY(72px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
body.intro-landed .slide.in-view [data-stagger] {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--i, 0) * 110ms + 0.1s);
}

/* ============================================================
   深色主题
   ============================================================ */
[data-theme="dark"] {
  --bg: #0f1219;
  --bg-top: #1a2130;
  --card: #1a202c;
  --text: #e6eaf2;
  --muted: #97a2b8;
  --accent: #818cf8;
  --accent-2: #38bdf8;
  --border: #2b3446;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.005) 45%, rgba(255, 255, 255, 0.025) 100%);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-hover: rgba(255, 255, 255, 0.3);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 8px 32px rgba(0, 0, 0, 0.45);
  --liquid-light: rgba(255, 255, 255, 0.18);
  --liquid-ripple: rgba(255, 255, 255, 0.28);
  color-scheme: dark;
}
[data-theme="dark"] .btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(129, 140, 248, 0.3); }
[data-theme="dark"] .navbar { background: rgba(15, 18, 25, 0.55); }
[data-theme="dark"] .btn-danger { background: rgba(248, 113, 113, 0.12); color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
[data-theme="dark"] body::before { background: radial-gradient(circle, rgba(79, 70, 229, 0.4) 0%, rgba(79, 70, 229, 0.15) 40%, transparent 70%); }
[data-theme="dark"] body::after { background: radial-gradient(circle, rgba(2, 132, 199, 0.35) 0%, rgba(2, 132, 199, 0.12) 40%, transparent 70%); }

/* 跟随系统：系统为深色时，auto 模式同样使用深色变量 */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #0f1219;
    --bg-top: #1a2130;
    --card: #1a202c;
    --text: #e6eaf2;
    --muted: #97a2b8;
    --accent: #818cf8;
    --accent-2: #38bdf8;
    --border: #2b3446;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --glass: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.005) 45%, rgba(255, 255, 255, 0.025) 100%);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-border-hover: rgba(255, 255, 255, 0.3);
    --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.35), 0 8px 32px rgba(0, 0, 0, 0.45);
    --liquid-light: rgba(255, 255, 255, 0.18);
    --liquid-ripple: rgba(255, 255, 255, 0.28);
    color-scheme: dark;
  }
  [data-theme="auto"] .btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(129, 140, 248, 0.3); }
  [data-theme="auto"] .navbar { background: rgba(15, 18, 25, 0.55); }
  [data-theme="auto"] .btn-danger { background: rgba(248, 113, 113, 0.12); color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
  [data-theme="auto"] body::before { background: radial-gradient(circle, rgba(79, 70, 229, 0.4) 0%, rgba(79, 70, 229, 0.15) 40%, transparent 70%); }
  [data-theme="auto"] body::after { background: radial-gradient(circle, rgba(2, 132, 199, 0.35) 0%, rgba(2, 132, 199, 0.12) 40%, transparent 70%); }
}

@media (max-width: 640px) {
  /* ---------- 顶栏 ---------- */
  .navbar { padding: 10px 14px; flex-wrap: wrap; row-gap: 8px; }
  .navbar .logo { font-size: 18px; }
  .nav-links { gap: 10px; flex-wrap: wrap; }
  .nav-links a { font-size: 14px; }
  .lang-switch button { padding: 8px 12px; font-size: 13px; }
  .nav-tools { gap: 6px; }
  .theme-switch button { padding: 8px 10px; }
  #logout-btn { padding: 8px 12px; font-size: 13px; }

  /* ---------- 布局 ---------- */
  .container { padding: 20px 16px; }
  .section-title { font-size: 22px; }

  /* ---------- 名片 Hero：竖排居中 ---------- */
  .hero { flex-direction: column; text-align: center; padding: 28px 20px; gap: 16px; }
  .hero-avatar img { width: 112px; height: 112px; }
  .hero-info h1 { font-size: 28px; }
  .hero-info .bio { margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; min-width: 130px; }

  /* ---------- 联系人：两列 ---------- */
  .contact { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .contact-item { padding: 16px 12px; }
  .contact-item .value { font-size: 15px; }

  /* ---------- 照片墙 / 朋友：更紧凑 ---------- */
  .gallery-item { width: 240px; margin-right: 12px; }
  .gallery-item img { height: 150px; }
  .gallery-item .meta { padding: 10px 12px; }
  .gallery-item .meta h3 { font-size: 14px; }
  .friends-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .friend-info { padding: 12px 14px 16px; }
  .friend-info .name { font-size: 17px; }

  /* ---------- 编辑页 ---------- */
  .admin-card { padding: 18px 14px; }
  .tabs { gap: 6px; }
  .tab { padding: 9px 14px; font-size: 14px; flex: 1 1 auto; text-align: center; }
  /* 16px 字号防 iOS 聚焦时自动放大页面 */
  .form-field input, .form-field textarea, .login-card input { font-size: 16px; }
  .item-row { flex-wrap: wrap; }
  .item-row .btn { padding: 8px 14px; font-size: 14px; }

  /* ---------- 弹窗 / 提示 ---------- */
  .toast { max-width: 90vw; text-align: center; }
  .lightbox .lb-close { top: 14px; right: 18px; font-size: 30px; }

  .footer { padding: 20px; font-size: 13px; }

  /* 极光光斑缩小 */
  body::before { width: 340px; height: 340px; top: -100px; left: -120px; }
  body::after { width: 420px; height: 420px; bottom: -140px; right: -160px; }

  /* PPT 页滚动：顶栏更高，吸附偏移增大 */
  html { scroll-padding-top: 96px; }
  .slide { padding: 14px 0; }

  /* 移动端：内容直接显示，不依赖入场检测（修复安卓/苹果端作品区不显示的问题） */
  .slide [data-stagger] { opacity: 1; transform: none; transition: none; }

  /* 开场全屏名片：手机竖排 + 适当缩小 + iOS 动态工具栏适配 */
  body.intro-active .hero { height: 100svh; flex-direction: column; gap: 22px; padding: 32px; }
  body.intro-active .hero .hero-avatar img { width: 150px; height: 150px; }
  body.intro-active .hero .hero-info h1 { font-size: 36px; }
}

/* 超小屏手机：联系人单列，避免过挤 */
@media (max-width: 380px) {
  .contact { grid-template-columns: 1fr; }
  .hero-actions .btn { min-width: 0; width: 100%; }
}

/* ============================================================
   iOS/Android 安全区适配（刘海屏、底部横条）
   ============================================================ */
.navbar {
  padding-top: calc(14px + env(safe-area-inset-top));
  padding-left: calc(24px + env(safe-area-inset-left));
  padding-right: calc(24px + env(safe-area-inset-right));
}
.corner-tools {
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(16px + env(safe-area-inset-bottom));
}
.back-top {
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(22px + env(safe-area-inset-bottom));
}
.toast {
  bottom: calc(28px + env(safe-area-inset-bottom));
}

/* 主页整体背景图 */
.home-bg {
  position: fixed; inset: 0; z-index: -1;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0.4;
  pointer-events: none;
  will-change: opacity, transform;
  transform: scale(1.06);
  transition: transform 0.3s ease-out;
}
.home-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, transparent 40%, transparent 60%, var(--bg) 100%);
}

/* 主页名片：去掉液态玻璃卡片，只保留介绍内容 */
.hero {
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0;
  padding: 0;
  overflow: visible;
}
.hero::before, .hero::after { content: none; }

/* 与你一起页：进入渐入转场（遮罩淡出 + 内容交错渐入） */
.intro-veil {
  position: fixed; inset: 0; z-index: 9990;
  background: var(--bg);
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.intro-veil.done { opacity: 0; }

.with-page [data-fade] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 1s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.with-page [data-fade].pop {
  transform: translateY(18px) scale(0.7);
}
.with-page.with-ready [data-fade] {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: var(--d, 0s);
}

@media (prefers-reduced-motion: reduce) {
  .intro-veil { display: none; }
  .with-page [data-fade] { opacity: 1; transform: none; transition: none; }
}

/* 开关（toggle switch） */
.switch-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch-wrap input { display: none; }
.switch-ui {
  position: relative; width: 46px; height: 26px; border-radius: 999px;
  background: var(--border); transition: background 0.2s ease; flex: 0 0 auto;
}
.switch-ui::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.switch-wrap input:checked + .switch-ui { background: var(--accent); }
.switch-wrap input:checked + .switch-ui::after { left: 23px; }