/* ============================================
   叶明轩 · 游戏策划求职站
   像素风 (Pixel / 8-bit) 样式表
   ============================================ */

/* ---- 变量与基础 ---- */
:root {
  --bg: #0f0f1b;
  --bg-alt: #1a1a2e;
  --bg-card: #16213e;
  --panel: #20203a;
  --ink: #e8f0e8;
  --ink-dim: #9fb3b3;
  --accent: #4ef6ac;      /* 霓虹绿 */
  --accent-2: #fbbf24;    /* 像素黄 */
  --accent-3: #60a5fa;    /* 像素蓝 */
  --danger: #f87171;
  --pixel-border: #2dd4bf;
  --shadow: rgba(78, 246, 172, 0.35);
  --font-pixel: 'Press Start 2P', 'Courier New', monospace;
  --font-body: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif;
  --header-h: 60px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

/* ---- 像素边框通用工具 ---- */
.px-border {
  position: relative;
  border: 3px solid var(--ink);
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 6px var(--accent);
}

/* ---- 顶部导航 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 27, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 3px 0 var(--bg);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.nav-logo {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 1px;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-logo-blink {
  animation: blink 1s steps(1) infinite;
}

.pixel-dot {
  width: 12px;
  height: 12px;
  background: var(--accent-2);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-2);
  display: inline-block;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 4px;
}

.nav-menu a {
  display: block;
  padding: 8px 12px;
  color: var(--ink-dim);
  font-size: 14px;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.nav-menu a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
  box-shadow: 0 0 10px var(--shadow);
}

.nav-menu .nav-cta {
  color: var(--bg);
  background: var(--accent);
  font-weight: bold;
}

.nav-menu .nav-cta:hover {
  background: var(--accent-2);
  color: var(--bg);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 2px solid var(--accent);
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 3px;
  background: var(--accent);
}

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 90px 0 70px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(78, 246, 172, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78, 246, 172, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
}

/* 游戏手柄像素装饰 */
.hero-bg::before {
  content: '';
  position: absolute;
  right: 8%;
  top: 12%;
  width: 48px;
  height: 48px;
  background:
    linear-gradient(var(--accent), var(--accent)) center/60% 100% no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 50%/100% 60% no-repeat;
  image-rendering: pixelated;
  opacity: 0.35;
}

.hero-bg::after {
  content: '';
  position: absolute;
  left: 6%;
  bottom: 15%;
  width: 40px;
  height: 40px;
  background:
    linear-gradient(var(--accent-2), var(--accent-2)) center/100% 60% no-repeat,
    linear-gradient(var(--accent-2), var(--accent-2)) 50% 0/60% 100% no-repeat;
  opacity: 0.3;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent-2);
  margin-bottom: 22px;
  letter-spacing: 2px;
}

.hero-title {
  font-family: var(--font-pixel);
  font-size: clamp(34px, 6vw, 60px);
  color: var(--ink);
  text-shadow:
    3px 3px 0 var(--accent),
    6px 6px 0 rgba(78, 246, 172, 0.25);
  margin-bottom: 18px;
  letter-spacing: 4px;
}

.hero-sub {
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero-tagline {
  color: var(--ink-dim);
  margin-bottom: 32px;
  font-size: 15px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.hero-meta {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--ink-dim);
  font-size: 14px;
}

/* ---- 按钮 ---- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 1px;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--bg);
  transition: all 0.12s;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--bg);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--bg);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.btn-secondary {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  border-color: var(--ink-dim);
  color: var(--ink-dim);
}

/* ---- 区块通用 ---- */
.section {
  padding: 64px 0;
  border-top: 3px dashed var(--panel);
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-family: var(--font-pixel);
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 2px;
}

.title-bracket {
  color: var(--accent-2);
}

.section-desc {
  text-align: center;
  color: var(--ink-dim);
  margin-bottom: 36px;
  font-size: 15px;
}

/* ---- 卡片通用 ---- */
.card {
  background: var(--bg-card);
  border: 3px solid var(--accent);
  padding: 26px;
  box-shadow: 6px 6px 0 rgba(78, 246, 172, 0.15);
}

/* ---- 个人总结 ---- */
.about-card p {
  margin-bottom: 12px;
  font-size: 15.5px;
}

.about-card strong {
  color: var(--accent-2);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.stat {
  background: var(--panel);
  border: 3px solid var(--ink-dim);
  padding: 20px 12px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-pixel);
  font-size: 24px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.stat-plus {
  color: var(--accent-2);
}

.stat-label {
  font-size: 13px;
  color: var(--ink-dim);
}

/* ---- 游戏经历 ---- */
.game-group {
  margin-bottom: 36px;
}

.group-title {
  font-size: 18px;
  color: var(--accent-2);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--panel);
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-icon {
  color: var(--accent);
  font-size: 14px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--bg-card);
  border: 3px solid var(--panel);
  padding: 18px;
  transition: all 0.15s;
}

.game-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--shadow);
  transform: translateY(-2px);
}

.game-card h4 {
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--ink);
}

.game-hours {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--accent-3);
  margin-bottom: 8px;
}

.game-card p:last-child {
  font-size: 13.5px;
  color: var(--ink-dim);
}

/* ---- 标签 ---- */
.tag {
  display: inline-block;
  background: var(--panel);
  border: 2px solid var(--accent-3);
  color: var(--accent-3);
  font-size: 12px;
  padding: 2px 8px;
  margin: 2px;
}

/* ---- 项目经历 ---- */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-card {
  background: var(--bg-card);
  border: 3px solid var(--panel);
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 0;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.35);
  transition: all 0.15s;
}

