/* ============================================================
   个人官网 · 前台样式
   基于原版「液态玻璃」设计系统，改为由后台配置驱动
   ============================================================ */

:root{
  --card-tint: rgba(255,255,255,0.55);
  --card-tint-strong: rgba(255,255,255,0.72);
  --card-border: rgba(255,255,255,0.65);
  --text: #1d1d1f;
  --text-dim: rgba(29,29,31,0.6);
  --accent: #d98bab;
  --shadow: 0 10px 34px rgba(20,10,20,0.16);
  --spring: cubic-bezier(.34,1.12,.64,1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

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

html,body{
  margin:0;
  padding:0;
  min-height:100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  overflow-x:hidden;
  scroll-behavior:smooth;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; }
}

/* ---------------- 首屏骨架（配置加载前） ---------------- */
.boot{
  position:fixed; inset:0; display:flex; align-items:center; justify-content:center;
  z-index:100; background:rgba(248,244,246,0.9);
  transition:opacity .5s var(--ease-out), visibility .5s;
}
.boot.hide{ opacity:0; visibility:hidden; }
.boot-spin{
  width:34px; height:34px; border-radius:50%;
  border:2.5px solid rgba(0,0,0,0.1); border-top-color:var(--accent);
  animation:bootspin .8s linear infinite;
}
@keyframes bootspin{ to{ transform:rotate(360deg); } }

/* ---------------- 背景 ---------------- */
.bg{
  position:fixed;
  inset:-60px;
  background-size:cover;
  background-position:center 30%;
  background-repeat:no-repeat;
  background-color:#e9e2e6;
  filter: blur(4px) brightness(0.92) saturate(1.08);
  z-index:-2;
  transform:scale(1.05);
  will-change:transform;
}
.bg-veil{
  position:fixed;
  inset:0;
  z-index:-1;
  background:linear-gradient(180deg, rgba(255,255,255,0.25) 0%, rgba(250,246,248,0.42) 60%, rgba(245,240,244,0.5) 100%);
}

/* ---------------- 开场高斯模糊淡入（可开关） ---------------- */
.page{
  min-height:100vh;
  padding: 20px 20px 60px;
  max-width:1180px;
  width:100%;
  margin:0 auto;
  box-sizing:border-box;
}
.page.anim-intro{
  animation: pageIn 1.3s cubic-bezier(.22,.61,.36,1) forwards;
}
/* 关闭开场动画时，直接静止显示，但仍保证初始可见 */
.page.no-anim-intro{
  opacity:1;
  filter:none;
  transform:none;
}
@keyframes pageIn{
  0%{ filter: blur(26px); opacity:0; transform: scale(1.03); }
  100%{ filter: blur(0px); opacity:1; transform: scale(1); }
}

/* ---------------- 液态玻璃 ---------------- */
.glass{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  border:1px solid var(--card-border);
  background:var(--card-tint);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow), inset 0 1px 1px rgba(255,255,255,0.7);
  transition: transform 0.55s var(--spring), box-shadow 0.5s ease, background 0.5s ease;
}
.glass.strong{ background:var(--card-tint-strong); }

.glass::before,
.icon-btn::before,
.player-toggle::before,
.player-chevron::before{
  content:'';
  position:absolute;
  inset:-22%;
  border-radius:inherit;
  pointer-events:none;
  opacity:0;
  transform:scale(1);
  backdrop-filter: blur(3px) saturate(220%) brightness(1.05);
  -webkit-backdrop-filter: blur(3px) saturate(220%) brightness(1.05);
  background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.35), transparent 62%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
  transition: opacity 0.5s var(--spring), transform 0.5s var(--spring);
  z-index:0;
}
.glass:active::before,
.icon-btn:active::before,
.player-toggle:active::before,
.player-chevron:active::before{
  opacity:1;
  transform:scale(1.14);
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.card{ border-radius:26px; }

/* ---------------- 顶栏 ---------------- */
.navbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 26px;
  margin-bottom:22px;
  position:sticky;
  top:14px;
  z-index:30;
}
.nav-left{ display:flex; align-items:center; gap:12px; position:relative; z-index:1; min-width:0; }
.nav-avatar{ width:38px; height:38px; border-radius:50%; object-fit:cover; flex-shrink:0; background:var(--card-tint-strong); }
.nav-avatar-fallback{
  width:38px; height:38px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--accent), #b8a6d9);
  color:#fff; font-weight:700; font-size:16px;
}
.nav-name{ font-size:17px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.nav-right{ display:flex; gap:10px; position:relative; z-index:1; flex-wrap:wrap; justify-content:flex-end; }

.icon-btn{
  width:38px;
  height:38px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text);
  text-decoration:none;
  box-shadow:none;
  border:1px solid transparent;
  position:relative;
  overflow:hidden;
  isolation:isolate;
  transition: transform 0.35s var(--ease-out), border-color 0.45s ease, box-shadow 0.45s ease;
}
.icon-btn svg{ width:17px; height:17px; position:relative; z-index:1; }
.icon-btn img{ width:19px; height:19px; object-fit:contain; position:relative; z-index:1; border-radius:4px; }
@media (hover:hover) and (pointer:fine){
  .icon-btn:hover{ border-color:var(--card-border); box-shadow: 0 6px 16px rgba(20,10,20,0.12); transform:translateY(-2px); }
}
.icon-btn:active{ transform:translateY(0) scale(0.9); }

