:root {
  --bg: #0f1115;
  --panel: #181c23;
  --panel-2: #202632;
  --line: #2d3542;
  --text: #f2f6fb;
  --muted: #9aa8ba;
  --brand: #32d3bd;
  --gold: #f1be63;
  --danger: #ef6262;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.front-shell {
  background:
    linear-gradient(180deg, rgba(15,17,21,.36) 0%, #0f1115 460px),
    radial-gradient(circle at 18% 12%, rgba(50, 211, 189, .16), transparent 32%),
    radial-gradient(circle at 92% 18%, rgba(241, 190, 99, .12), transparent 30%),
    #0f1115;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(15, 17, 21, .86);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 800;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--panel-2);
}
.site-header nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.site-header nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius);
  color: #cdd7e4;
  font-size: 14px;
}
.site-header nav a:hover { background: rgba(255,255,255,.07); color: var(--text); }

.public-layout main,
.project-detail {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}
.hero-band {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  gap: 42px;
  align-items: center;
  min-height: 560px;
  padding: 42px 0 58px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 800;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}
h2 { margin: 0; font-size: 30px; letter-spacing: 0; }
h3 { margin: 0; font-size: 20px; }
.hero-subtitle, .section-heading p, .project-card p, .detail-main p {
  color: var(--muted);
  line-height: 1.75;
}
.hero-actions, .project-actions, .admin-actions, .form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-actions { margin-top: 26px; }
.button-primary, .button-secondary, .button-pledge, .button-muted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}
.button-primary { background: var(--brand); color: #071312; }
.button-secondary { background: #242b36; border-color: var(--line); color: #eaf1f8; }
.button-pledge { background: var(--gold); color: #161007; }
.button-muted { background: transparent; border-color: var(--line); color: #cbd6e4; }
.button-pledge.is-disabled { opacity: .52; pointer-events: none; }

.hero-media {
  position: relative;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.hero-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.hero-stats {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.hero-stats span {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  background: rgba(12, 15, 19, .78);
  color: #dbe6f2;
}
.hero-stats strong { color: var(--brand); font-size: 26px; }

.content-section { padding: 54px 0; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}
.section-heading p { max-width: 520px; margin: 0; }
.project-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.filter-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #1a2029;
  color: #dbe5f1;
}
.filter-button.is-active { color: #071312; background: var(--brand); border-color: var(--brand); }
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #1a2029, #151a21);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  overflow: hidden;
}
.project-cover { aspect-ratio: 16 / 10; background: #202632; overflow: hidden; }
.project-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-body { display: flex; flex: 1; flex-direction: column; padding: 16px; }
.project-title-row, .money-row, .game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-title-row span, .game-meta span, .money-row span { color: #b6c4d5; font-size: 13px; }
.project-state {
  align-self: flex-start;
  margin: 12px 0 0;
  padding: 4px 9px;
  border-radius: var(--radius);
  background: rgba(50,211,189,.14);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}
.state-completed { background: rgba(241,190,99,.16); color: var(--gold); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius);
  background: #242b36;
  color: #c6d2df;
  font-size: 12px;
}
.progress-track {
  height: 8px;
  margin: 14px 0 10px;
  border-radius: 999px;
  background: #2b3340;
  overflow: hidden;
}
.progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--gold)); }
.project-description { flex: 1; margin: 12px 0 0; color: #97a6b8; line-height: 1.65; }
.project-actions { margin-top: 16px; }
.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,.03);
}

.back-link { display: inline-flex; margin: 24px 0; color: var(--brand); }
.detail-hero {
  display: grid;
  grid-template-columns: 48% 1fr;
  gap: 28px;
  align-items: center;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  background: var(--panel);
}
.detail-hero img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; margin: 22px 0 70px; }
.detail-main, .pledge-panel {
  padding: 22px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius);
  background: var(--panel);
}
.full-detail { margin: 22px 0 70px; }
.detail-images { display: grid; gap: 12px; margin-top: 18px; }
.detail-images img, .qr-grid img { border-radius: var(--radius); }
.game-info-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.game-info-strip span {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #242b36;
  color: #d7e2ee;
}
.terms-box { color: #c8d7e8; line-height: 1.7; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; }
.qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.qr-grid label { display: grid; gap: 8px; font-size: 14px; }

input, textarea, select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111821;
  color: #f4f8fd;
}
textarea { min-height: 100px; }
label span { display: block; margin-bottom: 6px; color: #c7d3e0; font-size: 13px; font-weight: 700; }
.checkbox-row { display: flex; gap: 8px; align-items: center; }
.checkbox-row input { width: auto; }
.pledge-form, .admin-form { display: grid; gap: 14px; }
.notice-success { padding: 12px 14px; border-radius: var(--radius); background: rgba(50,211,189,.15); margin-bottom: 12px; }

.admin-shell { background: #f4f6f9; color: #1d2733; }
.admin-shell .site-header {
  background: #fff;
  border-bottom: 1px solid #e4e8ef;
}
.admin-shell .site-header nav a { color: #475569; }
.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}
.admin-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  min-height: calc(100vh - 72px);
  padding: 18px;
  border-right: 1px solid #e2e8f0;
  background: #fff;
}
.admin-sidebar-title { margin: 4px 8px 14px; color: #0f172a; font-weight: 900; }
.admin-sidebar a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: #526174;
  font-size: 14px;
}
.admin-sidebar a:hover { background: #eef6f5; color: #0f766e; }
.admin-main {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 54px;
}
.admin-panel, .admin-stats .stat-card {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.admin-panel { padding: 20px; margin-bottom: 18px; }
.admin-hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.admin-hero-panel p { color: #64748b; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card { padding: 18px; }
.stat-card span { color: #64748b; }
.stat-card strong { display: block; margin-top: 8px; font-size: 34px; color: #0f766e; }
.admin-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.admin-form label:has(textarea),
.admin-form .admin-preview-grid,
.admin-form .form-actions,
.admin-form .checkbox-row {
  grid-column: 1 / -1;
}
.admin-preview-grid {
  display: grid;
  grid-template-columns: 120px 1fr 180px;
  gap: 12px;
}
.admin-preview-grid img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #eef2f7;
}
.form-actions {
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 11px 10px;
  text-align: left;
  vertical-align: middle;
}
.data-table th { color: #64748b; font-size: 13px; }
.data-table form { display: flex; gap: 8px; align-items: center; }
.inline-review-form input { width: 110px; }
.proof-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f766e;
  font-weight: 800;
}
.proof-link img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 1px solid #dbe4ee;
  border-radius: 6px;
  background: #f8fafc;
}

@media (max-width: 980px) {
  .hero-band, .detail-hero, .detail-layout { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    min-height: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }
  .admin-sidebar-title { display: none; }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }
  .site-header nav { justify-content: flex-start; width: 100%; }
  .site-header nav a { padding: 0 9px; }
  .public-layout main, .project-detail { width: min(100% - 28px, 520px); }
  .hero-band { min-height: 0; padding: 26px 0 32px; gap: 24px; }
  h1 { font-size: 36px; }
  h2 { font-size: 24px; }
  .hero-actions, .project-actions, .form-actions { align-items: stretch; flex-direction: column; }
  .button-primary, .button-secondary, .button-pledge, .button-muted { width: 100%; }
  .hero-stats { position: static; grid-template-columns: 1fr 1fr; padding: 10px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .content-section { padding: 34px 0; }
  .project-grid { grid-template-columns: 1fr; }
  .project-title-row, .money-row, .game-meta { align-items: flex-start; flex-direction: column; gap: 6px; }
  .qr-grid, .admin-stats, .admin-form, .admin-preview-grid { grid-template-columns: 1fr; }
  .admin-main { width: min(100% - 24px, 560px); padding-top: 14px; }
  .admin-hero-panel { align-items: stretch; flex-direction: column; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}
