:root {
  /* 字体统一使用系统内置中文字体，避免加载外部字体拖慢手机端 */
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', serif;
  --font-display: 'STZhongsong', 'Songti SC', 'Noto Serif SC', 'SimSun', serif;

  --bg-deep: #0c0f14;
  --bg-card: rgba(22, 28, 38, 0.72);
  --border: rgba(212, 175, 106, 0.22);
  --gold: #d4af6a;
  --gold-soft: #e8c98a;
  --text: #e8ecf2;
  --muted: #9aa3b2;
  --accent-narrative: #c97b63;
  --accent-aesthetic: #9b7edc;
  --accent-mechanics: #5eb8a8;
  --accent-system: #6a9fd4;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-serif);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.7;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 175, 106, 0.12), transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(155, 126, 220, 0.08), transparent 40%),
    linear-gradient(180deg, #0c0f14 0%, #121822 50%, #0a0d12 100%);
  pointer-events: none;
  z-index: -2;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

/* 顶部导航读条 */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 999;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  box-shadow: 0 0 10px rgba(212, 175, 106, 0.6);
  opacity: 0;
  transition: width 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.nav-progress.active {
  opacity: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(12, 15, 20, 0.75);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
}

.brand span {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  display: block;
  margin-top: 0.15rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero-eyebrow {
  color: var(--gold);
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.section-card {
  position: relative;
  display: block;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  box-shadow: var(--shadow);
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.9;
}

.section-card.narrative::before { background: var(--accent-narrative); }
.section-card.aesthetic::before { background: var(--accent-aesthetic); }
.section-card.mechanics::before { background: var(--accent-mechanics); }
.section-card.system::before { background: var(--accent-system); }

.section-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 175, 106, 0.45);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

.section-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.section-card h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--gold-soft);
}

.section-card p {
  font-size: 0.92rem;
  color: var(--muted);
}

.section-meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--gold-soft);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 40rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 123, 99, 0.5);
}

.project-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-thumb {
  height: 140px;
  background: linear-gradient(135deg, #2a1810 0%, #4a3020 40%, #1a2838 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
}

.project-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(201, 123, 99, 0.35), transparent 55%);
}

.project-body {
  padding: 1.25rem 1.35rem 1.5rem;
}

.project-tag {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent-narrative);
  margin-bottom: 0.5rem;
}

.project-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.project-body p {
  font-size: 0.88rem;
  color: var(--muted);
}

.empty-state {
  padding: 2.5rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.utility-links {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: center;
}

.utility-links a {
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.utility-links a:hover {
  color: var(--gold);
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold);
}

.portal-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 520px;
  margin: 2rem auto 0;
}

.portal-card {
  position: relative;
  display: block;
  padding: 1.75rem 1.5rem 1.75rem 4.5rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  box-shadow: var(--shadow);
}

.portal-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 106, 0.5);
}

.portal-rank {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--gold);
}

.portal-card.realm {
  background: linear-gradient(135deg, rgba(26, 37, 47, 0.95), rgba(12, 15, 20, 0.9));
}

.portal-card.relic {
  background: linear-gradient(135deg, rgba(42, 28, 24, 0.92), rgba(18, 20, 28, 0.92));
}

.portal-card h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--gold-soft);
  margin-bottom: 0.35rem;
}

.portal-card p {
  font-size: 0.92rem;
  color: var(--muted);
}

.portal-lock {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.gate-box {
  width: 100%;
  max-width: 400px;
  padding: 2.25rem 2rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
}

.gate-box h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold-soft);
  margin-bottom: 0.5rem;
}

.gate-box .hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.gate-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.gate-input:focus {
  outline: none;
  border-color: var(--gold);
}

.gate-error {
  color: #e07a7a;
  font-size: 0.85rem;
  min-height: 1.25rem;
  margin-bottom: 0.5rem;
}

.gate-btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #b8924f, var(--gold));
  color: #1a1408;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

.gate-btn:hover {
  filter: brightness(1.05);
}

.gate-back {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.gate-back:hover {
  color: var(--gold);
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
