/* ============================================================
   星宸阁 · 游戏众筹 / 设计系统
   深黑底 + 青色霓虹，BEM 命名，单一文件
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --bg-elevated: #0f151d;
  --surface: #131922;
  --surface-strong: #19232f;
  --surface-soft: #0c1118;
  --line: rgba(144, 247, 255, 0.20);
  --line-strong: rgba(144, 247, 255, 0.38);
  --text: #f5f8fc;
  --text-soft: #a9b5c3;
  --text-muted: #718092;
  --cyan: #4de7ff;
  --cyan-bright: #90f7ff;
  --green: #9dff57;
  --amber: #ffcc66;
  --red: #ff5c7a;
  --blue: #82aaff;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --container: 1240px;
  --header-height: 72px;
  --font-sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

/* 注意：.button / .form-field 自带 display，会覆盖 [hidden] 的 UA 样式，
   这里统一兜底，否则 JS 里 setAttribute('hidden') 不生效。 */
[hidden] { display: none !important; }

html { min-width: 320px; scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background:
    radial-gradient(1200px 620px at 82% -8%, rgba(77, 231, 255, 0.10), transparent 62%),
    radial-gradient(900px 520px at 4% 12%, rgba(130, 170, 255, 0.07), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
dl, dd, dt, ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--surface-strong); color: var(--cyan-bright);
  padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

#network-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.55;
}

.site-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-height);
  display: flex; align-items: center;
  background: rgba(10, 13, 18, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(144, 247, 255, 0.12);
  transition: transform .28s ease;
}
/* 手机端向下滚动时收起，向上滚动立即回来 */
.site-header.is-hidden { transform: translateY(-100%); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.site-brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(77, 231, 255, 0.18), rgba(130, 170, 255, 0.1));
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 22px rgba(77, 231, 255, 0.16) inset;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
/* 自定义图片模式：容器彻底透明、无边框无圆角无内阴影，
   让上传图自己的轮廓决定外观 —— 圆的显示圆、方的显示方 */
.brand-mark.brand-mark--image {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
}
.brand-mark.brand-mark--image img { padding: 0; border-radius: 0; }
.brand-mark__glyph.is-long { font-size: 11px; letter-spacing: 0; }
.brand-mark__glyph { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--cyan-bright); letter-spacing: -1px; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
/* 站点副标题：页头品牌名下方的小字，过长自动省略 */
.brand-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-tagline {
  font-size: 11px; line-height: 1.3; color: #718092; font-weight: 400;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  font-size: 14px; color: var(--text-soft);
  padding: 8px 14px; border-radius: 60px;
  transition: color .18s ease, background .18s ease;
}
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.site-nav a[aria-current="page"] { color: var(--cyan-bright); background: rgba(77, 231, 255, 0.1); }

/* ---------------- Buttons ---------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 22px;
  border-radius: 60px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, opacity .2s;
  white-space: nowrap;
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button-primary {
  background: linear-gradient(135deg, #4de7ff, #82aaff);
  color: #04121a;
  box-shadow: 0 6px 26px rgba(77, 231, 255, 0.30);
}
.button-primary:hover { box-shadow: 0 10px 34px rgba(77, 231, 255, 0.42); }
.button-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}
.button-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--line-strong); }
.button-danger { background: rgba(255, 92, 122, 0.12); border-color: rgba(255, 92, 122, 0.4); color: #ff9dae; }
.button-danger:hover { background: rgba(255, 92, 122, 0.2); }
.button-sm { min-height: 34px; padding: 5px 14px; font-size: 13px; }

/* ---------------- Hero ---------------- */
.page-main { position: relative; z-index: 1; padding-bottom: 72px; }

.home-hero {
  display: grid; grid-template-columns: 1.35fr 0.9fr; gap: 48px;
  align-items: center;
  padding-top: 64px; padding-bottom: 56px;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.32em;
  color: var(--cyan); opacity: 0.85; margin-bottom: 16px;
}
.home-hero h1 {
  font-size: clamp(28px, 3vw, 42px); line-height: 1.42;
  background: linear-gradient(120deg, #ffffff 20%, #bcd6e6 82%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  max-width: 22ch;
}
.hero__description { margin-top: 18px; color: var(--text-soft); font-size: 15px; max-width: 46ch; }
.hero__actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

.hero-console {
  background: linear-gradient(160deg, rgba(25, 35, 47, 0.9), rgba(12, 17, 24, 0.9));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-console::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(77, 231, 255, 0.08), transparent 40%);
  pointer-events: none;
}
.hero-console__inner { padding: 18px 20px 20px; position: relative; }
.hero-console__header {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--text-muted); text-transform: uppercase;
  padding-bottom: 14px; border-bottom: 1px dashed rgba(144, 247, 255, 0.16);
}
.live-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; }
.live-indicator i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(157, 255, 87, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(157, 255, 87, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(157, 255, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(157, 255, 87, 0); }
}
.telemetry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); margin-top: 16px; border-radius: 8px; overflow: hidden; }
.telemetry-stat { background: var(--surface-soft); padding: 14px 16px; }
.telemetry-stat--wide { grid-column: span 2; }
.telemetry-stat dt { font-size: 12px; color: var(--text-muted); }
.telemetry-stat dd {
  font-family: var(--font-mono); font-size: 26px; font-weight: 700;
  color: var(--cyan-bright); line-height: 1.3; margin-top: 2px;
}
.telemetry-stat--wide dd { font-size: 32px; }

