:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --paper-deep: #eeece4;
  --surface: #ffffff;
  --ink: #17231d;
  --muted: #667069;
  --line: #d9ddd6;
  --green: #176447;
  --green-dark: #0d452f;
  --green-soft: #dcece4;
  --lime: #d9ed80;
  --orange: #c9572b;
  --orange-soft: #f7e4da;
  --blue: #275c7a;
  --blue-soft: #e0ecf2;
  --shadow: 0 16px 45px rgba(24, 48, 37, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button {
  color: inherit;
}

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

:focus-visible {
  outline: 3px solid rgba(23, 100, 71, 0.24);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--green-dark);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(23, 35, 29, 0.1);
  background: rgba(248, 247, 242, 0.92);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  min-height: 74px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50% 50% 50% 12px;
  color: #fff;
  background: var(--green);
  font-family: ui-serif, "Songti SC", serif;
  font-size: 20px;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: 0.06em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.header-actions,
.identity {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 20px;
}

.identity {
  gap: 8px;
  max-width: 230px;
  color: var(--muted);
  font-size: 13px;
}

#identityText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9ba39e;
  box-shadow: 0 0 0 4px rgba(155, 163, 158, 0.14);
}

.identity.is-authenticated .identity-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 100, 71, 0.13);
}

.identity.is-error .identity-dot {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(201, 87, 43, 0.13);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  line-height: 1;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--green);
}

.button-primary:not(:disabled):hover {
  background: var(--green-dark);
}

.button-dark {
  color: #fff;
  background: var(--ink);
}

.button-dark:not(:disabled):hover {
  background: var(--green-dark);
}

.button-outline {
  border-color: var(--line);
  background: transparent;
}

.button-outline:not(:disabled):hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.button-quiet {
  color: var(--muted);
  background: transparent;
}

.market-link {
  text-decoration: none;
}

.home-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.65fr);
  gap: clamp(48px, 8vw, 112px);
  align-items: end;
  min-height: 430px;
  padding: 76px 0 64px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.2em;
}

.hero h1 {
  max-width: 760px;
  margin: 18px 0 22px;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(48px, 7.2vw, 90px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.hero-description {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.75;
}

.hero-note {
  padding: 27px 0 7px;
  border-top: 3px solid var(--ink);
}

.hero-note p {
  margin: 0;
}

.note-index {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.note-quote {
  padding: 28px 0 34px;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(21px, 2.3vw, 29px);
  font-weight: 700;
  line-height: 1.45;
}

.note-rule {
  width: 34px;
  height: 2px;
  margin-bottom: 16px;
  background: var(--lime);
}

.note-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.search-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 17px;
}

.search-field {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 0 4px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.search-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 100, 71, 0.1);
}

.search-icon {
  color: var(--green);
  font-size: 25px;
  line-height: 1;
  transform: rotate(-16deg);
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-field input::placeholder {
  color: #929b95;
}

.search-button {
  min-width: 132px;
  min-height: 50px;
}

.category-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: #fbfaf7;
}

.filter-label {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.category-list {
  display: flex;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-list::-webkit-scrollbar {
  display: none;
}

.category-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}

.category-button:hover {
  color: var(--green);
  background: var(--green-soft);
}

.category-button.is-active {
  border-color: rgba(23, 100, 71, 0.18);
  color: var(--green-dark);
  background: var(--green-soft);
  font-weight: 750;
}

.questions-section {
  padding: 86px 0 100px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--ink);
}

.section-heading h2,
.dialog-header h2 {
  margin: 8px 0 0;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
}

.filter-controls {
  display: flex;
  align-items: end;
  gap: 14px;
}

.select-control {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.select-control select,
.form-field select {
  min-height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  color: var(--ink);
  background: var(--surface);
}

.select-control select:focus,
.form-field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 100, 71, 0.1);
}

