:root {
  --paper: #f5f0e5;
  --paper-deep: #ebe3d3;
  --card: #fffdf7;
  --ink: #183247;
  --ink-soft: #53636e;
  --line: rgba(24, 50, 71, 0.14);
  --red: #c84e36;
  --red-soft: #f3d9cf;
  --blue: #2d6f8d;
  --blue-soft: #d6e6ec;
  --green: #477a6f;
  --green-soft: #dce9e2;
  --yellow: #f1c45f;
  --shadow: 0 16px 40px rgba(46, 51, 44, 0.08);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(241, 196, 95, 0.12), transparent 28rem),
    radial-gradient(circle at 92% 32%, rgba(45, 111, 141, 0.08), transparent 32rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

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

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 max(5vw, 28px);
  border-bottom: 1px solid rgba(24, 50, 71, 0.1);
  background: rgba(245, 240, 229, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--ink);
}

.brand-mark svg {
  width: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

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

.brand strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.21em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 14px;
}

.header-nav a,
.text-button {
  position: relative;
  border: 0;
  background: none;
  cursor: pointer;
}

.header-nav a::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 2px;
  content: "";
  background: var(--red);
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.header-nav a:hover::after,
.header-nav a:focus-visible::after {
  transform: scaleX(1);
}

.nav-count {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  margin-left: 5px;
  padding: 0 5px;
  place-items: center;
  border-radius: 12px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 11px;
  font-weight: 700;
}

.hero {
  display: grid;
  max-width: 1440px;
  min-height: 600px;
  margin: 0 auto;
  padding: 105px max(5vw, 28px) 80px;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 7vw;
  align-items: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 20px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(46px, 5.6vw, 82px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.13;
}

.hero-intro {
  max-width: 600px;
  margin: 27px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.9;
}

.hero-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 35px;
}

.primary-button,
.secondary-button,
.load-more-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.primary-button {
  color: var(--paper);
  background: var(--ink);
}

.primary-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 160ms ease;
}

.primary-button:hover,
.load-more-button:hover {
  box-shadow: 5px 5px 0 var(--yellow);
  transform: translate(-2px, -2px);
}

.primary-button:hover svg {
  transform: translateX(3px);
}

.secondary-button,
.load-more-button {
  color: var(--ink);
  background: transparent;
}

.secondary-button:hover {
  background: var(--card);
}

.hero-visual {
  position: relative;
  min-height: 420px;
}

.hero-visual::before {
  position: absolute;
  top: 17%;
  left: 12%;
  width: 73%;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background:
    linear-gradient(150deg, rgba(45, 111, 141, 0.1), rgba(200, 78, 54, 0.08)),
    var(--paper-deep);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(24, 50, 71, 0.2);
  border-radius: 50%;
}

.orbit::after {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  content: "";
  background: var(--red);
}

.orbit-one {
  top: 8%;
  left: 2%;
  width: 90%;
  aspect-ratio: 1;
  transform: rotate(-14deg);
}

.orbit-one::after {
  top: 17%;
  right: 10%;
}

.orbit-two {
  top: 17%;
  left: 15%;
  width: 72%;
  aspect-ratio: 1;
  transform: rotate(20deg);
}

.orbit-two::after {
  bottom: 13%;
  left: 16%;
  background: var(--blue);
}

.formula-card {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: min(340px, 66%);
  padding: 38px;
  border: 1px solid rgba(24, 50, 71, 0.22);
  background: rgba(255, 253, 247, 0.91);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%) rotate(-3deg);
}

.formula-label {
  display: block;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.formula {
  margin: 37px 0 31px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(45px, 5vw, 66px);
  font-style: italic;
  letter-spacing: -0.04em;
  text-align: center;
}

.formula sup {
  font-size: 0.46em;
}

.formula-note {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  text-align: center;
}

.stat-card {
  position: absolute;
  z-index: 3;
  min-width: 138px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
}

.stat-card span {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
}

.stat-card-top {
  top: 4%;
  right: 0;
  transform: rotate(2deg);
}

.stat-card-bottom {
  bottom: 4%;
  left: 0;
  transform: rotate(-2deg);
}

.category-section,
.library-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 78px max(5vw, 28px);
}

.category-section {
  border-top: 1px solid var(--line);
}

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

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(31px, 3.5vw, 46px);
  letter-spacing: -0.03em;
}

.section-heading > p {
  max-width: 420px;
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.8;
}

