/* ==========================================================================
   zibuyu.life — 主站
   全屏背景图（按日期每日轮换）+ 磨砂玻璃名片 + 胶囊入口
   ========================================================================== */

:root {
  --white: #ffffff;
  --dim: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.5);
  --pill-bg: rgba(255, 255, 255, 0.12);
  --pill-br: rgba(255, 255, 255, 0.34);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --pad: 24px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: #12171f;
  color: var(--white);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 背景 ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #12171f;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 1s var(--ease), transform 6s var(--ease);
}

.bg.is-ready {
  opacity: 1;
  transform: none;
}

/* 图片加载失败时的兜底：一层冷色渐变，不至于露白 */
.bg.is-fallback {
  background-image:
    radial-gradient(90% 70% at 20% 10%, #2c3e56 0%, transparent 60%),
    radial-gradient(80% 60% at 85% 85%, #1d2a3a 0%, transparent 65%),
    linear-gradient(160deg, #1a2432, #0d1218);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(125% 90% at 50% 40%, rgba(8, 12, 18, 0.14) 0%, rgba(8, 12, 18, 0.46) 76%, rgba(8, 12, 18, 0.64) 100%),
    linear-gradient(180deg, rgba(8, 12, 18, 0.36) 0%, rgba(8, 12, 18, 0.12) 44%, rgba(8, 12, 18, 0.5) 100%);
  pointer-events: none;
}

/* ---------- 版面 ---------- */

.screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 8vh, 96px) var(--pad) clamp(24px, 6vh, 64px);
}

.vcard {
  width: 100%;
  min-width: 0;
  max-width: 760px;
  text-align: center;
}

.logo {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
  /* 外侧 1px 白圈：头像换成和背景相近的颜色时也不会糊在一起 */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.92), 0 10px 30px rgba(0, 0, 0, 0.34);
}

/* 头像缺失或读不到时的退路：白底「子」字圆标 */
.logo--text {
  display: grid;
  place-items: center;
  background: #fff;
  color: #141a22;
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 32px;
  line-height: 1;
  user-select: none;
}

.vcard__name {
  margin: 24px 0 0;
  font-size: clamp(30px, 4.2vw, 42px);
  font-weight: 500;
  letter-spacing: 0.16em;
  margin-right: -0.16em; /* 抵消字距在末尾多出的空白，视觉居中 */
  line-height: 1.3;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.vcard__tagline {
  margin: 16px -0.08em 0 0;
  font-size: 15px;
  letter-spacing: 0.08em;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 12px rgba(0, 0, 0, 0.38);
}

/* ---------- 胶囊入口 ---------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

/* 配置里一条都没开时，别留一段空白 */
.pills:empty { display: none; }

.pill {
  display: inline-block;
  padding: 8px 19px;
  border: 1px solid var(--pill-br);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--white);
  font-size: 13.5px;
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.pill:hover,
.pill:focus-visible {
  background: #fff;
  border-color: #fff;
  color: #141a22;
  transform: translateY(-1px);
}

/* ---------- 切换壁纸按钮 ---------- */

.bgswitch {
  position: fixed;
  top: 20px;
  right: var(--pad);
  z-index: 3;
  padding: 7px 15px;
  border: 1px solid var(--pill-br);
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--white);
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  line-height: 1.3;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
    color 0.25s var(--ease), transform 0.25s var(--ease);
}

.bgswitch:hover,
.bgswitch:focus-visible {
  background: #fff;
  border-color: #fff;
  color: #141a22;
}

.bgswitch:active { transform: scale(0.97); }

/* ---------- 页脚 ---------- */

.foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--pad) 22px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
}

.foot p { margin: 0; }

.foot__meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.foot__filing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  color: rgba(255, 255, 255, 0.4);
}

.foot__filing a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.foot__filing a:hover { color: rgba(255, 255, 255, 0.78); }

.foot__filing .sep {
  color: rgba(255, 255, 255, 0.24);
}

.foot__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.foot__time {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.42);
}

/* 页脚名言：单行不换行，放不下的句子由 JS 判断后不显示；出处再压一档亮度 */
.foot__quote {
  white-space: nowrap;
  text-align: right;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.46);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* 量宽度用的隐藏量尺，字体字号与名言完全一致 */
.quote-ruler {
  position: absolute;
  top: 0;
  left: -9999px;
  visibility: hidden;
  pointer-events: none;
}

.foot__quote .src {
  color: rgba(255, 255, 255, 0.3);
}

.foot__quote[hidden] { display: none; }

/* ---------- 404 ---------- */

.lost {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.lost__code {
  margin: 0 0 20px;
  font-size: 12px;
  letter-spacing: 0.34em;
  margin-right: -0.34em;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.lost__title {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.lost__desc {
  margin: 16px 0 0;
  font-size: 14.5px;
  line-height: 1.95;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.42);
}

/* ---------- 焦点与动效 ---------- */

a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .vcard > * {
    animation: rise 0.9s var(--ease) both;
  }
  .vcard > *:nth-child(1) { animation-delay: 0.05s; }
  .vcard > *:nth-child(2) { animation-delay: 0.12s; }
  .vcard > *:nth-child(3) { animation-delay: 0.19s; }
  .vcard > *:nth-child(4) { animation-delay: 0.26s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- 窄屏 ---------- */

@media (max-width: 560px) {
  :root { --pad: 20px; }

  .logo { width: 66px; height: 66px; }
  .vcard__name { margin-top: 20px; }
  .vcard__tagline { font-size: 14px; margin-top: 14px; }

  .bgswitch { top: 14px; padding: 6px 13px; font-size: 12px; }

  .pills { gap: 8px; margin-top: 28px; }
  .pill { padding: 7px 15px; font-size: 13px; }
}

/* 页脚先于其他元素改成上下排：
   横排时右侧被版权栏挤得只剩一百多像素，名言几乎整句都放不下 */
@media (max-width: 720px) {
  .foot {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    padding-bottom: 20px;
  }

  .foot__side {
    align-items: center;
  }

  .foot__quote {
    text-align: center;
  }
}
