@font-face {
  font-family: 'MaShanZheng';
  src: url('/static/fonts/ma-shan-zheng/MaShanZheng-Regular.logo.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html {
  scrollbar-gutter: stable;
}

:root {
  --home-surface-border: #e6e1d8;
  --home-surface-shadow: 0 10px 24px rgba(47, 52, 64, 0.05);
  --home-surface-shadow-soft: 0 6px 14px rgba(47, 52, 64, 0.04);
  --home-surface-shadow-light: 0 8px 18px rgba(47, 52, 64, 0.035);
  --home-radius-large: 16px;
  --home-radius-medium: 12px;
  --home-radius-pill: 999px;
  --home-section-gap-tight: 14px;
  --home-section-gap: 18px;
  --home-section-gap-loose: 28px;
}

.home-page {
  background: #fcfaf5;
  overflow-y: scroll;
}

.home-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.home-topbar {
  width: 100%;
  padding: 18px 36px;
  background: #f7f1e7;
  border-bottom: 1px solid #e8ddcf;
  box-shadow: 0 1px 0 rgba(120, 83, 15, 0.04);
}

.home-topbar-inner {
  width: min(1500px, calc(100vw - 72px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr minmax(720px, 860px) 1fr;
  align-items: center;
  gap: 28px;
}

.home-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  color: #8c4d1d;
  text-decoration: none;
}

.logo-lockup {
  --logo-stack-height: clamp(1.9rem, 2vw, 2.1rem);
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  width: max-content;
  min-width: var(--logo-lockup-fixed-width, max-content);
  box-sizing: border-box;
  line-height: 1;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  transform: none;
  transition: none;
}

.logo-lockup:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

.logo-lockup > span {
  display: inline-flex;
  text-align: left;
  white-space: nowrap;
  transform-origin: left center;
}

.logo-mark {
  display: block;
  width: auto;
  height: var(--logo-stack-height);
  min-height: 0;
  flex-shrink: 0;
  align-self: flex-start;
  object-fit: contain;
  border: 0;
}

.logo-text-stack {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  height: var(--logo-stack-height);
  gap: 1px;
  line-height: 1;
}

.logo-text-inner,
.logo-subtext-inner {
  display: inline-block;
  transform-origin: left center;
}

.logo-text {
  font-family: 'MaShanZheng', 'LXGW WenKai', 'Patrick Hand', 'Indie Flower', sans-serif;
  font-size: clamp(1.15rem, 1.34vw, 1.46rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: rgb(120 53 15);
  transition: none;
  display: block;
}

.logo-subtext {
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: clamp(0.68rem, 0.82vw, 0.8rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(146 64 14);
  opacity: 0.88;
  display: block;
}

.logo-lockup .logo-subtext-inner {
  opacity: 0;
  transition: opacity 120ms ease-out;
}

.logo-lockup.logo-subtext-ready .logo-subtext-inner {
  opacity: 1;
}

.home-search-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.home-search {
  width: 100%;
  display: flex;
  align-items: center;
  height: 54px;
  background: #ffffff;
  border: 1px solid #e6e1d8;
  border-radius: var(--home-radius-medium);
  overflow: visible;
  box-shadow: 0 4px 10px rgba(47, 52, 64, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.home-search:focus-within {
  border-color: #4c8bf5;
  box-shadow: 0 4px 12px rgba(76, 139, 245, 0.12);
}

.home-search-channel {
  position: relative;
  flex-shrink: 0;
}

.home-search-category {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 18px 0 20px;
  border: 0;
  color: #5f6672;
  font-size: 16px;
  white-space: nowrap;
  background: #ffffff;
  cursor: pointer;
}

.home-search-category::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #9ca7b6;
}

.home-search-channel-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  min-width: 148px;
  padding: 8px;
  border: 1px solid #dfe4ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(47, 52, 64, 0.08);
  display: grid;
  gap: 4px;
  z-index: 5;
}

.home-search-channel-menu[hidden] {
  display: none;
}

.home-search-channel-option {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  color: #5f6672;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.home-search-channel-option:hover:not(.is-active) {
  background: #f7fbff;
  color: #2f6fe4;
}

.home-search-channel-option.is-active {
  background: #eaf2ff;
  color: #2f6fe4;
  font-weight: 600;
}

.home-search-divider {
  width: 1px;
  height: 22px;
  background: #e6e1d8;
}

.home-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #2f3440;
  font-size: 15px;
}

.home-search-button {
  position: relative;
  width: 88px;
  height: 100%;
  border: 0;
  border-radius: 0 calc(var(--home-radius-medium) - 1px) calc(var(--home-radius-medium) - 1px) 0;
  background: linear-gradient(180deg, #5b97fb 0%, #4c8bf5 100%);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}

.home-search-button:hover {
  background: linear-gradient(180deg, #4c8bf5 0%, #2f6fe4 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.home-search-button:focus {
  outline: none;
}

.home-search-button:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 0 4px rgba(76, 139, 245, 0.16);
}

.home-search-button::before {
  content: "";
  position: absolute;
  left: 34px;
  top: 14px;
  width: 12px;
  height: 12px;
  border: 3px solid #ffffff;
  border-radius: 50%;
}

.home-search-button::after {
  content: "";
  position: absolute;
  left: 47px;
  top: 27px;
  width: 9px;
  height: 3px;
  background: #ffffff;
  border-radius: 999px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.home-side-links {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 18px;
  font-size: 14px;
  color: #7b8696;
  white-space: nowrap;
}

.home-side-links a,
.home-side-links span {
  color: #7b8696;
}

.home-user-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #445268;
}

.home-logout-form {
  margin: 0;
}

.home-logout-button {
  border: 0;
  background: transparent;
  color: #7b8696;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.home-logout-button:hover {
  color: #2f6fe4;
}

.home-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 38%, #f6d4b8 0 18%, transparent 19%),
    radial-gradient(circle at 52% 70%, #f97316 0 24%, #7c2d12 52%, #111827 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.home-breadcrumb {
  color: #8b95a3;
  font-size: 14px;
  line-height: 1.6;
  padding: 0 0 6px;
}

.home-channel-shell {
  width: min(1500px, calc(100vw - 72px));
  margin: 0 auto;
  padding: var(--home-section-gap-tight) 0 0;
}

.home-channel-panel {
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid var(--home-surface-border);
  border-radius: var(--home-radius-large);
  box-shadow: var(--home-surface-shadow-soft);
  overflow: hidden;
}

.home-channel-tabs {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #f1ece3;
}

.home-channel-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 24px;
  padding: 0;
  color: #2f3440;
  font-size: 16px;
  font-weight: 600;
}

.home-channel-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5f6672;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.home-channel-link:hover:not(.active) {
  color: #2f6fe4;
}

.home-channel-link.active {
  color: #2f6fe4;
}

.home-channel-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -15px;
  height: 2px;
  background: #4c8bf5;
}

.home-style-row {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 14px 22px 18px;
  color: #475569;
  font-size: 15px;
  flex-wrap: wrap;
}

.home-style-row[hidden] {
  display: none !important;
}

.home-style-label {
  color: #7b8696;
  font-size: 14px;
  white-space: nowrap;
}

.home-style-chip-list {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  flex: 1 1 0;
  min-width: 0;
}

.home-style-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 12px;
  border-width: 1px;
  border-style: solid;
  border-radius: var(--home-radius-pill);
  border: 1px solid rgba(230, 225, 216, 0.35);
  background: rgba(255, 253, 249, 0.65);
  color: #5f6672;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.home-style-chip:hover:not(.active) {
  background: #eaf2ff;
  color: #4c8bf5;
}

.home-style-chip.active {
  background: #eaf2ff;
  border-color: #bfd4fb;
  color: #4c8bf5;
  box-shadow: 0 4px 10px rgba(76, 139, 245, 0.08);
}

.home-sort-shell {
  width: min(1500px, calc(100vw - 72px));
  margin: 0 auto;
  padding: var(--home-section-gap) 0;
}

.home-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.web-share-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 40px;
  position: relative;
}

.web-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  box-shadow: none;
}

