:root {
  --bg: #070707;
  --bg-soft: rgba(11, 11, 14, 0.96);
  --panel: rgba(12, 12, 15, 0.94);
  --line: rgba(255, 194, 20, 0.18);
  --line-strong: rgba(255, 194, 20, 0.42);
  --text: #f3f0e7;
  --muted: #8b877d;
  --accent: #f0bd15;
  --accent-soft: rgba(240, 189, 21, 0.1);
  --cool: #434149;
  --danger: #ff4d6d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.44);
  --radius: 22px;
  --radius-sm: 16px;
  --font-display: "Bahnschrift", "Segoe UI", sans-serif;
  --font-body: "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(240, 189, 21, 0.08), transparent 25%),
    linear-gradient(180deg, #0a0a0b 0%, #070707 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.32;
}

.theme-cyber {
  color: var(--text);
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 34px;
}

.hero,
.panel-heading,
.field,
.editor-toolbar,
.editor-actions,
.hero-meta,
.hero-actions,
.detail-topline,
.tag-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero {
  border-radius: 28px;
  padding: 28px 30px;
  margin-bottom: 22px;
  justify-content: space-between;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 8px;
  color: #6f695a;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
}

h1,
h2,
h3,
strong {
  margin: 0;
  font-family: var(--font-display);
}

h1 {
  font-size: clamp(32px, 3.8vw, 54px);
  line-height: 1.08;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 15px;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-copy {
  max-width: 720px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 194, 20, 0.2);
  background: rgba(255, 194, 20, 0.06);
  color: var(--text);
  font-size: 13px;
}

.chip-accent {
  background: rgba(255, 194, 20, 0.14);
  border-color: rgba(255, 194, 20, 0.32);
}

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

button {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 16px;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  color: #ddd7ca;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.primary-button {
  color: #140c00;
  background: linear-gradient(135deg, #ffd155, #f0bd15);
  box-shadow: 0 12px 30px rgba(240, 189, 21, 0.22);
}

.danger-button {
  color: #fff3f6;
  background: rgba(255, 77, 109, 0.18);
  border: 1px solid rgba(255, 77, 109, 0.3);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 13, 0.95);
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(240, 189, 21, 0.42);
}

.field {
  flex-direction: column;
  margin-bottom: 14px;
}

.field span,
.legend-title {
  font-size: 13px;
  color: var(--text);
}

.editor-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  color: #ddd7ca;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nexus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 22px;
  align-items: start;
}

.nexus-form-panel,
.nexus-result-panel {
  border-radius: var(--radius-sm);
  padding: 20px;
}

.checkbox-field {
  justify-content: flex-start;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
}

.inline-check input {
  width: auto;
}

.nexus-results {
  display: grid;
  gap: 12px;
}

.nexus-cookie-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nexus-cookie-box summary {
  cursor: pointer;
  color: var(--text);
}

.nexus-cookie-box .field {
  margin-top: 12px;
  margin-bottom: 0;
}

.batch-progress {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.batch-progress[hidden] {
  display: none;
}

.batch-progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.batch-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0bd15, #53c6ff);
  transition: width 180ms ease;
}