@keyframes riseIn{
  from{ opacity:0; transform:translateY(14px); }
  to{ opacity:1; transform:translateY(0); }
}

/* ---------------- 滚动入场（可开关） ---------------- */
.reveal{
  opacity:0;
  transform:translateY(20px);
  filter:blur(10px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out), filter 1.1s var(--ease-out);
}
.reveal.in-view{
  opacity:1;
  transform:translateY(0);
  filter:blur(0);
}
/* 关闭入场动画：元素直接可见，不参与观察 */
.reveal.no-anim{
  opacity:1;
  transform:none;
  filter:none;
  transition:none;
}

/* ---------------- 布局 ---------------- */
.layout{
  display:grid;
  grid-template-columns:320px minmax(0, 1fr);
  gap:22px;
  align-items:start;
  min-width:0;
}
@media (max-width:860px){
  .layout{ grid-template-columns:minmax(0, 1fr); }
}

/* ---------------- 侧栏 ---------------- */
.sidebar{
  padding:36px 28px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  min-width:0;
}

.avatar-wrap{ position:relative; z-index:1; flex-shrink:0; }
.avatar{
  width:150px;
  height:150px;
  border-radius:50%;
  object-fit:cover;
  box-shadow: 0 8px 26px rgba(20,10,20,0.18);
  position:relative;
  z-index:1;
  display:block;
  background:var(--card-tint-strong);
}
.avatar-fallback{
  width:150px; height:150px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--accent), #b8a6d9);
  color:#fff; font-weight:700; font-size:52px;
  box-shadow: 0 8px 26px rgba(20,10,20,0.18);
}
/* 头像悬停微交互（可开关） */
.avatar-wrap.anim-avatar .avatar{ transition: transform 0.5s var(--spring); }
@media (hover:hover) and (pointer:fine){
  .avatar-wrap.anim-avatar:hover .avatar{ transform: scale(1.045) rotate(-1deg); }
}

.name{ margin:22px 0 4px; font-size:28px; font-weight:700; letter-spacing:0.01em; position:relative; z-index:1; word-break:break-word; }
.username{ margin:0; font-size:15px; color:var(--text-dim); position:relative; z-index:1; word-break:break-word; }
.bio-quote{ margin:18px 0 0; font-size:14px; line-height:1.6; color:var(--text-dim); position:relative; z-index:1; word-break:break-word; }

