:root {
  color-scheme: dark;
  --bg: #1a1b1f;
  --top: #1b1c20;
  --nav: #26272d;
  --panel: #25262c;
  --panel-2: #2d3037;
  --line: #373a43;
  --soft-line: #2d3037;
  --text: #f3f4f7;
  --muted: #b7bdca;
  --dim: #828a99;
  --blue: #3f76c7;
  --blue-soft: #203a5b;
  --purple: #6d5dfc;
  --mint: #79d7bd;
  --danger: #ff6b6b;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--text);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
}

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

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 980px;
}

.cv-header {
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(520px, 660px) minmax(320px, 1fr);
  align-items: center;
  gap: 18px;
  height: 60px;
  padding: 0 14px;
  background: var(--top);
  border-bottom: 1px solid var(--soft-line);
}

.brand-group,
.header-actions,
.main-tabs,
.feed-tools,
.tab-link,
.tool-button,
.create-button,
.signin-button,
.hamburger-button,
.search-scope,
.search-submit,
.reaction-row,
.prompt-box header,
.pending-head,
.mine-section {
  display: flex;
  align-items: center;
}

.brand-group {
  gap: 10px;
  min-width: 0;
}

.brand-link img {
  display: block;
  width: 220px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

.pro-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 13px;
  border-radius: 4px;
  color: white;
  font-weight: 800;
  background: #6657f2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pro-pill::after {
  content: "◇";
  font-size: 15px;
}

.search-bar {
  justify-self: center;
  display: grid;
  grid-template-columns: 132px minmax(240px, 1fr) 38px 44px;
  width: 100%;
  height: 38px;
  overflow: hidden;
  background: #17191e;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.search-bar:focus-within {
  border-color: #4a7fd0;
}

.search-scope,
.search-submit {
  background: #30333a;
}

.search-scope {
  justify-content: space-between;
  padding: 0 12px;
  color: #d9dee8;
  border-right: 1px solid var(--soft-line);
}

.search-bar input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  color: var(--text);
  outline: 0;
  border: 0;
  background: transparent;
}

.search-bar input::placeholder {
  color: #757d8b;
}

.search-bar kbd {
  align-self: center;
  justify-self: center;
  min-width: 24px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  color: #d9dee8;
  border: 1px solid #3a3e48;
  border-radius: 5px;
  background: #121319;
  font-weight: 800;
}

.search-submit {
  justify-content: center;
  border-left: 1px solid var(--soft-line);
}

.header-actions {
  justify-content: flex-end;
  gap: 12px;
}

.create-button,
.signin-button,
.hamburger-button,
.tool-button,
.tag-chip,
.primary-upload,
.danger-button {
  height: 38px;
  border-radius: var(--radius);
  font-weight: 800;
}

.create-button {
  gap: 9px;
  padding: 0 12px;
  color: #cde4ff;
  background: var(--blue-soft);
}

.create-button:hover,
.tool-button:hover {
  background: #344052;
}

.signin-button {
  padding: 0 18px;
  color: #f4f6fb;
  background: #252831;
  border: 1px solid #3a3d46;
}

.hamburger-button {
  width: 38px;
  background: transparent;
}

.hamburger-button span,
.hamburger-button::before,
.hamburger-button::after {
  display: block;
  width: 22px;
  height: 3px;
  margin: 4px auto;
  border-radius: 99px;
  background: #e5e9f1;
  content: "";
}

.cv-subnav {
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 0 14px;
  background: var(--nav);
  border-bottom: 1px solid var(--soft-line);
}

.main-tabs {
  gap: 8px;
  min-width: 0;
}

.tab-link {
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  color: #eef1f7;
  font-weight: 800;
  white-space: nowrap;
}

.tab-link.active {
  background: #3a3d45;
}

.tab-link.muted {
  color: #d6dbe5;
}

.tab-link.shop {
  color: #f2cc6c;
  background: #34312a;
}

.feed-tools {
  gap: 12px;
  margin-left: auto;
}

.tool-button {
  gap: 7px;
  padding: 0 12px;
  background: transparent;
}

.menu-wrap {
  position: relative;
}

.menu-popover,
.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 200;
  min-width: 190px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #25262c;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.menu-popover button,
.filter-popover label {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
}

.menu-popover button:hover,
.filter-popover label:hover {
  background: #333640;
}

.filter-popover footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--soft-line);
}