.nexus-result {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nexus-result-review {
  display: block;
}

.nexus-result-error {
  display: block;
  border-color: rgba(255, 77, 109, 0.36);
  background: rgba(255, 77, 109, 0.08);
}

.nexus-result-body {
  display: grid;
  gap: 8px;
}

.nexus-image-review {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.nexus-image-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.nexus-image-option input {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  width: 18px;
  height: 18px;
}

.nexus-image-option img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.nexus-image-option input:not(:checked) + img {
  opacity: 0.38;
  filter: grayscale(1);
}

.nexus-result > img,
.nexus-result-placeholder {
  width: 92px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.nexus-result a {
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 900px) {
  .nexus-layout {
    grid-template-columns: 1fr;
  }
}

.panel-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.editor-list,
.viewer-sections {
  display: grid;
  gap: 18px;
}

.editor-list {
  max-height: 70vh;
  overflow: auto;
  padding-right: 4px;
}

.editor-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.editor-item.active {
  border-color: rgba(240, 189, 21, 0.4);
  background: rgba(240, 189, 21, 0.08);
}

.vehicle-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.field-wide {
  grid-column: 1 / -1;
}

.empty-state {
  border-radius: 18px;
  padding: 18px;
  border: 1px dashed rgba(255, 194, 20, 0.22);
  color: var(--muted);
}

.image-upload-block {
  display: grid;
  gap: 12px;
}

.image-preview {
  min-height: 220px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 194, 20, 0.12);
  background: linear-gradient(140deg, rgba(255, 194, 20, 0.08), rgba(255, 255, 255, 0.04));
  color: var(--muted);
  position: relative;
}

.image-preview img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.preview-count,
.art-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-width: 56px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 10, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3f0e7;
  font-size: 12px;
  z-index: 2;
}

.image-upload-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.category-editor {
  display: grid;
  gap: 14px;
}

.category-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.category-help {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.category-list {
  display: grid;
  gap: 12px;
}

.category-image-block .image-preview {
  min-height: 130px;
}

.category-image-preview img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  display: block;
}

.category-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.category-row.is-dragging {
  opacity: 0.45;
}

.category-row.is-drop-target {
  border-color: rgba(240, 189, 21, 0.36);
  background: rgba(240, 189, 21, 0.08);
}

.category-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  color: #b9b29f;
  background: rgba(255, 255, 255, 0.03);
  cursor: grab;
  user-select: none;
}

.viewer-page {
  background: #050505;
}

.viewer-shell {
  width: min(1740px, calc(100% - 36px));
  margin: 0 auto;
  padding: 20px 0 32px;
  display: block;
  position: relative;
}

.viewer-rail {
  position: fixed;
  left: 14px;
  top: 18px;
  bottom: 18px;
  width: 274px;
  padding: 16px 0;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background:
    linear-gradient(180deg, rgba(11, 11, 14, 0.99), rgba(7, 7, 9, 0.99));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(calc(-100% - 18px));
  transition: transform 180ms ease;
  z-index: 25;
  overflow: auto;
}

.viewer-rail.is-open {
  transform: translateX(0);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  align-items: stretch;
}

.rail-fab {
  position: fixed;
  left: 14px;
  top: 24px;
  z-index: 26;
  width: 46px;
  min-height: 72px;
  padding: 0;
  border-radius: 16px;
  background: rgba(15, 15, 18, 0.96);
  border: 1px solid rgba(240, 189, 21, 0.16);
  color: var(--accent);
  letter-spacing: 0.16em;
  font-weight: 700;
  writing-mode: vertical-rl;
  text-orientation: upright;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.rail-link {
  width: 100%;
  min-height: 56px;
  padding: 12px 12px 12px 18px;
  border-radius: 0;
  background: transparent;
  color: #9c9992;
  border: 0;
  font-size: 16px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}

.rail-link:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.02);
}

.rail-link.is-active {
  color: #ffd55f;
  background: rgba(240, 189, 21, 0.1);
  box-shadow: inset 0 0 0 1px rgba(240, 189, 21, 0.06);
}

.rail-link-text {
  text-align: left;
}

.rail-link-text-only {
  flex: 1;
  font-size: 15px;
  line-height: 1.4;
}

.rail-link-count {
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(50, 50, 58, 0.72);
  color: #8f8d99;
  font-size: 14px;
  font-weight: 600;
}

.rail-link.is-active .rail-link-count {
  background: rgba(42, 40, 55, 0.95);
  color: #d1c9f6;
}

.rail-link-icon,
.vehicle-group-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.rail-link-icon img,
.vehicle-group-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  mix-blend-mode: normal;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.24));
}

.viewer-main {
  min-width: 0;
  margin-left: 0;
}

.viewer-hero {
  position: relative;
  overflow: hidden;
  padding: 54px 40px 74px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background:
    radial-gradient(circle at 78% 50%, rgba(255, 194, 20, 0.06), transparent 22%),
    linear-gradient(180deg, rgba(13, 13, 15, 0.98), rgba(10, 10, 12, 0.98));
  text-align: center;
}

.viewer-kicker {
  color: #4f4a41;
  letter-spacing: 0.55em;
  font-size: 13px;
  margin-bottom: 14px;
}

