:root {
  --bg: #efe8dc;
  --bg-deep: #e6ddd0;
  --paper: #faf7f1;
  --paper-2: #f3eee4;
  --ink: #1b2430;
  --ink-soft: #2c3644;
  --muted: #5d6570;
  --line: #d7cebf;
  --line-strong: #c3b8a4;
  --teal: #1c5c57;
  --teal-hover: #164943;
  --teal-soft: #e4efee;
  --copper: #b85a28;
  --copper-soft: #f4e6db;
  --ok: #1e6b45;
  --ok-soft: #e5f3ea;
  --warn: #8a4b12;
  --warn-soft: #f7ead8;
  --danger: #9b2c2c;
  --danger-soft: #f8e8e6;
  --chip: #ece4d6;
  --shadow: 0 10px 28px rgba(27, 36, 48, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 64px;
  --tab-h: 62px;
  --font: "Source Sans 3", "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --serif: "Instrument Serif", "Songti SC", "Noto Serif SC", "Source Han Serif SC", Palatino, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #f7f1e6 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #e7efe9 0%, transparent 50%),
    var(--bg);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  padding-bottom: calc(var(--tab-h) + 18px);
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
}
.wordmark:hover { text-decoration: none; }
.wordmark b {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.wordmark span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: none;
}
.site-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 550;
  font-size: 14px;
}
.site-nav a:hover { background: var(--chip); text-decoration: none; }
.site-nav a.active {
  background: var(--teal);
  color: #f7faf9;
}

.wallet-wrap { position: relative; margin-left: auto; }
.wallet-btn, .btn {
  border: 0;
  background: var(--teal);
  color: #f7faf9;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.wallet-btn:hover, .btn:hover { background: var(--teal-hover); }
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn.secondary:hover { background: var(--paper-2); }
.btn.copper { background: var(--copper); color: #fff; }
.btn.copper:hover { background: #9a4920; }
.btn.ghost { background: var(--teal-soft); color: var(--teal); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.wallet-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(320px, 86vw);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: none;
}
.wallet-menu.open { display: block; }
.wallet-menu .addr {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  margin-bottom: 6px;
}
.wallet-menu .hint { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

.ribbon {
  background: var(--ink);
  color: #efe8dc;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 16px;
  text-align: center;
}
.ribbon strong { color: #f3d2b3; font-weight: 650; }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: 0.01em; line-height: 1.25; margin: 0 0 10px; }
h1 { font-size: clamp(32px, 5vw, 52px); }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
.lede { font-size: 18px; color: var(--ink-soft); max-width: 40rem; margin: 0 0 22px; }
.muted { color: var(--muted); }
.kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 8px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 36px;
}
.hero-card, .card, .section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section, .card, .hero-card { padding: 20px 22px; }
.section { margin-bottom: 20px; }
.section h2 { margin-bottom: 14px; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 8px 0 28px;
}
.step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
}
.step .n {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--copper);
  line-height: 1;
  margin-bottom: 8px;
}
.step p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.callout {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 22px;
  border: 1px solid var(--line);
}
.callout.warn { background: var(--warn-soft); border-color: #e2c7a0; }
.callout.danger { background: var(--danger-soft); border-color: #e3c0bc; }
.callout.ok { background: var(--ok-soft); border-color: #b9d8c5; }
.callout.teal { background: var(--teal-soft); border-color: #bcd4d1; }
.callout h3 { font-size: 20px; margin-bottom: 6px; }
.callout ul { margin: 8px 0 0; padding-left: 1.15em; }
.callout li { margin: 4px 0; }

.meta-grid, .form-grid, .stat-grid, .proj-grid {
  display: grid;
  gap: 14px;
}
.meta-grid { grid-template-columns: 1fr 1fr; }
.form-grid { grid-template-columns: 1fr 1fr; }
.stat-grid { grid-template-columns: repeat(4, 1fr); }
.proj-grid { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 6px;
}
label .req { color: var(--copper); }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }

input[type="text"], input[type="number"], input[type="url"], input[type="date"],
select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(28, 92, 87, 0.15);
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  font-size: 14px;
  margin: 10px 0;
}
.check input { margin-top: 4px; flex: 0 0 auto; }

.stat {
  background: var(--paper-2);
  border-radius: 12px;
  padding: 12px 14px;
}
.stat b { display: block; font-size: 20px; font-weight: 700; }
.stat span { color: var(--muted); font-size: 12px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 650;
  background: var(--chip);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.copper { background: var(--copper-soft); color: var(--copper); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.toolbar input, .toolbar select { min-width: 0; flex: 1; }

.project-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-height: 100%;
}
a.project-card:hover { text-decoration: none; border-color: var(--teal); }
.project-card .top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--teal);
  color: #f6faf9;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 18px;
  flex: 0 0 auto;
}
.project-card h3 { margin: 0; font-size: 22px; }
.project-card .sym { color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 14px; }
.kv b { font-weight: 650; display: block; }
.kv span { color: var(--muted); font-size: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 16px);
  transform: translateX(-50%);
  background: var(--ink);
  color: #faf7f1;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 80;
  display: none;
  max-width: min(560px, 92vw);
  text-align: center;
}
.toast.show { display: block; }

.mobile-tab {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--tab-h);
  background: rgba(250, 247, 241, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: none;
  z-index: 40;
}
.mobile-tab a {
  flex: 1;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
  padding: 8px 2px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.mobile-tab a.active { color: var(--teal); }
.mobile-tab a::before {
  content: "";
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin: 0 auto 2px;
  opacity: 0.35;
}
.mobile-tab a.active::before { opacity: 1; }

.site-footer {
  max-width: 1120px;
  margin: 8px auto 0;
  padding: 8px 20px 18px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer p { margin: 0 0 6px; }

.split {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 16px;
  align-items: start;
}
.cover-box {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  min-height: 140px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.cover-box img { width: 100%; height: 160px; object-fit: cover; display: block; }
.cover-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}

@media (max-width: 900px) {
  .hero, .split, .steps, .stat-grid, .proj-grid, .form-grid, .meta-grid {
    grid-template-columns: 1fr;
  }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; }
  .mobile-tab { display: flex; }
  h1 { font-size: 34px; }
  .header-inner { padding: 8px 14px; }
  .wordmark b { font-size: 22px; }
}
@media (min-width: 901px) {
  body { padding-bottom: 24px; }
}