.social-list{ width:100%; display:flex; flex-direction:column; gap:10px; margin-top:28px; min-width:0; }
.social-btn{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 18px;
  border-radius:16px;
  color:var(--text);
  text-decoration:none;
  font-size:14px;
  font-weight:600;
  min-width:0;
}
.social-btn svg{ width:18px; height:18px; flex-shrink:0; position:relative; z-index:1; }
.social-btn img{ width:18px; height:18px; object-fit:contain; flex-shrink:0; position:relative; z-index:1; border-radius:4px; }
.social-btn span{ position:relative; z-index:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (hover:hover) and (pointer:fine){
  .social-btn:hover{ transform: translateY(-3px) scale(1.015); }
}
.social-btn:active{ transform: translateY(0) scale(0.97); }

/* ---------------- 内容列 ---------------- */
.content{ display:flex; flex-direction:column; gap:22px; min-width:0; }
.content .card{ padding:32px 34px; min-width:0; }

.section-title{ margin:0 0 14px; font-size:22px; font-weight:700; position:relative; z-index:1; }
.about-text{ margin:0; font-size:15px; line-height:1.7; color:var(--text-dim); position:relative; z-index:1; word-break:break-word; white-space:pre-wrap; }

/* 电报频道卡片 */
.tg-card{
  display:flex; flex-direction:column; gap:2px;
  text-decoration:none; color:var(--text);
  position:relative; z-index:1;
}
.tg-title{ font-size:16px; font-weight:700; display:flex; align-items:center; gap:8px; }
.tg-title svg{ width:18px; height:18px; flex-shrink:0; }
.tg-sub{ font-size:12.5px; color:var(--text-dim); }

.repo-grid{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; position:relative; z-index:1; }
@media (max-width:760px){ .repo-grid{ grid-template-columns:minmax(0, 1fr); } }

@media (max-width:480px){
  .page{ padding:14px 14px 50px; }
  .navbar{ padding:12px 16px; flex-wrap:wrap; row-gap:10px; }
  .nav-right{ gap:6px; }
  .sidebar{ padding:28px 18px; }
  .content .card{ padding:24px 20px; }
  .avatar{ width:120px; height:120px; }
  .avatar-fallback{ width:120px; height:120px; font-size:42px; }
  .name{ font-size:24px; }
}

.repo-card{
  border-radius:18px;
  padding:18px 20px;
  text-decoration:none;
  color:var(--text);
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:96px;
}
@media (hover:hover) and (pointer:fine){
  .repo-card:hover{ transform: translateY(-4px) scale(1.01); }
}
.repo-card:active{ transform: translateY(-1px) scale(0.98); }
.repo-name{ font-size:16px; font-weight:700; position:relative; z-index:1; word-break:break-word; }
.repo-desc{
  font-size:13px; color:var(--text-dim); line-height:1.5;
  overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  position:relative; z-index:1;
}
.repo-meta{ display:flex; align-items:center; gap:14px; font-size:12px; color:var(--text-dim); margin-top:2px; position:relative; z-index:1; }
.repo-meta span{ display:flex; align-items:center; gap:5px; }
.lang-dot{ width:9px; height:9px; border-radius:50%; background:var(--accent); display:inline-block; }
.repo-meta svg{ width:13px; height:13px; opacity:0.85; }

.projects-status{ color:var(--text-dim); font-size:14px; position:relative; z-index:1; }

.contribution-wrap{ width:100%; min-width:0; overflow-x:auto; position:relative; z-index:1; border-radius:12px; -webkit-overflow-scrolling:touch; }
.contribution-wrap img{ display:block; width:100%; min-width:640px; height:auto; }

/* ---------------- 页脚（备案号等） ---------------- */
.site-footer{
  text-align:center;
  margin-top:34px;
  padding:0 20px;
  font-size:13px;
  line-height:1.6;
  word-break:break-word;
  position:relative;
  z-index:1;
}
.site-footer a{ color:inherit; text-decoration:none; border-bottom:1px solid currentColor; padding-bottom:1px; }
.site-footer a:hover{ opacity:1 !important; }

/* ---------------- 音乐播放器 ---------------- */
.player{
  position:fixed;
  right:20px;
  bottom:20px;
  display:flex;
  flex-direction:column;
  border-radius:26px;
  z-index:40;
  max-width:calc(100vw - 40px);
}
.player.anim-player{ animation: riseIn 0.9s cubic-bezier(.22,.61,.36,1) forwards; animation-delay:0.6s; }
.player.no-anim-player{ animation:none; }
.player.playing.anim-player{ animation: riseIn 0.9s cubic-bezier(.22,.61,.36,1) forwards, breathe 3.2s ease-in-out 0.9s infinite; }
.player.playing.no-anim-player{ animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe{ 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.014); } }

.player-main{ display:flex; align-items:center; gap:12px; padding:9px 10px 9px 9px; cursor:pointer; position:relative; z-index:1; }

