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

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #6b6b6b;
  --ink-faint: #a3a3a3;
  --line: #e5e5e5;
  --line-strong: #d4d4d4;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 24px 120px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
header { margin-bottom: 64px; }
h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}
h1::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--ink);
  margin-top: 16px;
}
.subtitle {
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.2px;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  flex: 1;
  align-content: start;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 24px 24px;
  position: relative;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  min-width: 0;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0;
  height: 2px;
  background: var(--ink);
  transition: width .3s ease;
}
.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 4px 20px rgba(0,0,0,.05);
  transform: translateY(-2px);
}
.card:hover::before { width: 100%; }

.card h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.card .desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 20px;
  min-height: 44px;
}

/* Path */
.path {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
  color: var(--ink-faint);
  background: #f5f5f5;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 12px;
  margin-bottom: 18px;
  word-break: break-all;
  line-height: 1.5;
}
.path .id { color: var(--ink); font-weight: 600; }

/* Actions */
.actions { display: flex; gap: 8px; }
.btn {
  flex: 1;
  padding: 10px 0;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  text-align: center;
}
.btn:hover { background: #f0f0f0; }
.btn.solid {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn.solid:hover { background: #262626; }

/* 404 content */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 40px;
}
.code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 96px;
  font-weight: 700;
  letter-spacing: -4px;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 24px;
}
.message {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.8;
  margin-bottom: 32px;
}
.back {
  display: inline-block;
  padding: 11px 32px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  border-radius: 3px;
  background: var(--ink);
  border: 1px solid var(--ink);
  color: #fff;
  text-decoration: none;
  transition: background .15s;
}
.back:hover { background: #262626; }

/* Footer */
footer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, rgba(250,250,250,0));
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.3px;
  text-align: center;
  pointer-events: none;
}
footer::before {
  content: '';
  display: block;
  max-width: 760px;
  margin: 0 auto 16px;
  border-top: 1px solid var(--line);
}

/* Responsive */
@media (max-width: 520px) {
  .wrap { padding: 48px 16px 120px; }
  h1 { font-size: 26px; }
  header { margin-bottom: 40px; }
  .code { font-size: 72px; letter-spacing: -3px; }
}