/* ============================================================
   HaoHeao — 个人站点（无框架单页版）
   手写 CSS，等价还原原 Vue + Tailwind 版本的全部视觉效果
   ============================================================ */

/* ====== 基础 ====== */
:root {
  --glass-blur: 0px;
  --glass-sat: 160%;
  --glass-bg: rgba(15, 15, 25, 0.25);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: 0.12;
  --glass-shadow-a: 0.35;
  --glass-radius: 16px;
}

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

html {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #0a0a14;
  color: #fff;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

/* 自定义滚动条 — 主题渐变 + 发光 */
html {
  scrollbar-width: thin;
  scrollbar-color: #6366f1 rgba(255, 255, 255, 0.06);
}
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track {
  background: rgba(12, 12, 26, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 55%, #06b6d4 100%);
  border-radius: 999px;
  border: 2px solid rgba(8, 8, 18, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 0 8px rgba(99, 102, 241, 0.35);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #818cf8 0%, #a78bfa 55%, #22d3ee 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 12px rgba(99, 102, 241, 0.5);
}
::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #a5b4fc 0%, #c4b5fd 55%, #67e8f9 100%);
}
::-webkit-scrollbar-corner { background: transparent; }

/* 选中文字 */
::selection {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

/* ====== 背景 SVG ====== */
.bg-svg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ====== 页面容器 ====== */
.page {
  position: relative;
  z-index: 10;
}

/* ====== Hero ====== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 80px;
  gap: 28px;
  position: relative;
}

.hero-nav {
  position: fixed;              /* 悬浮导航，滚动时始终可见 */
  left: 20px;
  top: 20px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(12, 12, 22, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.hero-nav button {
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}

.hero-nav button:hover { color: #fff; }

.hero-github {
  position: absolute;
  right: 24px;
  top: 48px;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.hero-github:hover { color: rgba(255, 255, 255, 0.8); }

.hero-github svg { width: 20px; height: 20px; display: block; }

.hero-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 48px;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.hero-svg {
  width: min(90vw, 700px);
  height: auto;
  margin-top: 32px;
  user-select: none;
  pointer-events: none;
}

/* ====== 项目展示 ====== */
.projects {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.project-section { margin-bottom: 80px; }

.project-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.project-section-icon { font-size: 24px; }

.project-section-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.project-section-count { color: rgba(255, 255, 255, 0.2); font-weight: 400; }

/* 收藏未展开时隐藏的卡片 */
.project-hidden { display: none; }

/* 查看全部 / 收起 按钮 */
.load-more {
  display: block;
  margin: 30px auto 0;
  padding: 12px 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}
.load-more:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.load-more:active { transform: scale(0.97); }

/* 「收藏」分组下的来源声明 */
.project-source-note {
  margin: -22px 0 28px;
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.45);
}
.project-source-note a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
  transition: color 0.25s ease;
}
.project-source-note a:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.8); }

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* ====== 玻璃卡片 ====== */
.glass-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, var(--glass-shadow-a)),
    0 2px 8px rgba(0, 0, 0, calc(var(--glass-shadow-a) * 0.7));
  transition: border-radius 0.4s ease, box-shadow 0.4s ease;
}

/* 玻璃边缘高光 */
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, var(--glass-highlight)),
    inset 1.5px 2px 0 -1px rgba(255, 255, 255, calc(var(--glass-highlight) * 1.6)),
    inset -1.5px -1.5px 0 -1px rgba(255, 255, 255, calc(var(--glass-highlight) * 1.2)),
    inset 0 -1px 4px 0 rgba(0, 0, 0, var(--glass-highlight));
  transition: box-shadow 0.5s ease;
}

/* 鼠标跟随镜面高光 */
.glass-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    300px circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, calc(var(--glass-highlight) * 1.15)),
    transparent 60%
  );
}

.glass-card:hover::after { opacity: 1; }

