/* ============================================================
   Visual Upgrade v1 — "Gallery Light"
   保持原有结构与内容不变，只叠加视觉层：
   暖纸底色 + 蓝色光谱 + 胶片颗粒 + 渐入编排 + 玻璃导航。
   所有规则只使用既有 class，不改任何 HTML/JS。
   ============================================================ */

:root {
  --bg: #f5f4ef;
  --panel: #fffefb;
  --ink: #14171c;
  --line: #e2dfd4;
  --accent-2: #6a5cf5;
  --spectrum: linear-gradient(90deg, #2867ed 0%, #6a5cf5 52%, #b14fd8 100%);
  --up-arrive: cubic-bezier(.22, 1, .36, 1);
}

html { background: var(--bg); }

body {
  background: var(--bg);
  background-image:
    radial-gradient(1150px 760px at 88% -18%, rgb(40 103 237 / .075), transparent 62%),
    radial-gradient(950px 720px at -12% 112%, rgb(177 79 216 / .055), transparent 60%);
  background-attachment: fixed;
}

::selection { background: #2867ed; color: #fff; }

/* 入场渐入（:not(.motion-ready) 保证只播一次，未来加该类即自动停用）
   注意：首页 .world 有 3D 变换，绝不能动画 transform，只做 opacity */
@keyframes up-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes up-rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
@keyframes up-rise-sm {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* 首页：只做透明度渐入（保护 3D 展台的 transform） */
body:not(.motion-ready) .site-header { animation: up-fade .8s ease both; }
body:not(.motion-ready) .hero-description { animation: up-fade .9s ease .1s both; }
body:not(.motion-ready) .home-view .world { animation: up-fade 1.2s ease .15s both; }
body:not(.motion-ready) .home-view .scene-note { animation: up-fade .8s ease .5s both; }
body:not(.motion-ready) .dock-wrap { animation: up-fade .8s ease .6s both; }
body:not(.motion-ready) footer { animation: up-fade .8s ease .65s both; }

/* 内部页面：可以做 translateY 渐入（无 3D 变换） */
body:not(.motion-ready) .page-heading { animation: up-rise .75s var(--up-arrive) .06s both; }
body:not(.motion-ready) .projects-view .toolbar { animation: up-rise-sm .7s var(--up-arrive) .18s both; }
body:not(.motion-ready) .project-group { animation: up-rise .8s var(--up-arrive) .26s both; }
body:not(.motion-ready) .project-group:nth-of-type(2) { animation-delay: .36s; }
body:not(.motion-ready) .project-group:nth-of-type(3) { animation-delay: .46s; }
body:not(.motion-ready) .project-group:nth-of-type(4) { animation-delay: .56s; }
body:not(.motion-ready) .about-view h2 { animation: up-rise .75s var(--up-arrive) .08s both; }
body:not(.motion-ready) .about-columns { animation: up-rise .8s var(--up-arrive) .22s both; }

/* ---------- 首页：网格增彩 + 浮光 ---------- */

.home-view {
  background:
    radial-gradient(880px 540px at 78% 30%, rgb(106 92 245 / .07), transparent 62%),
    radial-gradient(660px 520px at 12% 84%, rgb(40 103 237 / .06), transparent 64%),
    linear-gradient(180deg, #f8f7f2 0%, var(--bg) 100%);
}

.home-view .plane-grid {
  background-image:
    linear-gradient(rgb(40 103 237 / .1) 1px, transparent 1px),
    linear-gradient(90deg, rgb(40 103 237 / .1) 1px, transparent 1px);
}

/* 两束极慢漂移的环境浮光 */
.home-view::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(520px 380px at 62% 24%, rgb(106 92 245 / .1), transparent 70%),
    radial-gradient(460px 360px at 26% 72%, rgb(40 103 237 / .08), transparent 70%);
  filter: blur(38px);
  animation: up-drift 26s ease-in-out infinite alternate;
}
@keyframes up-drift {
  from { transform: translate3d(-2.5%, -1.5%, 0); }
  to   { transform: translate3d(2.5%, 2%, 0); }
}

/* 浮光沉到展台之下：hero-description / scene-note 本来就有定位，天然在 ::before(z-index:0) 之上 */

/* 顶部一道细光谱，克制地点出主色 */
.site-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--spectrum);
  opacity: .9;
  pointer-events: none;
}

.site-header .pageviews { color: #8b8878; }

/* 巨型字标：墨色渐变 + 蓝色微光晕 */
.home-view .wordmark button {
  background: linear-gradient(152deg, #262b33 8%, #0f1216 58%, #1d2432 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 12px 26px rgb(20 23 28 / .16));
}
.home-view .wordmark button:hover {
  background-image: linear-gradient(152deg, #2e3440 8%, #141920 58%, #25304a 100%);
}

/* 展品卡片：纯白浮于纸上，投影更立体（终端类深色展品除外） */
.home-view .exhibit:not(.exhibit-attacker) .exhibit-face {
  background: #fff;
  border: 1px solid rgb(20 23 28 / .05);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(20 23 28 / .05), 0 16px 34px rgb(20 23 28 / .09), 0 42px 84px rgb(20 23 28 / .07);
}
.home-view .exhibit:is(:hover, :focus-visible):not(:disabled) .exhibit-face {
  border-color: rgb(40 103 237 / .22);
  box-shadow: 0 2px 3px rgb(20 23 28 / .06), 0 24px 48px rgb(20 23 28 / .13), 0 60px 110px rgb(20 23 28 / .09), 0 0 0 5px rgb(40 103 237 / .06);
}

/* 深色终端展品（Attacker）：保持原有深色面板，只加蓝色光晕 */
.home-view .exhibit-attacker .exhibit-face {
  border-color: rgb(255 255 255 / .08);
  box-shadow: 0 2px 4px rgb(10 12 16 / .3), 0 26px 54px rgb(10 12 16 / .42), 0 0 70px rgb(40 103 237 / .16);
}
.home-view .exhibit-attacker:is(:hover, :focus-visible):not(:disabled) .exhibit-face {
  border-color: rgb(96 165 250 / .45);
  box-shadow: 0 2px 4px rgb(10 12 16 / .3), 0 30px 60px rgb(10 12 16 / .5), 0 0 90px rgb(40 103 237 / .3);
}

/* 编号注脚：箭头紫化 */
.home-view .exhibit-caption {
  font-weight: 500;
  color: #4b4f45;
  letter-spacing: .3px;
}
.home-view .exhibit-caption > span:last-child {
  color: var(--accent-2);
  font-weight: 700;
}

/* 左下简介：磨砂玻璃卡片 */
.home-view .hero-description {
  background: rgb(255 254 250 / .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid rgb(255 255 255 / .65);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 10px 34px rgb(20 23 28 / .07);
}
.home-view .hero-description .hero-intro { color: #3f434a; }

/* CTA 圆形按钮：光谱渐变 */
.hero-cta > span {
  background: linear-gradient(135deg, #2867ed, #6a5cf5) !important;
  box-shadow: 0 8px 20px rgb(64 92 240 / .35);
}
.hero-cta:hover > span {
  background: linear-gradient(135deg, #1d53cc, #5443e0) !important;
  box-shadow: 0 10px 26px rgb(64 92 240 / .45);
}

/* ---------- 底部 Dock：更通透的玻璃 + 渐变激活态 ---------- */

.dock {
  background: rgb(255 254 250 / .82) !important;
  border: 1px solid rgb(255 255 255 / .8) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 2px 6px rgb(20 23 28 / .05), 0 18px 46px rgb(20 23 28 / .12);
}
.dock-item.active {
  background: linear-gradient(135deg, #2867ed, #6a5cf5) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgb(64 92 240 / .35);
}
.dock-item.active svg { color: #fff; }

/* ---------- 作品列表页 ---------- */

.page-heading h2 {
  background: linear-gradient(120deg, var(--ink) 58%, #5a4fd0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.page-heading h2 .heading-count {
  -webkit-text-fill-color: var(--accent-2);
  color: var(--accent-2);
}

/* 搜索框：浅纸色 + 聚焦蓝环 */
.search {
  background: #edece4;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.search:hover { background: #e9e7de; }
.search:focus-within {
  background: #fff;
  border-color: rgb(40 103 237 / .5);
  box-shadow: 0 0 0 4px rgb(40 103 237 / .1);
}

/* 筛选器激活态：渐变下划线 */
.filter.active::after {
  background: var(--spectrum) !important;
  height: 2px;
}

/* 预览块：分类专属的双色渐变底 + 中央微光 */
.project-preview {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgb(20 23 28 / .05);
}
.project-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 46% at 50% 44%, rgb(255 255 255 / .34), transparent 72%);
  pointer-events: none;
}
.preview-agent    { background: linear-gradient(140deg, #e8eefb 0%, #f2effa 100%) !important; }
.preview-backend  { background: linear-gradient(140deg, #e6f0ea 0%, #eef4ef 100%) !important; }
.preview-frontend { background: linear-gradient(140deg, #f0ebfa 0%, #f7f2fb 100%) !important; }
.preview-demo     { background: linear-gradient(140deg, #f5efe4 0%, #f8f4ec 100%) !important; }
.preview-logo     { background: linear-gradient(140deg, #ebedf1 0%, #f4f3f6 100%) !important; }

.preview-agent .preview-symbol    { color: #2c50b8; }
.preview-backend .preview-symbol  { color: #2f6b4f; }
.preview-frontend .preview-symbol { color: #5b44b8; }
.preview-demo .preview-symbol     { color: #8a6a2f; }

.preview-grid {
  background-image:
    linear-gradient(rgb(20 23 28 / .045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(20 23 28 / .045) 1px, transparent 1px);
}
.preview-caption { color: #5c6158; opacity: .85; }

/* 悬停时预览轻轻浮起 */
.project-preview .preview-object,
.project-preview .preview-symbol,
.project-preview .project-logo {
  transition: transform .5s var(--up-arrive);
}
.project:is(:hover, :focus-within) .project-preview {
  border-color: rgb(40 103 237 / .18);
}
.project:is(:hover, :focus-within) .project-logo { transform: translateY(-3px) scale(1.03); }

/* 分组标题序号：渐变强调 */
.group-heading h3 > span {
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.group-index { color: #8b8878; }

/* 技术标签：胶囊化 */
.project-meta .tags > span {
  background: #efeee6;
  border: 1px solid #e3e1d4;
  border-radius: 999px;
  padding: 3px 9px;
  color: #57534a;
}
.project-github:hover { color: var(--accent); }

/* 行尾箭头：渐变描边感 */
.project-arrow {
  border: 1px solid #d9d6c9;
  background: #fffefb;
}
.project-arrow:hover {
  background: linear-gradient(135deg, #2867ed, #6a5cf5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgb(64 92 240 / .32);
}

/* 加载 / 空状态 */
.state { color: #57534a; }

/* ---------- 关于页 ---------- */

.about-view h2 > span {
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 侧栏：纸面卡片 + 左侧光谱线 */
.about-columns aside {
  background: rgb(255 254 250 / .7);
  border: 1px solid #e6e3d6;
  border-radius: 16px;
  padding: 26px 26px 22px !important;
  box-shadow: 0 8px 28px rgb(20 23 28 / .05);
}
.about-columns aside h3 {
  position: relative;
  padding-left: 14px;
}
.about-columns aside h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--spectrum);
}
.about-columns li { border-bottom-color: #e9e6da; }
.about-columns aside > p:last-child { color: #4f4a3e; }

/* 主按钮：墨色 → 悬停光谱 */
.button {
  background: linear-gradient(135deg, #22262d, #10141a);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgb(20 23 28 / .18);
  transition: background .3s, box-shadow .3s, transform .3s var(--up-arrive);
}
.button:hover {
  background: linear-gradient(135deg, #2867ed, #6a5cf5);
  box-shadow: 0 10px 28px rgb(64 92 240 / .4);
  transform: translateY(-1px);
}

/* ---------- 项目详情弹窗 ---------- */

#project-dialog {
  border: 1px solid rgb(255 255 255 / .7);
  box-shadow: 0 30px 90px rgb(20 23 28 / .16);
}
#project-dialog .project-notes .tags > span {
  background: #efeee6;
  border: 1px solid #e3e1d4;
  border-radius: 999px;
  padding: 3px 9px;
}
#project-dialog .kicker { color: #6a5cf5; }

/* ---------- 彩蛋提示条 ---------- */

.easter-egg-message {
  border-color: rgb(255 255 255 / .7);
  background: rgb(255 254 250 / .88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 34px rgb(20 23 28 / .1);
}

/* ---------- 滚动条 ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfccbd; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b6b2a2; }

/* ---------- 胶片颗粒（最顶层，不拦截交互） ---------- */

body::after {
  content: "";
  position: fixed;
  inset: -12px;
  z-index: 100;
  pointer-events: none;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* ---------- 响应式与无障碍 ---------- */

@media (max-width: 950px) {
  .home-view .hero-description {
    background: none;
    border: 0;
    box-shadow: none;
    padding: 12px 16px 12px 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .about-columns aside { padding: 22px 20px 18px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.motion-ready) .site-header,
  body:not(.motion-ready) .hero-description,
  body:not(.motion-ready) .home-view .world,
  body:not(.motion-ready) .home-view .scene-note,
  body:not(.motion-ready) .dock-wrap,
  body:not(.motion-ready) footer,
  body:not(.motion-ready) .page-heading,
  body:not(.motion-ready) .projects-view .toolbar,
  body:not(.motion-ready) .project-group,
  body:not(.motion-ready) .about-view h2,
  body:not(.motion-ready) .about-columns {
    animation: none;
  }
  .home-view::before { animation: none; }
}
