:root {
  color-scheme: dark;
  --bg: #111316;
  --bg-deep: #08090b;
  --panel: #181b20;
  --panel-2: #20242b;
  --panel-3: #252a32;
  --line: #303640;
  --line-strong: #454d59;
  --text: #f4f6f8;
  --muted: #a7afb9;
  --soft: #2a3038;
  --red: #e02d2d;
  --red-dark: #b91f24;
  --gold: #d6a453;
  --green: #33b37c;
  --blue: #4f9cff;
  --amber: #e5a342;
  --shadow: 0 18px 46px rgba(0, 0, 0, .34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(224, 45, 45, .16), transparent 260px),
    radial-gradient(circle at 70% 0, rgba(79, 156, 255, .12), transparent 300px),
    var(--bg-deep);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

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

button,
.button-like {
  min-height: 38px;
  border: 1px solid rgba(224, 45, 45, .78);
  border-radius: 6px;
  background: linear-gradient(180deg, #f04444, var(--red-dark));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(224, 45, 45, .18);
}

button:hover,
.button-like:hover {
  filter: brightness(1.06);
}

button.secondary,
.button-like.secondary {
  background: #252a32;
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

i[data-lucide] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  width: 17px;
  height: 17px;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
  font-style: normal;
  font-weight: 800;
  color: currentColor;
  flex: 0 0 auto;
}

i[data-lucide] svg {
  width: 15px;
  height: 15px;
  display: block;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(620px, 1fr) 382px;
}

.sidebar,
.detail-panel {
  background: rgba(18, 20, 24, .96);
  border-color: var(--line);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 14px 0 30px rgba(0, 0, 0, .18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 8px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 82px;
  height: 42px;
  border-radius: 0;
  background: transparent;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 42px;
  object-fit: contain;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.detail-header h2 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.brand p,
.topbar p,
.hint,
.source-note p,
.empty-state span,
.detail-empty,
.eyebrow {
  color: var(--muted);
}

.brand p {
  font-size: 12px;
  margin-top: 4px;
}

.side-section {
  display: grid;
  gap: 9px;
}

.side-section label,
.detail-content > label,
.section-title,
.switch-line {
  font-size: 13px;
  font-weight: 800;
}

.section-title,
.switch-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #12151a;
  color: var(--text);
  border-radius: 6px;
  min-height: 38px;
  padding: 0 11px;
  outline: none;
}

textarea {
  padding: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224, 45, 45, .16);
}

.path-row {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 8px;
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.icon-button.small {
  width: 30px;
  min-height: 30px;
}

.hint,
.source-note p {
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

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

.source-note span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.group-list,
.game-list {
  display: grid;
  gap: 7px;
}

.game-list {
  max-height: 350px;
  overflow-y: auto;
  padding-right: 3px;
}

.group-item,
.game-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  border-radius: 6px;
  padding: 0 10px;
  background: #1d2229;
  color: var(--text);
  border: 1px solid transparent;
  cursor: pointer;
}

.game-item {
  grid-template-columns: 1fr auto;
  min-height: 38px;
  padding-left: 12px;
  font-weight: 800;
}

.group-item:hover,
.game-item:hover {
  background: #272d36;
}

.group-item.active,
.game-item.active {
  border-color: rgba(224, 45, 45, .58);
  background: linear-gradient(90deg, rgba(224, 45, 45, .28), rgba(224, 45, 45, .08));
  color: #fff;
}

.group-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.group-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  padding: 22px;
  background: rgba(17, 19, 22, .72);
}

.topbar {
  min-height: 122px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(224, 45, 45, .34);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(224, 45, 45, .24), rgba(32, 36, 43, .96) 52%),
    linear-gradient(180deg, #252a32, #171a1f);
  box-shadow: var(--shadow);
}

.topbar h2 {
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.topbar p {
  margin-top: 8px;
  font-size: 14px;
}

.top-actions,
.batch-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-guide {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.resource-notice {
  grid-column: 1 / -1;
  min-height: 56px;
  border: 1px solid rgba(214, 164, 83, .36);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(214, 164, 83, .16), rgba(32, 36, 43, .88));
  color: #f5dfb7;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.resource-notice i {
  color: var(--gold);
}

.resource-notice p {
  margin: 0;
  line-height: 1.55;
  font-size: 13px;
}

.quick-step {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #20242b, #171a1f);
  padding: 14px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 4px 10px;
  align-content: start;
}

.quick-step span {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.quick-step strong {
  align-self: center;
}

.quick-step p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.control-band {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 130px 140px 126px auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 27, 32, .94);
}

.search-wrap {
  position: relative;
}

.search-wrap i {
  position: absolute;
  left: 12px;
  top: 11px;
  color: var(--muted);
}

.search-wrap input {
  padding-left: 38px;
}

.drop-zone {
  margin-top: 16px;
  min-height: 78px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #181b20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.drop-zone.dragging {
  border-color: var(--red);
  background: rgba(224, 45, 45, .1);
}

.drop-zone > i {
  width: 28px;
  height: 28px;
  color: var(--red);
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.table-shell {
  margin-top: 16px;
}

.table-head {
  display: none;
}

.mod-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}

.mod-row {
  min-height: 154px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr auto;
  align-items: start;
  gap: 10px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #20242b, #171a1f);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.mod-row:hover {
  border-color: rgba(224, 45, 45, .45);
  transform: translateY(-1px);
}

.game-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(224, 45, 45, .24);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(224, 45, 45, .2), rgba(32, 36, 43, .92));
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.game-divider span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.check-cell {
  display: grid;
  place-items: center;
}

.check-cell input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--red);
}

