/* 早上好资源网 — a small, dependency-free static site. */

:root {
  color-scheme: light dark;
  --bg: #fdf8f1;
  --bg-soft: #f6ecdf;
  --panel: #fffaf3;
  --card: #ffffff;
  --ink: #2c241b;
  --muted: #756654;
  --faint: #9b8a76;
  --accent: #b25c1b;
  --accent-2: #c26a22;
  --on-accent: #ffffff;
  --accent-soft: rgba(201, 116, 44, 0.1);
  --accent-line: rgba(201, 116, 44, 0.28);
  --line: rgba(120, 90, 50, 0.15);
  --line-strong: rgba(120, 90, 50, 0.26);
  --header-bg: rgba(253, 248, 241, 0.86);
  --shadow: 0 24px 60px -34px rgba(94, 62, 22, 0.4);
  --shadow-soft: 0 10px 30px -24px rgba(94, 62, 22, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
    monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110d;
    --bg-soft: #1a1510;
    --panel: #1b1610;
    --card: #211a13;
    --ink: #f5ece0;
    --muted: #b6a692;
    --faint: #8f7f6c;
    --accent: #f2b45c;
    --accent-2: #e08a3c;
    --on-accent: #1b140d;
    --accent-soft: rgba(242, 180, 92, 0.1);
    --accent-line: rgba(242, 180, 92, 0.28);
    --line: rgba(255, 220, 170, 0.12);
    --line-strong: rgba(255, 220, 170, 0.22);
    --header-bg: rgba(20, 17, 13, 0.86);
    --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
    --shadow-soft: 0 10px 30px -22px rgba(0, 0, 0, 0.7);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.72;
  background:
    radial-gradient(56rem 34rem at 8% -12%, rgba(242, 180, 92, 0.18), transparent 62%),
    radial-gradient(48rem 32rem at 96% 4%, rgba(224, 138, 60, 0.1), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-2);
}

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

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

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

.skip {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip:focus {
  top: 16px;
  color: var(--bg);
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-lockup:hover {
  color: var(--ink);
}

.brand-lockup img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 14px -8px rgba(94, 62, 22, 0.6);
}

.brand-lockup span {
  font-size: 16px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.main-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.main-nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Typography helpers ------------------------------------------------------ */

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.8;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* Hero -------------------------------------------------------------------- */

.hero {
  padding: clamp(46px, 8vw, 86px) 0 28px;
  text-align: center;
}

.hero h1 {
  max-width: 18em;
  margin: 0 auto 18px;
  font-size: clamp(32px, 5.6vw, 54px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero .lead {
  max-width: 46em;
  margin: 0 auto 28px;
}

.searchbar {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.searchbar:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-soft);
}

.searchbar input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.searchbar input::placeholder {
  color: var(--faint);
}

.searchbar button {
  flex: none;
  padding: 10px 20px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: var(--on-accent);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.searchbar button:hover {
  filter: brightness(1.06);
}

.searchbar button:active {
  transform: translateY(1px);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--faint);
  font-size: 12px;
}

.quick-links a {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  background: var(--panel);
}

.quick-links a:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

/* Stats ------------------------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 820px;
  margin: 30px auto 0;
}

.stat {
  padding: 15px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
}

.stat b {
  display: block;
  color: var(--ink);
  font-size: clamp(19px, 2.4vw, 25px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* Section ----------------------------------------------------------------- */

.section {
  margin-top: 52px;
}

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

.section-head h2 {
  margin: 0;
  font-size: clamp(19px, 2.4vw, 23px);
  font-weight: 750;
}

.section-head .more {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.section-note {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

/* Category cards ---------------------------------------------------------- */

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

.cat-card {
  display: flex;
  flex-direction: column;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.cat-card:hover {
  color: var(--ink);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.cat-card .count {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.cat-card h3 {
  margin: 6px 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.cat-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Brand cards ------------------------------------------------------------- */

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

.brand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.brand-card:hover {
  color: var(--ink);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.brand-card span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-card em {
  flex: none;
  color: var(--faint);
  font-size: 11px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.brand-grid--large {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.brand-grid--large .brand-card {
  padding: 13px 15px;
}

/* Document lists ---------------------------------------------------------- */

.doc-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.doc-row:first-child {
  border-top: 0;
}

.doc-row:hover {
  background: var(--accent-soft);
}

.doc-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.doc-main {
  flex: 1 1 auto;
  min-width: 0;
}

.doc-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-meta {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-arrow {
  flex: none;
  color: var(--faint);
  font-size: 15px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.doc-row:hover .doc-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* Page header ------------------------------------------------------------- */

.page-head {
  padding: 14px 0 24px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  max-width: 24em;
  margin: 0 0 12px;
  font-size: clamp(26px, 4.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.page-head .lead {
  max-width: 60em;
  margin: 0;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 26px 0 18px;
  color: var(--faint);
  font-size: 12px;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--accent);
}

.crumbs .sep {
  color: var(--faint);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  text-decoration: none;
}

.chip strong {
  color: var(--ink);
  font-weight: 700;
}

a.chip:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

/* Category / brand page specifics ---------------------------------------- */

.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
}

.brand-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
}

.doc-group {
  margin-top: 30px;
}

.doc-group h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 17px;
}

.doc-group h2 .count {
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
}

.intro-box {
  margin: 22px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.intro-box p:last-child {
  margin-bottom: 0;
}

.intro-box ul {
  margin: 8px 0 0;
  padding-left: 1.1em;
  color: var(--muted);
}

.intro-box li {
  margin: 3px 0;
}

/* Pagination -------------------------------------------------------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 26px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
}

.pagination a:hover {
  border-color: var(--accent-line);
  color: var(--accent);
}

.pagination .current {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.pagination .disabled {
  opacity: 0.45;
}

/* Detail page ------------------------------------------------------------- */

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 34px;
  align-items: start;
  margin-top: 26px;
}

.doc-article {
  min-width: 0;
}

.cta-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 22px 0 0;
  padding: 16px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: linear-gradient(120deg, var(--accent-soft), transparent 70%),
    var(--card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.btn:hover {
  color: var(--on-accent);
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(1px);
}

.btn.disabled {
  background: var(--bg-soft);
  color: var(--faint);
  cursor: default;
}

.cta-note {
  color: var(--muted);
  font-size: 12px;
}

.prose {
  margin-top: 30px;
}

.prose h2 {
  margin: 30px 0 10px;
  font-size: 19px;
  font-weight: 750;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.prose ul {
  margin: 8px 0 0;
  padding-left: 1.15em;
  color: var(--muted);
}

.prose li {
  margin: 4px 0;
}

.info-card {
  position: sticky;
  top: 84px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.info-card h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.info-card dl {
  margin: 0;
}

.info-card dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.info-card dl > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.info-card dt {
  flex: none;
  color: var(--faint);
  font-size: 12px;
}

.info-card dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12.5px;
  text-align: right;
}

.info-card dd a {
  color: var(--accent);
  text-decoration: none;
}

.related {
  margin-top: 36px;
}

.related h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.related-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.related-card:hover {
  color: var(--ink);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.related-title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related-meta {
  color: var(--faint);
  font-size: 11px;
}

.disclaimer {
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.8;
}

/* Search ------------------------------------------------------------------ */

.search-page {
  max-width: 880px;
  margin: 0 auto;
}

.search-page .page-head {
  text-align: center;
}

.search-page .page-head h1 {
  margin-left: auto;
  margin-right: auto;
}

.search-page .searchbar {
  margin-top: 22px;
}

.search-status {
  min-height: 24px;
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.result:hover {
  color: var(--ink);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.result-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.result-main {
  flex: 1 1 auto;
  min-width: 0;
}

.result-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.suggest h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.suggest .chip {
  margin: 0 4px 6px 0;
}

/* About / note ------------------------------------------------------------ */

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.note-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.note-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.note-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.about-body {
  max-width: 760px;
  margin-top: 28px;
}

.about-body h2 {
  margin: 32px 0 10px;
  font-size: 20px;
}

.about-body p,
.about-body li {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.85;
}

.about-body ul {
  padding-left: 1.15em;
}

.about-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.9em;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: 74px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 36px;
  padding: 42px 0 28px;
}

.footer-brand p {
  max-width: 34em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.footer-col h2 {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-col a {
  display: block;
  margin: 5px 0;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 0 30px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
}

/* Empty / error ----------------------------------------------------------- */

.empty {
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

/* Responsive -------------------------------------------------------------- */

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

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

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 24px;
  }

  .doc-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 26px;
  }
}

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12.5px;
  }

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

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

  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .info-card {
    position: static;
    order: -1;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

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

@media (max-width: 560px) {
  body {
    font-size: 14.5px;
  }

  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding-top: 36px;
  }

  .hero h1 {
    font-size: clamp(29px, 10vw, 38px);
  }

  .searchbar {
    flex-direction: column;
    padding: 8px;
  }

  .searchbar button {
    width: 100%;
  }

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

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

  .cat-card {
    min-height: 0;
  }

  .brand-grid,
  .brand-grid--large {
    grid-template-columns: 1fr;
  }

  .doc-icon {
    width: 32px;
    height: 32px;
  }

  .doc-row {
    padding: 11px 12px;
  }

  .doc-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-top: 32px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .section {
    margin-top: 42px;
  }

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

  .page-head h1 {
    font-size: clamp(24px, 7.5vw, 32px);
  }
}

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

@media print {
  .site-header,
  .site-footer,
  .searchbar,
  .quick-links,
  .cta-box,
  .pagination {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .doc-layout {
    display: block;
  }

  .info-card {
    position: static;
    box-shadow: none;
  }
}