.text-button {
  min-height: 40px;
  padding: 0 2px;
  border: 0;
  color: var(--green);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.result-summary {
  min-height: 20px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.question-list {
  display: grid;
}

.question-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 34px;
  padding: 30px 4px;
  border-bottom: 1px solid var(--line);
  animation: reveal 260ms ease both;
}

.question-main {
  min-width: 0;
}

.question-overline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.category-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.status-open {
  color: var(--green-dark);
  background: var(--green-soft);
}

.status-solved {
  color: #5f5100;
  background: #f1e9ae;
}

.status-closed {
  color: #636a66;
  background: #e8eae8;
}

.question-link {
  display: block;
  max-width: 820px;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(20px, 2.35vw, 27px);
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.32;
}

.question-link::after {
  position: absolute;
  inset: 0;
  content: "";
}

.question-card:hover .question-link {
  color: var(--green);
}

.question-excerpt {
  display: -webkit-box;
  max-width: 810px;
  margin: 11px 0 14px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.question-footer,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.question-footer {
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.question-footer > span + span::before {
  margin-right: 12px;
  color: #c2c7c3;
  content: "·";
}

.tag-list {
  position: relative;
  z-index: 1;
  gap: 6px;
}

.tag {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.answer-stat {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 96px;
  padding: 12px;
  border-left: 1px solid var(--line);
}

.answer-stat strong {
  font-family: ui-serif, Georgia, serif;
  font-size: 31px;
  line-height: 1;
}

.answer-stat span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.question-card.is-solved .answer-stat strong {
  color: var(--green);
}

.list-state,
.detail-state {
  text-align: center;
}

.empty-state,
.error-state {
  display: grid;
  justify-items: center;
  padding: 70px 20px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.state-symbol {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-family: ui-serif, "Songti SC", serif;
  font-size: 27px;
  font-weight: 700;
}

.error-state .state-symbol {
  color: var(--orange);
  background: var(--orange-soft);
}

.empty-state h3,
.error-state h3 {
  margin: 0;
  font-size: 19px;
}

.empty-state p,
.error-state p {
  max-width: 460px;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.skeleton-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 34px;
  padding: 32px 4px;
  border-bottom: 1px solid var(--line);
}

.skeleton-lines {
  display: grid;
  gap: 12px;
}

.skeleton {
  overflow: hidden;
  border-radius: 5px;
  background: #e6e7e2;
}

.skeleton::after {
  display: block;
  width: 45%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: shimmer 1.2s infinite;
}

.skeleton-short {
  width: 19%;
  height: 14px;
}

.skeleton-title {
  width: 74%;
  height: 27px;
}

.skeleton-copy {
  width: 92%;
  height: 16px;
}

.skeleton-meta {
  width: 46%;
  height: 13px;
}

.skeleton-stat {
  width: 70px;
  height: 70px;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 28px;
}

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

/* Detail */
.detail-shell {
  width: min(930px, calc(100% - 48px));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 42px 0 100px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.back-button:hover {
  color: var(--green);
}

.detail-question {
  padding: 47px 0 40px;
  border-bottom: 2px solid var(--ink);
  animation: reveal 240ms ease both;
}

.detail-question h1 {
  margin: 18px 0 20px;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: clamp(34px, 5.2vw, 56px);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: 12px;
}

.detail-meta > span + span::before {
  margin-right: 18px;
  color: #bec3bf;
  content: "·";
}

.question-body,
.answer-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.question-body {
  color: #2c3932;
  font-size: 17px;
  line-height: 1.9;
}

.detail-tags {
  margin-top: 30px;
}

.owner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.action-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.action-button:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.action-button.danger:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}

.answers-section {
  padding-top: 44px;
}

.answers-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.answers-heading h2 {
  margin: 0;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-size: 30px;
}

.answers-heading span {
  color: var(--muted);
  font-size: 12px;
}

.accepted-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 13px;
}

.answer-list {
  display: grid;
}

.answer-card {
  position: relative;
  padding: 27px 4px 29px;
  border-bottom: 1px solid var(--line);
}

.answer-card.is-accepted {
  margin: 18px -18px 0;
  padding: 27px 22px 29px;
  border: 1px solid rgba(23, 100, 71, 0.24);
  border-radius: var(--radius-md);
  background: rgba(220, 236, 228, 0.5);
}

.answer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 12px;
}

.answer-meta strong {
  color: var(--ink);
  font-size: 13px;
}

.accepted-label {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--lime);
  font-size: 11px;
  font-weight: 800;
}

.answer-body {
  color: #303d36;
  font-size: 15px;
  line-height: 1.85;
}

.answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.answer-composer {
  margin-top: 44px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.answer-composer h3 {
  margin: 0 0 5px;
  font-family: ui-serif, "Songti SC", serif;
  font-size: 23px;
}

.answer-composer > p {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 13px;
}

.answer-composer textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
}

.answer-composer textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 100, 71, 0.1);
}

.answer-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.answer-form-footer p {
  margin: 0;
  color: var(--orange);
  font-size: 12px;
}

.closed-notice {
  margin-top: 38px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 14px;
  text-align: center;
}

.detail-loading {
  display: grid;
  gap: 18px;
  padding: 54px 0;
}

.detail-loading .skeleton:nth-child(1) {
  width: 18%;
  height: 15px;
}

.detail-loading .skeleton:nth-child(2) {
  width: 91%;
  height: 58px;
}

.detail-loading .skeleton:nth-child(3) {
  width: 55%;
  height: 14px;
}

.detail-loading .skeleton:nth-child(4) {
  width: 100%;
  height: 150px;
}

/* Dialog */
.question-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: min(860px, calc(100vh - 32px));
  padding: 0;
  overflow: hidden auto;
  border: 0;
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(15, 40, 29, 0.28);
}

.question-dialog::backdrop {
  background: rgba(14, 28, 21, 0.62);
  backdrop-filter: blur(5px);
}