.mod-row > .check-cell {
  grid-row: 1 / 5;
}

.mod-row.selected {
  background: linear-gradient(180deg, rgba(79, 156, 255, .16), #171a1f);
}

.mod-row.active {
  border-color: rgba(224, 45, 45, .78);
  box-shadow: 0 0 0 2px rgba(224, 45, 45, .18), 0 14px 30px rgba(0, 0, 0, .24);
}

.mod-main {
  min-width: 0;
  grid-column: 2 / 4;
}

.mod-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mod-title button {
  justify-content: flex-start;
  min-height: 28px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
}

.mod-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row {
  grid-column: 2 / 4;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-content: start;
}

.tag {
  border-radius: 4px;
  background: #2a3038;
  border: 1px solid rgba(255, 255, 255, .06);
  padding: 4px 7px;
  font-size: 12px;
  color: #d8dee6;
}

.tag.access-open {
  background: rgba(51, 179, 124, .14);
  color: #8de6bb;
  border-color: rgba(51, 179, 124, .28);
}

.tag.access-direct {
  background: rgba(224, 45, 45, .16);
  color: #ff8d8d;
  border-color: rgba(224, 45, 45, .34);
}

.tag.access-external {
  background: rgba(229, 163, 66, .14);
  color: #ffd18a;
  border-color: rgba(229, 163, 66, .28);
}

.mod-row > span:not(.state-pill) {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.state-pill {
  grid-column: 2;
  width: max-content;
  min-width: 68px;
  text-align: center;
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.state-pill.enabled {
  color: #90f0c4;
  background: rgba(51, 179, 124, .16);
}

.state-pill.disabled {
  color: #ffd18a;
  background: rgba(229, 163, 66, .14);
}

.row-actions {
  grid-column: 3;
  grid-row: 4;
  display: flex;
  gap: 7px;
  justify-self: end;
  align-self: end;
  min-width: 0;
}

.row-actions .icon-button {
  width: 34px;
  min-height: 34px;
}

.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #181b20;
}

.empty-state i {
  width: 42px;
  height: 42px;
  color: var(--line-strong);
}

.detail-panel {
  border-left: 1px solid var(--line);
  padding: 20px 16px;
  min-width: 0;
  box-shadow: -14px 0 30px rgba(0, 0, 0, .18);
}

.detail-empty {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
}

.detail-empty i {
  width: 36px;
  height: 36px;
}

.detail-content {
  display: grid;
  gap: 10px;
}

.detail-header {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 12px;
  align-items: start;
  margin-bottom: 6px;
  padding: 14px;
  border: 1px solid rgba(224, 45, 45, .28);
  border-radius: 8px;
  background: linear-gradient(180deg, #252a32, #181b20);
}

.detail-header h2 {
  font-size: 21px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 5px;
  color: var(--gold);
}

.tool-panel,
.file-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 6px;
  display: grid;
  gap: 10px;
}

.explain-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  background: #15181d;
  border-radius: 8px;
  padding: 12px;
}

.explain-panel div {
  display: grid;
  gap: 3px;
}

.explain-panel span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.explain-panel p {
  margin: 0;
  color: #d1d7df;
  font-size: 13px;
  line-height: 1.58;
}

.usage-steps {
  margin: 0;
  padding-left: 20px;
  color: #d1d7df;
  font-size: 13px;
  line-height: 1.65;
}

.usage-steps li + li {
  margin-top: 4px;
}

.tool-title {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 900;
}

.replace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.replace-grid label {
  font-size: 12px;
  color: var(--muted);
}

.full {
  width: 100%;
}

.preview-list,
.file-list {
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15181d;
}

.preview-item,
.file-item {
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  overflow-wrap: anywhere;
  color: #d3dae2;
}

.preview-item:first-child,
.file-item:first-child {
  border-top: 0;
}

.preview-item strong {
  display: block;
  color: var(--gold);
  margin-top: 3px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 20;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  border-radius: 8px;
  background: #252a32;
  color: #fff;
  padding: 11px 13px;
  box-shadow: var(--shadow);
  font-size: 13px;
  border: 1px solid var(--line);
}

.toast.error {
  background: var(--red-dark);
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
}

.guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .62);
}