.filter-popover footer button {
  height: 32px;
  padding: 0 10px;
  border-radius: 5px;
  background: #333640;
}

.filter-popover footer button:last-child {
  color: #10221d;
  background: var(--mint);
}

.filter-badge {
  min-width: 19px;
  height: 19px;
  line-height: 19px;
  text-align: center;
  border-radius: 999px;
  color: white;
  background: #4b82d4;
  font-size: 12px;
}

.page-scroll {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 48px;
}

.gallery-view,
.upload-view {
  width: min(100%, 1780px);
  margin: 0 auto;
}

.promo-card {
  position: relative;
  display: grid;
  grid-template-columns: 170px 1fr auto;
  min-height: 164px;
  overflow: hidden;
  border: 1px solid #51418f;
  border-radius: 7px;
  background: #24252b;
}

.promo-art {
  background:
    radial-gradient(circle at 42% 30%, rgba(119, 214, 255, 0.95), transparent 26%),
    linear-gradient(135deg, #2f2b66, #31546f 45%, #17191f);
}

.promo-copy {
  align-self: center;
  padding: 18px 22px;
}

.promo-copy h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.promo-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.promo-close {
  align-self: start;
  margin: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #e4ccd7;
  background: transparent;
  font-size: 26px;
}

.tag-scroller {
  display: flex;
  gap: 6px;
  overflow: hidden;
  padding: 12px 86px 10px;
}

.tag-chip {
  padding: 0 12px;
  color: #eef2f8;
  background: #3a3d45;
}

.tag-chip.active {
  background: #4b82d4;
}

.masonry-feed {
  column-width: 320px;
  column-gap: 16px;
  min-height: 220px;
  padding: 0 86px;
}

.masonry-feed:empty {
  min-height: 0;
}

.masonry-feed.compact {
  padding: 0;
}

.image-card {
  display: inline-block;
  width: 100%;
  overflow: hidden;
  margin: 0 0 16px;
  break-inside: avoid;
  border: 1px solid #343742;
  border-radius: 6px;
  background: #25262c;
}

.image-frame {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  background: #15161a;
}

.image-frame img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 170px;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.35s ease;
}

.image-card:hover .image-frame img {
  transform: scale(1.035);
}

.card-menu,
.remix-button,
.prompt-mark {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-menu {
  top: 8px;
  right: 8px;
  width: 28px;
  height: 32px;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.38);
  font-size: 25px;
}

.remix-button {
  top: 47px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #101318;
  background: rgba(255, 255, 255, 0.92);
  font-size: 21px;
  font-weight: 900;
}

.prompt-mark {
  right: 10px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  color: white;
  background: rgba(0, 0, 0, 0.52);
  font-weight: 900;
  font-family: Georgia, serif;
}

.reaction-row {
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  color: #d6dce7;
  font-size: 14px;
}

.owned-mark {
  padding: 2px 7px;
  border-radius: 999px;
  color: #10221d;
  background: var(--mint);
  font-weight: 800;
}

.empty-state {
  min-height: 340px;
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--muted);
}

.empty-state h1 {
  margin: 22px 0 8px;
  color: #d7dbe4;
  font-size: 34px;
}

.empty-state p {
  margin: 0;
  font-size: 16px;
}

.empty-icon {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 999px;
  background: #477ccc;
}

.empty-icon span {
  position: absolute;
  left: 34px;
  top: 42px;
  width: 62px;
  height: 42px;
  border: 6px solid white;
  border-radius: 18px;
}

.empty-icon span::after {
  content: "";
  position: absolute;
  left: -12px;
  top: 13px;
  width: 82px;
  height: 6px;
  border-radius: 99px;
  background: white;
  transform: rotate(43deg);
}

.upload-card {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(360px, 1fr);
  gap: 16px;
  padding: 20px;
  border: 1px solid #343742;
  border-radius: 8px;
  background: #25262c;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 300px;
  border: 1px dashed #4a4e5a;
  border-radius: 7px;
  background: #202127;
  text-align: center;
}

.dropzone.dragging {
  border-color: #6fa1ee;
  background: #22314a;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone h1 {
  margin: 14px 0 6px;
  font-size: 24px;
}

.dropzone p,
.dropzone strong {
  margin: 0;
  color: var(--muted);
}

.drop-icon {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background: #476d9f;
}

.drop-icon span {
  position: relative;
  display: block;
  width: 38px;
  height: 30px;
  margin: 24px auto;
  border: 4px solid white;
  border-radius: 6px;
}