/* ====== 项目卡片 ====== */
.project-card {
  position: relative;
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-card:hover {
  transform: translateY(-6px) scale(1.02);
}

/* 卡片主链接区（含封面/图标 + 名称 + 描述 + 标签） */
.project-open {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* 下载按钮（右上角悬浮） */
.project-download {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(15, 15, 25, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.25s ease;
}

.project-download:hover {
  color: #fff;
  background: rgba(20, 20, 35, 0.8);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.12);
}

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 10;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* 项目封面缩略图 */
.project-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  object-fit: cover;
  object-position: center;
  background-color: #0d0d1a;   /* 占位底色，避免加载中布局抖动 */
  z-index: 10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 4px 14px rgba(0, 0, 0, 0.25);
}

.project-body { z-index: 10; }

.project-name {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 6px;
}

.project-desc {
  font-size: 13px;
  line-height: 1.625;
  color: rgba(255, 255, 255, 0.35);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  z-index: 10;
}

.project-tech span {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.3);
}

/* ====== 跑马灯 ====== */
.marquee-area {
  padding: 64px 0;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  opacity: 0.3;
}

.marquee-track,
.marquee-track-reverse {
  display: flex;
  white-space: nowrap;
}

.marquee-track { animation: marquee 22s linear infinite; }
.marquee-track-reverse { animation: marquee-ltr 26s linear infinite; }

.marquee-copy {
  display: flex;
  gap: 0;
  white-space: nowrap;
  padding-right: 1em;
}

.marquee-word {
  font-size: clamp(44px, 9vw, 100px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px #fff;
}

.marquee-sep {
  margin: 0 0.15em;
  color: rgba(255, 255, 255, 0.25);
  -webkit-text-stroke: 0;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes marquee-ltr {
  to { transform: translateX(50%); }
}

/* ====== 右下角控制区 ====== */
.dev-area {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.dev-btn {
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
}

.dev-btn:hover { color: rgba(255, 255, 255, 0.7); }

/* 玻璃参数面板 */
.dev-panel {
  width: 250px;
  border-radius: 22px;
  padding: 18px 20px;
  font-size: 13px;
  transition: opacity 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dev-panel-head {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

.dev-fold-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  font-size: 15px;
  transition: color 0.3s ease;
}

.dev-fold-btn:hover { color: rgba(255, 255, 255, 0.7); }

.dev-row { margin-bottom: 13px; position: relative; z-index: 10; }

.dev-label {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 5px;
  font-size: 12px;
}

.dev-label output {
  color: rgba(255, 255, 255, 0.7);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 滑块 */
.range-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 -1px 2px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

/* 背景切换面板 */
.dev-bgbox {
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dev-bg-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
}

.dev-bg-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 200px;
  justify-content: center;
}

.dev-bg-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0;
}

.dev-bg-btn:hover {
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.8;
}

.dev-bg-btn.active {
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.dev-bg-btn:not(.active) {
  opacity: 0.5;
}

/* ====== 页脚 ====== */
.site-footer {
  text-align: center;
  padding: 32px 0 96px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.2);
}

/* 页脚来源声明 */
.footer-source {
  margin-bottom: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}
.footer-source a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  transition: color 0.25s ease;
}
.footer-source a:hover { color: #fff; }

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.2);
  transition: color 0.3s ease;
}

.footer-links a:hover { color: rgba(255, 255, 255, 0.5); }

.footer-gongan {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-gongan svg { width: 14px; height: 14px; }

/* ====== 响应式（对应 Tailwind sm / lg 断点） ====== */
@media (min-width: 640px) {
  .hero-nav { left: 24px; top: 20px; }
  .hero-nav button { font-size: 18px; }
  .hero-github { right: 40px; top: 64px; }
  .hero-title { top: 64px; font-size: 20px; }
  .projects { padding: 0 24px 40px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card { padding: 24px; }
  .project-section-title { font-size: 30px; }
}

@media (min-width: 1024px) {
  .project-grid { grid-template-columns: repeat(3, 1fr); }
}