.guide-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  background: #181b20;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.guide-header,
.guide-footer {
  padding: 18px;
}

.guide-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  border-bottom: 1px solid var(--line);
}

.guide-header span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.guide-header h2 {
  margin: 3px 0 0;
  font-size: 22px;
}

.guide-body {
  display: grid;
  gap: 0;
}

.guide-body article {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.guide-body article > i {
  width: 28px;
  height: 28px;
  color: var(--red);
  margin-top: 2px;
}

.guide-body h3,
.guide-body p {
  margin: 0;
}

.guide-body h3 {
  font-size: 16px;
}

.guide-body p {
  color: var(--muted);
  line-height: 1.65;
  margin-top: 5px;
}

.guide-footer {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .detail-empty {
    min-height: 180px;
  }
}

@media (max-width: 940px) {
  .app-shell {
    display: block;
  }

  .sidebar,
  .workspace,
  .detail-panel {
    padding: 16px;
  }

  .topbar,
  .control-band {
    display: grid;
  }

  .topbar h2 {
    font-size: 28px;
  }

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

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

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

/* Resource-library mode: keep the page focused on find, download, install. */
.sidebar .side-section:nth-of-type(1),
.sidebar .side-section:nth-of-type(2),
#addGroup,
#stateFilter,
.batch-actions,
#importFolder,
.top-actions .button-like,
.check-cell,
.state-pill,
#toggleCurrent,
#removeMod,
.switch-line,
.detail-content > label,
#detailTitle,
#detailAuthor,
#detailGroup,
#detailTags,
#detailNotes,
.file-panel {
  display: none !important;
}

.app-shell {
  grid-template-columns: 260px minmax(620px, 1fr) 360px;
}

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

.top-actions {
  align-self: flex-start;
}

.quick-guide {
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
}

.control-band {
  grid-template-columns: minmax(260px, 1fr) 150px 170px;
}

.mod-row {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  min-height: 176px;
}

.mod-main,
.tag-row,
.mod-row > span:not(.state-pill),
.row-actions {
  grid-column: 1;
}

.mod-main {
  padding-right: 0;
}

.tag-row {
  min-height: 32px;
}

.row-actions {
  grid-row: auto;
  justify-self: stretch;
  display: grid;
  grid-template-columns: 1fr 38px;
  margin-top: auto;
}

.download-mod {
  min-height: 40px;
  width: 100%;
  font-weight: 900;
}

.download-mod svg {
  width: 17px;
  height: 17px;
}

.view-mod {
  width: 38px;
}

.detail-panel {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow: auto;
}

.detail-header {
  margin-bottom: 4px;
}

.explain-panel {
  margin-top: 6px;
}

#resourceLink {
  min-height: 44px;
  font-weight: 900;
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

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

@media (max-width: 940px) {
  .quick-guide,
  .control-band {
    grid-template-columns: 1fr;
  }
}

/* 18183 resource portal polish */
body {
  background:
    linear-gradient(180deg, rgba(185, 31, 36, .22) 0, rgba(8, 9, 11, .98) 310px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 96px),
    #090a0d;
}

.app-shell {
  grid-template-columns: 236px minmax(640px, 1fr) 330px;
}

.sidebar {
  background: #0f1115;
  padding: 18px 14px;
}

.brand {
  min-height: 64px;
  padding: 8px 6px 16px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: #e02d2d;
  box-shadow: 0 10px 24px rgba(224, 45, 45, .34);
}

.brand h1 {
  font-size: 19px;
}

.game-list,
.group-list {
  gap: 5px;
}

.game-item,
.group-item {
  border-radius: 4px;
  background: transparent;
  border-color: transparent;
  min-height: 38px;
}

.game-item:hover,
.group-item:hover {
  background: #1b1f27;
}

.game-item.active,
.group-item.active {
  background: #e02d2d;
  border-color: #ff5555;
  box-shadow: 0 10px 22px rgba(224, 45, 45, .2);
}

.game-item.active .group-count,
.group-item.active .group-count {
  color: #fff;
}

.workspace {
  padding: 18px 20px;
  background: rgba(10, 12, 16, .74);
}

.topbar {
  position: relative;
  overflow: hidden;
  min-height: 176px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    linear-gradient(90deg, rgba(8, 9, 11, .94) 0, rgba(8, 9, 11, .78) 42%, rgba(8, 9, 11, .34) 100%),
    url("./assets/hero-mod-hub.png") center right / cover no-repeat;
  box-shadow: 0 20px 46px rgba(0, 0, 0, .42);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 4px;
  background: #e02d2d;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar h2 {
  font-size: 40px;
  max-width: 520px;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .75);
}

.topbar p {
  max-width: 560px;
  color: #d7dce3;
}

.top-actions .secondary {
  background: rgba(13, 15, 19, .72);
  border-color: rgba(255, 255, 255, .22);
  backdrop-filter: blur(8px);
}

.quick-guide {
  margin-top: 14px;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.resource-notice,
.quick-step {
  border-radius: 4px;
  background: #151922;
}

.resource-notice {
  grid-column: auto;
  min-height: 92px;
}

.quick-step {
  min-height: 92px;
  padding: 12px;
}

.quick-step span {
  border-radius: 3px;
  background: #e02d2d;
}

.control-band {
  position: sticky;
  top: 0;
  z-index: 6;
  margin-top: 14px;
  border-radius: 4px;
  background: rgba(14, 16, 21, .96);
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}

input,
select,
textarea {
  border-radius: 4px;
  background: #0f1218;
}

.mod-list {
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 14px;
}

.game-divider {
  border-radius: 4px;
  min-height: 42px;
  background: #171b23;
  border-color: rgba(255, 255, 255, .08);
  border-left: 4px solid #e02d2d;
}

.game-divider span:first-child {
  font-size: 16px;
}

.mod-row {
  position: relative;
  overflow: hidden;
  min-height: 188px;
  grid-template-columns: 154px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 0;
  border-radius: 5px;
  background: #151922;
  border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .26);
}

.mod-row:hover {
  border-color: rgba(224, 45, 45, .72);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .36);
}

