/* =========================================================
   科幻个人站 · 全局视觉
   深空黑底 + 紫青霓虹渐变 + 毛玻璃 + 发光交互
   ========================================================= */
:root {
  --bg-0: #04050a;
  --bg-1: #0a0e1a;
  --bg-2: #0f1424;
  --glass: rgba(150, 170, 255, 0.06);
  --glass-2: rgba(150, 170, 255, 0.10);
  --glass-border: rgba(150, 175, 255, 0.16);
  --neon-purple: #b14dff;
  --neon-cyan: #2ef2ff;
  --neon-pink: #ff5cf0;
  --text: #e8ebff;
  --muted: #9aa3c7;
  --glow-purple: 0 0 22px rgba(177, 77, 255, 0.45);
  --glow-cyan: 0 0 22px rgba(46, 242, 255, 0.45);
  --radius: 18px;
  --maxw: 1180px;
  --font-head: "Orbitron", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "Noto Sans SC", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: radial-gradient(1200px 800px at 70% -10%, rgba(177, 77, 255, 0.10), transparent 60%),
              radial-gradient(900px 700px at 10% 10%, rgba(46, 242, 255, 0.08), transparent 55%),
              var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* 背景星空 canvas */
#starfield {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -2; pointer-events: none;
}
body::before {
  /* 细微网格 + 暗角 */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(transparent 95%, rgba(150, 175, 255, 0.04) 100%) 0 0 / 100% 28px,
    radial-gradient(circle at 50% 0%, transparent 40%, rgba(0,0,0,0.55) 100%);
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(8, 11, 22, 0.55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.nav .brand {
  font-family: var(--font-head); font-weight: 700; letter-spacing: 2px;
  font-size: 18px; background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav .links { display: flex; gap: 26px; font-size: 14px; }
.nav .links a { color: var(--muted); position: relative; transition: color .2s; }
.nav .links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  transition: width .25s;
}
.nav .links a:hover, .nav .links a.active { color: var(--text); }
.nav .links a:hover::after, .nav .links a.active::after { width: 100%; }
.nav .menu-btn { display: none; background: none; border: 1px solid var(--glass-border);
  color: var(--text); border-radius: 10px; padding: 6px 10px; font-size: 18px; cursor: pointer; }
.nav-right { display: flex; align-items: center; gap: 18px; }

/* ---------- 通用容器 / 段落 ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 90px 0 30px; }
.section-title {
  font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: 1px;
  margin-bottom: 8px;
}
.section-sub { color: var(--muted); margin-bottom: 36px; font-size: 15px; }
.gradient-text {
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- 毛玻璃卡片 ---------- */
.glass {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.glass:hover {
  transform: translateY(-6px);
  border-color: rgba(150, 175, 255, 0.4);
  box-shadow: var(--glow-purple), var(--glow-cyan);
}

/* ---------- 首页 Hero ---------- */
.hero { min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 120px 24px 60px; }
.hero .badge {
  display: inline-block; font-family: var(--font-head); font-size: 12px; letter-spacing: 3px;
  color: var(--neon-cyan); border: 1px solid rgba(46,242,255,0.3); border-radius: 999px;
  padding: 6px 16px; margin-bottom: 26px; background: rgba(46,242,255,0.05);
}
.hero h1 {
  font-family: var(--font-head); font-weight: 800; font-size: clamp(30px, 6vw, 60px);
  line-height: 1.15; letter-spacing: 1px; min-height: 1.2em;
}
.hero h1 .caret { color: var(--neon-cyan); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero p.lead { color: var(--muted); font-size: clamp(15px, 2vw, 18px); margin: 22px auto 38px; max-width: 640px; }
.cta-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.btn {
  font-family: var(--font-head); font-size: 14px; letter-spacing: 1px;
  padding: 14px 30px; border-radius: 999px; cursor: pointer; border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn-primary {
  color: #06070d; font-weight: 700;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  animation: pulse-glow 2.4s ease-in-out infinite;
}
.btn-primary:hover { transform: translateY(-3px); }
.btn-ghost { color: var(--text); border-color: var(--glass-border); background: var(--glass); }
.btn-ghost:hover { border-color: rgba(150,175,255,0.5); box-shadow: var(--glow-cyan); transform: translateY(-3px); }

/* 门户导航栏登录按钮：独立于文字链接组，白字更醒目，与导航同高对齐 */
.nav-right .login-btn {
  align-self: center;
  padding: 4px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  color: #fff;
  border-radius: 999px;
}
.nav-right .login-btn::after { display: none; }

/* 门户导航栏用户菜单（已登录态） */
.nav-right .user-area { display: flex; align-items: center; }
.nav-right .user-menu { position: relative; }
.user-btn { background: transparent; border: 1px solid var(--glass-border); color: var(--text); font-family: var(--font-body); font-size: 14px; padding: 4px 14px; border-radius: 999px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.user-btn:hover { border-color: rgba(150,175,255,0.5); }
.user-dropdown { position: absolute; top: calc(100% + 10px); right: 0; min-width: 184px; background: rgba(8,11,22,0.96); border: 1px solid var(--glass-border); border-radius: 12px; padding: 8px; display: none; flex-direction: column; gap: 2px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 50; }
.user-dropdown.open { display: flex; }
.user-dropdown a, .user-dropdown button { display: block; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; text-decoration: none; background: transparent; border: none; cursor: pointer; font-family: var(--font-body); }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--glass); color: var(--text); }
.user-dropdown button#logoutBtn { color: #f0997b; }
.user-dropdown button#logoutBtn:hover { background: rgba(216,90,48,0.12); color: #ff8a6a; }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(46,242,255,0.0), 0 0 18px rgba(177,77,255,0.35); }
  50% { box-shadow: 0 0 28px rgba(46,242,255,0.55), 0 0 40px rgba(177,77,255,0.45); }
}

/* ---------- 网格布局 ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* 标签墙 */
.tag { padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; }
.tag .t-name { font-family: var(--font-head); font-size: 16px; }
.tag .t-desc { color: var(--muted); font-size: 13px; }

/* 代表作 / 卡片通用 */
.card-pad { padding: 26px 24px; display: flex; flex-direction: column; height: 100%; }
.card-icon {
  width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(46,242,255,0.18), rgba(177,77,255,0.18));
  color: var(--neon-cyan); margin-bottom: 18px; font-size: 22px;
}
.card-pad h3 { font-size: 19px; font-weight: 650; margin-bottom: 8px; }
.card-pad .desc { color: var(--muted); font-size: 14px; flex: 1; }
.card-pad .enter {
  margin-top: 18px; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--neon-cyan);
  border: 1px solid var(--glass-border); padding: 9px 18px; border-radius: 10px; transition: .2s;
}
.card-pad .enter:hover { background: rgba(46,242,255,0.12); box-shadow: var(--glow-cyan); }

/* 资源导航 5 分类 */
.cat-card { padding: 30px 20px; text-align: center; }
.cat-card .c-ico { font-size: 32px; margin-bottom: 14px; }
.cat-card .c-name { font-family: var(--font-head); font-size: 15px; letter-spacing: 1px; }
.cat-card .c-num { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* 博客预览 */
.blog-card .b-meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.blog-card .b-title { font-size: 17px; font-weight: 650; margin-bottom: 8px; }
.blog-card .b-excerpt { color: var(--muted); font-size: 13px; }
.blog-card .b-tag { display: inline-block; font-size: 11px; color: var(--neon-cyan);
  border: 1px solid rgba(46,242,255,0.3); border-radius: 999px; padding: 2px 10px; margin-top: 14px; }

/* 社交区 */
.social { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.social a {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: var(--glass); border: 1px solid var(--glass-border);
  transition: .25s;
}
.social a:hover { transform: translateY(-5px); box-shadow: var(--glow-purple); border-color: rgba(177,77,255,0.5); color: var(--neon-cyan); }

/* 滚动揭示 */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 关于我 ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }
.tech-row { margin-bottom: 18px; }
.tech-row .t-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.tech-bar { height: 8px; border-radius: 999px; background: rgba(150,175,255,0.12); overflow: hidden; }
.tech-bar > span { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple)); transition: width 1.2s ease; }
.timeline { border-left: 2px solid rgba(150,175,255,0.2); padding-left: 22px; }
.timeline .tl-item { position: relative; margin-bottom: 26px; }
.timeline .tl-item::before { content: ""; position: absolute; left: -29px; top: 4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--neon-cyan); box-shadow: var(--glow-cyan); }
.timeline .tl-date { font-family: var(--font-head); font-size: 13px; color: var(--neon-cyan); }
.timeline .tl-title { font-size: 16px; font-weight: 600; margin: 4px 0; }
.timeline .tl-desc { color: var(--muted); font-size: 14px; }

