:root {
  --bg-deep: #08111d;
  --bg-mid: #0f2034;
  --surface: rgba(9, 20, 34, 0.44);
  --surface-strong: rgba(11, 26, 43, 0.72);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --text-primary: #f3f8ff;
  --text-secondary: rgba(233, 243, 255, 0.76);
  --text-dim: rgba(226, 236, 248, 0.58);
  --accent: #79d7ff;
  --accent-strong: #2aa7e8;
  --accent-warm: #ff9f6e;
  --danger: #ff6c7b;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.28);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  background: linear-gradient(160deg, var(--bg-deep), var(--bg-mid));
}

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

a {
  color: inherit;
}

.background-stage {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 20%, rgba(121, 215, 255, 0.24), transparent 26%),
    radial-gradient(circle at 90% 15%, rgba(255, 159, 110, 0.18), transparent 22%),
    linear-gradient(160deg, #07111d 0%, #0b1726 40%, #102033 100%);
}

.background-media,
.background-gradient,
.background-noise {
  position: absolute;
  inset: 0;
}

.background-media img,
.background-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
  filter: brightness(0.5) saturate(1.08) contrast(1.05);
}

.background-gradient {
  background:
    linear-gradient(180deg, rgba(4, 10, 20, 0.2), rgba(4, 10, 20, 0.65)),
    radial-gradient(circle at top, rgba(18, 54, 88, 0.25), transparent 38%),
    linear-gradient(120deg, rgba(7, 17, 29, 0.85), rgba(7, 17, 29, 0.38));
}

.background-noise {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black, transparent 82%);
  opacity: 0.25;
}

.site-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 72px;
}

.admin-shell {
  padding-bottom: 56px;
}

.glass-card,
.glass-panel {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.glass-card::before,
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 40%, transparent 70%, rgba(255, 255, 255, 0.08));
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 26px;
  padding: 34px;
  border-radius: var(--radius-xl);
}

.admin-hero {
  align-items: start;
}

.hero-copy,
.hero-side {
  position: relative;
  z-index: 1;
}

.hero-eyebrow,
.section-eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
strong,
span {
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.05rem;
}

.hero-text,
.panel-copy,
.info-card p,
.hero-note p,
.status-text,
.stat-footnote,
.file-type,
.file-date,
.file-downloads {
  color: var(--text-secondary);
  line-height: 1.7;
}