.web-share-button:hover {
  opacity: 0.9;
}

.web-share-button svg {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.web-share-toast {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: max-width 0.18s ease, opacity 0.18s ease, transform 0.18s ease, padding 0.18s ease;
  padding: 0;
  border-radius: 999px;
  background: rgba(61, 49, 38, 0.9);
  color: #ffffff;
  font-size: 12px;
  line-height: 28px;
  pointer-events: none;
}

.web-share-toast.is-visible {
  max-width: 220px;
  opacity: 1;
  transform: translateX(0);
  padding: 0 12px;
}

.home-sort-tabs {
  display: inline-flex;
  align-items: stretch;
  background: #ffffff;
  border: 1px solid var(--home-surface-border);
  border-radius: var(--home-radius-medium);
  box-shadow: var(--home-surface-shadow-soft);
  overflow: hidden;
}

.home-sort-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  height: 36px;
  padding: 0 18px;
  border: 0;
  background: #ffffff;
  color: #7b8696;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.home-sort-tab:hover:not(.active) {
  background: #fcfaf5;
  color: #5f6672;
}

.home-sort-tab + .home-sort-tab {
  border-left: 1px solid #f1ece3;
}

.home-sort-tab.active {
  color: #2f3440;
  background: #fbf8f1;
}

@media (max-width: 960px) {
  .home-topbar {
    padding: 16px 16px;
  }

  .home-topbar-inner {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-brand {
    justify-self: center;
  }

  .home-channel-shell,
  .home-sort-shell {
    width: calc(100vw - 32px);
  }

  .home-sort-bar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .home-sort-bar .web-share-group {
    width: 100%;
    justify-content: flex-start;
  }

  .home-search {
    width: 100%;
  }

  .home-side-links {
    justify-content: flex-end;
  }

  .home-channel-tabs,
  .home-style-row {
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .logo-lockup {
    --logo-stack-height: 1.7rem;
    gap: 6px;
  }

  .home-search {
    height: 48px;
  }

  .home-search-category {
    padding: 0 12px;
    font-size: 15px;
  }

  .home-search input {
    padding: 0 10px;
  }

  .home-search-button {
    width: 62px;
  }

  .home-search-button::before {
    left: 22px;
    top: 13px;
    width: 11px;
    height: 11px;
  }

  .home-search-button::after {
    left: 34px;
    top: 25px;
  }

  .home-side-links {
    gap: 12px;
    font-size: 13px;
    flex-wrap: wrap;
  }

  .home-channel-tabs {
    padding: 14px 14px 12px;
    gap: 16px;
    overflow-x: auto;
  }

  .home-style-row {
    padding: 12px 14px 16px;
    gap: 12px;
  }

  .home-channel-link,
  .home-style-chip {
    font-size: 14px;
  }

  .home-sort-tab {
    min-width: 94px;
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  .home-brand {
    justify-self: start;
  }
}
