:root {
  --paper: #f1f0eb;
  --paper-strong: #e8e6df;
  --ink: #151515;
  --muted: #74736e;
  --line: #ceccc4;
  --white: #faf9f5;
  --acid: #d8ff35;
  --coral: #ff694d;
  --blue: #4069ff;
  --card-radius: 6px;
  --sidebar-width: 238px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
}

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

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

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  padding: 22px 18px 18px;
}

.brand-block {
  padding-bottom: 36px;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  color: inherit;
  gap: 5px;
  text-decoration: none;
}

.brand-mark span {
  font-size: 20px;
  font-weight: 800;
}

.brand-mark strong {
  color: var(--coral);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
}

.brand-block p,
.section-label,
.sidebar-foot > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.primary-nav {
  display: grid;
  gap: 2px;
}

.nav-item,
.topic-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.nav-item:hover,
.topic-button:hover {
  background: var(--paper-strong);
}

.nav-item.is-active {
  background: var(--ink);
  color: var(--white);
}

.nav-count {
  min-width: 24px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.nav-item.is-active .nav-count {
  color: #aaa9a3;
}

.sidebar-section {
  margin-top: 34px;
}

.section-label {
  margin: 0 0 8px 10px;
}

.topic-list {
  display: grid;
  gap: 1px;
}

.topic-button {
  justify-content: flex-start;
  gap: 10px;
  color: #52514d;
  font-size: 13px;
}

.topic-button::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
}

.topic-button.is-active {
  color: var(--ink);
  font-weight: 600;
}

