:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #111720;
  --panel-2: #17212d;
  --text: #edf4f6;
  --muted: #9dafb8;
  --line: rgba(255,255,255,.12);
  --cyan: #35d7e8;
  --red: #ff4d6d;
  --gold: #f3c35b;
  --green: #79d388;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(53, 215, 232, .08), transparent 290px),
    linear-gradient(135deg, #090b10 0%, #10161d 50%, #08090c 100%);
  color: var(--text);
}

button, input, select {
  font: inherit;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px clamp(18px, 4vw, 56px) 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stats span,
.link-button,
.tag,
.pill {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
}

.link-button {
  text-decoration: none;
  color: #061014;
  background: var(--cyan);
  border-color: transparent;
}

main {
  width: min(1820px, calc(100% - 76px));
  margin: 0 auto;
  padding-bottom: 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: stretch;
  padding: 26px 0;
}

.hero-copy {
  display: flex;
  align-items: end;
  min-height: 250px;
  border-left: 3px solid var(--red);
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,77,109,.12), rgba(255,255,255,.03));
}

.hero-copy p {
  margin: 0;
  color: #d5e1e5;
  font-size: 17px;
  line-height: 1.8;
}

.hero-strip {
  min-height: 250px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  overflow: hidden;
}

.hero-strip img {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.controls {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr minmax(190px, 260px);
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  background: rgba(9, 11, 16, .92);
  backdrop-filter: blur(14px);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  background: var(--panel);
}

.tab,
.category-rail button,
.close {
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.tab {
  min-width: 96px;
  padding: 12px 14px;
}

.tab.is-active {
  background: var(--cyan);
  color: #061014;
}

.search {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0 12px;
}

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

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.search input {
  border: 0;
}

select {
  padding: 0 12px;
}

.category-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 20px;
}

.category-rail button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255,255,255,.04);
}

.category-rail button.is-active {
  color: #071015;
  background: var(--gold);
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 42%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.card:hover {
  border-color: rgba(53, 215, 232, .42);
  box-shadow: 0 14px 36px rgba(0,0,0,.28);
  transform: translateY(-2px);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0d1218;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 12px;
}

.thumb .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(53,215,232,.20), transparent),
    linear-gradient(315deg, rgba(255,77,109,.18), transparent);
}

.card-body {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 112px;
  padding: 18px 20px 14px;
}

.card-body::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 0;
  width: 42px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--red));
}

.card h2 {
  margin: 0;
  color: #f7fbfc;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.18;
}

.card p {
  margin: 0;
  min-height: 0;
  color: #aebdc5;
  font-size: 16px;
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.card .tag {
  border-color: rgba(53, 215, 232, .18);
  background: rgba(53, 215, 232, .08);
  color: #c7e9ee;
}

.beauty-showcase {
  display: grid;
  gap: 26px;
}

.beauty-feature {
  display: grid;
  grid-template-columns: minmax(420px, 1.45fr) minmax(320px, .85fr);
  gap: 22px;
  min-height: 560px;
}

.beauty-hero-card,
.beauty-combo-card,
.lookbook-card,
.npc-card,
.detail-beauty-card,
.beauty-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 48%),
    var(--panel);
}

.beauty-hero-card,
.beauty-combo-card,
.lookbook-card,
.npc-card,
.detail-beauty-card {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.beauty-hero-card:hover,
.beauty-combo-card:hover,
.lookbook-card:hover,
.npc-card:hover,
.detail-beauty-card:hover {
  border-color: rgba(243,195,91,.48);
  box-shadow: 0 16px 40px rgba(0,0,0,.32);
  transform: translateY(-2px);
}

.beauty-hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 560px;
}

.beauty-hero-photo,
.combo-photo,
.lookbook-photo,
.npc-photo,
.detail-photo {
  position: relative;
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(53,215,232,.16), transparent),
    #0d1218;
}

.beauty-hero-photo img,
.combo-photo img,
.lookbook-photo img,
.npc-photo img,
.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.beauty-hero-photo {
  min-height: 560px;
}

.beauty-hero-info {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 14px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(17,23,32,.82), #111720);
}

.beauty-hero-info p,
.beauty-combo-card p,
.lookbook-body p,
.npc-card p {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
}

.beauty-hero-info h2 {
  margin: 0;
  color: #fff;
  font-size: 34px;
  line-height: 1.12;
}

.beauty-hero-info > span,
.lookbook-body > span,
.npc-card span,
.detail-beauty-card span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.beauty-mini-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.beauty-mini-strip img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: #0d1218;
}