.art-wrap{ position:relative; width:44px; height:44px; flex-shrink:0; }
.progress-ring{ position:absolute; inset:-3px; width:50px; height:50px; transform:rotate(-90deg); pointer-events:none; }
.ring-bg{ fill:none; stroke:rgba(0,0,0,0.08); stroke-width:2.4; }
.ring-fg{ fill:none; stroke:var(--accent); stroke-width:2.4; stroke-linecap:round; stroke-dasharray:131.9; stroke-dashoffset:131.9; transition: stroke-dashoffset 0.25s linear; }

.player-art{ width:44px; height:44px; border-radius:50%; object-fit:cover; box-shadow:0 2px 10px rgba(0,0,0,0.25); display:block; transition: transform 0.32s var(--ease-out); background:linear-gradient(135deg, var(--accent), #b8a6d9); }
.player-art.spin{ animation: spin 8s linear infinite; }
.player-main:active .player-art{ transform:scale(0.9); }
@keyframes spin{ from{ transform:rotate(0deg);} to{ transform:rotate(360deg);} }

.player-text{ display:flex; flex-direction:column; min-width:0; }
.player-title{ font-size:14px; font-weight:600; color:var(--text); max-width:130px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.player-hint{ font-size:11px; color:var(--text-dim); max-width:130px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; height:14px; }

.player-toggle{
  width:34px; height:34px; border-radius:50%; border:1px solid transparent;
  color:var(--text); display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition: transform 0.32s var(--ease-out), border-color 0.45s ease; flex-shrink:0;
  position:relative; overflow:hidden; isolation:isolate;
  background:transparent; padding:0;
}
.player-toggle svg{ width:15px; height:15px; position:relative; z-index:1; }
.player-toggle:active{ transform:scale(0.88); }
@media (hover:hover) and (pointer:fine){
  .player-toggle:hover{ border-color:var(--card-border); }
}

.player-chevron{
  width:26px; height:26px; border-radius:50%; border:none; background:transparent;
  color:var(--text-dim); display:flex; align-items:center; justify-content:center;
  cursor:pointer; flex-shrink:0; transition: background 0.45s ease;
  position:relative; overflow:hidden; isolation:isolate; padding:0;
}
.player-chevron svg{ width:13px; height:13px; position:relative; z-index:1; transition: transform 0.55s var(--ease-in-out); }
@media (hover:hover) and (pointer:fine){
  .player-chevron:hover{ background:rgba(0,0,0,0.06); }
}
.player.expanded .player-chevron svg{ transform:rotate(180deg); }

.player-expand{
  max-height:0; opacity:0; padding:0 16px;
  transition: max-height 0.55s var(--ease-in-out), opacity 0.45s ease, padding 0.55s var(--ease-in-out);
  position:relative; z-index:1;
}
.player.expanded .player-expand{ max-height:56px; opacity:1; padding:0 16px 14px; }

.seek-row{ display:flex; align-items:center; gap:8px; }
.seek-time{ font-size:10.5px; color:var(--text-dim); min-width:30px; text-align:center; font-variant-numeric: tabular-nums; }
.seek-bar{
  -webkit-appearance:none; appearance:none; flex:1; height:4px; border-radius:99px;
  background: linear-gradient(to right, var(--accent) var(--seek-pct,0%), rgba(0,0,0,0.14) 0);
  outline:none; cursor:pointer;
}
.seek-bar::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; width:12px; height:12px; border-radius:50%;
  background:#fff; box-shadow:0 1px 4px rgba(0,0,0,0.35); transition: transform 0.3s var(--ease-out);
}
@media (hover:hover) and (pointer:fine){
  .seek-bar::-webkit-slider-thumb:hover{ transform:scale(1.25); }
}
.seek-bar::-moz-range-thumb{ width:12px; height:12px; border-radius:50%; background:#fff; border:none; box-shadow:0 1px 4px rgba(0,0,0,0.35); }

/* ---------------- 尚未初始化时的提示 ---------------- */
.not-ready{
  max-width:560px; margin:14vh auto; padding:40px 36px; text-align:center;
  border-radius:26px;
}
.not-ready h1{ margin:0 0 12px; font-size:22px; }
.not-ready p{ margin:0 0 8px; color:var(--text-dim); font-size:14px; line-height:1.7; }
.not-ready code{
  display:inline-block; margin-top:6px; padding:3px 8px; border-radius:8px;
  background:rgba(0,0,0,0.06); font-size:13px;
}
