:root{
  --bg:            #F5F8FC;   /* 页面底色 */
  --blob1:         #DCE7F7;   /* 背景雾斑 1 */
  --blob2:         #E2EAF3;   /* 背景雾斑 2 */
  --blob3:         #E6F0F6;   /* 背景雾斑 3 */
  --card-rgb:      255 255 255;  /* 卡片颜色(RGB 三元组,便于调透明度) */
  --card-a:        0.62;         /* 卡片不透明度 */
  --ink:           #232833;   /* 主文字 */
  --mute:          #6B7480;   /* 次要文字 */
  --primary:       #4E6EBC;   /* 主色:按钮、标签 */
  --on-primary:    #FFFFFF;   /* 主色上的文字 */
  --accent:        #E0A985;   /* 点缀色:细线、小圆点 */
  --radius:        24px;
  --shadow:        0 20px 44px rgb(23 32 51 / .10);
}

*{ box-sizing: border-box; }
html, body{ margin: 0; }
html{
  background: var(--bg);   /* 滚动到头的橡皮筋区域也跟着底色 */
  color-scheme: light;     /* 滚动条、表单控件走浅色 */
}

body{
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a{ color: inherit; }

/* ---------- 背景雾斑:色差极小,缓慢漂移 ---------- */
.sky{ position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.sky i{
  position: absolute; display: block; border-radius: 50%;
  filter: blur(78px); opacity: .95;
}
.sky .b1{ width: 56vmax; height: 56vmax; left: -16vmax; top: -18vmax;
          background: var(--blob1); animation: drift-a 36s ease-in-out infinite alternate; }
.sky .b2{ width: 48vmax; height: 48vmax; right: -14vmax; top: 4vmax;
          background: var(--blob2); animation: drift-b 44s ease-in-out infinite alternate; }
.sky .b3{ width: 52vmax; height: 52vmax; left: 10vmax; bottom: -26vmax;
          background: var(--blob3); animation: drift-c 40s ease-in-out infinite alternate; }
@keyframes drift-a{ to{ transform: translate3d(6vmax, 5vmax, 0) scale(1.08); } }
@keyframes drift-b{ to{ transform: translate3d(-7vmax, 6vmax, 0) scale(1.06); } }
@keyframes drift-c{ to{ transform: translate3d(5vmax, -6vmax, 0) scale(1.10); } }
@media (max-width: 640px){ .sky i{ filter: blur(56px); } }
@media (prefers-reduced-motion: reduce){ .sky i{ animation: none; } }

/* 换装时才开启颜色过渡,免得首次加载闪一下 */
.theming, .theming *{
  transition: background-color 1.6s ease, color 1.6s ease,
              border-color 1.6s ease, box-shadow 1.6s ease, transform .28s ease;
}

/* ---------- 布局 ---------- */
.wrap{
  position: relative; z-index: 1;
  width: min(760px, 92vw);
  margin: 0 auto;
  padding: clamp(30px, 7vh, 68px) 0 44px;
  /* 撑满视口 + 纵向排列,好把页脚压到底部(内容超一屏时正常往下排) */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;   /* 移动端地址栏收起/展开时不跳 */
}

.glass{
  background: rgb(var(--card-rgb) / var(--card-a));
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* ---------- 头部 ---------- */
.hero{
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px 24px;
  padding: 28px 30px;
}

.avatar-wrap{
  position: relative;
  width: 92px; height: 92px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary);
  flex: none;
  /* 彩蛋入口要用连点,别让浏览器把它当双击缩放 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* 图片到位前露的是下层的字母 */
.avatar-wrap img{ width: 100%; height: 100%; object-fit: cover; display: block; visibility: hidden; }
.avatar-wrap.loaded img{ visibility: visible; }
.avatar-wrap.loaded .fallback{ display: none; }   /* 字母是定位元素,永远压在图上,只能收走 */
.avatar-wrap .fallback{
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-primary);
  font-size: 38px; font-weight: 700; letter-spacing: 1px;
}
.avatar-wrap.failed img{ display: none; }

.hero h1{
  margin: 0;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.2;
}
.role{
  margin: 6px 0 0;
  color: var(--mute);
  font-size: 14.5px;
  letter-spacing: .3px;
}
.alias{
  margin: 8px 0 0;
  display: flex; align-items: center; gap: 9px;
  color: var(--mute);
  font-size: 13.5px;
}
.alias .dash{
  width: 18px; height: 2px; border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.actions{
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 4px;
}
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 108px; height: 44px; padding: 0 22px;
  border-radius: 14px;
  font-size: 14.5px; font-weight: 600;
  text-decoration: none;
  transition: transform .18s ease, filter .18s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0) scale(.98); }
.btn.primary{
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 10px 22px rgb(0 0 0 / .10);
}
.btn.primary:hover{ filter: brightness(1.06); }
.btn.ghost{
  background: rgb(var(--card-rgb) / .62);
  color: var(--ink);
  box-shadow: 0 6px 16px rgb(23 32 51 / .07);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* ---------- 区块 ---------- */
.section{ margin-top: 16px; }
.section-title{
  margin: 0 0 10px 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--mute);
}

/* 项目卡 */
.project{
  display: block;
  padding: 22px 24px;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
}
.project:hover{ transform: translateY(-2px); }
.project h3{
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .2px;
  word-break: break-all;
}
.project .p-desc{
  margin: 8px 0 0;
  font-size: 14.5px;
  color: var(--mute);
}
.project .p-meta{
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px;
}
.tag{
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--mute);
  font-size: 12px; font-weight: 600;
  letter-spacing: .4px;
}
.tag::before{
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
}
.more{
  margin-left: auto;
  font-size: 13.5px;
  color: var(--mute);
  transition: color .2s ease;
}
.project:hover .more{ color: var(--primary); }
.project + .project{ margin-top: 12px; }

