/* ============================================================
   Xuemeng 个人起始页 · 样式
   精致简约：玻璃拟态卡片 + 大字号时钟 + Bing 每日壁纸
   ============================================================ */

@font-face {
  font-family: "UnidreamLED";
  src: url("../fonts/UnidreamLED.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #0b0d12;
  --text: #f2f4f7;
  --text-2: #a7aeba;
  --text-3: #6e7683;
  --card: rgba(15, 18, 26, 0.45);
  --card-hover: rgba(24, 28, 38, 0.62);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #3ec6b2;
  --accent-2: #7fdcd0;
  --accent-glow: rgba(62, 198, 178, 0.4);
  --radius: 16px;
  --blur: 20px;
  --font: "HarmonyOS Sans SC", "HarmonyOS Sans", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 50% -8%, #1b2436 0%, rgba(27, 36, 54, 0) 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: rgba(62, 198, 178, 0.32);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 背景 ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.bg.loaded {
  opacity: 1;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(8, 10, 16, 0.40) 0%,
    rgba(8, 10, 16, 0.60) 55%,
    rgba(8, 10, 16, 0.86) 100%
  );
}

/* ---------- 布局 ---------- */

.page {
  min-height: 100vh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

/* ---------- 左右布局（宽屏两栏，窄屏自动堆叠） ---------- */

.layout {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.col-left,
.col-right {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

@media (min-width: 1200px) {
  .layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 80px;
  }

  .col-left {
    width: 44%;
    max-width: 500px;
  }

  .col-right {
    width: 56%;
    max-width: 640px;
  }
}

/* ---------- 顶部 ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #38c9b8, #2e7cf6);
  box-shadow:
    0 0 0 3px rgba(62, 198, 178, 0.3),
    0 0 24px rgba(62, 198, 178, 0.26),
    0 10px 26px rgba(46, 124, 246, 0.28),
    inset 0 0 0 2px rgba(255, 255, 255, 0.16);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

.avatar:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px rgba(62, 198, 178, 0.52),
    0 0 34px rgba(62, 198, 178, 0.42),
    0 12px 28px rgba(46, 124, 246, 0.32),
    inset 0 0 0 2px rgba(255, 255, 255, 0.16);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.avatar:hover img {
  transform: scale(1.05);
}

.name {
  font-family: "Pacifico", "Segoe Script", "Snell Roundhand", cursive, var(--font);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.15;
}

.motto {
  font-size: 15px;
  color: var(--text-2);
  letter-spacing: 2px;
}

/* ---------- 时钟 ---------- */

.clock {
  text-align: center;
}

.time {
  font-family: "UnidreamLED", "DIN Alternate", "Bahnschrift", ui-monospace, monospace;
  font-size: 74px;
  line-height: 1;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 34px rgba(255, 255, 255, 0.16);
  font-variant-numeric: tabular-nums;
}

.date {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--text-2);
  letter-spacing: 1px;
}

/* 天气 */

.weather {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
}

.weather svg {
  width: 15px;
  height: 15px;
  color: var(--accent-2);
}

.wx-temp {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wx-city {
  opacity: 0.75;
}

/* ---------- 搜索 ---------- */

.search-card {
  position: relative;
  width: 100%;
  max-width: 600px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 54px;
  padding: 0 6px 0 20px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.3);
  backdrop-filter: blur(var(--blur)) saturate(1.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-bar:focus-within {
  border-color: var(--accent-glow);
  box-shadow:
    0 0 0 4px rgba(62, 198, 178, 0.13),
    0 12px 32px rgba(0, 0, 0, 0.3);
}

.search-icon {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--text-3);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 15.5px;
  font-family: inherit;
  caret-color: var(--accent);
}

.search-bar input::placeholder {
  color: var(--text-3);
}

.search-btn {
  flex: none;
  height: 42px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #2fbfae, #2e7cf6);
  box-shadow: 0 6px 18px rgba(46, 124, 246, 0.3);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.search-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.search-btn:active {
  transform: scale(0.97);
}

/* 搜索联想 */

.suggest {
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 6px;
  border-radius: var(--radius);
  background: rgba(13, 16, 23, 0.9);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  animation: drop 0.18s ease;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text);
  font-size: 14.5px;
  cursor: pointer;
}

.suggest-item svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--text-3);
}

.suggest-item:hover,
.suggest-item.active {
  background: rgba(255, 255, 255, 0.07);
}

.suggest-item.active {
  color: var(--accent-2);
}

/* 快捷键提示 */

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  letter-spacing: 1px;
}

.hint kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
  font-family: inherit;
  font-size: 11px;
  color: var(--text-2);
}

/* ---------- 快捷链接 ---------- */

.links {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: calc((100% - 48px) / 5);
  min-width: 0;
  padding: 18px 8px 15px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  text-decoration: none;
  color: var(--text);
  transition: transform 0.22s ease, border-color 0.22s ease,
    background 0.22s ease, box-shadow 0.22s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  background: var(--card-hover);
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.link-card:active {
  transform: translateY(-1px) scale(0.98);
}

.link-card svg {
  width: 24px;
  height: 24px;
  color: var(--text-2);
  transition: color 0.22s ease;
}

.link-card:hover svg {
  color: var(--accent-2);
}

.link-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 10.5px;
  color: var(--text-3);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 页脚 ---------- */

.footer {
  /* 与上方内容保持正常间距，仅轻微下移 */
  margin-top: 24px;
  text-align: center;
}

.hitokoto {
  min-height: 1.5em;
  font-size: 13.5px;
  color: var(--text-2);
  font-style: italic;
  letter-spacing: 0.5px;
}

.copyright {
  margin-top: 9px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

.copyright a {
  color: var(--text-3);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.22);
  transition: color 0.2s ease;
}

.copyright a:hover {
  color: var(--accent-2);
}

/* ---------- 入场动画 ---------- */

.up {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.15s; }
.d3 { animation-delay: 0.25s; }
.d4 { animation-delay: 0.35s; }
.d5 { animation-delay: 0.45s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .up {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 560px) {
  .page {
    gap: 26px;
    padding-top: 40px;
  }

  .layout,
  .col-left,
  .col-right {
    gap: 26px;
  }

  .time {
    font-size: 52px;
    letter-spacing: 2px;
  }

  .search-bar {
    height: 50px;
    padding-left: 16px;
  }

  .search-btn {
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
  }
}

/* 中等宽度：链接 3 列 */
@media (max-width: 700px) {
  .link-card {
    width: calc((100% - 24px) / 3);
  }
}

/* 窄屏：链接 2 列 */
@media (max-width: 480px) {
  .link-card {
    width: calc((100% - 12px) / 2);
  }
}

/* ---------- 无脚本提示 ---------- */

.noscript {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-2);
  font-size: 14px;
}
