@import url("/assets/story-card.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;
}

.tag-hero {
  display: grid;
  grid-template-columns: auto minmax(0, max-content) minmax(160px, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 0 12px;
  max-width: none;
}

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

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: 0;
}

.tag-description {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.meta-row,
.article-meta,
.article-stats,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-row span,
.article-meta span,
.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.meta-row span,
.article-meta span {
  color: var(--brand-dark);
  background: var(--soft);
}

.tag-chip {
  gap: 6px;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid #ead8cf;
  border-radius: 10px;
  color: #3f3f46;
  background: #fff;
  box-shadow: 0 1px 0 rgba(236, 99, 62, 0.04);
}

.tag-chip:hover,
.tag-chip[aria-current="page"] {
  border-color: rgba(236, 99, 62, 0.62);
  color: var(--brand-dark);
  background: #fff6f0;
}

.tag-chip[aria-current="page"] {
  box-shadow: inset 0 0 0 1px rgba(236, 99, 62, 0.22);
}

.tag-chip-name {
  line-height: 1.1;
}

.tag-chip small {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 900;
  background: var(--soft);
}

.tag-cloud-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-top: 10px;
  padding: 6px 11px;
  border: 1px solid rgba(236, 99, 62, 0.42);
  border-radius: 999px;
  color: var(--brand-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  background: #fff7f2;
  cursor: pointer;
}

.tag-cloud-toggle:hover {
  border-color: var(--brand);
  background: #fff0e7;
}

.tag-cloud-toggle:focus-visible {
  outline: 3px solid rgba(236, 99, 62, 0.18);
  outline-offset: 2px;
}

.tag-cloud-toggle[hidden] {
  display: none;
}

.tag-cloud-section {
  scroll-margin-top: 74px;
  margin-top: 4px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--line);
}

.tag-cloud-section .section-head {
  margin: 0 0 10px;
}

.tag-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 180px);
  gap: 8px;
  align-items: end;
  margin: 14px 0 8px;
}

.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: 0;
}

.article-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-story-tags {
  gap: 5px;
}

.tag-story-tags span {
  min-height: 22px;
  padding: 3px 7px;
  font-size: 11px;
  background: #f5f7f7;
  color: #706b69;
}

.tag-story-card:first-child {
  border-top: 1px solid #f3eeee;
}

.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;
}

.tag-pagination {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f3eeee;
}

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

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

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

.pagination-page,
.pagination-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid #e6dedb;
  border-radius: 8px;
  color: #66666c;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  background: #fff;
}

.pagination-page:hover,
.pagination-arrow:hover,
.pagination-page.is-current {
  color: var(--brand-dark);
  border-color: var(--brand);
  background: var(--soft);
}

.pagination-page.is-current {
  cursor: default;
}

.pagination-arrow.is-disabled {
  color: #b8b1af;
  border-color: #eee7e4;
  background: #faf8f7;
}

.pagination-gap {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #aaa2a0;
  font-size: 12px;
  font-weight: 850;
}

.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: 760px) {
  .site-nav-inner {
    padding: 6px 14px;
  }

}

@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;
  }

  .tag-hero {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 10px;
    padding: 9px 0 11px;
  }

  .tag-hero .meta-row {
    gap: 5px;
  }

  h1 {
    font-size: 22px;
  }

  .tag-description {
    font-size: 12px;
  }

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

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

  .tag-story-tags span:nth-child(n + 3) {
    display: none;
  }
}
