:root {
  --bg: #0b1117;
  --panel: #121b24cc;
  --panel-strong: #162231;
  --text: #e6eef7;
  --muted: #9db0c3;
  --accent: #3ed6b3;
  --accent-2: #5aa3ff;
  --danger: #ff6b6b;
  --border: #233549;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(1000px 500px at 10% -20%, rgba(62, 214, 179, 0.18), transparent 62%),
    radial-gradient(900px 500px at 100% 0%, rgba(90, 163, 255, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.22;
}

.bg-orb-a {
  width: 260px;
  height: 260px;
  background: #1ec9a7;
  top: 8%;
  left: -100px;
}

.bg-orb-b {
  width: 320px;
  height: 320px;
  background: #2a8cff;
  right: -120px;
  top: 25%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 5vw;
  border-bottom: 1px solid #1f2f41;
  background: rgba(10, 15, 22, 0.88);
  backdrop-filter: blur(10px);
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.ghost-btn,
.primary-btn,
.danger-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--text);
  text-decoration: none;
  background: #14202db0;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #081018;
  border: none;
  font-weight: 700;
}

.danger-btn {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.32);
  color: #ffc5c5;
}

.container {
  width: min(1200px, 92vw);
  margin: 24px auto 40px;
}

.hero-card,
.panel,
.detail-card {
  background: linear-gradient(145deg, #13202dbd, #0d151fc9);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 22px;
  margin-bottom: 22px;
}

.hero-card h1 {
  margin: 0;
  font-size: clamp(1.3rem, 4vw, 2rem);
}

.hero-card p {
  color: var(--muted);
  margin: 10px 0 18px;
}

.toolbar {
  display: grid;
  gap: 10px;
  grid-template-columns: 2fr 1fr;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a3d54;
  background: #101923;
  color: var(--text);
}

.video-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.video-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid #233548;
  border-radius: 16px;
  overflow: hidden;
  transform: translateY(0);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.35);
  border-color: #3c5a78;
}

.video-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #0d141d;
}

.video-meta {
  padding: 12px;
}

.video-title {
  font-size: 1rem;
  margin: 0;
  line-height: 1.35;
}

.video-desc {
  color: var(--muted);
  margin: 8px 0 10px;
  font-size: 0.9rem;
  line-height: 1.4;
  min-height: 2.5em;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 4px 10px;
  background: #1b2b3a;
  border: 1px solid #2a4259;
  color: #b8d7f4;
}

.empty-hint,
.status {
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none;
}

.detail-card {
  padding: 18px;
}

.detail-info-block {
  margin-top: 16px;
}

.detail-title {
  margin: 0 0 10px;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
}

.detail-desc {
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.player-shell {
  display: grid;
  gap: 12px;
}

.player {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #233548;
  background: #000;
}

.player-extra-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.player-extra-controls-secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.player-inline-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.player-inline-control select,
.player-inline-control input {
  min-width: 0;
}

.player-seek-bar {
  width: 100%;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
  gap: 18px;
}

.panel {
  padding: 16px;
}

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

.upload-form label {
  display: grid;
  gap: 6px;
  color: #d5e4f4;
  font-size: 0.92rem;
}

.cover-picker {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #0f1822;
  border: 1px solid #203143;
}

.cover-picker-head {
  display: grid;
  gap: 4px;
}

.cover-picker-head strong {
  font-size: 0.95rem;
}

.cover-picker-head span {
  font-size: 0.82rem;
  color: var(--muted);
}

.cover-video,
.cover-preview-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  background: #000;
}

.cover-capture-tools {
  display: grid;
  gap: 10px;
}

.cover-canvas {
  display: none;
}

.status.ok { color: #80f0d0; }
.status.err { color: var(--danger); }

.upload-progress {
  margin-top: 12px;
}

.upload-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #12202e;
  border: 1px solid #203143;
  overflow: hidden;
}

.upload-progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .2s ease;
}

.upload-progress-text {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  background: #101924;
  border: 1px solid #203143;
  border-radius: 12px;
  padding: 8px;
}

.recent-item-main {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.recent-delete-btn {
  flex: 0 0 auto;
}

.recent-item img {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.recent-item h4 {
  margin: 0;
  font-size: 0.92rem;
}

.recent-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

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

  .site-header {
    padding: 12px 4vw;
  }

  .container {
    width: 94vw;
    margin-top: 16px;
  }
}
