/* ============================================================
   Astesia核心 · 星语 · 简约天蓝 / 深空自然风
   ============================================================ */
:root {
  --bg-deep: #071529;
  --bg-mid: #0b1e3a;
  --bg-card: rgba(255, 255, 255, 0.055);
  --bg-card-strong: rgba(13, 35, 66, 0.72);
  --line: rgba(148, 200, 230, 0.16);
  --line-strong: rgba(148, 200, 230, 0.32);
  --sky: #7ec8e3;
  --sky-light: #b8e4f5;
  --sky-dim: #4d7fa0;
  --gold: #f5d76e;
  --text: #eaf4fb;
  --muted: #9db7c7;
  --muted-2: #6f8da0;
  --shadow: 0 18px 50px rgba(2, 10, 24, 0.55);
  --radius: 18px;
  --maxw: 1120px;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(126, 200, 227, 0.35); }

a { color: var(--sky-light); text-decoration: none; }
a:hover { color: #ffffff; }

/* ---------- 全局星空背景（Canvas 粒子） ---------- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(7, 21, 41, 0.82), rgba(7, 21, 41, 0.35) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom: 1px solid var(--line); background: rgba(7, 21, 41, 0.88); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text);
  font-size: 17px;
}
.brand .star { color: var(--gold); font-size: 19px; }
.brand small { font-size: 12px; color: var(--sky); font-weight: 400; margin-top: 4px; letter-spacing: 2px; }

.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  color: var(--muted);
  font-size: 14.5px;
  letter-spacing: 1px;
  position: relative;
  transition: color .25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -6px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--sky), var(--gold));
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width .25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-burger {
  display: none;
  background: none; border: 0;
  color: var(--text); font-size: 22px;
  cursor: pointer;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 24px) 20px 60px;
  z-index: 1;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: url("../assets/bg.jpg") center 30% / cover no-repeat fixed;
  filter: brightness(.72) saturate(1.05);
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(7, 21, 41, 0) 40%, rgba(7, 21, 41, 0.62) 100%),
    linear-gradient(180deg, rgba(7, 21, 41, 0.55) 0%, rgba(7, 21, 41, 0.30) 40%, rgba(7, 21, 41, 0.78) 100%);
  z-index: -1;
}

.hero-title {
  text-align: center;
  margin-bottom: 30px;
}
.hero-title .kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--sky);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-title .kicker::before, .hero-title .kicker::after {
  content: "";
  width: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--sky));
}
.hero-title .kicker::after { background: linear-gradient(90deg, var(--sky), transparent); }
.hero-title h1 {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: 8px;
  background: linear-gradient(180deg, #ffffff 20%, var(--sky-light) 60%, var(--sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(126, 200, 227, 0.25);
}
.hero-title p {
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 17px);
  letter-spacing: 2px;
}

.scroll-hint {
  margin-top: 26px;
  color: var(--muted-2);
  font-size: 13px;
  letter-spacing: 3px;
  animation: floatY 2.4s ease-in-out infinite;
}
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- 天文钟 ---------- */
.clock-wrap {
  width: min(100%, 980px);
  margin-top: 12px;
}
.clock-panel {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: 22px;
  align-items: stretch;
  background: var(--bg-card-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 20px;
}
.clock-canvas-box { position: relative; }
#clockCanvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 45%, #0c2343 0%, #081c38 60%, #061429 100%);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.55);
}
.clock-canvas-box .clock-badge {
  position: absolute;
  left: 50%; bottom: 10px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 1px;
  white-space: nowrap;
  background: rgba(7, 21, 41, 0.7);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.clock-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.clock-side .row { display: flex; gap: 10px; flex-wrap: wrap; }
.clock-card {
  flex: 1 1 150px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 0;
}
.clock-card .k {
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.clock-card .v {
  font-size: 15px;
  font-weight: 600;
  color: var(--sky-light);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clock-card .v.gold { color: var(--gold); }
.clock-card.full { flex-basis: 100%; }
.clock-card .planets { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text); }
.clock-card .planets .p { display: inline-flex; align-items: center; gap: 5px; }
.clock-card .planets .p .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.clock-card .planets .p .zh { color: var(--muted); font-size: 12px; }

.clock-loc {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.clock-loc select, .clock-loc input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.clock-loc input { width: 72px; }
.clock-loc button {
  background: linear-gradient(135deg, rgba(126, 200, 227, 0.25), rgba(126, 200, 227, 0.08));
  border: 1px solid var(--line-strong);
  color: var(--sky-light);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background .25s, transform .1s;
}
.clock-loc button:hover { background: rgba(126, 200, 227, 0.35); transform: translateY(-1px); }
.clock-loc .hint { font-size: 12px; color: var(--muted-2); }

/* ---------- 通用区块 ---------- */
section { position: relative; z-index: 1; padding: 90px 20px; scroll-margin-top: var(--nav-h); }
.section-head { max-width: var(--maxw); margin: 0 auto 40px; text-align: center; }
.section-head .en { font-size: 12px; letter-spacing: 5px; color: var(--sky-dim); text-transform: uppercase; }
.section-head h2 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 4px;
  margin-top: 6px;
}
.section-head h2 .accent { color: var(--gold); }
.section-head .divider {
  width: 64px; height: 2px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, var(--sky), var(--gold), transparent);
  border-radius: 2px;
}
.section-head .sub { margin-top: 14px; color: var(--muted); font-size: 14.5px; }

.container { max-width: var(--maxw); margin: 0 auto; }

/* 卡片通用 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 46px rgba(2, 10, 24, 0.5);
}

/* ---------- 项目区 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.project-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.project-card.featured {
  border-color: rgba(245, 215, 110, 0.4);
  background: linear-gradient(160deg, rgba(245, 215, 110, 0.08), rgba(255, 255, 255, 0.03));
}
.project-card .flag {
  position: absolute; top: 14px; right: -34px;
  transform: rotate(40deg);
  background: linear-gradient(90deg, var(--gold), #e0a83a);
  color: #3a2b08;
  font-size: 11px; font-weight: 700;
  padding: 4px 40px;
  letter-spacing: 1px;
}
.project-card h3 { font-size: 17px; letter-spacing: 1px; color: #fff; }
.project-card h3 a:hover { color: var(--gold); }
.project-card .desc { color: var(--muted); font-size: 13.5px; flex: 1; }
.project-card .meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted-2); flex-wrap: wrap; }
.project-card .meta b { color: var(--sky-light); font-weight: 600; }
.project-card .lang { display: inline-flex; align-items: center; gap: 6px; }
.project-card .lang .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.project-card .topics { display: flex; flex-wrap: wrap; gap: 6px; }
.project-card .topics span {
  font-size: 11.5px;
  color: var(--sky);
  border: 1px solid var(--line);
  background: rgba(126, 200, 227, 0.08);
  padding: 1px 8px;
  border-radius: 20px;
}
.project-card .links { display: flex; gap: 12px; margin-top: 4px; }
.project-card .links a { font-size: 13px; color: var(--sky-light); }
.project-card .links a:hover { color: var(--gold); }

.project-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* ---------- B 站视频区 ---------- */
.bili-header {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.bili-header img.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  object-fit: cover;
}
.bili-header .who { flex: 1; min-width: 220px; }
.bili-header .who h3 { font-size: 19px; letter-spacing: 1px; }
.bili-header .who p { font-size: 13px; color: var(--muted); margin-top: 4px; max-width: 560px; }
.bili-stats { display: flex; gap: 22px; font-size: 13px; color: var(--muted-2); }
.bili-stats b { color: var(--sky-light); font-size: 17px; display: block; text-align: center; }
.bili-stats .st { text-align: center; }
.bili-stats a { color: var(--muted-2); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.tabs .tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 24px;
  padding: 7px 16px;
  font-size: 13.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all .25s;
  letter-spacing: 0.5px;
}
.tabs .tab:hover { color: var(--text); border-color: var(--line-strong); }
.tabs .tab.active {
  background: linear-gradient(135deg, rgba(126, 200, 227, 0.30), rgba(126, 200, 227, 0.10));
  border-color: var(--sky);
  color: var(--sky-light);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.video-card { overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.video-card .thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.video-card:hover .thumb img { transform: scale(1.06); }
.video-card .thumb .dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(4, 12, 26, 0.78);
  font-size: 12px;
  padding: 1px 7px;
  border-radius: 6px;
  color: #dceffb;
}
.video-card .thumb .play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 12, 26, 0.35);
  opacity: 0;
  transition: opacity .3s;
}
.video-card:hover .thumb .play { opacity: 1; }
.video-card .thumb .play .tri {
  width: 0; height: 0;
  border-left: 22px solid rgba(255,255,255,0.92);
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}
/* 封面加载失败时的占位背景 */
.video-card.no-thumb .thumb {
  background: radial-gradient(circle at 50% 40%, #123458 0%, #0a1e3a 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-card.no-thumb .thumb::after {
  content: "✦";
  font-size: 34px;
  color: rgba(245, 215, 110, 0.55);
}
.video-card.no-thumb .thumb img { display: none; }
.tag-solo {
  font-size: 10.5px;
  color: var(--sky);
  border: 1px solid var(--line-strong);
  background: rgba(126, 200, 227, 0.10);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.video-card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.video-card .body .t {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.video-card .body .meta { font-size: 12px; color: var(--muted-2); display: flex; justify-content: space-between; }
.video-card .body .view { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- 关于 ---------- */
.about-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 30px; align-items: start; }
.about-card {
  text-align: center;
  padding: 30px 24px;
}
.about-card img.avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--line-strong);
  box-shadow: 0 0 0 8px rgba(126, 200, 227, 0.06), 0 0 40px rgba(126, 200, 227, 0.25);
}
.about-card h3 { margin-top: 16px; font-size: 20px; letter-spacing: 1px; }
.about-card .tagline { color: var(--sky); font-size: 13px; letter-spacing: 1px; margin-top: 4px; }
.about-card .tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.about-card .tags span {
  font-size: 12px;
  color: var(--sky-light);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 11px;
  background: rgba(126, 200, 227, 0.07);
}
.about-card .social { display: flex; gap: 14px; justify-content: center; margin-top: 18px; }
.about-card .social a { font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.about-card .social a:hover { color: var(--gold); }

.about-text { display: flex; flex-direction: column; gap: 16px; }
.about-text .para {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  color: var(--text);
  font-size: 15px;
}
.about-text .para .hl { color: var(--gold); }
.about-text .para em { color: var(--sky-light); font-style: normal; }
.about-text .para .quote {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
  border-left: 3px solid var(--gold);
  padding-left: 14px;
}
.star-quote {
  text-align: center;
  padding: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(245, 215, 110, 0.04);
  color: var(--sky-light);
  font-size: 16px;
  letter-spacing: 2px;
}

/* ---------- 页脚 ---------- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(5, 15, 30, 0.9));
  padding: 46px 20px 34px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
}
footer .f-brand { color: var(--sky-light); font-size: 15px; letter-spacing: 3px; margin-bottom: 10px; }
footer .f-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 12px 0 16px; }
footer .f-links a { color: var(--muted); font-size: 13px; }
footer .f-links a:hover { color: var(--gold); }
footer .credits { max-width: 720px; margin: 0 auto; line-height: 1.9; }
footer .credits a { color: var(--sky-dim); border-bottom: 1px dotted var(--sky-dim); }
footer .credits a:hover { color: var(--sky-light); border-color: var(--sky-light); }
footer .data-note { margin-top: 12px; font-size: 12px; color: var(--muted-2); opacity: .8; }
footer .beian { margin-top: 8px; font-size: 12px; }
footer .beian a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-2); text-decoration: none; }
footer .beian a:hover { color: var(--sky-light); }
footer .beian img { width: 14px; height: 14px; flex-shrink: 0; }
footer .icp { margin-top: 14px; font-size: 12px; }
footer .icp a { color: var(--muted); text-decoration: none; }
footer .icp a:hover { color: var(--sky-light); }

/* ---------- 滚动显现 ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .clock-panel { grid-template-columns: 1fr; }
  .about-wrap { grid-template-columns: 1fr; }
  .about-card { max-width: 340px; margin: 0 auto; }
}
@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(7, 21, 41, 0.97);
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
    transform: translateY(-130%);
    transition: transform .3s;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 0; width: 100%; text-align: center; }
  .nav-links a::after { display: none; }
  .nav-burger { display: block; }
  .bili-stats { gap: 12px; }
}
