:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-strong: #f0eee7;
  --ink: #15171a;
  --muted: #6a6f76;
  --line: #dedbd2;
  --green: #2f6859;
  --green-dark: #173d35;
  --red: #9b3f32;
  --blue: #2f5f8f;
  --shadow: 0 14px 32px rgba(25, 29, 35, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(21, 23, 26, 0.08);
  background: rgba(246, 244, 239, 0.95);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 800;
}

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

.brand strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.nav a {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #33373d;
  font-size: 14px;
  text-align: center;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

main {
  width: min(100% - 24px, 1180px);
  margin: 0 auto;
  padding: 16px 0 40px;
}

.toolbar {
  display: grid;
  gap: 12px;
  padding: 18px 0 16px;
}

.toolbar h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: 0;
}

.toolbar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.text-action,
.primary-button,
.secondary-button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.text-action {
  justify-self: start;
  color: var(--green-dark);
  font-weight: 700;
}

.primary-button {
  padding: 11px 16px;
  background: var(--green-dark);
  color: #fff;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.secondary-button {
  padding: 9px 14px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.content-band {
  padding: 12px 0 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

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

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -12px 8px;
  padding: 0 12px 14px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: visible;
  margin: 0 0 12px;
  padding: 0;
}

.rating-grid .chip {
  width: 100%;
  min-width: 0;
  padding-right: 4px;
  padding-left: 4px;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: visible;
  margin: 0 0 12px;
  padding: 0;
}

.region-grid .chip {
  width: 100%;
  min-width: 0;
  padding-right: 6px;
  padding-left: 6px;
  white-space: normal;
}

.chip {
  min-height: 38px;
  padding: 8px 12px;
  border-color: var(--line);
  background: var(--surface);
  color: #2d3136;
  font-size: 14px;
}

.chip[aria-pressed="true"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(25, 29, 35, 0.06);
}

.load-more {
  grid-column: 1 / -1;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-dark);
  font-weight: 800;
  cursor: pointer;
}

.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-strong);
}

.cover img,
.cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(21, 23, 26, 0.76);
  color: #fff;
  font-size: 12px;
}

.card-body {
  padding: 12px;
}

.card-body h3 {
  display: -webkit-box;
  margin: 0 0 9px;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.34;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.rating-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.rating-pill {
  border: 1px solid #e4c49e;
  background: #fff0dd;
  color: #7a3e12;
  font-weight: 700;
}

.tag {
  background: #e7f0ed;
  color: var(--green-dark);
}

.empty-state,
.error-state {
  grid-column: 1 / -1;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.error-state {
  color: var(--red);
}

.detail-heading {
  align-items: start;
}

.back-link {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--blue);
  font-weight: 700;
}

.description {
  max-width: 860px;
  color: #363b41;
  white-space: pre-wrap;
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.media-item {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.media-item img,
.media-item video {
  width: 100%;
  height: auto;
  background: #111;
}

.media-item video {
  max-height: 78vh;
}

.media-caption {
  padding: 9px 11px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pin-screen {
  min-height: calc(100vh - 92px);
  display: grid;
  place-items: center;
  padding: 18px 12px 28px;
}

.pin-panel {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pin-panel h1 {
  margin: 16px 0 8px;
  font-size: 26px;
  line-height: 1.16;
  letter-spacing: 0;
}

.pin-panel p {
  margin: 0 0 16px;
  color: var(--muted);
}

.pin-panel label span {
  display: block;
  margin-bottom: 6px;
  color: #33373d;
  font-size: 14px;
  font-weight: 700;
}

.pin-panel input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  letter-spacing: 0;
}

.pin-panel .primary-button {
  width: 100%;
  margin-top: 14px;
}

.form-status {
  min-height: 22px;
  color: var(--red) !important;
}

@media (min-width: 560px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 12px 24px;
  }

  .nav {
    display: flex;
    justify-content: flex-end;
  }

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

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

  main {
    width: min(100% - 40px, 1180px);
    padding-top: 22px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding: 24px 0 20px;
  }

  .toolbar h1 {
    font-size: 44px;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 920px) {
  .brand-mark {
    width: 42px;
    height: 42px;
  }

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

  .toolbar h1 {
    font-size: 56px;
  }

  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
  }

  .project-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
  }

  .cover {
    aspect-ratio: 4 / 3;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
  }
}