.project-card-text {
  grid-template-columns: 1fr;
}

.project-card:hover {
  border-color: var(--accent);
}

.project-img-wrap {
  border-right: 3px solid var(--panel);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.project-img-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  align-content: stretch;
  gap: 0;
}

.project-img-double .project-img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  max-height: 420px;
  border-right: 2px solid var(--panel);
  border-bottom: none;
  object-fit: contain;
  image-rendering: pixelated;
  padding: 4px;
}

.project-img-double .project-img:last-child {
  border-right: none;
}

.project-img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  image-rendering: pixelated;
  min-height: 200px;
}

.project-body {
  padding: 22px 24px;
}

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.project-head h3 {
  font-size: 20px;
  color: var(--accent);
}

.project-time {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
}

.project-role {
  color: var(--accent-2);
  font-size: 14px;
  margin-bottom: 12px;
}

.project-points {
  list-style: none;
  margin-bottom: 14px;
}

.project-points li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--ink-dim);
}

.project-points li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ---- 项目文档按钮 ---- */
.project-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.btn-doc {
  padding: 8px 16px;
  font-size: 10px;
  box-shadow: 3px 3px 0 var(--bg);
}

/* ---- 游戏分析 ---- */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.analysis-card {
  background: var(--bg-card);
  border: 3px solid var(--panel);
  padding: 22px;
  color: var(--ink);
  display: block;
  position: relative;
  transition: all 0.15s;
}

.analysis-card:hover {
  border-color: var(--accent-2);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.3);
  text-decoration: none;
  color: var(--ink);
}

.analysis-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--bg);
  background: var(--accent);
  padding: 4px 8px;
}

.analysis-card h3 {
  font-size: 17px;
  color: var(--accent);
  margin: 6px 0 10px;
  padding-right: 90px;
}

.analysis-card p {
  font-size: 14px;
  color: var(--ink-dim);
  margin-bottom: 12px;
}

.analysis-link {
  color: var(--accent-2);
  font-size: 14px;
}

/* ---- 教育背景 ---- */
.edu-card {
  max-width: 680px;
  margin: 0 auto;
}

.edu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.edu-head h3 {
  font-size: 20px;
  color: var(--accent);
}

.edu-major {
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 12px;
}

.edu-time {
  color: var(--ink-dim);
  font-size: 14px;
  margin-left: 8px;
}

.edu-list {
  list-style: none;
  font-size: 14.5px;
  color: var(--ink-dim);
}

.edu-list li {
  margin-bottom: 6px;
}

.edu-list strong {
  color: var(--accent-2);
}

/* ---- 技能 ---- */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.skill-card {
  background: var(--bg-card);
  border: 3px solid var(--panel);
  padding: 22px;
}

.skill-card:hover {
  border-color: var(--accent);
}

.skill-card h3 {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 8px;
}

.skill-icon {
  color: var(--accent-2);
  margin-right: 6px;
}

.skill-card p {
  font-size: 14px;
  color: var(--ink-dim);
}

/* ---- 作品链接 ---- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.link-card {
  background: var(--bg-card);
  border: 3px solid var(--panel);
  padding: 20px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s;
}

.link-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--shadow);
  text-decoration: none;
  color: var(--ink);
}

.link-icon {
  font-size: 22px;
  color: var(--accent-2);
}

.link-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--ink);
}

.link-url {
  font-size: 13px;
  color: var(--ink-dim);
  word-break: break-all;
}

/* ---- 联系我 ---- */
.contact-card {
  max-width: 560px;
  margin: 0 auto;
}

.contact-line {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 15px;
}

.contact-label {
  color: var(--accent-2);
  min-width: 64px;
  font-weight: bold;
}

.contact-line a {
  color: var(--accent);
}

.contact-actions {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ---- 页脚 ---- */
.site-footer {
  border-top: 3px solid var(--accent);
  background: var(--bg-alt);
  padding: 30px 0;
  text-align: center;
  color: var(--ink-dim);
}

.site-footer p {
  margin-bottom: 6px;
  font-size: 14px;
}

.footer-copy {
  font-size: 12px !important;
  opacity: 0.8;
}

/* ---- 回到顶部 ---- */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--bg);
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 4px 4px 0 var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 90;
  text-decoration: none;
}

.back-top.show {
  opacity: 1;
  visibility: visible;
}

.back-top:hover {
  background: var(--accent-2);
  text-decoration: none;
  color: var(--bg);
}

/* ---- 动画 ---- */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .project-card {
    grid-template-columns: 1fr;
  }

  .project-img-wrap {
    border-right: none;
    border-bottom: 3px solid var(--panel);
  }

  .project-img {
    min-height: 180px;
    max-height: 320px;
  }

  .project-img-double {
    grid-template-columns: 1fr;
  }

  .project-img-double .project-img {
    min-height: 240px;
    max-height: 400px;
    border-right: none;
    border-bottom: 2px solid var(--panel);
  }

  .project-img-double .project-img:last-child {
    border-bottom: none;
  }

  .analysis-grid,
  .skill-grid {
    grid-template-columns: 1fr;
  }

  .link-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-alt);
    flex-direction: column;
    padding: 10px 4%;
    border-bottom: 3px solid var(--accent);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
    display: none;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    padding: 12px;
    font-size: 15px;
  }

  .hero {
    padding: 60px 0 50px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-meta {
    flex-direction: column;
    gap: 8px;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0;
  }

  .section-title {
    font-size: 17px;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- 无障碍：焦点样式 ---- */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

/* ---- 减少动态效果偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation: none !important;
    transition: none !important;
  }
}
