@import url("/assets/story-card.css");
@import url("/assets/article-entry.css");

:root {
  --ink: #27272a;
  --ink-soft: #3f3f46;
  --muted: #737373;
  --line: #eee2dc;
  --brand: #ec633e;
  --brand-dark: #bd4b25;
  --soft: #fff7f2;
  --surface: #fff;
  --shadow: 0 12px 26px rgba(48, 48, 51, 0.08);
}

* { box-sizing: border-box; }

html { background: #fff; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: #fff;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 8;
  width: 100%;
  max-width: 100%;
  border: 0;
  outline: 0;
  background: rgba(255, 255, 255, 0.26);
  box-shadow: none;
  -webkit-backdrop-filter: blur(6px) saturate(1.3);
  backdrop-filter: blur(6px) saturate(1.3);
}

.page,
.site-footer-inner {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.site-nav-inner {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-logo-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
}

.site-logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-brand-name {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-lab { color: #a85b47; }
.brand-tv { color: var(--brand); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 999px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--brand-dark);
  background: var(--soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  background: var(--brand);
}

.pill:hover {
  background: var(--brand-dark);
}

.pill-short {
  display: none;
}

.top-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 32px;
  min-height: 32px;
  padding: 3px 8px 4px;
  border: 1px solid rgba(236, 99, 62, 0.48);
  border-radius: 999px;
  color: var(--brand-dark);
  font: inherit;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  background: #fff0e7;
  cursor: pointer;
}

.top-button span:first-child {
  font-size: 14px;
}

.top-button:hover {
  border-color: var(--brand);
  background: #ffe4d4;
}

.page { padding: 20px 18px 68px; }

.category-hero {
  display: grid;
  gap: 12px;
  max-width: 820px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: 0;
}

.category-description {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.75;
}

.category-rule {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.meta-row,
.topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-row span,
.topic-links a {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  background: var(--soft);
}

.category-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 190px);
  gap: 8px;
  align-items: end;
  margin: 18px 0 14px;
  padding: 8px 0 2px;
}

.tool-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

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

.tool-field input,
.tool-field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #dacbc3;
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ink);
  font-size: 13px;
  background: var(--surface);
}

.tool-field input:focus,
.tool-field select:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(236, 99, 62, 0.14);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 14px;
}

.section-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.article-list {
  display: grid;
  gap: 12px;
}

.category-pagination {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.category-pagination[hidden] {
  display: none;
}

.pagination-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination-arrow,
.pagination-page,
.pagination-gap {
  display: inline-grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  background: #fff;
}

.pagination-arrow {
  min-width: 74px;
}

.pagination-page.is-current {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.pagination-arrow:hover,
.pagination-page:hover {
  border-color: rgba(236, 99, 62, 0.42);
  color: var(--brand-dark);
}

.pagination-arrow.is-disabled {
  color: #a69791;
  background: var(--soft);
}

.pagination-gap {
  min-width: 24px;
  border-color: transparent;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
}

.topic-block {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.topic-block h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 950;
}

.empty-state {
  margin: 24px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #1f2024;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.site-footer a {
  color: #fff;
  font-weight: 800;
}

@media (max-width: 720px) {
  .site-nav-inner {
    padding: 6px 14px;
  }

  .site-logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  .site-brand-name {
    font-size: 19px;
  }

  .nav-actions {
    gap: 6px;
  }

  .pill {
    height: 30px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 11px;
  }

  .pill-full {
    display: none;
  }

  .pill-short {
    display: inline;
  }

  .top-button {
    min-width: 28px;
    height: 30px;
    min-height: 30px;
    padding: 3px 7px 4px;
    font-size: 8px;
  }

  .category-tools {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 34%);
    gap: 7px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .pagination-controls {
    align-items: stretch;
  }

  .pagination-pages {
    width: 100%;
    order: 3;
  }

  .pagination-arrow {
    flex: 1;
  }
}