/* ---------- 站点:子站入口 ---------- */
.sites{
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 10px;
}
.site{
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px;
  border-radius: 16px;
  text-decoration: none;
  transition: background-color .2s ease;
}
.site:hover{
  background: rgb(var(--card-rgb) / .5);
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}
.site-name{
  font-size: 14.5px; font-weight: 600; letter-spacing: .2px;
  word-break: break-all;
  transition: color .2s ease;
}
.site-desc{
  font-size: 13px;
  color: var(--mute);
}
.site:hover .site-name{ color: var(--primary); }
@media (max-width: 520px){
  .sites{ grid-template-columns: 1fr; }
}

/* ---------- 页脚 ---------- */
.foot{
  margin-top: auto;    /* 吃掉剩余空间 -> 页脚贴到屏幕最底下 */
  padding-top: 30px;   /* 内容超过一屏时,与上方保底留 30px */
  text-align: center;
  font-size: 12.5px;
  color: var(--mute);
}
.foot p{ margin: 0; }
.foot .beian{ margin-top: 6px; }
.foot a{
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.foot a:hover{ color: var(--primary); border-bottom-color: var(--primary); }
.foot .sep{ margin: 0 8px; opacity: .5; }

/* 深夜才露出来的一行 */
.night{
  display: none;
  margin-top: 10px;
  letter-spacing: .3px;
}
html[data-period="late"] .night:not(:empty){
  display: block;
  animation: night-in 1.4s ease both;
}
@keyframes night-in{
  from{ opacity: 0; transform: translateY(4px); }
  to  { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce){
  html[data-period="late"] .night:not(:empty){ animation: none; }
}

/* ---------- 右下角浮出来的那张小纸条 ---------- */
.boot{
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 5;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgb(var(--card-rgb) / .82);
  /* 模糊半径压小、底色加实:它浮在会漂移的雾斑上面,backdrop-filter 是按帧算钱的 */
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 14px 34px rgb(23 32 51 / .16);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--mute);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;         /* 只是一张纸,不挡任何点击 */
}
.boot.show{ opacity: 1; transform: translateY(0); }
/* 打字效果:文字一开始就排好版,只逐格揭开那层遮挡 —— 全程不动布局。
   早先每打一个字卡片就重新变宽一次,那才是卡顿的来源。 */
.boot-line{ margin: 0; }
.boot-line::before{ content: "> "; color: var(--primary); }
.boot.show .boot-line{ animation: reveal .34s steps(14, end) both; }   /* both:延迟期间也保持裁掉,否则第二行会先整句露一下 */
.boot.show .boot-line:nth-child(2){
  animation-duration: .54s;
  animation-timing-function: steps(22, end);
  animation-delay: .42s;
}
@keyframes reveal{
  from{ clip-path: inset(0 100% 0 0); }
  to  { clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce){
  .boot.show .boot-line{ animation: none; }
}

/* ---------- 夜墨:暗底要连浏览器 UI 和头像一起照应 ---------- */
html[data-theme="夜墨"]{ color-scheme: dark; }
html[data-theme="夜墨"] .avatar-wrap{ background: #39436E; }
html[data-theme="夜墨"] .avatar-wrap .fallback{ color: #FFFFFF; }

@media (max-width: 520px){
  .hero{ padding: 22px; gap: 16px 18px; }
  .avatar-wrap{ width: 72px; height: 72px; }
  .avatar-wrap .fallback{ font-size: 30px; }
  .btn{ flex: 1; min-width: 0; }
  .project{ padding: 18px 20px; }
  .boot{ right: 16px; bottom: 20px; }
  /* 两条备案号各占一行,别挤在一起 */
  .foot .beian{ display: flex; flex-direction: column; gap: 5px; }
  .foot .sep{ display: none; }
}