:root {
  color-scheme: light;
  --bg: #f4f4f0;
  --surface: #ffffff;
  --surface-soft: #f7f7f3;
  --text: #000000;
  --muted: #666666;
  --border: #000000;
  --red: #e60000;
  --blue: #0055ff;
  --orange: #ff6b00;
  --green: #00a600;
  --shadow: 4px 4px 0 #000000;
  --shadow-lg: 6px 6px 0 #000000;
  --max: 1200px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Heiti SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  border-radius: 0;
  font: inherit;
}

button {
  cursor: pointer;
}

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 72px;
  border-bottom: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--max), calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
}

.brand,
.nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: max-content;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-mark {
  width: 15px;
  height: 15px;
  border: 2px solid var(--border);
  background: var(--red);
  box-shadow: 2px 2px 0 var(--border);
}

.nav {
  gap: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.account-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-actions [hidden] {
  display: none !important;
}

.account-actions.auth-pending {
  visibility: hidden;
}

.account-actions [data-auth-signout] {
  color: var(--red);
}

.account-actions [data-auth-account]:hover,
.account-actions [data-auth-account]:focus-visible {
  background: var(--text);
  color: var(--surface);
}

.nav .account-actions {
  margin-left: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

.btn:hover,
.btn:focus-visible,
.card:hover,
.card:focus-visible {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--border);
  outline: none;
}

.btn.primary {
  background: var(--text);
  color: var(--surface);
}

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

.shell {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 46px 0 76px;
}

.hero {
  margin-bottom: 34px;
  padding-left: 24px;
  border-left: 6px solid var(--page-accent, var(--orange));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 18px;
  padding: 0 10px;
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--border);
  color: var(--page-accent, var(--orange));
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 640px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
}

.controls {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}

.search {
  position: relative;
  width: min(100%, 440px);
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 900;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 48px;
  border: 2px solid var(--border);
  background: var(--surface);
  padding: 0 15px 0 42px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  outline: none;
  box-shadow: 3px 3px 0 var(--border);
}

.search input:focus {
  border-color: var(--page-accent, var(--orange));
  box-shadow: 3px 3px 0 var(--page-accent, var(--orange));
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter {
  min-height: 34px;
  padding: 0 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

.filter:hover,
.filter:focus-visible,
.filter.active {
  background: var(--text);
  box-shadow: 2px 2px 0 var(--page-accent, var(--orange));
  color: var(--surface);
  outline: none;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  min-width: 0;
  min-height: 100%;
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  flex-direction: column;
  transition: transform 170ms ease, box-shadow 170ms ease;
}

.cover {
  position: relative;
  display: grid;
  height: 170px;
  overflow: hidden;
  border-bottom: 2px solid var(--border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, white), white 56%),
    var(--surface-soft);
  place-items: center;
}

.cover::before,
.cover::after {
  position: absolute;
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--border);
  content: "";
}

.cover::before {
  top: 24px;
  left: 24px;
  width: 66px;
  height: 44px;
}

.cover::after {
  right: 24px;
  bottom: 24px;
  width: 92px;
  height: 58px;
  background: var(--accent);
}

.cover-letter {
  position: relative;
  z-index: 2;
  display: grid;
  width: 78px;
  height: 78px;
  border: 2px solid var(--border);
  background: var(--text);
  box-shadow: var(--shadow);
  color: var(--surface);
  font-size: 34px;
  font-weight: 900;
  place-items: center;
}

.card-body {
  display: flex;
  min-height: 240px;
  padding: 20px;
  flex: 1;
  flex-direction: column;
}

.meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.status {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
}

.card h2 {
  font-size: 19px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.tag {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.card-action {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 2px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.empty {
  display: none;
  margin-top: 22px;
  padding: 28px;
  border: 2px dashed var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.empty.show {
  display: block;
}

.footer {
  border-top: 4px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(var(--max), calc(100% - 48px));
  min-height: 96px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 940px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav {
    gap: 14px;
  }
}

@media (max-width: 720px) {
  .header {
    height: auto;
  }

  .header-inner {
    align-items: flex-start;
    padding: 18px 0;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav .account-actions,
  .nav .account-actions .btn {
    width: 100%;
  }

  .shell,
  .header-inner,
  .footer-inner {
    width: min(100% - 28px, var(--max));
  }

  .shell {
    padding-top: 34px;
  }

  .hero {
    padding-left: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .cover {
    height: 150px;
  }

  .footer-inner {
    align-items: flex-start;
    padding: 22px 0;
    flex-direction: column;
  }
}
