:root {
  --bg: #08111f;
  --bg-soft: rgba(10, 16, 30, 0.72);
  --bg-card: rgba(13, 20, 37, 0.9);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e7eefb;
  --muted: #9aa9c7;
  --accent: #4fd1c5;
  --accent-2: #7dd3fc;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79, 209, 197, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(125, 211, 252, 0.12), transparent 22%),
    linear-gradient(180deg, #09101c 0%, #050912 100%);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}

.topbar .navbar {
  background: rgba(7, 12, 21, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--text) !important;
}

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .8rem;
  color: #06101e;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(79, 209, 197, 0.12);
}

.nav-link {
  color: rgba(231, 238, 251, .82) !important;
  font-weight: 600;
  border-radius: .9rem;
  padding: .7rem 1rem !important;
}

.nav-link:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link-cta {
  background: linear-gradient(135deg, rgba(79, 209, 197, 0.18), rgba(125, 211, 252, 0.18));
  border: 1px solid rgba(125, 211, 252, 0.18);
}

.page-shell { padding-top: 5.75rem; }

.panel,
.card-soft {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.panel { padding: 1.25rem; }

.hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: linear-gradient(160deg, rgba(13, 20, 37, .95), rgba(7, 11, 20, .92));
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.hero-bg {
  position: absolute;
  inset: auto -10% -25% auto;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(79, 209, 197, 0.2), transparent 65%);
  filter: blur(12px);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  color: var(--accent);
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}

.stat-card {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  margin-top: .25rem;
  font-size: .9rem;
}

.featured-video,
.video-card { overflow: hidden; position: relative; }

.featured-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(6, 12, 22, .78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  font-weight: 700;
  font-size: .85rem;
}

.featured-player,
.detail-player {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #02050a;
  object-fit: contain;
}

.video-thumb-link {
  position: relative;
  display: block;
  text-decoration: none;
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  background: #04080f;
}

.play-overlay {
  position: absolute;
  inset: auto 1rem 1rem auto;
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(79, 209, 197, .92);
  color: #06101e;
  font-size: 1.8rem;
  box-shadow: 0 12px 28px rgba(79, 209, 197, .35);
}

.video-card {
  transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}

.video-card:hover {
  transform: translateY(-6px);
  border-color: rgba(79, 209, 197, 0.26);
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.42);
}

.filter-form {
  display: grid;
  grid-template-columns: 1.4fr .9fr auto;
  gap: .75rem;
}

.form-panel { max-width: 980px; }

.upload-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.preview-card {
  padding: 1rem;
  border-radius: 1.3rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: .75rem;
}

.preview-stage {
  position: relative;
  min-height: 14rem;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(5, 10, 18, 0.9), rgba(14, 24, 44, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-align: center;
  color: var(--muted);
  padding: 1rem;
}

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

.preview-note {
  margin-top: .75rem;
  font-size: .85rem;
  color: var(--muted);
}

.upload-dropzone {
  margin-top: .5rem;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: rgba(79, 209, 197, 0.7);
  background: rgba(79, 209, 197, 0.08);
  transform: translateY(-1px);
}

.upload-dropzone-inner {
  min-height: 7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .35rem;
}

.upload-dropzone .form-control[type="file"] {
  cursor: pointer;
}

.upload-progress-shell {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-progress {
  height: .95rem;
  background: rgba(255, 255, 255, 0.08);
}

.upload-progress .progress-bar {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.form-control,
.form-select {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.form-control:focus,
.form-select:focus {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(79, 209, 197, 0.65);
  box-shadow: 0 0 0 .25rem rgba(79, 209, 197, 0.14);
}

.form-control::file-selector-button {
  background: rgba(79, 209, 197, 0.12);
  color: var(--text);
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  padding: .6rem .9rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  color: #06101e;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(79, 209, 197, 0.18);
}

.btn-primary:hover { color: #06101e; filter: brightness(1.04); }

.btn-outline-light,
.btn-outline-danger { border-color: rgba(255, 255, 255, 0.16); }

.btn-outline-light {
  color: var(--text);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: .7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: transform .2s ease, background .2s ease;
}

.category-chip:hover,
.category-chip.active {
  background: rgba(79, 209, 197, 0.18);
  transform: translateY(-2px);
  color: #fff;
}

.chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.info-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 0;
}

.info-list div {
  padding: .9rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.info-list dt {
  color: var(--muted);
  font-size: .86rem;
  margin-bottom: .25rem;
}

.info-list dd {
  margin-bottom: 0;
  font-weight: 600;
  word-break: break-word;
}

.poster-preview-wrap {
  min-height: 13rem;
  border-radius: 1.25rem;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-preview {
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
}

.placeholder-panel {
  padding: 4rem 2rem;
  text-align: center;
}

.text-muted { color: var(--muted) !important; }

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

.site-footer {
  margin-top: 2rem;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
}

.footer-brand {
  font-weight: 800;
  color: var(--text);
  margin-bottom: .25rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.table-dark {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: rgba(255, 255, 255, 0.08);
}

.table-dark td,
.table-dark th {
  border-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 991.98px) {
  .page-shell { padding-top: 5rem; }
  .filter-form { grid-template-columns: 1fr; }
  .upload-previews {
    grid-template-columns: 1fr;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .hero-panel {
    padding: 1rem;
    border-radius: 1.35rem;
  }

  .stats-grid { grid-template-columns: 1fr; }
  .upload-previews {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 1rem;
    border-radius: 1.2rem;
  }

  .form-control-lg {
    min-height: calc(1.5em + 1.5rem + calc(var(--bs-border-width) * 2));
  }
}
