:root {
  --bg: #f5f6f8;
  --surface: #fff;
  --surface-soft: #f1f3f5;
  --text: #222;
  --muted: #7a828c;
  --line: #e5e8ec;
  --brand: #343a40;
  --accent: #1f8f74;
  --shadow: 0 12px 32px rgba(24, 32, 43, 0.08);
}

body.dark {
  --bg: #111417;
  --surface: #181d22;
  --surface-soft: #22282f;
  --text: #eef2f6;
  --muted: #a8b0ba;
  --line: #2c333b;
  --brand: #dbe3ec;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
}

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

img {
  display: block;
  max-width: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.top-nav {
  width: min(1180px, calc(100% - 28px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-weight: 800;
}

.site-logo img,
.footer-logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.site-logo span {
  font-size: 20px;
  letter-spacing: 0;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-end;
}

.user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.account-orb {
  width: 58px;
  height: 58px;
  border: 2px solid #55aaff;
  border-radius: 50%;
  background: #25262d;
  color: #62b7ff;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 0 18px rgba(76, 159, 255, 0.3);
}

.account-orb.logged {
  font-weight: 900;
  text-transform: uppercase;
}

.account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 28px);
  z-index: 40;
  width: min(514px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 42px 40px;
  padding: 72px 74px 58px;
  border: 1px solid #3a3b44;
  border-radius: 28px 28px 0 0;
  background: #202128;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

.account-panel[hidden] {
  display: none;
}

.account-panel a,
.account-panel button {
  min-height: 142px;
  display: grid;
  place-items: center;
  gap: 10px;
  border: 0;
  border-radius: 24px;
  background: #2a2b33;
  color: #b6bbc7;
  cursor: pointer;
  font-size: 24px;
}

.account-panel span {
  color: #aeb4c2;
  font-size: 34px;
  line-height: 1;
}

.account-panel strong {
  font-size: 28px;
}

.nav-menu a {
  padding: 9px 13px;
  border-radius: 4px;
  color: var(--muted);
}

.nav-menu a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.theme-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.search-menu {
  position: relative;
  flex: 0 0 auto;
}

.search-orb {
  width: 58px;
  height: 58px;
  border: 2px solid #3a3b44;
  border-radius: 50%;
  background: #25262d;
  color: #e4e8f0;
  cursor: pointer;
  font-size: 38px;
  line-height: 1;
}

.search-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 18px);
  z-index: 42;
  width: min(420px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 18px;
  border: 1px solid #3a3b44;
  border-radius: 18px;
  background: #202128;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

.search-panel[hidden] {
  display: none;
}

.search-panel input {
  min-height: 48px;
  min-width: 0;
  border: 1px solid #3c3d47;
  border-radius: 10px;
  background: #262730;
  color: #f2f4f8;
  padding: 0 14px;
}

.search-panel button {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(90deg, #69c2f3, #3c88f8);
  color: #fff;
  cursor: pointer;
  padding: 0 18px;
  font-weight: 800;
}

.hero-slider {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 0;
  overflow: hidden;
}

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

.slide {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  border-radius: 3px;
  background: #111;
  box-shadow: var(--shadow);
}

.slide img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  opacity: 0.82;
  transition: transform 220ms ease;
}

.slide:hover img {
  transform: scale(1.04);
}

.slide span {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.home-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 26px auto 54px;
  display: grid;
  gap: 28px;
}

.archive-section {
  padding: 0;
}

.category-archive {
  width: min(1180px, calc(100% - 28px));
  margin: 24px auto 46px;
}

.category-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 0 2px 14px;
  border-bottom: 1px solid var(--line);
}

.category-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.category-head p {
  margin: 0;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  padding: 0 0 10px;
  font-size: 19px;
  font-weight: 800;
}

.section-head a {
  color: var(--muted);
  font-size: 14px;
}

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

.card-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.archive-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow);
}

.card-cover {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-soft);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.archive-card:hover .card-cover img {
  transform: scale(1.04);
}

.card-info {
  padding: 12px 13px 14px;
}

.card-info h3 {
  min-height: 46px;
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.45;
}

.card-info h3 a:hover {
  color: var(--accent);
}

.card-info time {
  color: var(--muted);
  font-size: 13px;
}

.single-post {
  width: min(920px, calc(100% - 28px));
  margin: 26px auto 58px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.post-titlebar {
  padding: 30px 36px 18px;
  border-bottom: 1px solid var(--line);
}

.post-titlebar h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.35;
}

.post-titlebar ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
  font-size: 14px;
}

