:root {
  --blue: #1677ff;
  --blue-strong: #0b63df;
  --navy: #0b1f4d;
  --orange: #ff9f1c;
  --line: #dce7f7;
  --text: #172033;
  --muted: #667085;
  --panel: rgba(255, 255, 255, 0.95);
  --shadow: 0 16px 46px rgba(18, 54, 112, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 10% 10%, rgba(22, 119, 255, 0.18), transparent 380px),
    radial-gradient(circle at 88% 6%, rgba(255, 159, 28, 0.16), transparent 330px),
    linear-gradient(135deg, #edf4ff 0%, #f7faff 44%, #fff8ed 100%);
}

html {
  scroll-behavior: smooth;
}

button,
select,
input {
  font: inherit;
}

.page-shell {
  width: min(1500px, calc(100% - 44px));
  margin: 24px auto 56px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  min-height: 188px;
  overflow: hidden;
  padding: 30px 54px;
  border-radius: 26px;
  color: #fff;
  background:
    linear-gradient(126deg, rgba(255, 159, 28, 0.96) 0 12px, transparent 13px 100%),
    radial-gradient(circle at 90% 2%, rgba(255, 176, 32, 0.30) 0 74px, transparent 75px),
    linear-gradient(118deg, #071b55 0%, #095be8 48%, #238cff 100%);
  box-shadow: 0 24px 60px rgba(11, 70, 175, 0.26);
}

.hero h1 {
  margin: 0;
  font-size: 58px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 900;
  text-shadow: 0 6px 18px rgba(0, 30, 100, 0.24);
}

.hero p {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding: 8px 16px 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.10);
}

.hero p::before {
  content: "";
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: var(--orange);
}

.hero-visual {
  position: relative;
  height: 130px;
}

.paper {
  position: absolute;
  width: 88px;
  height: 110px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f1f7ff, #bdd8ff);
  box-shadow: 0 20px 32px rgba(0, 48, 130, 0.16);
}

.paper-a {
  left: 24px;
  top: 8px;
  transform: rotate(-8deg);
}

.paper-b {
  right: 46px;
  top: 18px;
  transform: rotate(7deg);
}

.ribbon {
  position: absolute;
  left: 82px;
  top: 74px;
  width: 120px;
  height: 8px;
  border-radius: 999px;
  background: var(--orange);
  transform: rotate(-14deg);
}

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

.quick-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 70px;
  padding: 16px 18px;
  border: 1px solid rgba(198, 216, 242, 0.92);
  border-radius: 18px;
  color: var(--navy);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(18, 54, 112, 0.08);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.quick-nav a:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 119, 255, 0.55);
  box-shadow: 0 18px 34px rgba(18, 54, 112, 0.13);
}

.quick-nav span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  background: linear-gradient(180deg, #2687ff 0%, var(--blue-strong) 100%);
}

.quick-nav strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.stats,
.filters,
.module-filters,
.admin-panel,
.content-section {
  border: 1px solid rgba(198, 216, 242, 0.92);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 24px;
}

.stat-card {
  min-height: 96px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.7);
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.stat-card strong {
  display: block;
  color: var(--navy);
  font-size: 24px;
  line-height: 1.25;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 132px;
  gap: 16px;
  align-items: end;
  margin-top: 24px;
  padding: 20px;
}

.filters label span {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 850;
}

.filters select {
  width: 100%;
  height: 48px;
  border: 1px solid #bfd4f5;
  border-radius: 14px;
  outline: none;
  padding: 0 12px;
  color: #111827;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.filters select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12);
}

.module-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 96px;
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
  padding: 16px;
  border-radius: 16px;
  box-shadow: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 251, 255, 0.88));
}

.module-filters.outline-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr)) 96px;
}

.module-filters label span {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 850;
}

.module-filters select,
.module-filters input {
  width: 100%;
  height: 44px;
  border: 1px solid #bfd4f5;
  border-radius: 12px;
  outline: none;
  padding: 0 12px;
  color: #111827;
  background: #fff;
}

.module-filters input::placeholder {
  color: #98a2b3;
}

.module-filters select:focus,
.module-filters input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12);
}

.search-box {
  position: relative;
}

.search-box input[type="search"] {
  appearance: none;
  padding-right: 38px;
  background:
    linear-gradient(180deg, #ffffff, #f7fbff);
}

.search-box::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid #7b91b3;
  border-bottom: 2px solid #7b91b3;
  pointer-events: none;
  transform: translateY(-62%) rotate(45deg);
}