.section-kicker {
  margin-bottom: 11px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.category-card {
  position: relative;
  display: flex;
  min-height: 190px;
  padding: 27px;
  flex-direction: column;
  align-items: flex-start;
  border: 0;
  cursor: pointer;
  background: var(--card);
  text-align: left;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.category-card:hover,
.category-card:focus-visible {
  color: var(--paper);
  background: var(--ink);
}

.category-card:hover .category-arrow {
  color: var(--yellow);
  transform: translate(3px, -3px);
}

.category-number {
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 12px;
}

.category-card h3 {
  margin: 30px 0 7px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
}

.category-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.category-card:hover p,
.category-card:focus-visible p,
.category-card:hover .category-number,
.category-card:focus-visible .category-number {
  color: rgba(245, 240, 229, 0.65);
}

.category-arrow {
  position: absolute;
  top: 26px;
  right: 26px;
  font-size: 22px;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.library-section {
  padding-top: 86px;
  border-top: 1px solid var(--line);
}

.library-heading {
  margin-bottom: 29px;
}

.search-panel {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.8);
  box-shadow: 0 8px 30px rgba(46, 51, 44, 0.04);
}

.search-field {
  display: flex;
  height: 60px;
  padding: 0 16px;
  align-items: center;
  gap: 13px;
  border: 1px solid rgba(24, 50, 71, 0.22);
  background: var(--card);
}

.search-field:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(24, 50, 71, 0.08);
}

.search-field svg {
  width: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.search-field input::placeholder {
  color: #8f948f;
}

.search-field kbd {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-soft);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 11px;
}

.filter-row {
  display: flex;
  margin-top: 14px;
  align-items: end;
  gap: 9px;
}

.filter-row > label:not(.toggle-filter) {
  display: grid;
  flex: 1;
  gap: 6px;
}

.filter-row > label > span:first-child {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.filter-row select {
  width: 100%;
  height: 40px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: var(--card);
  cursor: pointer;
}

.sync-only-filter[hidden] {
  display: none;
}

.toggle-filter {
  display: flex;
  height: 40px;
  padding: 0 13px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--card);
  font-size: 12px;
  white-space: nowrap;
}

.toggle-filter input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 20px;
  background: #d5d3cc;
  transition: background-color 160ms ease;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  content: "";
  background: white;
  transition: transform 160ms ease;
}

.toggle-filter input:checked + .toggle {
  background: var(--red);
}

.toggle-filter input:checked + .toggle::after {
  transform: translateX(12px);
}

.active-filters {
  display: flex;
  margin: 18px 0 0;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  display: inline-flex;
  height: 30px;
  padding: 0 11px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink-soft);
  background: rgba(255, 253, 247, 0.6);
  font-size: 11px;
}