.drop-icon span::after {
  content: "+";
  position: absolute;
  right: -12px;
  top: -17px;
  color: white;
  font-size: 30px;
  font-weight: 900;
}

.upload-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 42px;
  color: #e4e8ef;
  font-weight: 800;
}

.switch-row input {
  position: absolute;
  opacity: 0;
}

.switch-row span {
  position: relative;
  width: 58px;
  height: 30px;
  border-radius: 999px;
  background: #3a3d45;
}

.switch-row span::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: white;
  transition: 0.18s ease;
}

.switch-row input:checked + span {
  background: #4b82d4;
}

.switch-row input:checked + span::after {
  transform: translateX(28px);
}

.textarea-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 12px;
  color: var(--text);
  outline: 0;
  border: 1px solid #343742;
  border-radius: 6px;
  background: #1b1c21;
}

.pending-panel {
  grid-column: 1 / -1;
  border-top: 1px solid #343742;
  padding-top: 16px;
}

.pending-head,
.mine-section {
  justify-content: space-between;
}

.pending-head h2,
.mine-section h2 {
  margin: 0;
  font-size: 24px;
}

.pending-head span,
.mine-section p {
  color: var(--muted);
}

.pending-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.pending-empty {
  margin: 0;
  padding: 18px;
  border-radius: 6px;
  background: #20334e;
  color: #d4e4fa;
}

.pending-item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #343742;
  border-radius: 7px;
  background: #202127;
}

.pending-item img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 5px;
}

.pending-item h3 {
  margin: 0 0 4px;
}

.pending-item p {
  margin: 0;
  color: var(--muted);
}

.pending-item button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #343742;
}

.primary-upload {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  float: right;
  padding: 0 18px;
  color: white;
  background: #4b82d4;
}

.primary-upload:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upload-status {
  min-height: 24px;
  clear: both;
  margin: 50px 0 0;
  color: var(--muted);
}

.mine-section {
  margin: 26px 0 14px;
}

.detail-dialog {
  width: min(1800px, 94vw);
  height: min(980px, 92vh);
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 1px solid #353945;
  border-radius: 8px;
  background: #0f1116;
}

.detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.detail-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 520px;
  height: 100%;
}

.detail-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #1e222b;
  font-size: 30px;
}

.detail-media {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #090b10;
}

.detail-media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.detail-sidebar {
  overflow: auto;
  padding: 28px 24px;
  background: #272930;
  border-left: 1px solid #343742;
}

.detail-heading h2 {
  margin: 0;
  font-size: 28px;
}

.detail-heading p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.prompt-box {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #373b46;
  border-radius: 8px;
  background: #202228;
}

.prompt-box header {
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #30333c;
}

.prompt-box h3 {
  margin: 0;
}

.prompt-box button,
.danger-button {
  padding: 0 12px;
  border-radius: 6px;
  background: #355a8e;
  height: 34px;
}

.prompt-box pre {
  min-height: 120px;
  max-height: 330px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  color: #d5d9e2;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.55;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.danger-button {
  background: #63313a;
  color: #ffdbe1;
}

.chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.8;
}

.i-search,
.i-brush,
.i-home,
.i-grid,
.i-image,
.i-video,
.i-cube,
.i-file,
.i-book,
.i-bag,
.i-sort,
.i-filter,
.i-image-plus {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.i-search::before {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.i-search::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 8px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
  transform: rotate(45deg);
}

.i-brush::before,
.i-image-plus::before,
.i-image::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.i-brush::after,
.i-image-plus::after {
  content: "+";
  position: absolute;
  right: -4px;
  top: -9px;
  font-weight: 900;
}

.i-home::before {
  content: "⌂";
}

.i-grid::before {
  content: "▦";
}

.i-video::before {
  content: "▣";
}

.i-cube::before {
  content: "◇";
}

.i-file::before {
  content: "▤";
}

.i-book::before {
  content: "▥";
}

.i-bag::before {
  content: "♙";
}

.i-sort::before {
  content: "≡";
}

.i-filter::before {
  content: "▽";
}

@media (max-width: 1180px) {
  .cv-header {
    grid-template-columns: 280px 1fr 300px;
  }

  .brand-link img {
    width: 190px;
  }

  .tab-link.muted:nth-of-type(n + 5),
  .promo-card {
    display: none;
  }

  .tag-scroller,
  .masonry-feed {
    padding-left: 0;
    padding-right: 0;
  }
}