.post-titlebar li + li::before {
  content: "-";
  margin-right: 8px;
}

.post-body {
  padding: 28px 36px 34px;
}

.post-body h2 {
  margin: 26px 0 10px;
  font-size: 21px;
}

.post-body p {
  margin: 10px 0;
}

.post-body figure {
  margin: 24px 0;
}

.post-body figure img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
}

.keyword-card {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0 14px;
  padding: 8px 12px;
  border: 1px dashed var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.keyword-card span {
  color: var(--muted);
}

.reply-form {
  display: grid;
  gap: 10px;
  margin: 10px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.reply-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.reply-form input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.reply-form button,
.download-result a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  background: #2d3339;
  color: #fff;
  cursor: pointer;
  width: fit-content;
}

.reply-form p {
  margin: 0;
  color: var(--muted);
}

.reply-form p.error {
  color: #c93824;
}

.download-result {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.download-result span {
  color: var(--muted);
}

.post-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}

.post-pager a {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 18px 24px;
  border-right: 1px solid var(--line);
}

.post-pager a:last-child {
  border-right: 0;
  text-align: right;
}

.post-pager span {
  color: var(--muted);
  font-size: 13px;
}

.post-pager strong {
  font-size: 15px;
}

.page-post .post-body {
  min-height: 320px;
}

.auth-page {
  min-height: calc(100vh - 75px);
  display: grid;
  place-items: start center;
  padding: 42px 14px 70px;
  background: #1d1e25;
}

.dark-auth {
  width: min(648px, 100%);
  padding: 38px 32px 44px;
  background: #1f2027;
  color: #fff;
  border: 0;
  box-shadow: none;
}

.dark-auth h1 {
  margin: 0 0 20px;
  color: #fff;
  font-size: 52px;
  line-height: 1;
  font-weight: 900;
}

.auth-switch {
  margin: 0 0 82px;
  color: #a9afbd;
  font-size: 24px;
}

.auth-switch a {
  color: #c2c7d3;
}

.auth-form {
  display: grid;
  gap: 28px;
}

.auth-form label {
  display: grid;
  gap: 8px;
}

.auth-form label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.auth-form input {
  width: 100%;
  min-height: 90px;
  padding: 0 38px;
  border: 2px solid #3c3d47;
  border-radius: 14px;
  background: #262730;
  color: #f2f4f8;
  font-size: 28px;
  outline: 0;
}

.auth-form input::placeholder {
  color: #8f939f;
  font-weight: 700;
}

.password-field {
  position: relative;
}

.password-field button {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #9297a4;
  cursor: pointer;
  font-size: 26px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #c1c6d1;
  font-size: 23px;
}

.remember-row {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
}

.remember-row input {
  width: 26px;
  height: 26px;
  min-height: 0;
  padding: 0;
  accent-color: #58b9f5;
}

.auth-submit {
  min-height: 70px;
  margin: 46px auto 0;
  width: min(506px, 100%);
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #69c2f3, #3c88f8);
  color: #fff;
  cursor: pointer;
  font-size: 30px;
  font-weight: 800;
}

.auth-form p {
  margin: 0;
  color: #a9afbd;
  font-size: 16px;
}

.auth-form p.error {
  color: #ff8c8c;
}

.empty-state {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.search-results .section-head span {
  color: var(--muted);
}

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

.footer-inner {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
}

.footer-logo span {
  color: var(--text);
}

@media (max-width: 900px) {
  .top-nav {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav-menu {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .search-menu {
    margin-left: auto;
  }

  .slider-track,
  .card-grid,
  .card-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-logo span {
    font-size: 18px;
  }

  .slider-track,
  .card-grid,
  .card-grid.compact,
  .post-pager {
    grid-template-columns: 1fr;
  }

  .account-panel {
    right: -54px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 28px;
  }

  .account-panel a,
  .account-panel button {
    min-height: 118px;
  }

  .account-panel strong {
    font-size: 22px;
  }

  .dark-auth h1 {
    font-size: 42px;
  }

  .auth-switch {
    margin-bottom: 46px;
    font-size: 20px;
  }

  .auth-form input {
    min-height: 72px;
    font-size: 22px;
    padding: 0 22px;
  }

  .auth-row {
    align-items: flex-start;
    flex-direction: column;
    font-size: 19px;
  }

  .post-titlebar,
  .post-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .post-titlebar h1 {
    font-size: 24px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Visual polish layer */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --text: #20242a;
  --muted: #78808d;
  --line: #e4e8ee;
  --accent: #3f8cff;
  --accent-2: #66c8f0;
  --shadow: 0 18px 46px rgba(27, 39, 58, 0.1);
}

body {
  background:
    radial-gradient(circle at top left, rgba(63, 140, 255, 0.08), transparent 360px),
    linear-gradient(180deg, #fbfcfe 0%, var(--bg) 380px);
}

body.dark {
  --bg: #101216;
  --surface: #181b21;
  --surface-soft: #22262e;
  --text: #f0f4fa;
  --muted: #a2aab8;
  --line: #2d333d;
  background:
    radial-gradient(circle at top left, rgba(63, 140, 255, 0.12), transparent 360px),
    #101216;
}

.site-header {
  box-shadow: 0 10px 30px rgba(24, 32, 43, 0.06);
}

.site-logo {
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  transition:
    background 180ms ease,
    transform 180ms ease;
}

.site-logo:hover {
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.site-logo img,
.footer-logo img {
  border: 2px solid rgba(63, 140, 255, 0.22);
  box-shadow: 0 8px 18px rgba(63, 140, 255, 0.16);
}

.nav-menu a {
  border-radius: 999px;
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav-menu a:hover {
  transform: translateY(-1px);
}

.search-orb,
.account-orb,
.theme-button {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.search-orb:hover,
.account-orb:hover,
.theme-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(63, 140, 255, 0.22);
}

.theme-button {
  width: 46px;
  height: 46px;
}

.search-panel,
.account-panel {
  animation: panelIn 180ms ease both;
}

.hero-slider {
  margin-top: 26px;
}

.slide {
  min-height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.62));
}

.slide span {
  z-index: 1;
}

.archive-section {
  animation: riseIn 320ms ease both;
}

.section-head {
  border-bottom: 0;
  padding: 0 2px;
}

.section-head h2 {
  position: relative;
  padding-bottom: 8px;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.section-head a {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.archive-card {
  border-radius: 12px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.archive-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: 0 18px 42px rgba(35, 48, 73, 0.14);
}

.card-cover {
  border-radius: 12px 12px 0 0;
}

.card-info {
  min-height: 106px;
}

.single-post {
  border-radius: 14px;
  overflow: hidden;
}

.post-titlebar {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface));
}

.reply-form,
.download-result,
.keyword-card {
  border-radius: 12px;
}

.reply-form button,
.download-result a {
  border-radius: 999px;
  background: linear-gradient(90deg, #69c2f3, #3c88f8);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.reply-form button:hover,
.download-result a:hover,
.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(63, 140, 255, 0.25);
}

.auth-page {
  background:
    radial-gradient(circle at 20% 10%, rgba(91, 173, 255, 0.16), transparent 340px),
    #1d1e25;
}

.dark-auth {
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  animation: riseIn 260ms ease both;
}

.auth-form input:focus,
.search-panel input:focus {
  border-color: #5ab2ff;
  box-shadow: 0 0 0 4px rgba(90, 178, 255, 0.12);
}

.site-footer {
  box-shadow: 0 -10px 28px rgba(24, 32, 43, 0.04);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

/* Header/auth refinement */
.top-nav {
  gap: 14px;
}

.search-menu,
.user-menu {
  position: relative;
}

.search-orb,
.account-orb,
.theme-button {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: none;
  font-size: 22px;
}

.search-orb {
  font-size: 30px;
}

.account-orb {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  color: var(--accent);
  font-size: 20px;
}

.theme-button {
  font-size: 18px;
}

.search-orb:hover,
.account-orb:hover,
.theme-button:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  box-shadow: 0 10px 24px rgba(63, 140, 255, 0.12);
}

.account-panel {
  right: 0;
  top: calc(100% + 14px);
  width: 320px;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
}

.account-panel a,
.account-panel button {
  min-height: 104px;
  gap: 6px;
  border-radius: 16px;
  font-size: 18px;
}

.account-panel span {
  font-size: 24px;
}

.account-panel strong {
  font-size: 22px;
}

.search-panel {
  top: calc(100% + 14px);
  width: 390px;
  border-radius: 18px;
}

.auth-page {
  background:
    radial-gradient(circle at 16% 10%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 340px),
    var(--bg);
}

.dark-auth {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.dark-auth h1 {
  color: var(--text);
}

.auth-switch,
.auth-form p {
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
}

.auth-form input {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.auth-form input::placeholder {
  color: var(--muted);
}

.password-field button {
  color: var(--muted);
}

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

body.dark .search-orb,
body.dark .account-orb,
body.dark .theme-button {
  background: #20242c;
}

body.dark .account-panel,
body.dark .search-panel {
  background: #1c2027;
}

body.dark .account-panel a,
body.dark .account-panel button {
  background: #272c35;
}

@media (max-width: 560px) {
  .search-orb,
  .account-orb,
  .theme-button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .account-panel {
    right: -48px;
    width: min(320px, calc(100vw - 20px));
    gap: 12px;
    padding: 14px;
  }

  .account-panel a,
  .account-panel button {
    min-height: 92px;
  }

  .account-panel strong {
    font-size: 18px;
  }
}

/* Resource site layout refresh */
.site-hero {
  width: min(1180px, calc(100% - 28px));
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: stretch;
}

.hero-copy {
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
  box-shadow: var(--shadow);
}

.hero-copy span {
  color: var(--accent);
  font-weight: 900;
}

.hero-copy h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.22;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
}

.site-hero .slider-track {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.slide em {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #20242a;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.category-strip {
  width: min(1180px, calc(100% - 28px));
  margin: 18px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.category-strip a {
  display: grid;
  gap: 2px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(24, 32, 43, 0.06);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.category-strip a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 16px 34px rgba(35, 48, 73, 0.12);
}

.category-strip span {
  color: var(--muted);
  font-size: 13px;
}

.card-badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-soft));
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.card-info {
  min-height: 154px;
}

.card-info p {
  display: -webkit-box;
  min-height: 42px;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-titlebar > span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft));
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.post-cover {
  margin-top: 0;
}

.post-cover img {
  border-radius: 10px;
}

.resource-panel,
.download-box {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.resource-panel h2,
.download-box h2 {
  margin-top: 0;
}

.resource-panel dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.resource-panel dl div {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
}

.resource-panel dt {
  color: var(--muted);
  font-size: 13px;
}

.resource-panel dd {
  margin: 3px 0 0;
  font-weight: 900;
}

@media (max-width: 900px) {
  .site-hero,
  .category-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .site-hero,
  .site-hero .slider-track,
  .category-strip,
  .resource-panel dl {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 26px;
  }
}

/* Mobile polish and themed account menu */
.account-panel {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 54px rgba(28, 42, 64, 0.16);
}

.account-panel a,
.account-panel button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.account-panel span {
  color: var(--accent);
}

body.dark .account-panel {
  border-color: var(--line);
  background: var(--surface);
}

body.dark .account-panel a,
body.dark .account-panel button {
  background: var(--surface-soft);
  color: var(--text);
}

@media (max-width: 900px) {
  .site-header {
    position: sticky;
  }

  .top-nav {
    width: min(100% - 22px, 1180px);
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    padding: 10px 0 12px;
  }

  .site-logo {
    min-width: 0;
    padding: 3px 0;
  }

  .site-logo img {
    width: 34px;
    height: 34px;
  }

  .site-logo span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
  }

  .nav-menu {
    grid-column: 1 / -1;
    order: 0;
    flex-basis: auto;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

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

  .nav-menu a {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    word-break: keep-all;
  }

  .search-menu {
    margin-left: 0;
  }

  .search-orb,
  .account-orb,
  .theme-button {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 18px;
  }

  .search-orb {
    font-size: 24px;
  }

  .search-panel {
    right: -96px;
    width: min(360px, calc(100vw - 22px));
    grid-template-columns: 1fr;
  }

  .account-panel {
    right: -48px;
    width: min(360px, calc(100vw - 22px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
  }

  .account-panel a,
  .account-panel button {
    min-height: 78px;
    gap: 5px;
    border-radius: 12px;
  }

  .account-panel span {
    font-size: 20px;
  }

  .account-panel strong {
    font-size: 15px;
  }

  .site-hero {
    width: min(100% - 22px, 1180px);
    margin-top: 14px;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 0;
    padding: 20px;
  }

  .hero-copy h1 {
    font-size: 25px;
  }

  .hero-copy p {
    font-size: 14px;
  }

  .category-strip,
  .home-shell,
  .category-archive,
  .single-post,
  .footer-inner {
    width: min(100% - 22px, 1180px);
  }
}

@media (max-width: 560px) {
  .top-nav {
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
  }

  .nav-menu {
    gap: 7px;
  }

  .nav-menu a {
    padding: 6px 10px;
    font-size: 12px;
  }

  .account-panel {
    right: -44px;
  }

  .hero-copy {
    padding: 18px;
    border-radius: 10px;
  }

  .hero-copy h1 {
    font-size: 23px;
  }
}