.viewer-hero h1 {
  font-size: clamp(42px, 4vw, 72px);
  letter-spacing: 0.04em;
}

.viewer-subtitle {
  margin-top: 18px;
  color: var(--accent);
  font-size: 18px;
  letter-spacing: 0.32em;
}

.viewer-note {
  margin-top: 8px;
  color: #5f5a4d;
  font-size: 16px;
}

.viewer-brand-row {
  position: absolute;
  right: 36px;
  bottom: 34px;
  display: flex;
  gap: 18px;
  align-items: center;
}

.viewer-brand {
  color: #0f95d4;
  font-size: 28px;
  font-weight: 700;
}

.viewer-brand-light {
  color: #d6d1c4;
}

.viewer-search-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 1px solid rgba(240, 189, 21, 0.08);
}

.viewer-search-bar input {
  height: 40px;
  border-radius: 999px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: #d9d2c7;
}

.viewer-search-bar input::placeholder {
  color: #5b574d;
}

.viewer-clear {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.viewer-content {
  position: relative;
  overflow: hidden;
  padding: 26px 34px 40px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.viewer-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.vehicle-group {
  position: relative;
  z-index: 1;
}

.vehicle-group + .vehicle-group {
  margin-top: 28px;
}

.vehicle-group-header {
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 18px;
}

.vehicle-group-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vehicle-group-title h2 {
  font-size: 30px;
  letter-spacing: 0.04em;
}

.rail-type-muscle {
  color: #ff7a1a;
}

.rail-type-super {
  color: #53c6ff;
}

.rail-type-offroad {
  color: #ffd447;
}

.rail-type-classic {
  color: #d8c3a5;
}

.rail-type-pickup {
  color: #8cff65;
}

.rail-type-default {
  color: #f0bd15;
}

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

.gallery-card {
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 189, 21, 0.36);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.28);
}

.gallery-art,
.viewer-modal-art {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(255, 194, 20, 0.12), rgba(255, 255, 255, 0.06)),
    linear-gradient(120deg, #121212, #090909);
}

.gallery-art {
  aspect-ratio: 1.45 / 1;
}

.gallery-caption {
  padding: 14px 18px 16px;
  background: #121216;
}

.gallery-caption strong {
  display: block;
  font-size: 20px;
  color: #f3f0e7;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 22px;
}

.load-more-button {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(240, 189, 21, 0.28);
  background: rgba(240, 189, 21, 0.12);
  color: #f3f0e7;
  font-weight: 800;
}

.load-more-button:hover {
  border-color: rgba(240, 189, 21, 0.5);
  background: rgba(240, 189, 21, 0.2);
}

.art-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end start;
  padding: 16px;
}

.art-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.12), transparent 15%),
    linear-gradient(120deg, transparent 24%, rgba(255, 255, 255, 0.06) 50%, transparent 76%);
}

.art-fallback img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 420ms ease;
}

.art-fallback img.is-active {
  opacity: 1;
}

.art-fallback strong {
  position: relative;
  z-index: 1;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.viewer-modal.hidden {
  display: none;
}

.viewer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.viewer-modal-card {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(240, 189, 21, 0.2);
  background: rgba(11, 11, 13, 0.98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.viewer-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
}

.viewer-modal-art {
  height: 420px;
}

.viewer-modal-body {
  padding: 22px;
}

.detail-summary {
  margin-top: 14px;
  margin-bottom: 18px;
  font-size: 16px;
}

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

.spec-item {
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spec-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.detail-section + .detail-section {
  margin-top: 16px;
}

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

@media (max-width: 1200px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .viewer-shell {
    width: min(100% - 18px, 100%);
  }

  .viewer-rail {
    width: min(274px, calc(100vw - 32px));
  }

  .rail-nav {
    flex-direction: column;
  }

  .rail-fab {
    width: 40px;
    min-height: 64px;
  }

  .rail-link {
    min-height: 52px;
  }

  .viewer-hero {
    padding: 34px 18px 88px;
  }

  .viewer-brand-row {
    left: 18px;
    right: auto;
    bottom: 18px;
  }

  .gallery-grid,
  .vehicle-form .form-grid,
  .spec-grid {
    grid-template-columns: 1fr;
  }
}
