:root {
  color-scheme: light;
  --text: #1f1e24;
  --muted: #626168;
  --subtle: #89888d;
  --border: #dcdcde;
  --border-strong: #bfbfc3;
  --background: #ffffff;
  --panel: #f7f7f8;
  --panel-strong: #f1f1f4;
  --purple: #7759c2;
  --purple-dark: #5b3e99;
  --orange: #c95d2e;
  --orange-soft: #fdf1ec;
  --blue: #1f75cb;
  --green: #108548;
  --red: #dd2b0e;
  --shadow: 0 1px 2px rgba(31, 30, 36, 0.08);
  --focus: 0 0 0 3px rgba(119, 89, 194, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.site-header {
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(247, 247, 248, 0.94), rgba(255, 255, 255, 1)),
    var(--background);
}

.nav {
  width: min(1200px, calc(100% - 32px));
  min-height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand::before {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background:
    linear-gradient(135deg, var(--orange) 0 48%, transparent 49%),
    linear-gradient(315deg, var(--purple) 0 50%, #fca326 51%);
  content: "";
}

.nav-actions {
  display: flex;
  gap: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-actions a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 4px;
  text-decoration: none;
}

.nav-actions a:hover {
  background: var(--panel-strong);
  color: var(--text);
}

.hero {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 38px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 32px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--purple-dark);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.2;
}

.lede {
  max-width: 760px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.13rem);
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-metrics span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-metrics strong {
  color: var(--text);
}

.search-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  box-shadow: var(--shadow);
}

.search-panel label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--background);
  color: var(--text);
}

button {
  border: 0;
  cursor: pointer;
}

.search-row button,
.link,
.local-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.search-row button {
  border: 1px solid var(--border-strong);
  background: var(--background);
  color: var(--text);
}

.search-row button:hover {
  background: var(--panel-strong);
}

#resultSummary {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.toolbar-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.filter {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.filter:hover {
  border-color: var(--border);
  background: var(--panel);
  color: var(--text);
}

.filter.active {
  border-color: #cbbbf2;
  background: #f2effb;
  color: var(--purple-dark);
}

.library {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.library {
  padding: 38px 0 48px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

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

.card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  box-shadow: var(--shadow);
}

.card:hover {
  border-color: var(--border-strong);
}

.card[data-accent] {
  border-top-width: 3px;
}

.card[data-accent="sage"] {
  border-top-color: var(--green);
}

.card[data-accent="teal"] {
  border-top-color: #0090b1;
}

.card[data-accent="cranberry"] {
  border-top-color: #a989f5;
}

.card[data-accent="gold"] {
  border-top-color: #fca326;
}

.card[data-accent="blue"] {
  border-top-color: var(--blue);
}

.card-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.32;
}

.status {
  max-width: 120px;
  padding: 2px 7px;
  border: 1px solid #cbbbf2;
  border-radius: 999px;
  background: #f2effb;
  color: var(--purple-dark);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.card p {
  color: var(--muted);
  font-size: 0.94rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 16px;
}

.tag {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: #45424d;
  font-size: 0.78rem;
  font-weight: 650;
}

.tag-private {
  border-color: #f5c4b6;
  background: var(--orange-soft);
  color: #8f3318;
}

.links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.link {
  border: 1px solid var(--purple-dark);
  background: var(--purple-dark);
  color: white;
}

.link:hover {
  border-color: #452981;
  background: #452981;
}

.local-link {
  border: 1px solid var(--border-strong);
  background: var(--background);
  color: var(--text);
}

.local-link:hover {
  background: var(--panel);
}

.private-link {
  border-color: #f5c4b6;
  background: var(--orange-soft);
  color: #8f3318;
}

.private-link:hover {
  background: var(--orange-soft);
}

.private-note {
  margin-top: 2px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  border: 1px solid #f5c4b6;
  border-left: 3px solid var(--orange);
  border-radius: 4px;
  background: var(--orange-soft);
  color: #6f2a13;
  font-size: 0.88rem;
}

.private-note strong {
  color: #5f230f;
}

.private-note span {
  color: #7d412c;
}

.private-note a {
  width: fit-content;
  margin-top: 4px;
  color: var(--purple-dark);
  font-weight: 700;
  text-decoration: none;
}

.private-note a:hover {
  text-decoration: underline;
}

.local-private-note {
  background: #fff7ed;
}

[aria-disabled="true"] {
  cursor: default;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #ececef;
  color: var(--text);
}

footer {
  padding: 22px 16px 34px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

.empty {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  color: var(--muted);
  background: var(--panel);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 34px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nav {
    min-height: auto;
    align-items: flex-start;
    padding: 14px 0;
    flex-direction: column;
  }

  .hero {
    width: min(100% - 24px, 1200px);
    padding: 28px 0 32px;
    gap: 22px;
  }

  h1 {
    font-size: clamp(2.15rem, 12vw, 3.25rem);
  }

  .search-row,
  .links {
    grid-template-columns: 1fr;
  }

  .library,
  .toolbar-inner {
    width: min(100% - 24px, 1200px);
  }

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

  .card {
    min-height: 0;
  }
}
