:root {
  --bg-top: #364153;
  --bg-mid: #132034;
  --bg-bottom: #03070f;
  --panel-border: rgba(216, 195, 128, 0.24);
  --panel-border-strong: rgba(216, 195, 128, 0.44);
  --panel-bg: linear-gradient(180deg, rgba(255, 244, 200, 0.06), transparent 28%),
    linear-gradient(90deg, rgba(30, 42, 62, 0.96), rgba(17, 25, 39, 0.94) 52%, rgba(8, 14, 24, 0.96));
  --text: #f1ead6;
  --muted: #a9b2c4;
  --gold: #f4dd98;
  --line: rgba(221, 197, 125, 0.18);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Serif SC", serif;
  background:
    linear-gradient(180deg, rgba(95, 121, 165, 0.12), transparent 18%),
    linear-gradient(180deg, rgba(10, 18, 32, 0.92), rgba(4, 7, 14, 0.98));
}

body.modal-open {
  overflow: hidden;
}

body::before {
  z-index: -1;
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 225, 145, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(7, 12, 22, 0.5), rgba(4, 7, 14, 0.9) 42%, rgba(3, 5, 10, 0.96)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(0deg, transparent, transparent 43px, rgba(221, 197, 125, 0.04) 44px);
  opacity: 0.96;
}

body::after {
  z-index: -2;
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 12, 22, 0.18), rgba(7, 12, 22, 0.26)),
    url("https://imgs.gamersky.com/upimg/new_preview/2026/03/10/origin_202603101600024738.jpg")
      center top / cover no-repeat;
  transform: scale(1.03);
  transform-origin: top center;
  filter: saturate(0.88) brightness(0.68);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.app-header {
  display: none;
}

.list-page,
.detail-shell {
  display: grid;
  gap: 8px;
}

.panel,
.toolbar,
.deck-card {
  position: relative;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}

.panel::before,
.toolbar::after,
.deck-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(216, 195, 128, 0.08);
  pointer-events: none;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  height: 44px;
  border: 1px solid rgba(216, 195, 128, 0.24);
  background: rgba(7, 12, 21, 0.9);
}

.search-icon {
  color: #cfc8b2;
  font-size: 1.1rem;
}

.searchbox input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.toolbar-side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.toolbar-button,
.back-link {
  color: #ddd8c8;
  text-decoration: none;
  font: inherit;
}

.toolbar-button {
  height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(216, 195, 128, 0.18);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease;
}

.toolbar-button:hover {
  border-color: var(--panel-border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.toolbar-button strong,
.app-badge,
.accent-text {
  color: var(--gold);
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
}

.toolbar-button-active {
  border-color: var(--panel-border-strong);
}

.list-meta,
.deck-foot,
.deck-foot-left,
.detail-meta,
.detail-author-row,
.detail-header-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.list-meta {
  justify-content: flex-start;
  color: var(--muted);
  padding: 0 4px;
  font-size: 0.96rem;
  display: none;
}

.deck-list {
  display: grid;
  gap: 6px;
}

.deck-card {
  border-radius: 10px;
  padding: 25px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.deck-card:hover,
.deck-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--panel-border-strong);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
}

.deck-card:focus-visible,
.toolbar-button:focus-visible,
.searchbox:focus-within,
.resource-link:focus-visible,
.back-link:focus-visible {
  outline: 2px solid rgba(244, 221, 152, 0.75);
  outline-offset: 2px;
}

.deck-card-main {
  display: grid;
  gap: 15px;
}

.deck-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 16px;
}

.deck-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.deck-meta-top {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 4px;
  min-width: 112px;
  text-align: right;
}

.deck-author {
  color: #aeb7c6;
  font-size: 0.84rem;
}

.deck-class-inline,
.deck-author-inline {
  display: none;
}

.deck-card h3,
.detail-header h1,
.app-header h1 {
  margin: 0;
}

.deck-card-title {
  display: grid;
  gap: 15px;
}

.deck-card h3 {
  font-size: 1.18rem;
}

.deck-card p,
.detail-summary,
.strategy-box,
.detail-empty,
.app-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.38;
}

