/* ===== 主题（后台“前景”设置，换主题只改变量） ===== */
body[data-theme="aurora"] {
  --bg-a:#eef2ff; --bg-b:#fdf4ff; --bg-c:#e0f2fe;
  --text:#1f2937; --text2:#6b7280;
  --accent:#7c5cff; --accent2:#c26cf5;
  --btn-bg:linear-gradient(135deg, rgba(124,92,255,.80), rgba(192,108,245,.86));
  --btn-bg-hover:linear-gradient(135deg, rgba(124,92,255,.92), rgba(192,108,245,.97));
  --card-bg:rgba(255,255,255,.66); --card-border:rgba(255,255,255,.85);
  --card-shadow:rgba(80,63,205,.10);
  --notice-bg:rgba(255,251,235,.85); --notice-border:rgba(253,230,138,.9); --notice-text:#92400e;
  --foot:#9ca3af;
}
body[data-theme="mint"] {
  --bg-a:#e9f7ef; --bg-b:#d5efe2; --bg-c:#c2e9d5;
  --text:#274435; --text2:#5b7a6a;
  --accent:#d99a2b; --accent2:#e6b84c;
  --btn-bg:linear-gradient(135deg, rgba(214,158,46,.85), rgba(230,184,76,.90));
  --btn-bg-hover:linear-gradient(135deg, rgba(203,143,32,.95), rgba(226,178,64,1));
  --card-bg:rgba(255,255,255,.62); --card-border:rgba(255,255,255,.45);
  --card-shadow:rgba(39,102,72,.10);
  --notice-bg:rgba(255,251,235,.9); --notice-border:rgba(253,230,138,.9); --notice-text:#92400e;
  --foot:#7ba28e;
}
body[data-theme="sunset"] {
  --bg-a:#fff1eb; --bg-b:#ffe4ec; --bg-c:#ffeeda;
  --text:#43302b; --text2:#8a6f66;
  --accent:#ff6b6b; --accent2:#ff9046;
  --btn-bg:linear-gradient(135deg, rgba(255,107,107,.82), rgba(255,144,70,.88));
  --btn-bg-hover:linear-gradient(135deg, rgba(255,107,107,.95), rgba(255,144,70,1));
  --card-bg:rgba(255,255,255,.66); --card-border:rgba(255,255,255,.9);
  --card-shadow:rgba(214,89,74,.12);
  --notice-bg:rgba(255,247,237,.9); --notice-border:rgba(253,186,116,.9); --notice-text:#9a3412;
  --foot:#c0988c;
}
body[data-theme="night"] {
  --bg-a:#0b1026; --bg-b:#1a1440; --bg-c:#0e1a3a;
  --text:#e5e7eb; --text2:#9aa3b5;
  --accent:#8b5cf6; --accent2:#ec4899;
  --btn-bg:linear-gradient(135deg, rgba(139,92,246,.62), rgba(236,72,153,.60));
  --btn-bg-hover:linear-gradient(135deg, rgba(139,92,246,.85), rgba(236,72,153,.82));
  --card-bg:rgba(255,255,255,.07); --card-border:rgba(255,255,255,.14);
  --card-shadow:rgba(0,0,0,.45);
  --notice-bg:rgba(251,191,36,.10); --notice-border:rgba(251,191,36,.35); --notice-text:#fcd34d;
  --foot:#64748b;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(165deg, var(--bg-a) 0%, var(--bg-b) 52%, var(--bg-c) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

/* ===== 动态背景：漂移光斑 + 上升粒子 ===== */
.blob { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; }
.b1 { width: 300px; height: 300px; background: var(--accent);  opacity: .18; top: -90px;  left: -90px;  animation: drift1 16s ease-in-out infinite alternate; }
.b2 { width: 280px; height: 280px; background: var(--accent2); opacity: .16; bottom: -70px; right: -70px; animation: drift2 20s ease-in-out infinite alternate; }
.b3 { width: 220px; height: 220px; background: var(--accent2); opacity: .10; top: 40%; left: 55%;   animation: drift3 24s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(70px, 50px)   scale(1.25); } }
@keyframes drift2 { to { transform: translate(-60px, -40px) scale(1.2); } }
@keyframes drift3 { to { transform: translate(-80px, 60px)  scale(.8); } }
.particle {
  position: fixed; bottom: -12px; border-radius: 50%;
  background: var(--accent); opacity: 0; pointer-events: none; z-index: 0;
  animation: rise linear infinite;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  12%  { opacity: .5; }
  85%  { opacity: .25; }
  100% { transform: translateY(-105vh) translateX(30px); opacity: 0; }
}

