/* ============================================================
   个人游戏开发者网站 · 样式表
   纯 CSS，无外部字体 / 框架 / CDN 依赖
   修改配色请直接改 :root 里的变量
   ============================================================ */

:root {
  /* 基础色板：深色克制风格 */
  --bg: #0b0c0f;
  --bg-soft: #0f1116;
  --panel: #13161c;
  --panel-2: #171b23;
  --line: #232a35;
  --line-soft: #1a1f28;
  --text: #e7e9ef;
  --text-dim: #b6bdca;
  --muted: #8d96a5;
  --accent: #e9a24c;
  --accent-dim: rgba(233, 162, 76, 0.14);
  --accent-line: rgba(233, 162, 76, 0.35);
  --cool: #7cc7d9;
  --cool-dim: rgba(124, 199, 217, 0.12);

  /* 排版与间距 */
  --wrap: 1080px;
  --gutter: clamp(18px, 5vw, 40px);
  --radius: 14px;
  --radius-sm: 8px;

  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Noto Sans SC",
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas,
    "Liberation Mono", monospace;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(760px 420px at 12% -8%, rgba(233, 162, 76, 0.09), transparent 62%),
    radial-gradient(680px 420px at 92% 4%, rgba(124, 199, 217, 0.07), transparent 60%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

dl {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: #15100a;
}

/* ---------- 通用布局 ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(56px, 9vw, 104px) 0;
  border-top: 1px solid var(--line-soft);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: clamp(26px, 4vw, 44px);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-size: clamp(24px, 5.2vw, 32px);
}

.section-desc {
  color: var(--muted);
  font-size: 15px;
  max-width: 58ch;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 10px 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 12, 15, 0.94);
  border-bottom: 1px solid var(--line-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  display: block;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-dim);
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--panel);
}

.nav-links a.is-active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ---------- 首页 / Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  opacity: 0.42;
  filter: saturate(0.92);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 12, 15, 0.86) 0%, rgba(11, 12, 15, 0.6) 42%, var(--bg) 96%),
    linear-gradient(90deg, rgba(11, 12, 15, 0.94) 0%, rgba(11, 12, 15, 0.55) 58%, rgba(11, 12, 15, 0.86) 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: clamp(64px, 13vw, 118px);
  padding-bottom: clamp(52px, 10vw, 96px);
}

.hero-title {
  font-size: clamp(34px, 9vw, 60px);
  letter-spacing: -0.01em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-title .placeholder-flag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  transform: translateY(2px);
}

.hero-lead {
  max-width: 52ch;
  font-size: clamp(15px, 3.9vw, 17.5px);
  color: var(--text-dim);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(19, 22, 28, 0.72);
  font-size: 12.5px;
  color: var(--text-dim);
}

.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.chip.is-todo {
  border-style: dashed;
  color: var(--muted);
}

.chip.is-todo::before {
  background: var(--muted);
}

.chip.is-cool::before {
  background: var(--cool);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-line);
}

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

.btn-primary:hover {
  background: #f2b063;
  border-color: #f2b063;
}

.btn-ghost {
  background: rgba(19, 22, 28, 0.55);
  color: var(--text-dim);
}

/* ---------- 简介 ---------- */

.about-grid {
  display: grid;
  gap: clamp(24px, 4vw, 44px);
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 62ch;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.fact {
  padding: 14px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.fact dt {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.fact dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
}

/* ---------- 作品 ---------- */

.works {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

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

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 20px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-meta .dot {
  color: var(--line);
}

.card-title {
  font-size: 19px;
}

.card-sub {
  margin-top: -4px;
  font-size: 12.5px;
  color: var(--muted);
}

.card-desc {
  font-size: 14px;
  color: var(--text-dim);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.tag {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
  font-size: 13px;
}

.card-links a,
.card-links span {
  color: var(--accent);
}

.card-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-links .is-todo {
  color: var(--muted);
  font-size: 12.5px;
}

/* 占位卡片：虚线描边 + 角标，替换后把 placeholder 设为 false 即可去掉 */
.card.is-placeholder {
  border-style: dashed;
  border-color: #2b3340;
  background: rgba(15, 17, 22, 0.72);
}

.card.is-placeholder:hover {
  border-color: var(--accent-line);
}

.badge-todo {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px dashed #3a4350;
  background: rgba(11, 12, 15, 0.85);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.works-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 技术栈 ---------- */

.stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.stack-block {
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
}

.stack-block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14.5px;
}

.stack-block h3::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stack-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
}

.stack-item .name {
  color: var(--text);
  font-weight: 600;
}

.stack-item .note {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- 开发日志 ---------- */

.devlog {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.log-entry {
  display: grid;
  gap: 6px;
  padding: 18px 18px 18px 16px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid var(--accent-line);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--panel);
}

.log-entry.is-placeholder {
  border-style: dashed;
  border-left-style: dashed;
  border-left-color: #333c48;
  background: rgba(15, 17, 22, 0.72);
}

.log-date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.log-title {
  font-size: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.log-body {
  font-size: 14px;
  color: var(--text-dim);
}

.log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.log-content {
  min-width: 0;
}

/* 日志标题里的「占位」角标改为行内显示（卡片里的角标才是绝对定位） */
.log-title .badge-todo {
  position: static;
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
}

/* ---------- 联系方式 ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

a.contact-item:hover {
  border-color: var(--accent-line);
  background: var(--panel-2);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.contact-value {
  font-size: 14.5px;
  color: var(--text);
  word-break: break-all;
}

.contact-value.is-todo {
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
}

.contact-arrow {
  flex: none;
  color: var(--muted);
  font-size: 16px;
}

.contact-note {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */

.site-footer {
  padding: 34px 0 42px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-inner a:hover {
  color: var(--text);
}

/* ---------- 入场动效（轻量，可降级） ---------- */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.no-js .reveal,
.motion-off .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

/* ---------- 404 ---------- */

.nf {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 18px;
  padding: 64px var(--gutter);
  max-width: var(--wrap);
  margin: 0 auto;
}

.nf-code {
  font-family: var(--font-mono);
  font-size: clamp(64px, 18vw, 128px);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text);
  opacity: 0.9;
}

.nf-code span {
  color: var(--accent);
}

/* ---------- 响应式 ---------- */

@media (min-width: 720px) {
  .works {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-grid,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .log-entry {
    grid-template-columns: 132px 1fr;
    column-gap: 20px;
  }

  .log-date {
    padding-top: 3px;
  }
}

@media (min-width: 960px) {
  .about-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }

  .works {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* 降级：系统要求减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .card,
  .btn,
  .contact-item,
  .nav-links a {
    transition: none;
  }
}