/* ---------------- Filters + section heading ---------------- */
.projects-section { padding-top: 8px; }
.project-filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-bottom: 18px; margin-bottom: 26px;
  border-bottom: 1px solid rgba(144, 247, 255, 0.12);
  flex-wrap: wrap;
}
.project-filters { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-soft); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 60px; }
.filter-button {
  border: 0; background: transparent; color: var(--text-muted);
  padding: 7px 18px; border-radius: 60px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .18s ease;
}
.filter-button:hover { color: var(--text); }
.filter-button.is-active { background: rgba(77, 231, 255, 0.14); color: var(--cyan-bright); box-shadow: 0 0 0 1px var(--line-strong) inset; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.section-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.28em; color: var(--cyan); opacity: 0.8; }
.section-heading h2 { font-size: 24px; margin-top: 4px; }
.section-heading__description { font-size: 13px; color: var(--text-muted); white-space: nowrap; text-align: right; }

/* ---------------- Project grid ---------------- */
.project-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.project-card {
  display: flex; flex-direction: column;
  background: linear-gradient(170deg, var(--surface), var(--surface-soft));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px; overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(77, 231, 255, 0.1);
}
.project-card[hidden] { display: none; }
.project-cover {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--surface-strong);
}
.project-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project-card:hover .project-cover img { transform: scale(1.035); }
.project-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(6, 9, 13, 0.72));
}
.project-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.project-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 10px; border-radius: 60px; border: 1px solid transparent;
}
.status-badge--active { color: var(--green); background: rgba(157, 255, 87, 0.1); border-color: rgba(157, 255, 87, 0.32); }
.status-badge--completed { color: var(--text-soft); background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.status-badge--pending { color: var(--amber); background: rgba(255, 204, 102, 0.1); border-color: rgba(255, 204, 102, 0.32); }
.status-badge--rejected { color: var(--red); background: rgba(255, 92, 122, 0.1); border-color: rgba(255, 92, 122, 0.32); }
.project-card__title { font-size: 16px; line-height: 1.45; }
.project-card__title a:hover { color: var(--cyan-bright); }
.project-card__summary {
  font-size: 13px; color: var(--text-muted); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.progress-block { margin-top: auto; padding-top: 6px; }
.progress { height: 6px; border-radius: 60px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress__bar {
  display: block; height: 100%; width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--cyan), var(--cyan-bright));
  border-radius: 60px;
  box-shadow: 0 0 12px rgba(77, 231, 255, 0.5);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.progress__bar--done { background: linear-gradient(90deg, #6f8fa0, #9dff57); box-shadow: 0 0 12px rgba(157, 255, 87, 0.4); }
.funding-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.funding-meta strong { color: var(--text); font-weight: 600; }
.project-card__footer { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.project-card__footer .button { flex: 1; min-height: 38px; font-size: 13px; }

.empty-state { padding: 60px 20px; text-align: center; color: var(--text-muted); border: 1px dashed rgba(255, 255, 255, 0.12); border-radius: 12px; }

/* ---------------- Detail ---------------- */
.detail-wrap { padding-top: 36px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; display: flex; gap: 8px; }
.breadcrumb a:hover { color: var(--cyan-bright); }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.detail-cover { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08); aspect-ratio: 16 / 9; background: var(--surface-strong); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.4; margin-top: 22px; }
.detail-lead { margin-top: 12px; color: var(--text-soft); font-size: 14px; }
.detail-body { margin-top: 26px; }
.detail-body h2 { font-size: 16px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(144, 247, 255, 0.14); }
.detail-text { color: var(--text-soft); font-size: 14px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }

.detail-sidebar { position: sticky; top: calc(var(--header-height) + 20px); display: flex; flex-direction: column; gap: 16px; }
.panel {
  background: linear-gradient(170deg, var(--surface), var(--surface-soft));
  border: 1px solid var(--line); border-radius: 14px; padding: 20px;
}
.panel__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.22em; color: var(--text-muted); text-transform: uppercase; }
.panel__amount { font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: var(--cyan-bright); line-height: 1.25; margin-top: 8px; }
.panel__amount-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.panel__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 18px; padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.panel__stat dt { font-size: 11px; color: var(--text-muted); }
.panel__stat dd { font-family: var(--font-mono); font-size: 17px; font-weight: 600; margin-top: 2px; }
.panel .button { width: 100%; }
.panel__hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; line-height: 1.7; }

.supporters { margin-top: 34px; }
.supporters__list { display: flex; flex-direction: column; gap: 1px; background: rgba(255, 255, 255, 0.06); border-radius: 12px; overflow: hidden; }
.supporter-row { background: var(--surface-soft); padding: 13px 16px; display: flex; align-items: center; gap: 14px; }
.supporter-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: rgba(77, 231, 255, 0.12); color: var(--cyan-bright);
  border: 1px solid var(--line);
}
.supporter-main { flex: 1; min-width: 0; }
.supporter-name { font-size: 14px; font-weight: 600; }
.supporter-note { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supporter-amount { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--cyan-bright); }
.supporter-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

/* ---------------- Modal ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.is-open { display: block; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 7, 10, 0.78); backdrop-filter: blur(4px); }
.modal__dialog {
  position: relative; z-index: 1;
  width: min(620px, calc(100% - 32px));
  max-height: calc(100vh - 64px); overflow-y: auto;
  margin: 8vh auto 0;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: modal-in .22s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 22px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.modal__title { font-size: 17px; }
.modal__subtitle { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.modal__close {
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.05);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--text-soft);
  display: grid; place-items: center; line-height: 1; flex: none;
}
.modal__close:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.modal__body { padding: 20px 22px; }
.modal__footer { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 22px; }
.modal__footer .button { min-width: 120px; }

.step-dots { display: flex; gap: 6px; align-items: center; margin-bottom: 16px; }
.step-dots span { height: 3px; flex: 1; border-radius: 3px; background: rgba(255, 255, 255, 0.1); }
.step-dots span.is-done { background: var(--cyan); box-shadow: 0 0 10px rgba(77, 231, 255, 0.5); }

.notice-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.notice-list li {
  font-size: 13px; color: var(--text-soft); line-height: 1.7;
  padding-left: 20px; position: relative;
}
.notice-list li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); opacity: .8;
}
.notice-box {
  margin-top: 16px; padding: 12px 14px; border-radius: 8px;
  background: rgba(255, 204, 102, 0.07); border: 1px solid rgba(255, 204, 102, 0.22);
  color: #ffdfa3; font-size: 12px; line-height: 1.7;
}

/* ---------------- Form ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field--full { grid-column: 1 / -1; }
.form-label { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.form-label .required { color: var(--red); }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px; font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(77, 231, 255, 0.12);
}
input[type="file"].form-input { padding: 8px 10px; font-size: 12px; }
input[type="file"].form-input::file-selector-button {
  margin-right: 12px; padding: 7px 12px; cursor: pointer;
  font-size: 12px; color: var(--cyan-bright);
  background: rgba(77, 231, 255, 0.1);
  border: 1px solid var(--line-strong); border-radius: 6px;
  transition: background .16s ease;
}
input[type="file"].form-input::file-selector-button:hover { background: rgba(77, 231, 255, 0.2); }
.form-textarea { resize: vertical; min-height: 76px; line-height: 1.65; }
.field-hint { font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.checkbox-label { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); }
.form-grid .checkbox-label { align-self: end; min-height: 42px; }
.checkbox-label input { width: 15px; height: 15px; accent-color: var(--cyan); }
.payment-option {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1); background: var(--surface-soft);
  transition: border-color .16s, background .16s;
}
.payment-option:hover { border-color: var(--line); }
.payment-option:has(input:checked) { border-color: var(--line-strong); background: rgba(77, 231, 255, 0.06); }
.payment-option input { margin-top: 4px; accent-color: var(--cyan); }
.payment-option__name { font-size: 14px; font-weight: 600; display: block; }
.payment-option__status { font-size: 11px; color: var(--text-muted); }
.payment-options { display: flex; flex-direction: column; gap: 8px; }
.qr-panel {
  margin-top: 12px; padding: 14px; border-radius: 10px; text-align: center;
  background: var(--surface-soft); border: 1px dashed rgba(144, 247, 255, 0.2);
}
.qr-panel img { width: min(220px, 70%); margin: 0 auto 8px; border-radius: 8px; background: #fff; padding: 6px; }
.qr-panel p { font-size: 11px; color: var(--text-muted); }
.upload-field input[type="file"] {
  padding: 8px; font-size: 12px; background: var(--surface-soft);
  border: 1px dashed rgba(255, 255, 255, 0.16); border-radius: 8px; cursor: pointer; width: 100%;
}
.upload-preview { display: none; max-width: 180px; border-radius: 8px; margin-top: 8px; border: 1px solid var(--line); }

.form-error {
  display: none; margin-bottom: 14px; padding: 10px 14px; border-radius: 8px;
  background: rgba(255, 92, 122, 0.1); border: 1px solid rgba(255, 92, 122, 0.35);
  color: #ff9dae; font-size: 13px;
}
.form-error.is-visible { display: block; }

.success-panel { text-align: center; padding: 12px 0 4px; }
.success-icon {
  width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(157, 255, 87, 0.12); border: 1px solid rgba(157, 255, 87, 0.4);
  color: var(--green); font-size: 24px;
}
.success-panel h3 { font-size: 17px; margin-bottom: 8px; }
.success-panel p { font-size: 13px; color: var(--text-soft); }

/* ---------------- Toast ---------------- */
.toast-region { position: fixed; right: 20px; bottom: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface-strong); border: 1px solid var(--line-strong);
  color: var(--text); font-size: 13px; padding: 10px 16px; border-radius: 10px;
  box-shadow: var(--shadow); animation: toast-in .2s ease;
}
.toast--error { border-color: rgba(255, 92, 122, 0.45); color: #ffb2c0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid rgba(255, 255, 255, 0.07); padding: 26px 0 34px; }
.site-footer__inner {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
}

/* ---------------- Admin ---------------- */
.admin-body { background: #070a0e; }
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.admin-side {
  background: var(--surface-soft); border-right: 1px solid rgba(255, 255, 255, 0.07);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); margin-bottom: 14px; }
.admin-brand span { font-size: 14px; font-weight: 700; }
.admin-nav-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--text-soft);
}
.admin-nav-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.admin-nav-link.is-active { background: rgba(77, 231, 255, 0.1); color: var(--cyan-bright); }
.admin-nav-link .count {
  font-family: var(--font-mono); font-size: 11px; padding: 1px 7px; border-radius: 60px;
  background: rgba(255, 92, 122, 0.18); color: #ff9dae;
}
.admin-side__foot { margin-top: auto; font-size: 12px; color: var(--text-muted); padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.admin-main { padding: 26px 28px 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-head h1 { font-size: 20px; }
.admin-head p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 16px 18px; }
.stat-card dt { font-size: 12px; color: var(--text-muted); }
.stat-card dd { font-family: var(--font-mono); font-size: 24px; font-weight: 700; color: var(--cyan-bright); margin-top: 4px; }
.table-card { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); padding: 12px 14px; background: var(--surface-soft); white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
table.data td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.num { font-family: var(--font-mono); }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 13px; }
.thumb-sm { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; border: 1px solid rgba(255,255,255,.1); }
.badge-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); background: var(--bg-elevated);
  border: 1px solid var(--line); border-radius: 16px; padding: 30px 28px;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card .sub { font-size: 12px; color: var(--text-muted); margin-bottom: 22px; }