.hero-text {
  margin-top: 18px;
  max-width: 58ch;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-side {
  display: grid;
  gap: 18px;
  justify-items: end;
  align-content: space-between;
}

.hero-note,
.info-card,
.capacity-panel,
.background-current {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.hero-note {
  width: min(100%, 340px);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(121, 215, 255, 0.14);
  border: 1px solid rgba(121, 215, 255, 0.22);
  color: #d6f5ff;
  font-weight: 700;
  text-align: center;
}

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

.stat-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.stat-card strong {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  letter-spacing: -0.03em;
}

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

.admin-sidebar {
  display: grid;
  gap: 24px;
  align-content: start;
}

.side-panel,
.library-panel {
  padding: 24px;
  border-radius: var(--radius-xl);
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.small-gap {
  margin-bottom: 14px;
}

.filters-form,
.stack-form {
  display: grid;
  gap: 12px;
}

.filters-form {
  grid-template-columns: minmax(220px, 1fr) 160px auto auto;
  align-items: center;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

.stack-form span {
  color: var(--text-secondary);
  font-size: 0.94rem;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  outline: none;
  background: rgba(7, 17, 29, 0.42);
  color: var(--text-primary);
}

input::placeholder {
  color: rgba(240, 248, 255, 0.45);
}

input:focus,
select:focus {
  border-color: rgba(121, 215, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(121, 215, 255, 0.14);
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

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

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.primary-button {
  color: #04111f;
  background: linear-gradient(135deg, #9fe6ff, #43c4f7);
  box-shadow: 0 18px 36px rgba(67, 196, 247, 0.22);
}

.ghost-button {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.danger-button {
  color: #fff3f5;
  background: linear-gradient(135deg, rgba(255, 108, 123, 0.92), rgba(210, 45, 64, 0.88));
  box-shadow: 0 16px 30px rgba(210, 45, 64, 0.18);
}

.compact-button {
  min-height: 44px;
}

.full-width-button {
  width: 100%;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 22px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(121, 215, 255, 0.32);
  background:
    linear-gradient(180deg, rgba(121, 215, 255, 0.08), rgba(255, 255, 255, 0.04)),
    rgba(7, 17, 29, 0.24);
}

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

.dropzone.dragover {
  border-color: rgba(121, 215, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(121, 215, 255, 0.14), rgba(255, 255, 255, 0.07)),
    rgba(7, 17, 29, 0.32);
}

.dropzone-title {
  font-size: 1.02rem;
  font-weight: 700;
}

.dropzone-subtitle {
  color: var(--text-secondary);
}

.capacity-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.capacity-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent));
}

.status-text {
  margin-top: 12px;
}

.status-text[data-tone="danger"] {
  color: #ffd1d6;
}

.background-current {
  display: grid;
  gap: 14px;
}

.background-preview {
  min-height: 170px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.background-preview img,
.background-preview video {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.background-meta {
  display: grid;
  gap: 6px;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 18px;
}

.file-card {
  display: grid;
  gap: 14px;
  min-height: 340px;
  padding: 14px;
  border-radius: 24px;
}

.file-visual {
  position: relative;
}

.file-preview {
  display: grid;
  place-items: center;
  min-height: 185px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(121, 215, 255, 0.08)),
    rgba(255, 255, 255, 0.03);
}

.file-preview img,
.file-preview video {
  width: 100%;
  height: 185px;
  object-fit: cover;
  display: block;
}

.file-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(7, 17, 29, 0.78);
  border: 1px solid rgba(121, 215, 255, 0.28);
  color: #dff8ff;
  font-size: 0.86rem;
  font-weight: 700;
}

.placeholder-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(121, 215, 255, 0.14);
  color: #d9f4ff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.file-meta {
  display: grid;
  gap: 6px;
}

.file-name {
  line-height: 1.5;
  word-break: break-word;
}

.file-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}

.empty-state {
  padding: 44px 20px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.preview-modal {
  width: min(96vw, 1180px);
  max-width: 1180px;
  padding: 0;
  border: none;
  background: transparent;
}

.preview-modal::backdrop {
  background: rgba(2, 7, 13, 0.76);
  backdrop-filter: blur(10px);
}

.preview-shell {
  padding: 18px;
  border-radius: 28px;
}

.preview-content {
  display: grid;
  place-items: center;
  min-height: min(70vh, 520px);
}

.preview-content img,
.preview-content video,
.preview-content iframe,
.preview-content pre {
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  border-radius: 20px;
  background: rgba(5, 10, 18, 0.82);
}

.preview-content audio {
  width: min(100%, 560px);
}

.preview-content pre {
  padding: 24px;
  overflow: auto;
  color: #eff7ff;
  white-space: pre-wrap;
}

.close-preview {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

.error-shell,
.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.error-card {
  width: min(560px, 100%);
  padding: 34px;
  border-radius: var(--radius-xl);
}

.inline-button {
  margin-top: 24px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .hero-card,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-side {
    justify-items: start;
  }

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

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .hero-card,
  .side-panel,
  .library-panel,
  .stat-card {
    padding: 20px;
  }

  .panel-heading,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-form,
  .stats-grid,
  .file-grid,
  .file-actions {
    grid-template-columns: 1fr;
  }

  .hero-card {
    gap: 20px;
  }

  h1 {
    font-size: clamp(2.2rem, 12vw, 3.4rem);
  }
}