.beauty-side-stack {
  display: grid;
  gap: 22px;
}

.beauty-combo-card {
  display: grid;
  grid-template-columns: 42% 1fr;
  min-height: 269px;
}

.beauty-combo-card > div:last-child,
.npc-card > div:last-child,
.detail-beauty-card > div:last-child {
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 18px;
}

.beauty-combo-card h3,
.lookbook-card h3,
.npc-card h3,
.detail-beauty-card h3 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.2;
}

.beauty-section {
  padding: 18px;
}

.beauty-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.beauty-section-head span {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.beauty-section-head small {
  color: var(--muted);
}

.beauty-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.beauty-pager button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255,255,255,.05);
  cursor: pointer;
}

.beauty-pager button:not(:disabled):hover {
  border-color: rgba(53, 215, 232, .5);
  background: rgba(53, 215, 232, .12);
}

.beauty-pager button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.lookbook-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.lookbook-card {
  display: grid;
  grid-template-rows: minmax(420px, 58vh) auto;
}

.lookbook-collection-card {
  grid-template-rows: minmax(560px, 72vh) auto;
}

.lookbook-photo {
  min-height: 420px;
}

.lookbook-collection-card .lookbook-photo {
  min-height: 560px;
}

.lookbook-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.beauty-lower {
  display: grid;
  grid-template-columns: minmax(420px, .95fr) minmax(420px, 1.05fr);
  gap: 22px;
}

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

.npc-card {
  display: grid;
  grid-template-rows: 360px auto;
}

.npc-collection-card {
  grid-template-rows: auto auto;
}

.npc-collection-card .npc-photo {
  aspect-ratio: 4 / 3;
  min-height: 0;
  max-height: 720px;
}

.npc-collection-card .npc-photo img {
  object-fit: cover;
  object-position: center center;
}

.npc-photo img {
  object-position: center top;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-beauty-card {
  display: grid;
  grid-template-rows: 190px auto;
}

.detail-beauty-card h3 {
  font-size: 17px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

dialog {
  width: min(920px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #0b1016;
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0,0,0,.72);
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,.62);
  font-size: 24px;
}

#detail-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  background: #0d1218;
}

.detail-media {
  position: relative;
  background: #0d1218;
}

.detail-body {
  padding: 20px;
}

.detail-body p {
  color: var(--muted);
  line-height: 1.7;
}

.detail-body h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

#detail-kind {
  margin: 0;
  color: var(--cyan);
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .controls {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .hero-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-copy,
  .hero-strip,
  .hero-strip img {
    min-height: 180px;
  }
}

@media (max-width: 1280px) {
  main {
    width: min(100% - 32px, 1120px);
  }

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

  .beauty-feature,
  .beauty-lower {
    grid-template-columns: 1fr;
  }

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

  .beauty-hero-info {
    justify-content: start;
  }

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

@media (max-width: 960px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .beauty-combo-card,
  .npc-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .beauty-combo-card {
    grid-template-rows: 280px auto;
  }
}

@media (max-width: 620px) {
  main {
    width: calc(100% - 24px);
  }

  .topbar {
    padding: 20px 14px 14px;
  }

  .stats {
    justify-content: flex-start;
  }

  .controls {
    position: static;
    gap: 10px;
    padding: 10px 0 12px;
  }

  .tabs,
  .search,
  select {
    width: 100%;
  }

  .category-rail {
    flex-wrap: nowrap;
    margin: 0 -12px;
    padding: 2px 12px 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .hero-strip {
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-strip img {
    min-height: 118px;
    aspect-ratio: 16 / 10;
  }

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

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

  .beauty-hero-photo {
    min-height: 300px;
  }

  .beauty-hero-info h2 {
    font-size: 26px;
  }

  .beauty-feature {
    min-height: 0;
  }

  .beauty-hero-card {
    min-height: 0;
  }

  .beauty-combo-card {
    grid-template-rows: 230px auto;
  }

  .lookbook-card,
  .lookbook-collection-card {
    grid-template-rows: minmax(280px, 56vh) auto;
  }

  .lookbook-photo,
  .lookbook-collection-card .lookbook-photo {
    min-height: 280px;
  }

  .npc-card,
  .detail-beauty-card {
    grid-template-rows: 260px auto;
  }

  dialog {
    width: calc(100% - 18px);
    max-height: calc(100dvh - 18px);
  }

  #detail-image {
    max-height: 42vh;
    object-fit: contain;
  }
}