/* ===== 页面主体：手机铺满，电脑固定 480px 居中 ===== */
.page {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 480px;
  padding: 40px 22px calc(46px + env(safe-area-inset-bottom));
}
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ===== 顶部：头像 + 标题 + 简介 ===== */
.profile { text-align: center; animation: fadeInUp .6s .02s backwards; }
.avatar-wrap { position: relative; width: 104px; height: 104px; margin: 0 auto 16px; }
.avatar-ring {
  position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent2), transparent 55%, var(--accent));
  animation: spin 5s linear infinite;
  opacity: .9;
}
.avatar-ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg-b); }
@keyframes spin { to { transform: rotate(360deg); } }
.avatar {
  position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 700; color: #fff;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 35%, transparent), 0 10px 28px rgba(0,0,0,.12);
  animation: float 4s ease-in-out infinite;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .avatar { box-shadow: 0 10px 28px rgba(0,0,0,.18); }
}
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.name { font-size: 23px; font-weight: 800; letter-spacing: 1px; }
.bio { margin-top: 8px; font-size: 13.5px; color: var(--text2); }

/* ===== 滚动公告 ===== */
.notice {
  display: flex; align-items: center; gap: 10px;
  margin-top: 20px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 10px 16px;
  overflow: hidden;
  animation: fadeInUp .6s .1s backwards;
}
.notice-icon { font-size: 15px; flex-shrink: 0; animation: shake 2.6s ease-in-out infinite; }
@keyframes shake {
  0%, 55%, 100% { transform: rotate(0); }
  60% { transform: rotate(-14deg); } 70% { transform: rotate(12deg); }
  80% { transform: rotate(-8deg); }  90% { transform: rotate(6deg); }
}
.notice-viewport { flex: 1; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.notice-track { display: flex; width: max-content; animation: marquee var(--notice-dur, 22s) linear infinite; }
.notice:hover .notice-track { animation-play-state: paused; }
.notice-track.still { animation: none; }
.notice-track span { white-space: nowrap; font-size: 13px; color: var(--notice-text); padding-right: 4em; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===== 跳转按钮：胶囊、文字居中、滑过高光扫过+上浮+发光 ===== */
.links { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.link-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 54px;
  border-radius: 999px;
  background: var(--btn-bg);
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  box-shadow: 0 4px 14px var(--card-shadow);
  transition: transform .28s cubic-bezier(.34,1.56,.64,1), box-shadow .28s ease, background .28s ease;
  animation: fadeInUp .55s var(--d, 0s) backwards;
}
.link-btn:hover {
  transform: translateY(-4px) scale(1.02);
  background: var(--btn-bg-hover);
  box-shadow: 0 12px 30px var(--card-shadow), 0 6px 22px color-mix(in srgb, var(--accent) 45%, transparent);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .link-btn:hover { box-shadow: 0 12px 30px rgba(0,0,0,.25); }
}
.link-btn:active { transform: scale(.96); }
.link-btn::before {
  content: ""; position: absolute; top: 0; left: -80%;
  width: 45%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.6), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
}
.link-btn:hover::before { left: 140%; }
.link-icon {
  position: absolute; left: 5px;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: rgba(255,255,255,.22);
  overflow: hidden;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.link-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.link-btn:hover .link-icon { transform: scale(1.15) rotate(-8deg); }
.link-text {
  font-size: 15.5px; font-weight: 700; color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0,0,0,.18);
  padding: 0 56px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-arrow {
  position: absolute; right: 20px;
  color: rgba(255,255,255,.85); font-size: 20px; line-height: 1;
  transition: transform .28s ease;
}
.link-btn:hover .link-arrow { transform: translateX(4px); }

/* ===== 图文卡片：正方形 1:1 单列通栏，横向 16:9 单列通栏 ===== */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.card {
  position: relative; display: block; overflow: hidden;
  border-radius: 16px;
  text-decoration: none; color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 3px 12px var(--card-shadow);
  transition: transform .16s ease-out, box-shadow .3s ease;
  transform-style: preserve-3d;
  animation: fadeInUp .55s var(--d, 0s) backwards;
  will-change: transform;
}
.card:hover { box-shadow: 0 12px 28px var(--card-shadow), 0 6px 20px color-mix(in srgb, var(--accent) 32%, transparent); }
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .card:hover { box-shadow: 0 12px 28px rgba(0,0,0,.3); }
}
.card:active { transform: scale(.98) !important; }
.card.square { aspect-ratio: 1 / 1; grid-column: 1 / -1; }
.card.wide { aspect-ratio: 16 / 9; grid-column: 1 / -1; }
.card-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: rgba(255,255,255,.92);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  background-size: cover; background-position: center;
  transition: transform .5s cubic-bezier(.2,.6,.2,1);
}
.card:hover .card-ph { transform: scale(1.08); }
.card-ph .emoji { font-size: 38px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.card-ph .label { font-size: 11px; opacity: .85; letter-spacing: 2px; }
.card-title {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 14px 10px;
  color: #fff; font-size: 13px; font-weight: 600;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}

.footer { margin-top: 30px; text-align: center; font-size: 12px; color: var(--foot); animation: fadeInUp .5s .46s backwards; }

/* ===== 背景音乐：悬浮唱片按钮 ===== */
.music-btn {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 20px var(--card-shadow), 0 4px 14px rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
  animation: fadeInUp .55s .5s backwards;
}
.music-btn:hover { transform: scale(1.12); }
.music-btn:active { transform: scale(.92); }
.music-btn .vinyl { font-size: 22px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.music-btn.on .vinyl { animation: spin 3.2s linear infinite; }
.music-btn.wait::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(.9); opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* 点击涟漪 */
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.55);
  transform: scale(0); pointer-events: none;
  animation: rip .6s ease-out forwards;
}
@keyframes rip { to { transform: scale(3); opacity: 0; } }

/* ===== 访客统计行 ===== */
.stats-line {
  margin-top: 30px; text-align: center;
  font-size: 12.5px; color: var(--text2);
  animation: fadeInUp .5s .42s backwards;
}
.stats-line b { color: var(--accent); font-weight: 700; }

/* ===== 访客主题切换器（左下角悬浮） ===== */
.theme-switch {
  position: fixed; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
  animation: fadeInUp .55s .5s backwards;
}
.ts-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--card-border); cursor: pointer;
  background: var(--card-bg);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px var(--card-shadow), 0 4px 14px rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.ts-btn:hover { transform: scale(1.12); }
.ts-btn:active { transform: scale(.92); }
.ts-pop {
  position: absolute; left: 0; bottom: 62px;
  display: flex; gap: 9px; align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 999px; padding: 10px 14px;
  box-shadow: 0 10px 30px var(--card-shadow), 0 6px 18px rgba(0,0,0,.14);
  opacity: 0; transform: translateY(8px) scale(.9); pointer-events: none;
  transform-origin: left bottom;
  transition: .25s cubic-bezier(.34,1.56,.64,1);
}
.theme-switch.open .ts-pop { opacity: 1; transform: none; pointer-events: auto; }
.ts-dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9); cursor: pointer;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  padding: 0;
}
.ts-dot:hover { transform: scale(1.2); }
.ts-dot.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2.5px var(--accent), 0 2px 8px rgba(0,0,0,.22);
}