.filter-chip button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.resource-grid {
  display: grid;
  margin-top: 25px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.resource-card {
  position: relative;
  display: flex;
  min-height: 258px;
  padding: 23px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.resource-card:hover {
  border-color: rgba(24, 50, 71, 0.3);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.resource-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.file-badge {
  display: inline-flex;
  min-width: 45px;
  height: 27px;
  padding: 0 8px;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  color: var(--paper);
  background: var(--red);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.file-badge[data-kind="PPT"] {
  background: var(--red);
}

.file-badge[data-kind="PDF"] {
  color: var(--paper);
  background: var(--blue);
}

.file-badge[data-kind="Word"] {
  background: var(--green);
}

.file-badge[data-kind="答案"] {
  background: var(--green);
}

.file-badge[data-kind="视频"] {
  color: var(--ink);
  background: var(--yellow);
}

.file-badge[data-kind="压缩包"] {
  color: var(--ink);
  background: var(--paper-deep);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.card-tag {
  padding: 4px 7px;
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 9px;
  font-weight: 700;
}

.resource-card h3 {
  display: -webkit-box;
  margin: 26px 0 10px;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.chapter-label {
  margin: -3px 0 10px;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sync-group-heading {
  display: flex;
  min-height: 62px;
  padding: 15px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(24, 50, 71, 0.18);
  border-left: 4px solid var(--blue);
  background: var(--paper-deep);
  grid-column: 1 / -1;
}

.sync-group-heading span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sync-group-heading[data-answer-status="with"],
.sync-group-heading[data-answer-status="answers"] {
  border-left-color: var(--green);
}

.sync-group-heading[data-answer-status="with"] span,
.sync-group-heading[data-answer-status="answers"] span {
  color: var(--green);
}

.sync-group-heading[data-answer-status="without"] {
  border-left-color: var(--red);
}

.sync-group-heading[data-answer-status="without"] span {
  color: var(--red);
}

.sync-group-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
}

.resource-path {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.resource-card-footer {
  display: flex;
  margin-top: auto;
  padding-top: 20px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.resource-meta {
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 11px;
}

.card-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  cursor: pointer;
  background: transparent;
  transition: background-color 160ms ease;
}

.icon-button:hover {
  background: var(--paper);
}

.icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon-button.is-bookmarked {
  color: var(--red);
  border-color: rgba(200, 78, 54, 0.28);
  background: var(--red-soft);
}

.icon-button.is-bookmarked svg {
  fill: currentColor;
}

.empty-state {
  padding: 90px 20px;
  border: 1px dashed rgba(24, 50, 71, 0.25);
  text-align: center;
}

.empty-symbol {
  display: inline-grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 28px;
}

.empty-state h3 {
  margin: 22px 0 8px;
  font-family: var(--serif);
  font-size: 25px;
}

.empty-state p {
  color: var(--ink-soft);
  font-size: 14px;
}

.empty-state .secondary-button {
  margin-top: 14px;
}

.load-more-wrap {
  display: flex;
  margin-top: 28px;
  justify-content: center;
}

.load-more-button span {
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 400;
}

.site-footer {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  padding: 45px max(5vw, 28px) 60px;
  align-items: end;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.site-footer strong {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.site-footer p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.resource-dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 42px;
  overflow: auto;
  border: 1px solid rgba(24, 50, 71, 0.3);
  border-radius: 2px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 30px 100px rgba(24, 50, 71, 0.26);
}

.resource-dialog::backdrop {
  background: rgba(24, 50, 71, 0.45);
  backdrop-filter: blur(5px);
}

.resource-dialog[open] {
  animation: dialog-in 180ms ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  cursor: pointer;
  background: transparent;
}

.dialog-close svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.dialog-file-label {
  display: inline-flex;
  min-width: 50px;
  height: 28px;
  padding: 0 9px;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  background: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.resource-dialog h2 {
  margin: 24px 0 13px;
  padding-right: 30px;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.35;
}

.dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dialog-meta span {
  padding: 5px 9px;
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 10px;
  font-weight: 700;
}

.dialog-path {
  margin: 24px 0;
  padding: 15px;
  overflow-wrap: anywhere;
  border-left: 3px solid var(--blue);
  color: var(--ink-soft);
  background: var(--paper);
  font-size: 12px;
  line-height: 1.7;
}

.dialog-answers {
  margin: 24px 0;
  border: 1px solid rgba(45, 111, 141, 0.22);
  background: #f8fbfb;
}

.dialog-answers[hidden] {
  display: none;
}

.dialog-answers-heading {
  display: flex;
  padding: 15px 17px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(45, 111, 141, 0.16);
  background: var(--blue-soft);
}

.dialog-answers-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
}

.dialog-answers-heading span {
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}

#dialog-answer-content {
  max-height: 330px;
  padding: 6px 17px;
  overflow: auto;
}

.answer-snippet {
  display: grid;
  padding: 13px 0;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 8px;
  border-bottom: 1px solid rgba(24, 50, 71, 0.1);
}

.answer-snippet:last-child {
  border-bottom: 0;
}

.answer-snippet span {
  padding-top: 2px;
  color: var(--blue);
  font-family: Georgia, serif;
  font-size: 10px;
}

.answer-snippet p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.answer-loading {
  margin: 0;
  padding: 18px 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.dialog-answers > p {
  margin: 0;
  padding: 11px 17px;
  border-top: 1px solid rgba(45, 111, 141, 0.13);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.dialog-note {
  padding: 13px 15px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.dialog-note:empty {
  display: none;
}

.toast {
  position: fixed;
  z-index: 50;
  bottom: 24px;
  left: 50%;
  padding: 11px 18px;
  border-radius: 2px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1080px) {
  .hero {
    min-height: auto;
    padding-top: 80px;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 820px;
  }

  .hero-visual {
    width: min(640px, 92%);
    margin: 20px auto;
  }

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

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

  .filter-row {
    flex-wrap: wrap;
  }

  .filter-row > label:not(.toggle-filter) {
    min-width: calc(50% - 5px);
  }
}

@media (max-width: 700px) {
  .site-header {
    height: 66px;
    padding: 0 18px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    display: none;
  }

  .header-nav {
    gap: 0;
  }

  .header-nav a {
    display: none;
  }

  .text-button {
    font-size: 12px;
  }

  .hero {
    padding: 60px 20px 45px;
    gap: 30px;
  }

  .hero h1 {
    font-size: clamp(39px, 12vw, 58px);
    line-height: 1.18;
  }

  .hero-intro {
    font-size: 15px;
  }

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

  .hero-visual {
    width: 100%;
    min-height: 340px;
  }

  .formula-card {
    width: 74%;
    padding: 27px;
  }

  .stat-card {
    min-width: 112px;
    padding: 12px 15px;
  }

  .stat-card strong {
    font-size: 21px;
  }

  .category-section,
  .library-section {
    padding: 56px 20px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

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

  .category-card {
    min-height: 155px;
  }

  .search-panel {
    padding: 11px;
  }

  .search-field {
    height: 53px;
  }

  .search-field kbd {
    display: none;
  }

  .filter-row > label:not(.toggle-filter) {
    min-width: 100%;
  }

  .sync-group-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .toggle-filter {
    width: 100%;
    justify-content: center;
  }

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

  .resource-card {
    min-height: 240px;
  }

  .site-footer {
    padding: 35px 20px 45px;
    align-items: flex-start;
    flex-direction: column;
    gap: 25px;
  }

  .resource-dialog {
    padding: 32px 24px 28px;
  }

  .resource-dialog h2 {
    font-size: 26px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