.login-card .form-field { margin-bottom: 14px; }
.login-card .button { width: 100%; }
.login-foot { margin-top: 16px; font-size: 11px; color: var(--text-muted); text-align: center; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
  .home-hero { grid-template-columns: 1fr; gap: 32px; padding-top: 44px; }
  .hero-console { max-width: 520px; }
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; overflow-x: auto; align-items: center; gap: 6px; }
  .admin-brand { border: 0; margin: 0; padding: 0 10px 0 0; }
  .admin-side__foot { display: none; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
}
@media (max-width: 680px) {
  :root { --header-height: 56px; }
  .site-brand { gap: 8px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand-mark img { width: 100%; height: 100%; padding: 2px; }
  .brand-mark__glyph { font-size: 12px; }
  .brand-mark__glyph.is-long { font-size: 10px; }
  .brand-name { font-size: 14px; }
  .brand-tagline { max-width: 128px; font-size: 10px; }
  .site-nav { gap: 2px; }
  .site-nav a { font-size: 13px; padding: 6px 10px; }
  /* 只改左右，避免 padding 简写把 .home-hero / .projects-section 的上下留白清掉 */
  .site-container { padding-left: 16px; padding-right: 16px; }
  .home-hero { padding-top: 28px; padding-bottom: 36px; }
  .projects-section { padding-top: 8px; }
  .project-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .section-heading__description { text-align: left; white-space: normal; font-size: 12px; }
  .home-hero h1 { font-size: 26px; }
  .section-heading h2 { font-size: 20px; }
  .modal__dialog { margin-top: 4vh; max-height: 92vh; }
  .modal__footer { flex-direction: column-reverse; }
  .modal__footer .button { width: 100%; }
  .site-footer__inner { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