.topic-button.is-active::before {
  border-color: var(--coral);
  background: var(--coral);
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.archive-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.archive-status strong,
.archive-status span {
  display: block;
}

.archive-status strong {
  font-size: 12px;
}

.archive-status span {
  max-width: 155px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 3px;
  border-radius: 50%;
  background: #48a655;
  box-shadow: 0 0 0 3px rgb(72 166 85 / 12%);
}

.sidebar-foot > p {
  margin-top: 18px;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgb(241 240 235 / 92%);
  padding: 12px 32px;
  backdrop-filter: blur(16px);
}

.search-box {
  display: flex;
  width: min(520px, 60vw);
  min-height: 42px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #aaa9a3;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 8px 0;
}

.search-box input::placeholder {
  color: #8b8983;
}

.search-box kbd {
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 10px;
  padding: 3px 5px;
}

.icon {
  display: inline-flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.topbar-actions,
.view-switch {
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-switch {
  margin-left: 7px;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}

.icon-button {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover,
.icon-button.is-active {
  background: var(--ink);
  color: var(--white);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
  gap: 44px;
  padding: 74px 32px 56px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 700;
}

.intro h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Songti SC", "Times New Roman", serif;
  font-size: clamp(42px, 5.5vw, 78px);
  font-weight: 400;
  line-height: 0.98;
}

.intro-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.intro-meta > p {
  max-width: 380px;
  margin: 0;
  color: #55544f;
  font-size: 14px;
  line-height: 1.65;
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.text-button,
.text-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.featured-strip {
  display: grid;
  min-height: 360px;
  grid-template-columns: 0.8fr 1.4fr 0.8fr;
  border-block: 1px solid var(--line);
}

.feature-note {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 360px;
  background: var(--acid);
  padding: 26px;
}

.feature-note > p {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
}

.feature-note h2 {
  margin: auto 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 400;
  line-height: 1.03;
}

.text-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-decoration: none;
}

.feature-image {
  position: relative;
  display: block;
  min-height: 360px;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #222;
  cursor: pointer;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.feature-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 500ms ease;
}

.feature-image:hover img {
  transform: scale(1.025);
}

.feature-image span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border-radius: 3px;
  background: var(--white);
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 700;
}

.feature-fallback {
  display: flex;
  height: 100%;
  min-height: 360px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 28px;
  color: var(--ink);
}

.feature-fallback--huaban {
  background:
    linear-gradient(135deg, transparent 0 55%, rgb(255 255 255 / 42%) 55% 58%, transparent 58%),
    #f0b4c6;
}

.feature-fallback--behance {
  background:
    radial-gradient(circle at 78% 22%, rgb(255 255 255 / 55%) 0 9%, transparent 10%),
    #b7d4ff;
}

.feature-fallback-mark {
  display: inline-flex;
  width: 68px;
  height: 68px;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  font-style: italic;
}

.feature-fallback strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(34px, 4vw, 62px);
  font-weight: 400;
  line-height: 0.95;
}

.feature-fallback small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.active-filters {
  display: flex;
  min-height: 0;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 32px;
}

.active-filters:not(:empty) {
  padding-top: 22px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  padding: 7px 10px;
  font-size: 11px;
}

.filter-chip:hover {
  border-color: var(--ink);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 42px 18px;
  padding: 36px 32px 96px;
}

.resource-card {
  position: relative;
  grid-column: span 4;
  min-width: 0;
}

.resource-card:nth-child(7n + 1),
.resource-card:nth-child(7n + 6) {
  grid-column: span 6;
}

.card-open {
  display: block;
  width: 100%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.card-visual {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: var(--card-radius);
  background: #d9d7d0;
}

.resource-card:nth-child(7n + 1) .card-visual {
  aspect-ratio: 16 / 10;
}

.resource-card:nth-child(7n + 3) .card-visual,
.resource-card:nth-child(7n + 5) .card-visual {
  aspect-ratio: 4 / 5;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition:
    transform 450ms ease,
    filter 450ms ease;
}

.card-open:hover .card-image {
  transform: scale(1.025);
  filter: saturate(1.06);
}

.card-kind,
.card-arrow {
  position: absolute;
  z-index: 2;
  top: 10px;
}

.card-kind {
  left: 10px;
  border-radius: 3px;
  background: rgb(250 249 245 / 92%);
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.card-signal {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 72px;
  border-radius: 3px;
  background: var(--coral);
  color: var(--ink);
  padding: 5px 7px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.card-signal[hidden] {
  display: none;
}

.card-open-label {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 3px;
  background: var(--ink);
  color: var(--white);
  padding: 7px 9px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.94;
  pointer-events: none;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.card-open-label .icon {
  width: 13px;
  height: 13px;
}

.card-open:hover .card-open-label,
.card-open:focus-visible .card-open-label {
  background: var(--coral);
  color: var(--ink);
}

.card-arrow {
  right: 10px;
  display: flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgb(250 249 245 / 92%);
  opacity: 0;
  transform: translate(-5px, 5px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.card-open:hover .card-arrow {
  opacity: 1;
  transform: translate(0, 0);
}

.generated-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: #20201f;
  color: #f6f4ee;
  padding: 22px;
}

.generated-cover[hidden] {
  display: none;
}

.generated-cover::before,
.generated-cover::after {
  position: absolute;
  content: "";
}

.generated-cover::before {
  inset: 14px;
  border: 1px solid rgb(255 255 255 / 24%);
}

.generated-cover::after {
  top: -22%;
  right: -18%;
  width: 65%;
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: 50%;
}

.resource-card[data-tone="acid"] .generated-cover,
.generated-cover[data-tone="acid"] {
  background: var(--acid);
  color: var(--ink);
}

.resource-card[data-tone="coral"] .generated-cover,
.generated-cover[data-tone="coral"] {
  background: var(--coral);
  color: var(--ink);
}

.resource-card[data-tone="blue"] .generated-cover,
.generated-cover[data-tone="blue"] {
  background: var(--blue);
}

.resource-card[data-tone="paper"] .generated-cover,
.generated-cover[data-tone="paper"] {
  background: #dedbd1;
  color: var(--ink);
}

.cover-index,
.cover-type,
.cover-title,
.cover-tags {
  position: relative;
  z-index: 1;
}

.cover-index {
  position: absolute;
  top: 22px;
  left: 22px;
  font-family: Georgia, serif;
  font-size: 18px;
  font-style: italic;
}

.cover-type {
  margin-bottom: 8px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.cover-title {
  max-width: 85%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2.8vw, 42px);
  font-weight: 400;
  line-height: 0.95;
}

.cover-tags {
  margin-top: 14px;
  font-size: 9px;
  text-transform: uppercase;
}

.card-copy {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  border-top: 1px solid var(--ink);
  margin-top: 12px;
  padding-top: 11px;
}

.card-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.card-description {
  display: -webkit-box;
  max-width: 460px;
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-number {
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

.save-button {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 45px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.detail-button {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 87px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.detail-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.save-button:hover,
.save-button.is-saved {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.save-button.is-saved svg {
  fill: currentColor;
}

.resource-grid.compact {
  display: block;
  padding-top: 20px;
}

.resource-grid.compact .resource-card {
  border-top: 1px solid var(--line);
}

.resource-grid.compact .card-open {
  display: grid;
  min-height: 92px;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px 56px 10px 0;
}

.resource-grid.compact .card-visual {
  aspect-ratio: 16 / 9;
}

.resource-grid.compact .card-copy {
  margin: 0;
  border: 0;
  padding: 0;
}

.resource-grid.compact .card-arrow,
.resource-grid.compact .card-kind,
.resource-grid.compact .cover-tags {
  display: none;
}

.resource-grid.compact .cover-title {
  font-size: 18px;
}

.resource-grid.compact .save-button {
  right: 4px;
  bottom: 28px;
}

.resource-grid.compact .detail-button {
  right: 4px;
  bottom: 70px;
}

.empty-state {
  min-height: 380px;
  padding: 90px 32px;
  text-align: center;
}

.empty-state .icon {
  width: 28px;
  height: 28px;
}

.empty-state h2 {
  margin: 16px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 34px;
  font-weight: 400;
}

.empty-state p {
  color: var(--muted);
}

.primary-button {
  border-radius: 4px;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  padding: 10px 16px;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgb(17 17 17 / 38%);
  backdrop-filter: blur(3px);
}

.detail-panel {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  width: min(680px, 92vw);
  height: 100vh;
  overflow-y: auto;
  background: var(--white);
  box-shadow: -24px 0 80px rgb(0 0 0 / 12%);
  transform: translateX(102%);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.detail-panel.is-open {
  transform: translateX(0);
}

.panel-close {
  position: fixed;
  z-index: 3;
  top: 16px;
  right: 16px;
  background: rgb(250 249 245 / 90%);
  box-shadow: 0 2px 16px rgb(0 0 0 / 10%);
}

.detail-hero {
  position: relative;
  min-height: 390px;
  background: #ddd;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  min-height: 390px;
  object-fit: cover;
  object-position: top center;
}

.detail-generated {
  min-height: 390px;
}

.detail-body {
  padding: 34px 34px 60px;
}

.detail-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.detail-body h2 {
  margin: 20px 0 12px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 400;
  line-height: 0.96;
}

.detail-summary {
  max-width: 560px;
  margin: 0;
  color: #55544f;
  font-size: 15px;
  line-height: 1.7;
}

.source-note {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: #5f5e59;
  font-size: 11px;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.detail-tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 10px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.detail-link,
.detail-save {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  padding: 0 14px;
  text-decoration: none;
}

.detail-link.primary {
  background: var(--ink);
  color: var(--white);
}

.detail-section {
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.detail-section label,
.detail-section h3 {
  display: block;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-section p {
  margin: 0;
  color: #5f5e59;
  line-height: 1.65;
}

.note-field {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: #f4f3ee;
  padding: 14px;
  line-height: 1.55;
}

.note-field:focus {
  border-color: var(--ink);
}

.note-status {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

body.panel-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 202px;
  }

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

  .intro-meta {
    max-width: 560px;
  }

  .featured-strip {
    grid-template-columns: 0.9fr 1.3fr;
  }

  .feature-image--small {
    display: none;
  }

  .resource-card {
    grid-column: span 6;
  }

  .resource-card:nth-child(n) {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    position: static;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 16px;
  }

  .brand-block {
    padding-bottom: 14px;
  }

  .primary-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 2px;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    gap: 9px;
  }

  .sidebar-section,
  .sidebar-foot {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    min-height: 62px;
    padding: 10px 16px;
  }

  .search-box {
    width: 100%;
  }

  .search-box kbd,
  .view-switch {
    display: none;
  }

  .topbar-actions {
    margin-left: 8px;
  }

  .intro {
    gap: 28px;
    padding: 48px 16px 34px;
  }

  .intro h1 {
    font-size: 46px;
  }

  .featured-strip {
    min-height: 310px;
    grid-template-columns: 1fr;
  }

  .feature-note {
    min-height: 300px;
  }

  .feature-image {
    display: none;
  }

  .active-filters,
  .resource-grid {
    padding-right: 16px;
    padding-left: 16px;
  }

  .resource-grid {
    display: block;
    padding-top: 28px;
  }

  .resource-card {
    margin-bottom: 38px;
  }

  .card-visual,
  .resource-card:nth-child(n) .card-visual {
    aspect-ratio: 4 / 3;
  }

  .detail-panel {
    width: 100vw;
  }

  .detail-hero,
  .detail-hero img,
  .detail-generated {
    min-height: 300px;
  }

  .detail-body {
    padding: 26px 18px 46px;
  }
}

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