.question-form {
  margin: 0;
}

.dialog-header {
  position: relative;
  padding: 30px 34px 24px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  font-size: 34px;
}

.dialog-header p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.dialog-close {
  position: absolute;
  top: 21px;
  right: 24px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--paper);
  font-size: 24px;
  line-height: 1;
}

.dialog-close:hover {
  color: var(--ink);
  background: var(--paper-deep);
}

.dialog-body {
  display: grid;
  gap: 20px;
  padding: 26px 34px 22px;
}

.form-field {
  position: relative;
  display: grid;
  gap: 8px;
}

.form-field > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.form-field em {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  color: var(--ink);
  background: var(--paper);
}

.form-field input {
  min-height: 45px;
}

.form-field textarea {
  min-height: 155px;
  resize: vertical;
  line-height: 1.65;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(23, 100, 71, 0.1);
}

.counter {
  position: absolute;
  right: 10px;
  bottom: 9px;
  padding: 2px 4px;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
}

.form-field textarea + .counter {
  bottom: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 16px;
}

.form-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--orange);
  font-size: 12px;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 34px 23px;
  border-top: 1px solid var(--line);
  background: #fbfaf7;
}

.dialog-footer > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.dialog-footer > div {
  display: flex;
  gap: 8px;
}

.toast {
  position: fixed;
  z-index: 60;
  right: 24px;
  bottom: 24px;
  max-width: min(390px, calc(100% - 32px));
  padding: 13px 17px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--green-dark);
  box-shadow: 0 16px 45px rgba(9, 36, 25, 0.26);
  font-size: 13px;
  line-height: 1.5;
  animation: toast-in 200ms ease both;
}

.toast.is-error {
  background: #8b391d;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 27px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

@keyframes shimmer {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(250%);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 780px) {
  .header-inner,
  .home-shell,
  .detail-shell,
  .site-footer {
    width: min(100% - 32px, 1180px);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 45px;
    min-height: 0;
    padding: 58px 0 48px;
  }

  .hero-note {
    max-width: 520px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-button {
    width: 100%;
  }

  .category-strip {
    display: grid;
    gap: 10px;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

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

  .question-card {
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 17px;
  }

  .answer-stat {
    min-height: 84px;
  }

  .dialog-header,
  .dialog-body {
    padding-right: 22px;
    padding-left: 22px;
  }

  .dialog-footer {
    align-items: end;
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 520px) {
  .header-inner {
    min-height: 66px;
  }

  .brand-copy small {
    display: none;
  }

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

  .header-actions {
    gap: 6px;
  }

  .identity {
    display: none;
  }

  .header-actions .button {
    min-height: 39px;
    padding: 0 14px;
    font-size: 13px;
  }

  .hero {
    padding-top: 44px;
  }

  .hero h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .search-panel {
    margin: 0 -4px;
    border-radius: 18px;
  }

  .search-form {
    padding: 13px;
  }

  .category-strip {
    padding: 13px 16px;
  }

  .questions-section {
    padding: 66px 0 72px;
  }

  .filter-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 10px;
  }

  .select-control select {
    width: 100%;
    padding-left: 9px;
  }

  .text-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .question-card {
    display: block;
    padding: 25px 0;
  }

  .question-link {
    font-size: 21px;
  }

  .answer-stat {
    display: flex;
    min-height: 0;
    align-items: baseline;
    justify-content: start;
    gap: 5px;
    margin-top: 18px;
    padding: 0;
    border-left: 0;
  }

  .answer-stat strong {
    font-family: inherit;
    font-size: 13px;
  }

  .answer-stat span {
    margin-top: 0;
    letter-spacing: 0;
  }

  .skeleton-card {
    grid-template-columns: 1fr;
  }

  .skeleton-stat {
    display: none;
  }

  .pagination {
    display: grid;
    gap: 16px;
    justify-items: stretch;
  }

  .pagination .button {
    width: 100%;
  }

  .detail-shell {
    padding-top: 27px;
  }

  .detail-question {
    padding-top: 36px;
  }

  .detail-meta > span + span::before {
    display: none;
  }

  .owner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .answer-card.is-accepted {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .answer-composer {
    margin-right: -5px;
    margin-left: -5px;
    padding: 19px;
  }

  .answer-form-footer {
    display: grid;
  }

  .answer-form-footer .button {
    width: 100%;
  }

  .question-dialog {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 17px;
  }

  .dialog-header h2 {
    padding-right: 30px;
    font-size: 29px;
  }

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

  .dialog-footer {
    display: grid;
  }

  .dialog-footer > div,
  .dialog-footer .button {
    width: 100%;
  }

  .dialog-footer > div {
    flex-direction: row-reverse;
  }

  .site-footer {
    display: grid;
  }

  .toast {
    right: 16px;
    bottom: 16px;
  }
}

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