/* ---------- 作品 / 链接 筛选 ---------- */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.filter-btn {
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--muted);
  padding: 8px 18px; border-radius: 999px; font-size: 13px; cursor: pointer; transition: .2s;
}
.filter-btn.active, .filter-btn:hover { color: var(--text); border-color: rgba(150,175,255,0.5);
  box-shadow: var(--glow-cyan); background: rgba(46,242,255,0.08); }
.search-box { width: 100%; max-width: 480px; padding: 14px 20px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text); font-size: 15px; outline: none; }
.search-box:focus { border-color: rgba(46,242,255,0.5); box-shadow: var(--glow-cyan); }

/* ---------- 联系我 ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 12px; background: var(--glass);
  border: 1px solid var(--glass-border); color: var(--text); font-size: 14px; font-family: var(--font-body); outline: none;
}
.field input:focus, .field textarea:focus { border-color: rgba(46,242,255,0.5); box-shadow: var(--glow-cyan); }
.field textarea { min-height: 130px; resize: vertical; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 8px 16px; border-radius: 999px; background: rgba(46,242,255,0.08); border: 1px solid rgba(46,242,255,0.3); color: var(--neon-cyan); }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #38f5a0; box-shadow: 0 0 10px #38f5a0; }
.note-ok { color: #38f5a0; font-size: 14px; margin-top: 14px; display: none; }

/* ---------- 页脚 ---------- */
.footer { text-align: center; padding: 50px 24px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--glass-border); margin-top: 60px; }
.footer a { color: var(--neon-cyan); }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .nav .links { display: none; position: absolute; top: 64px; right: 16px; flex-direction: column;
    background: rgba(8,11,22,0.95); padding: 18px 24px; border-radius: 14px; border: 1px solid var(--glass-border); }
  .nav .links.open { display: flex; }
  .nav .menu-btn { display: block; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
}
