/* ==========================================================================
   HLCminecraft 站点样式（雏形 v0.1.0）
   纯原生 CSS：深色/浅色主题、响应式、卡片、截图灯箱
   ========================================================================== */

/* ---------- 主题变量 ---------- */
:root {
  color-scheme: dark;
  --bg: #0b0f0d;
  --bg-soft: #101713;
  --panel: #14201a;
  --panel-2: #18271f;
  --border: #26382d;
  --border-strong: #35503f;
  --text: #e8f0ea;
  --muted: #9fb0a4;
  --accent: #7bd389;
  --accent-strong: #4caf50;
  --accent-ink: #08130b;
  --copper: #c47c4a;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
  --radius: 14px;
  --wrap: 1100px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f6f1;
  --bg-soft: #e8efe7;
  --panel: #ffffff;
  --panel-2: #f6faf5;
  --border: #d2ded4;
  --border-strong: #b6c9bb;
  --text: #16211a;
  --muted: #5d6f62;
  --accent: #2f7d3f;
  --accent-strong: #2f7d3f;
  --accent-ink: #ffffff;
  --copper: #a85f2e;
  --shadow: 0 12px 30px rgba(22, 33, 26, 0.12);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 82% -12%, rgba(123, 211, 137, 0.13), transparent 62%),
    radial-gradient(900px 520px at -12% 16%, rgba(196, 124, 74, 0.11), transparent 58%),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

body.no-scroll {
  overflow: hidden;
}

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

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

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 1em;
}

code {
  font-family: "Cascadia Code", "Consolas", "SFMono-Regular", monospace;
  font-size: 0.92em;
  background: rgba(123, 211, 137, 0.10);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

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

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent-strong);
  color: var(--accent-ink);
  border-radius: 8px;
  font-weight: 700;
  transition: top 0.2s ease;
}

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

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  image-rendering: pixelated;
  background: var(--panel-2);
}

.brand-text span {
  color: var(--accent);
  font-weight: 600;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover {
  background: var(--panel-2);
  text-decoration: none;
}

.nav-toggle,
.theme-toggle {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.nav-toggle {
  display: none;
}

.theme-toggle {
  line-height: 1;
  padding: 8px 10px;
}

.nav-toggle:hover,
.theme-toggle:hover {
  border-color: var(--border-strong);
  background: var(--panel-2);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(56px, 9vw, 108px) 0 clamp(40px, 6vw, 72px);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
}

.hero h1 {
  font-size: clamp(2.1rem, 5.6vw, 3.6rem);
  font-weight: 900;
  max-width: 20em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.02em;
  height: 0.14em;
  background: var(--accent);
  opacity: 0.22;
  border-radius: 2px;
}

.lead {
  max-width: 44em;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.1rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 34px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.hero-stats div {
  flex: 1 1 150px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.hero-stats dt {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-stats dd {
  margin: 2px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--panel-2);
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

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

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

/* ---------- 区块 ---------- */
.section {
  padding: clamp(42px, 7vw, 84px) 0;
}

.section-alt {
  background: color-mix(in srgb, var(--panel) 55%, transparent);
  border-block: 1px solid var(--border);
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 850;
}

.section-sub {
  color: var(--muted);
  margin: 0;
}

/* ---------- 模组卡片 ---------- */
.mod-card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3.4vw, 32px);
}

.mod-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.mod-logo {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  image-rendering: pixelated;
  background: var(--bg-soft);
}

.mod-title h3 {
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  margin-bottom: 8px;
}

.mod-title h3 span {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 6px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.tag-accent {
  color: var(--accent);
  border-color: var(--border-strong);
  background: rgba(123, 211, 137, 0.08);
}

.mod-desc {
  margin: 22px 0 16px;
  color: var(--text);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 20px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.feature-list li {
  position: relative;
  padding-left: 22px;
}

.feature-list li::before {
  content: "▣";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
  top: 0.18em;
}

.mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.gallery figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
}

.gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--bg-soft);
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.gallery img:hover {
  transform: scale(1.03);
}

.gallery figcaption {
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ---------- 下载 ---------- */
.download-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.download-info h3 {
  margin-bottom: 6px;
}

.download-info p {
  margin-bottom: 6px;
}

.file-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

.checksum {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}

.checksum .hash {
  word-break: break-all;
  font-size: 0.78rem;
}

.pan-link {
  word-break: break-all;
}

.copy-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 6px;
  padding: 2px 8px;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

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

.note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 30px;
  background: var(--bg-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copyright {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 18px;
  background: rgba(4, 8, 5, 0.86);
  backdrop-filter: blur(6px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(1100px, 94vw);
  max-height: 76vh;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  background: var(--bg-soft);
}

.lightbox-caption {
  margin: 0;
  color: #dfe9e2;
  font-size: 0.92rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.6);
}

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

@media (max-width: 680px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 20px;
    right: 20px;
    top: 64px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
  }

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

  .site-nav a {
    padding: 10px 12px;
  }

  .theme-toggle {
    align-self: flex-end;
  }

  .download-item {
    align-items: flex-start;
  }
}