.mod-row.active {
  border-color: #e02d2d;
  box-shadow: 0 0 0 1px rgba(224, 45, 45, .36), 0 18px 38px rgba(0, 0, 0, .36);
}

.mod-cover {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 100%;
  height: 100%;
  min-height: 188px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .52)),
    var(--cover-image) center / cover no-repeat;
  box-shadow: none;
}

.mod-cover:hover {
  filter: saturate(1.12) brightness(1.08);
}

.mod-main {
  grid-column: 2;
  grid-row: 1;
  padding: 14px 14px 0 0;
}

.mod-title button {
  display: -webkit-box;
  min-height: auto;
  font-size: 16px;
  line-height: 1.38;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mod-title button:hover {
  color: #ff6969;
}

.mod-sub {
  margin-top: 8px;
  font-size: 13px;
  color: #aeb6c3;
  -webkit-line-clamp: 3;
}

.mod-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: #cbd2dc;
  font-size: 12px;
}

.mod-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mod-meta svg {
  width: 14px;
  height: 14px;
  color: #e6ad5f;
}

.tag-row {
  grid-column: 2;
  grid-row: 2;
  padding: 0 224px 14px 0;
  min-height: auto;
}

.tag {
  border-radius: 3px;
  background: #242a34;
}

.row-actions {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  align-self: end;
  width: min(210px, 60%);
  padding: 0 14px 14px 0;
  grid-template-columns: 1fr 36px;
}