.deck-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.group-label,
.section-kicker,
.skill-label,
.app-brand {
  display: block;
  color: var(--gold);
  font-family: "Orbitron", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tag-row,
.resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.key-card-row {
  display: flex;
  width: 100%;
  gap: 10px;
  justify-content: flex-start;
}

.mini-tag,
.resource-link,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid rgba(216, 195, 128, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-decoration: none;
}

.mini-tag {
  color: #d6dded;
  font-size: 0.84rem;
}

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

.pill {
  color: var(--gold);
  font-family: "Orbitron", sans-serif;
  font-size: 0.7rem;
}

.pill.mode {
  color: #b9cff4;
}

.deck-foot {
  justify-content: flex-start;
  font-size: 0.84rem;
  color: #aeb7c6;
}

.deck-foot-left {
  gap: 12px;
}

.detail-topbar {
  margin-bottom: 6px;
}

.panel.detail-page {
  padding: 20px;
}

.detail-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 15px;
}

.detail-header h1 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.detail-section {
  padding: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.detail-section-wide {
  grid-column: 1 / -1;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.strategy-box {
  padding-left: 14px;
  border-left: 3px solid rgba(221, 197, 125, 0.45);
}

.empty-state,
.detail-empty {
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.filter-modal[hidden] {
  display: none;
}

.filter-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.filter-dialog {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 72px auto 0;
  padding: 22px 22px 18px;
  border: 1px solid rgba(216, 195, 128, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 244, 200, 0.04), transparent 24%),
    linear-gradient(180deg, rgba(7, 10, 16, 0.98), rgba(7, 10, 16, 0.96));
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.48);
}

.filter-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.filter-dialog-head h2,
.filter-section-title {
  margin: 0;
}

.filter-dialog-actions {
  display: flex;
  gap: 12px;
}

.dialog-button {
  min-width: 76px;
  height: 32px;
  border: 0;
  color: #f4ecce;
  font: inherit;
  cursor: pointer;
}

.dialog-button-secondary {
  background: rgba(139, 127, 75, 0.4);
}

.dialog-button-primary {
  background: #8d6d26;
}

.filter-section {
  display: grid;
  gap: 14px;
}

.filter-section-title {
  font-size: 1.05rem;
}

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

.filter-option {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 195, 128, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.filter-option:hover,
.filter-option-active {
  border-color: rgba(216, 195, 128, 0.32);
  background: linear-gradient(180deg, rgba(157, 125, 48, 0.3), rgba(255, 255, 255, 0.06));
  color: var(--gold);
}

.filter-option-disabled,
.filter-option:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  color: #8e97a8;
}

.filter-option-disabled:hover,
.filter-option:disabled:hover {
  border-color: rgba(216, 195, 128, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #8e97a8;
}

.detail-stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.detail-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.detail-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.detail-row h3 {
  margin: 0;
  font-size: 1.02rem;
  text-align: left;
}

.detail-row-content {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  text-align: right;
}

.detail-key-cards {
  gap: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.key-card-unit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.key-card-unit-compact {
  gap: 5px;
}

.key-card-link {
  width: 86px;
  padding: 6px 6px 7px;
  min-height: auto;
  justify-content: center;
}

.key-card-link-static {
  cursor: default;
}

.key-card-media {
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-card-media-vertical {
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.key-card-image {
  width: 72px;
  height: 100px;
  object-fit: cover;
  border: 1px solid rgba(216, 195, 128, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.key-card-image-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.key-card-info {
  display: grid;
  gap: 4px;
  text-align: right;
}

.key-card-info-center {
  width: 100%;
  text-align: center;
}

.key-card-name {
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.25;
  word-break: break-all;
}

.key-card-count {
  color: var(--gold);
  font-family: "Orbitron", sans-serif;
  font-size: 0.8rem;
}

.key-card-count-outside {
  white-space: nowrap;
  align-self: center;
  font-size: 0.82rem;
}

.detail-row-text {
  display: block;
}

.detail-row .strategy-box {
  width: 100%;
  text-align: right;
  padding-left: 0;
  border-left: 0;
}

.detail-row-cards {
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.detail-row-cards .detail-row-content {
  justify-content: flex-end;
  text-align: right;
  align-self: start;
  margin-top: -23px;
}

.deck-skill-row {
  display: grid;
  gap: 15px;
}

.deck-skill-row .skill-label {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
}

.detail-row-strategy {
  grid-template-columns: 168px minmax(0, 1fr);
}

@media (max-width: 820px) {
  body {
    font-size: 80%;
  }

  body::after {
    background:
      linear-gradient(180deg, rgba(7, 12, 22, 0.16), rgba(7, 12, 22, 0.32)),
      url("https://imgs.gamersky.com/upimg/new_preview/2026/03/10/origin_202603101600024738.jpg")
        center top / cover no-repeat;
    transform: scale(1.06);
  }

  .page-shell {
    width: 100%;
    padding: 0 0 calc(24px + env(safe-area-inset-bottom));
  }

  .app-header {
    display: block;
    padding: calc(18px + env(safe-area-inset-top)) 20px 12px;
    background: linear-gradient(180deg, rgba(9, 13, 22, 0.96), rgba(9, 13, 22, 0.82));
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
  }

  .app-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .app-badge {
    margin-left: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
  }

  .app-header h1 {
    margin: 12px 0 6px;
    font-size: 2rem;
  }

  .list-page,
  .detail-shell {
    gap: 10px;
    padding: 14px 14px 0;
  }

  .toolbar {
    padding: 10px;
    border-radius: 22px;
    background: rgba(12, 18, 30, 0.72);
  }

  .toolbar::after,
  .panel::before,
  .deck-card::before {
    display: none;
  }

  .toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .toolbar-side {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
  }

  .toolbar-button {
    height: 36px;
    padding: 0 8px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.84rem;
  }

  .deck-card {
    border-radius: 24px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(27, 37, 57, 0.92), rgba(13, 18, 31, 0.95));
    border-color: rgba(255, 255, 255, 0.07);
  }

  .deck-card-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .deck-meta-top {
    display: none;
  }

  .deck-title-row {
    align-items: center;
    gap: 6px;
  }

  .deck-class-inline,
  .deck-author-inline {
    display: inline-flex;
  }

  .deck-class-inline {
    color: var(--gold);
  }

  .deck-author-inline {
    margin-left: auto;
    color: #aeb7c6;
    font-size: 0.82rem;
    line-height: 1;
  }

  .deck-card h3 {
    font-size: 1.1rem;
  }

  .list-meta {
    display: none;
  }

  .detail-topbar {
    padding: calc(12px + env(safe-area-inset-top)) 16px 0;
  }

  .panel.detail-page {
    border-radius: 28px 28px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(17, 24, 38, 0.98), rgba(8, 13, 22, 0.98));
  }

  .detail-page {
    padding: 18px 16px calc(32px + env(safe-area-inset-bottom));
  }

  .detail-header h1 {
    font-size: 2rem;
  }

  .detail-header {
    gap: 15px;
    padding-bottom: 15px;
  }

  .detail-header h1 {
    margin-top: 0;
  }

  .detail-meta {
    gap: 8px;
  }

  .empty-state,
  .detail-empty {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
  }

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

  .detail-row-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-row-cards h3 {
    margin-bottom: 15px;
  }

  .detail-row-cards .detail-row-content {
    justify-content: flex-start;
    text-align: left;
  }

  .detail-row-strategy {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .detail-row-strategy .detail-row-content {
    justify-content: flex-start;
    text-align: left;
  }

  .detail-row-strategy .strategy-box {
    text-align: left;
  }

  .key-card-link {
    width: 100%;
    padding: 4px 4px 6px;
  }

  .key-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 0.72;
  }

  .key-card-row,
  .detail-key-cards {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
  }

  .key-card-unit,
  .key-card-unit-compact {
    width: 100%;
    min-width: 0;
    gap: 3px;
  }

  .key-card-name {
    font-size: 0.71rem;
  }

  .key-card-count-outside {
    font-size: 0.63rem;
  }

  .filter-dialog {
    width: calc(100% - 18px);
    margin-top: 96px;
    padding: 18px 14px 14px;
    border-radius: 24px;
  }

  .filter-dialog-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-dialog-actions {
    width: 100%;
    justify-content: flex-end;
  }

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

  .filter-option {
    min-height: 40px;
    border-radius: 14px;
  }
}
