:root {
  color-scheme: dark;
  --bg: #080c12;
  --panel: #0e141d;
  --panel-raised: #121a25;
  --line: #233042;
  --line-strong: #33455d;
  --text: #eef4fb;
  --muted: #8d9db1;
  --subtle: #65758a;
  --accent: #5eead4;
  --accent-strong: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.11);
  --blue: #7dd3fc;
  --amber: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  --radius: 10px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(125, 211, 252, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
  font-size: 1rem;
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  padding: 0.6rem 0.8rem;
  color: #04110f;
  background: var(--accent);
  border-radius: 6px;
  font-weight: 750;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 4vw;
  background: rgba(8, 12, 18, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 7px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 0.08rem;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.system-status i {
  width: 7px;
  height: 7px;
  background: var(--accent-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.1);
}

.shell {
  width: min(1220px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(440px, 0.8fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  padding: clamp(3rem, 7vw, 6.5rem) 0 2.5rem;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.lede {
  max-width: 620px;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.1rem);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metrics div {
  padding: 1rem 0.9rem;
  border-right: 1px solid var(--line);
}

.metrics div:last-child {
  border-right: 0;
}

.metrics dt {
  color: var(--subtle);
  font-size: 0.75rem;
}

.metrics dd {
  margin: 0.28rem 0 0;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1.15rem;
  font-weight: 750;
}

.terminal {
  background: rgba(14, 20, 29, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-row,
.filter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.filter-row {
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.search-box {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.65rem;
  min-width: 220px;
  padding: 0 0.85rem;
  background: #090e15;
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box:focus-within {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.09);
}

.search-box svg {
  flex: 0 0 auto;
  fill: none;
  stroke: var(--subtle);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: #66768b;
}

.search-box kbd {
  padding: 0.08rem 0.38rem;
  color: var(--subtle);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
}

.type-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: #090e15;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.type-tab {
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 0.88rem;
  font-weight: 650;
}

.type-tab span {
  margin-left: 0.25rem;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.73rem;
}

.type-tab:hover {
  color: var(--text);
}

.type-tab.is-active {
  color: var(--text);
  background: var(--panel-raised);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.type-tab.is-active span {
  color: var(--accent);
}

.tag-filter {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.filter-label {
  flex: 0 0 auto;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.09em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-chip {
  padding: 0.32rem 0.58rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
}

.tag-chip:hover,
.tag-chip.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(94, 234, 212, 0.36);
}

.tag-placeholder {
  color: var(--subtle);
  font-size: 0.82rem;
}

.filter-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1rem;
}

.featured-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.featured-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.featured-toggle > span {
  position: relative;
  width: 34px;
  height: 18px;
  background: #202b39;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: 160ms ease;
}

.featured-toggle > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  content: "";
  background: var(--muted);
  border-radius: 50%;
  transition: 160ms ease;
}

.featured-toggle input:checked + span {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
}

.featured-toggle input:checked + span::after {
  background: var(--accent);
  transform: translateX(16px);
}

.featured-toggle input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--subtle);
  font-size: 0.78rem;
  white-space: nowrap;
}

.sort-control select {
  min-height: 38px;
  padding: 0 2rem 0 0.65rem;
  color: var(--text);
  background: #090e15;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.results {
  padding: 3.5rem 0 5rem;
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.results-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -0.035em;
}

.results-summary {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.77rem;
}

.text-button {
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.report-card {
  position: relative;
  display: flex;
  min-height: 280px;
  flex-direction: column;
  padding: 1.35rem;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(18, 26, 37, 0.98), rgba(12, 18, 26, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.report-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 84px;
  height: 1px;
  content: "";
  background: var(--line-strong);
}

.report-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.report-card.is-featured {
  border-color: rgba(94, 234, 212, 0.28);
}

.report-card.is-featured::before {
  background: var(--accent);
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.45);
}

.card-kicker,
.card-meta,
.card-tags,
.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.card-kicker {
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.type-badge,
.featured-badge {
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.07em;
}

.type-badge {
  color: var(--blue);
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.18);
}

.featured-badge {
  color: var(--amber);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.18);
}

.report-title {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.45rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.report-title a {
  text-decoration: none;
}

.report-title a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.report-card:hover .report-title a {
  color: var(--accent);
}

.card-meta {
  gap: 0.5rem 0.8rem;
  margin: 0.7rem 0 0;
  color: var(--subtle);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.74rem;
}

.card-meta span + span::before {
  margin-right: 0.8rem;
  color: var(--line-strong);
  content: "/";
}

.card-summary {
  margin: 1rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.card-tags {
  position: relative;
  z-index: 2;
  gap: 0.4rem;
  margin-top: auto;
}

.card-tag {
  padding: 0.24rem 0.48rem;
  color: var(--muted);
  background: #0a0f16;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.72rem;
}

.card-tag:hover {
  color: var(--accent);
  border-color: rgba(94, 234, 212, 0.3);
}

.card-footer {
  justify-content: space-between;
  margin-top: 1.15rem;
  padding-top: 0.9rem;
  color: var(--subtle);
  border-top: 1px solid var(--line);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
}

.open-label {
  color: var(--accent);
}

.empty-state {
  padding: clamp(3.5rem, 8vw, 6rem) 1.5rem;
  text-align: center;
  background: rgba(14, 20, 29, 0.72);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-index {
  color: var(--line-strong);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 2.5rem;
  font-weight: 800;
}

.empty-state h3 {
  margin: 0.6rem 0 0.25rem;
  font-size: 1.25rem;
}

.empty-state p {
  margin: 0 auto;
  color: var(--muted);
}

.button {
  margin-top: 1.2rem;
  padding: 0.62rem 0.9rem;
  color: #051310;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 750;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 4vw;
  color: var(--subtle);
  border-top: 1px solid var(--line);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.noscript {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  padding: 0.75rem 1rem;
  color: #fff;
  background: #9f1239;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .overview {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .search-row,
  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .type-tabs {
    align-self: flex-start;
  }

  .filter-actions {
    justify-content: space-between;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .topbar {
    min-height: 64px;
  }

  .system-status,
  .brand small {
    display: none;
  }

  .shell {
    width: min(100% - 1.25rem, 1220px);
  }

  .overview {
    padding-top: 3rem;
  }

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

  .metrics div:nth-child(2) {
    border-right: 0;
  }

  .metrics div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .type-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-control {
    justify-content: space-between;
  }

  .sort-control select {
    flex: 1;
  }

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

  .results-heading,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