.search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12;
  overflow: hidden;
  max-height: 268px;
  border: 1px solid #bfd4f5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(18, 54, 112, 0.18);
}

.search-suggestions button,
.search-suggestions span {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  border: 0;
  padding: 0 13px;
  color: #1f2f49;
  text-align: left;
  background: #fff;
}

.search-suggestions button {
  cursor: pointer;
  font-weight: 750;
}

.search-suggestions button:hover {
  color: var(--blue);
  background: #f2f7ff;
}

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

.primary-btn {
  height: 48px;
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  background: linear-gradient(180deg, #2687ff 0%, var(--blue-strong) 100%);
  box-shadow: 0 14px 24px rgba(22, 119, 255, 0.24);
}

.secondary-btn {
  height: 44px;
  border: 1px solid #cfe0f7;
  border-radius: 12px;
  padding: 0 14px;
  color: var(--blue);
  cursor: pointer;
  font-weight: 850;
  background: #fff;
}

.secondary-btn:hover {
  border-color: var(--blue);
  background: #f2f7ff;
}

.content-section {
  margin-top: 24px;
  padding: 24px 28px 28px;
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
  padding: 18px 20px;
}

.admin-copy {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.section-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  background: linear-gradient(145deg, #0c7f5b, #20b486);
  box-shadow: 0 14px 28px rgba(12, 127, 91, 0.22);
}

.admin-copy h2 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 21px;
  line-height: 1.25;
}

.admin-copy p,
.admin-summary {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.upload-control {
  position: relative;
  display: inline-grid;
  place-items: center;
  height: 44px;
  overflow: hidden;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  font-weight: 850;
  background: linear-gradient(180deg, #2687ff 0%, var(--blue-strong) 100%);
  box-shadow: 0 14px 24px rgba(22, 119, 255, 0.20);
}

.upload-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-control span {
  padding: 0 18px;
}

.admin-summary {
  grid-column: 1 / -1;
  display: none;
  padding-top: 2px;
}

.admin-summary.show {
  display: block;
}

.link-btn {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.admin-page {
  max-width: 1320px;
}

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

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

.admin-workbench {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.admin-step {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 246px;
  padding: 20px;
  border: 1px solid rgba(198, 216, 242, 0.92);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.step-title h2 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 20px;
  line-height: 1.25;
}

.step-title p,
.admin-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.image-badge {
  background: linear-gradient(145deg, #8b5cf6, #36a3ff);
  box-shadow: 0 14px 28px rgba(74, 109, 255, 0.20);
}

.zip-badge {
  background: linear-gradient(145deg, #f97316, #fbbf24);
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.20);
}

.wide-upload {
  width: 100%;
}

.export-actions {
  display: grid;
  gap: 10px;
}

.export-actions .primary-btn,
.export-actions .secondary-btn {
  width: 100%;
}

.admin-preview {
  margin-bottom: 48px;
}

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

.mini-preview {
  min-height: 116px;
  padding: 14px;
  border: 1px solid #d6e4f7;
  border-radius: 16px;
  background: #fff;
}

.mini-preview div {
  display: inline-flex;
  align-items: center;
  height: 24px;
  margin-bottom: 10px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  background: #eef6ff;
}

.mini-preview strong,
.mini-preview span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-preview strong {
  color: var(--navy);
  font-size: 16px;
}

.mini-preview span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(220, 231, 247, 0.86);
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 900;
}

.section-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.poster-icon {
  background: linear-gradient(145deg, #ff9f1c, #ffbd4a);
  box-shadow: 0 10px 20px rgba(255, 159, 28, 0.23);
}

.poster-icon::before,
.poster-icon::after {
  content: "";
  position: absolute;
  background: #fff;
}

.poster-icon::before {
  width: 15px;
  height: 18px;
  border-radius: 3px;
}

.poster-icon::after {
  bottom: 9px;
  width: 11px;
  height: 3px;
  border-radius: 999px;
}

.outline-icon {
  background: linear-gradient(145deg, #1677ff, #34a3ff);
  box-shadow: 0 10px 20px rgba(22, 119, 255, 0.23);
}

.outline-icon::before,
.outline-icon::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 7px 0 rgba(255, 255, 255, 0.92);
}

.outline-icon::after {
  width: 9px;
  transform: translateY(-7px);
  box-shadow: none;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.category-tabs button {
  height: 38px;
  border: 1px solid #cfe0f7;
  border-radius: 999px;
  padding: 0 16px;
  color: #37506f;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.category-tabs button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

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

.image-card {
  overflow: hidden;
  border: 1px solid #d6e4f7;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(27, 69, 133, 0.08);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.image-card:hover {
  transform: translateY(-4px);
  border-color: rgba(22, 119, 255, 0.58);
  box-shadow: 0 22px 52px rgba(25, 70, 128, 0.16);
}

.image-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 14px;
  border: 0;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.09), rgba(255, 176, 32, 0.07)),
    #eef5ff;
  cursor: zoom-in;
}

.image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.placeholder-poster {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  border: 1px dashed #b7d4ff;
  border-radius: 14px;
  color: var(--navy);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(237, 245, 255, 0.72)),
    repeating-linear-gradient(135deg, rgba(22, 119, 255, 0.08) 0 10px, transparent 10px 20px);
}

.placeholder-poster b,
.placeholder-poster em,
.placeholder-poster small {
  display: block;
  max-width: 86%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.placeholder-poster b {
  font-size: 22px;
  font-weight: 900;
}

.placeholder-poster em {
  color: var(--blue);
  font-size: 15px;
  font-weight: 850;
}

.placeholder-poster small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.card-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 11px 14px 11px 16px;
  border-top: 1px solid #edf2fa;
}

.card-footer strong,
.card-footer span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-footer strong {
  color: #1d2b44;
  font-size: 16px;
  line-height: 1.35;
}

.card-footer span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.image-card.compact-meta .card-footer {
  min-height: 60px;
}

.image-card.compact-meta .card-footer span {
  display: none;
}

.copy-btn {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid #b7d4ff;
  border-radius: 11px;
  color: var(--blue);
  background: #f7fbff;
  cursor: pointer;
}

.copy-btn::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  width: 13px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: -5px 5px 0 -2px #f7fbff, -5px 5px 0 0 currentColor;
}

.copy-btn.copying {
  opacity: 0.65;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--muted);
  border: 1px dashed #bed2f0;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.78);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 44px 28px 64px;
  background: rgba(6, 18, 42, 0.78);
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: min(96vw, 1280px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.lightbox p {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 18px;
  margin: 0;
  color: #fff;
  text-align: center;
  font-weight: 700;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  cursor: pointer;
}

.lightbox-close::before,
.lightbox-close::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 20px;
  width: 18px;
  height: 2px;
  background: #1f2937;
}

.lightbox-close::before {
  transform: rotate(45deg);
}

.lightbox-close::after {
  transform: rotate(-45deg);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  min-width: 180px;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  text-align: center;
  background: rgba(17, 32, 62, 0.92);
  box-shadow: 0 14px 34px rgba(17, 32, 62, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(24px);
  transition: opacity 0.18s, transform 0.18s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 25;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(183, 212, 255, 0.96);
  border-radius: 50%;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(17, 32, 62, 0.18);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s, transform 0.18s, border-color 0.18s;
}

.back-top::before,
.back-top::after {
  content: "";
  position: absolute;
  left: 50%;
  background: currentColor;
  transform: translateX(-50%);
}

.back-top::before {
  top: 13px;
  width: 2px;
  height: 20px;
  border-radius: 999px;
}

.back-top::after {
  top: 12px;
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  background: transparent;
  transform: translateX(-50%) rotate(45deg);
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-top:hover {
  border-color: var(--blue);
  background: #f2f7ff;
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero-visual {
    display: none;
  }

  .stats,
  .quick-nav,
  .admin-nav,
  .filters,
  .admin-panel,
  .module-filters,
  .module-filters.outline-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-workbench,
  .admin-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 1440px);
    margin-top: 10px;
  }

  .hero {
    min-height: 136px;
    padding: 22px 18px;
    border-radius: 16px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero p {
    font-size: 15px;
  }

  .stats,
  .quick-nav,
  .admin-nav,
  .filters,
  .admin-panel,
  .module-filters,
  .module-filters.outline-filters,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .admin-workbench,
  .admin-preview-grid {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    justify-content: stretch;
  }

  .admin-actions .secondary-btn,
  .upload-control {
    width: 100%;
  }

  .content-section {
    padding: 18px 16px 20px;
  }

  .back-top {
    right: 14px;
    bottom: 14px;
  }
}