.download-mod {
  border-radius: 3px;
  min-height: 38px;
  background: #e02d2d;
  border-color: #ff5757;
}

.view-mod {
  border-radius: 3px;
  min-height: 38px;
}

.detail-panel {
  background: #101217;
  padding: 18px 14px;
}

.detail-header {
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(224, 45, 45, .24), rgba(20, 23, 30, .96)),
    #171b23;
}

.detail-header h2 {
  font-size: 20px;
  line-height: 1.35;
}

.explain-panel {
  border-radius: 5px;
  background: #151922;
}

#resourceLink {
  border-radius: 3px;
  background: #e02d2d;
  border-color: #ff5757;
}

@media (max-width: 1260px) {
  .mod-list {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

@media (max-width: 940px) {
  .topbar {
    min-height: 158px;
  }

  .topbar h2 {
    font-size: 30px;
  }

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

  .mod-row {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .mod-cover {
    min-height: 178px;
  }

  .row-actions {
    width: calc(100% - 14px);
  }

  .tag-row {
    padding-right: 14px;
    padding-bottom: 58px;
  }
}

/* Fix card deformation: stable vertical resource cards. */
.mod-list {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.mod-row {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  height: 388px;
  padding: 0 !important;
  gap: 0;
  overflow: hidden;
}

.mod-cover {
  display: block;
  width: 100%;
  height: 142px;
  min-height: 142px;
  flex: 0 0 142px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .03), rgba(0, 0, 0, .46)),
    var(--cover-image) center / cover no-repeat;
}

.mod-main {
  display: block;
  width: 100%;
  padding: 14px 14px 0 !important;
}

.mod-title button {
  width: 100%;
  text-align: left;
  display: -webkit-box;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mod-sub {
  min-height: 58px;
  -webkit-line-clamp: 3;
}

.mod-meta {
  min-height: 20px;
}

.tag-row {
  display: flex !important;
  width: 100%;
  padding: 10px 14px 0 !important;
  gap: 6px;
  min-height: 34px;
  overflow: hidden;
}

.tag {
  max-width: 118px;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-actions {
  display: grid !important;
  grid-template-columns: 1fr 38px;
  gap: 8px;
  width: 100%;
  margin-top: auto;
  padding: 12px 14px 14px !important;
}

.download-mod,
.view-mod {
  position: static;
}

.download-mod {
  width: 100%;
}

.mod-row > .check-cell,
.mod-row > span.state-pill {
  display: none !important;
}

@media (min-width: 1500px) {
  .mod-list {
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  }
}

@media (max-width: 940px) {
  .mod-row {
    height: auto;
    min-height: 360px;
  }

  .mod-cover {
    height: 136px;
    min-height: 136px;
    flex-basis: 136px;
  }
}

/* 18183 portal layout: top navigation, hero, card grid, right detail. */
body {
  background: #0b0d11;
}

.app-shell {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "nav nav"
    "main detail";
  gap: 0;
}

.sidebar {
  grid-area: nav;
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 68px;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: rgba(17, 19, 24, .98);
  border-right: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

.brand {
  flex: 0 0 auto;
  min-height: 68px;
  padding: 0 18px 0 0;
  border-bottom: 0;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
  width: 38px;
  height: 38px;
}

.brand h1 {
  font-size: 18px;
}

.brand p {
  display: none;
}

.sidebar .side-section {
  min-width: 0;
}

.sidebar .side-section:nth-of-type(3) {
  flex: 1 1 auto;
  display: block;
}

.sidebar .side-section:nth-of-type(3) .section-title {
  display: none;
}

.sidebar .side-section:nth-of-type(4),
.source-note {
  display: none !important;
}

.game-list {
  display: flex;
  gap: 4px;
  max-height: none;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: thin;
}

.game-item {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 3px;
  background: transparent;
  color: #d9dfe8;
}

.game-item.active {
  background: #e02d2d;
}

.group-count {
  opacity: .78;
}

.workspace {
  grid-area: main;
  min-width: 0;
  padding: 18px;
}

.detail-panel {
  grid-area: detail;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  max-height: calc(100vh - 68px);
  overflow: auto;
  border-left: 1px solid rgba(255, 255, 255, .08);
}

.topbar {
  min-height: 230px;
  align-items: flex-end;
  padding: 28px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, .98) 0, rgba(5, 7, 10, .88) 35%, rgba(5, 7, 10, .48) 68%, rgba(5, 7, 10, .12) 100%),
    linear-gradient(180deg, rgba(5, 7, 10, .06), rgba(5, 7, 10, .42)),
    url("./assets/hero-mod-hub.png") center right / cover no-repeat;
}

.topbar h2 {
  font-size: 42px;
  max-width: 760px;
}

.topbar::after {
  left: 0;
  right: 0;
}

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

.resource-notice,
.quick-step {
  min-height: 86px;
}

.control-band {
  top: 68px;
  border-radius: 0;
  margin-top: 16px;
}

.mod-list {
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 14px;
}

.game-divider {
  margin-top: 4px;
  border-radius: 0;
}

.game-divider-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-game-section {
  min-height: 30px;
  border-radius: 3px;
  padding: 0 10px;
  background: #242a34;
  border-color: rgba(255, 255, 255, .12);
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

.toggle-game-section:hover {
  background: #e02d2d;
}

.mod-row {
  height: 350px;
  border-radius: 0;
  background: #151922;
}

.mod-cover {
  height: 124px;
  min-height: 124px;
  flex-basis: 124px;
}

.mod-main {
  padding: 12px 12px 0 !important;
  flex: 0 0 126px;
  min-height: 0;
  overflow: hidden;
}

.mod-title button {
  font-size: 15px;
  min-height: 42px;
  max-height: 42px;
  word-break: break-word;
}

.mod-sub {
  display: -webkit-box !important;
  margin-top: 8px;
  min-height: 38px;
  max-height: 38px;
  color: #aeb6c3;
  font-size: 12px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mod-meta {
  margin-top: 9px;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
  min-height: 20px;
}

.tag-row {
  padding: 6px 12px 0 !important;
  flex: 0 0 32px;
  align-items: flex-start;
}

.tag {
  max-width: 100%;
}

.row-actions {
  padding: 8px 12px 12px !important;
  flex: 0 0 56px;
}

.download-mod {
  min-height: 36px;
}

.detail-panel {
  overflow-x: hidden;
}

.detail-panel *,
.detail-header,
.detail-header h2,
.detail-content,
.explain-panel,
.explain-panel div,
.explain-panel p,
.usage-steps,
.usage-steps li,
#resourceLink {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.detail-header h2 {
  display: block;
  white-space: normal;
}

.explain-panel {
  overflow: hidden;
}

.usage-steps {
  padding-left: 18px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nav"
      "main"
      "detail";
  }

  .detail-panel {
    position: static;
    height: auto;
    max-height: none;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
}

@media (max-width: 940px) {
  .sidebar {
    position: static;
    flex-wrap: wrap;
    height: auto;
    padding: 10px;
  }

  .brand {
    min-height: 48px;
  }

  .quick-guide,
  .control-band {
    grid-template-columns: 1fr;
  }

  .topbar {
    min-height: 180px;
    padding: 20px;
  }

  .topbar h2 {
    font-size: 30px;
  }
}

/* Hot game carousel */
.topbar {
  background:
    linear-gradient(90deg, rgba(5, 7, 10, .98) 0, rgba(5, 7, 10, .88) 35%, rgba(5, 7, 10, .48) 68%, rgba(5, 7, 10, .12) 100%),
    linear-gradient(180deg, rgba(5, 7, 10, .06), rgba(5, 7, 10, .42)),
    url("./assets/hero-mod-hub.png") center right / cover no-repeat;
  isolation: isolate;
}

.hero-carousel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 4px;
  width: min(48%, 540px);
  z-index: 1;
  overflow: hidden;
  border-right: 1px solid rgba(224, 45, 45, .28);
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  opacity: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(1.08) contrast(1.08) brightness(1.12);
  box-shadow: none;
  cursor: pointer;
  transform: scale(1.03);
  transition: opacity .55s ease, transform 6s ease;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, .42) 0, rgba(5, 7, 10, .24) 52%, rgba(5, 7, 10, .60) 100%),
    linear-gradient(180deg, rgba(5, 7, 10, .02), rgba(5, 7, 10, .36));
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-slide-text {
  position: absolute;
  left: 26px;
  right: 24px;
  top: 26px;
  bottom: auto;
  bottom: auto;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 5px;
  max-width: 410px;
  text-align: left;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .82);
}

.hero-slide-text strong {
  font-size: 22px;
  line-height: 1.2;
  text-shadow: 0 3px 14px rgba(0, 0, 0, .9);
}

.hero-slide-text em,
.hero-slide-text small {
  display: block;
  max-width: 100%;
  font-style: normal;
  color: rgba(236, 240, 245, .9);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hero-slide-text small {
  color: #ffd9d9;
  font-weight: 700;
}

.hero-copy,
.top-actions,
.hero-dots {
  position: relative;
  z-index: 3;
}

.hero-copy {
  position: absolute;
  left: 60%;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  bottom: auto;
  max-width: none;
}

.top-actions {
  position: absolute;
  top: 28px;
  right: 28px;
  z-index: 4;
}

.topbar h2 {
  white-space: nowrap;
  font-size: clamp(34px, 3.1vw, 48px);
  text-align: left;
}

.hero-copy p {
  display: none;
}

.topbar::after {
  z-index: 3;
}

.hero-dots {
  position: absolute;
  left: 28px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-dots button {
  width: 26px;
  height: 4px;
  min-height: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, .32);
  box-shadow: none;
}

.hero-dots button.active {
  background: #e02d2d;
}

@media (max-width: 940px) {
  .hero-carousel {
    left: 20px;
    right: 20px;
    top: 0;
    bottom: 4px;
  }

  .hero-copy {
    left: 20px;
    right: 20px;
    bottom: 56px;
    width: auto;
    max-width: none;
  }

  .hero-slide-text {
    left: 20px;
    right: 20px;
    top: 18px;
    max-width: 70%;
  }

  .hero-slide-text strong {
    font-size: 16px;
  }

  .hero-slide-text em {
    display: none;
  }

  .hero-dots {
    left: 20px;
    bottom: 12px;
  }
}

/* Use the local 18183 logo asset in the sidebar brand. */
.brand {
  gap: 10px;
}

.brand-mark {
  width: 86px !important;
  height: 44px !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible;
}

.brand-mark img {
  display: block;
  width: 86px;
  height: auto;
  max-height: 44px;
  object-fit: contain;
}

.brand-mark span {
  display: none;
}

.brand h1 {
  font-size: 18px;
  white-space: nowrap;
}

/* Richer card chips without changing the card footprint. */
.tag-row {
  flex: 0 0 38px !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  overflow: hidden;
}

.tag {
  min-height: 23px;
  max-width: 100%;
  padding: 3px 7px !important;
  border-radius: 3px;
  background: #222832;
  color: #eef3f8;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
