/* =========================================================
   Admin Page Theme — 昆明市大学生创业园大屏媒体轮播
   基于 admin.html CSS 移植
   ========================================================= */
.admin-page {
  --primary: #00BD7D;
  --primary-hover: #00a36b;
  --primary-glow: rgba(0, 189, 125, 0.25);
  --primary-subtle: rgba(0, 189, 125, 0.07);
  --primary-surface: rgba(0, 189, 125, 0.04);
  --success: #16A34A;
  --success-subtle: rgba(22, 163, 74, 0.08);
  --warning: #D97706;
  --warning-subtle: rgba(217, 119, 6, 0.08);
  --danger: #DC2626;
  --danger-hover: #ef4444;
  --danger-subtle: rgba(220, 38, 38, 0.08);
  --surface: #FFFFFF;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-dim: #9ca3af;
  --text-inverse: #FFFFFF;
  --border-subtle: rgba(0,0,0,0.06);
  --border-default: rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.16);

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;

  --radius-sm: 4px;
  --radius-md: 8px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1), 0 16px 48px rgba(0,0,0,0.08);
  --shadow-xl: 0 12px 32px rgba(0,0,0,0.12), 0 24px 64px rgba(0,0,0,0.1);

  font-family: "Poppins", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #f3f4f6;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  position: relative;
}

/* ============ Spatial Background ============ */
.admin-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 80% 10%, rgba(0, 189, 125, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 38% at 18% 6%, rgba(217, 119, 6, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse 45% 28% at 50% 96%, rgba(0,0,0,0.02) 0%, transparent 50%);
}

.admin-page::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.02;
  background-image:
    linear-gradient(30deg, rgba(0,0,0,0.15) 1px, transparent 1px),
    linear-gradient(-30deg, rgba(0,0,0,0.15) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ============ Login ============ */
.login-wrapper {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--space-24);
}

.login-wrapper::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 189, 125, 0.07) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(217, 119, 6, 0.03) 0%, transparent 55%);
  pointer-events: none;
  animation: loginAmbient 8s ease-in-out infinite;
}
@keyframes loginAmbient {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
}

.login-wrapper::after {
  content: '';
  position: fixed;
  top: 10%;
  right: 6%;
  width: 240px;
  height: 240px;
  pointer-events: none;
  opacity: 0.05;
  background:
    linear-gradient(60deg, transparent 49%, rgba(0,189,125,0.6) 49.5%, rgba(0,189,125,0.6) 50.5%, transparent 51%),
    linear-gradient(-60deg, transparent 49%, rgba(0,189,125,0.6) 49.5%, rgba(0,189,125,0.6) 50.5%, transparent 51%),
    linear-gradient(180deg, transparent 49%, rgba(0,189,125,0.6) 49.5%, rgba(0,189,125,0.6) 50.5%, transparent 51%);
  background-size: 48px 48px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.login-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-32);
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.08),
    0 0 0 1px rgba(0,0,0,0.04),
    0 1px 0 rgba(255,255,255,0.6) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: perspective(800px) rotateX(1deg);
  transition: transform var(--transition-slow);
}
.login-card:hover { transform: perspective(800px) rotateX(0deg) translateY(-2px); }

.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-md);
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(0,0,0,0.04) 0%,
    rgba(0, 189, 125, 0.2) 30%,
    transparent 55%,
    rgba(217, 119, 6, 0.12) 80%,
    rgba(0,0,0,0.04) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-brand { margin-bottom: var(--space-32); }
.login-brand .icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-16);
  position: relative;
}
.login-brand .icon .iso-top {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 30px;
  height: 30px;
  background: rgba(0, 189, 125, 0.12);
  border: 1px solid rgba(0, 189, 125, 0.25);
  border-radius: 4px;
}
.login-brand .icon .iso-left {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 26px;
  height: 24px;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 4px;
  transform: skewY(25deg);
}
.login-brand .icon .iso-right {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 24px;
  background: rgba(0, 189, 125, 0.15);
  border: 1px solid rgba(0, 189, 125, 0.22);
  border-radius: 4px;
  transform: skewY(-25deg);
}
.login-brand .icon .iso-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(0, 189, 125, 0.35);
  z-index: 2;
}
.login-brand h2 {
  font-family: "Oswald", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.login-brand p {
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: var(--space-4);
}

.login-card .field { margin-bottom: var(--space-16); text-align: left; }
.login-card .field label {
  display: block;
  font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.login-card .field input {
  width: 100%;
  padding: var(--space-12) var(--space-16);
  background: #f9fafb;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-weight: 400;
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}
.login-card .field input:focus {
  border-color: rgba(0, 189, 125, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 189, 125, 0.08);
}
.login-card .field input::placeholder { color: var(--text-dim); }
.login-card .btn-login {
  width: 100%;
  margin-top: var(--space-8);
  padding: 13px;
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Oswald", "PingFang SC", sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(0, 189, 125, 0.15);
}
.login-card .btn-login:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 24px rgba(0, 189, 125, 0.25);
  transform: translateY(-2px);
}
.login-card .btn-login:active { transform: translateY(0); }

/* ============ Dashboard Layout ============ */
.dashboard { display: none; position: relative; z-index: 1; }
.dashboard.active { display: block; }

/* ============ Topbar ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.84);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 var(--space-32);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 2px 16px rgba(0,0,0,0.03);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-width: 0;
}
.topbar-left .brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(0, 189, 125, 0.35);
  flex-shrink: 0;
  animation: brandDotPulse 3s ease-in-out infinite;
}
@keyframes brandDotPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 189, 125, 0.3); }
  50% { box-shadow: 0 0 18px rgba(0, 189, 125, 0.5); }
}
.topbar-left h1 {
  font-family: "Oswald", "PingFang SC", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.topbar-center { flex: 1; text-align: center; min-width: 0; }
.status-bar-text {
  font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 400px;
  margin: 0 auto;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

/* Control buttons */
.btn-control {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #f9fafb;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}
.btn-control:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-control:active { transform: translateY(1px); box-shadow: none; }
.btn-control.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 16px rgba(0, 189, 125, 0.3);
}
.btn-control.play-btn {
  width: 48px;
  height: 48px;
  font-size: 18px;
  background: var(--surface);
  border-color: var(--border-default);
  box-shadow: var(--shadow-card);
}
.btn-control.play-btn:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}
.btn-control.play-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 0 20px rgba(0, 189, 125, 0.35);
}
.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
  margin: 0 var(--space-4);
}
.btn-logout {
  padding: var(--space-8) var(--space-16);
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-logout:hover {
  background: var(--danger-subtle);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--danger);
  transform: translateY(-1px);
}
.btn-return {
  padding: var(--space-8) var(--space-16);
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-return:hover {
  background: rgba(0, 189, 125, 0.08);
  border-color: rgba(0, 189, 125, 0.3);
  color: var(--primary);
  transform: translateY(-1px);
}

/* ============ Main Grid ============ */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-24);
  padding: var(--space-32);
  max-width: 1400px;
  margin: 0 auto;
}

/* ============ Cards ============ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-24);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  transition: all var(--transition-slow);
  transform: perspective(1000px) translateZ(0);
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, transparent 50%, rgba(0,0,0,0.01) 100%);
  pointer-events: none;
}
.card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover);
  transform: perspective(1000px) translateZ(4px);
}
.card.full { grid-column: 1 / -1; }
.playback-controls-card { display: none; }
.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-24);
  position: relative;
  z-index: 1;
}
.card-header .card-icon {
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(0, 189, 125, 0.12);
}
.card-header h3 {
  font-family: "Oswald", "PingFang SC", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ============ Form Elements ============ */
input[type="text"],
input[type="number"],
input[type="password"],
select {
  width: 100%;
  padding: var(--space-12) var(--space-16);
  background: #f9fafb;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}
input:focus, select:focus {
  border-color: rgba(0, 189, 125, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 189, 125, 0.07);
}
input::placeholder { color: var(--text-dim); }
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-12) center;
  padding-right: 36px;
}
input[type="file"] {
  font-size: 14px;
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-weight: 400;
  color: var(--text-secondary);
}
input[type="file"]::file-selector-button {
  background: #f3f4f6;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-8) var(--space-16);
  margin-right: var(--space-12);
  cursor: pointer;
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}
input[type="file"]::file-selector-button:hover {
  background: var(--surface);
  border-color: var(--border-strong);
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
  padding: 0;
  border: none;
}
input[type="range"]:focus { box-shadow: none; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15), 0 0 8px rgba(0, 189, 125, 0.25);
  transition: all var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 18px rgba(0, 189, 125, 0.35);
}

.form-group { margin-bottom: var(--space-16); position: relative; z-index: 1; }
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  display: block;
  font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-row {
  display: flex;
  gap: var(--space-8);
  align-items: end;
}
.form-row > :first-child { flex: 1; }
.form-row > button { flex: 0 0 auto; }
.form-inline {
  display: flex;
  gap: var(--space-24);
  align-items: end;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.form-inline .form-group { flex: 1; margin-bottom: 0; min-width: 0; }

/* ============ Buttons ============ */
button { font-family: "Poppins", "PingFang SC", sans-serif; cursor: pointer; transition: all var(--transition); }
.btn-primary {
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--text);
  color: var(--text-inverse);
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: #1f2937;
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(1px); }
.btn-accent {
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary);
  color: var(--text-inverse);
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0, 189, 125, 0.2);
}
.btn-accent:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(0, 189, 125, 0.3);
  transform: translateY(-1px);
}
.btn-accent:active { transform: translateY(1px); }
.btn-outline {
  padding: var(--space-10) var(--space-20);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--text);
  background: rgba(0, 189, 125, 0.06);
}
.btn-outline.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 189, 125, 0.1);
}
.btn-danger {
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--danger);
  color: var(--text-inverse);
  white-space: nowrap;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}
.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}
.btn-sm {
  padding: var(--space-8) var(--space-12);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

/* ============ Media Grid ============ */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-16);
}
.media-card {
  background: #f9fafb;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-slow);
  position: relative;
  box-shadow: var(--shadow-xs);
  transform: perspective(800px) translateZ(0);
}
.media-card:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
  transform: perspective(800px) translateZ(8px) translateY(-3px);
}
.media-card .thumb {
  width: 100%;
  height: 108px;
  object-fit: cover;
  background: #e5e7eb;
  display: block;
  cursor: pointer;
}
.thumb-video-wrap {
  position: relative;
  width: 100%;
  height: 108px;
  overflow: hidden;
  cursor: pointer;
  background: #111;
}
.thumb-video-wrap .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}
.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,0.15);
  transition: all 0.2s ease;
  pointer-events: none;
}
.thumb-video-wrap:hover .play-badge {
  background: rgba(0, 189, 125, 0.75);
  color: #fff;
  transform: translate(-50%, -50%) scale(1.1);
  border-color: rgba(255,255,255,0.3);
}
.media-card .thumb-placeholder {
  width: 100%;
  height: 108px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.media-card .body { padding: var(--space-12); }
.media-card .body .name {
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.media-card .body .meta-row {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}
.media-card .body .actions {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-12);
}
.media-card .body .actions button { flex: 1; }

.badge {
  display: inline-flex;
  align-items: center;
  font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-video { background: rgba(0, 189, 125, 0.1); color: #00BD7D; }
.badge-image { background: rgba(217, 119, 6, 0.1); color: #b45309; }
.badge-url { background: rgba(139, 92, 246, 0.08); color: #7c3aed; }
.badge-local { background: rgba(22, 163, 74, 0.1); color: #16A34A; }

.empty-state {
  text-align: center;
  padding: var(--space-32) var(--space-24);
  color: var(--text-dim);
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 400;
  grid-column: 1 / -1;
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: var(--space-12); opacity: 0.35; }

/* ============ Toast ============ */
.toast-container {
  position: fixed;
  top: var(--space-24);
  right: var(--space-24);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  pointer-events: none;
}
.toast {
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-md);
  font-family: "Poppins", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 500;
  pointer-events: auto;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 360px;
  border: 1px solid;
  box-shadow: var(--shadow-lg);
}
.toast.success { background: rgba(22, 163, 74, 0.1); color: #166534; border-color: rgba(22, 163, 74, 0.2); }
.toast.error { background: rgba(220, 38, 38, 0.08); color: #991b1b; border-color: rgba(220, 38, 38, 0.18); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.92); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============ Preview Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-32);
  animation: overlayIn 0.25s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.closing { animation: overlayOut 0.2s ease forwards; }
@keyframes overlayOut { from { opacity: 1; } to { opacity: 0; } }
.modal-panel {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: panelIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform: perspective(1000px) rotateX(0.5deg);
}
@keyframes panelIn { from { opacity: 0; transform: perspective(1000px) rotateX(2deg) translateY(20px) scale(0.94); } to { opacity: 1; transform: perspective(1000px) rotateX(0.5deg) translateY(0) scale(1); } }
.modal-overlay.closing .modal-panel { animation: panelOut 0.2s ease forwards; }
@keyframes panelOut { from { opacity: 1; transform: perspective(1000px) rotateX(0.5deg) translateY(0) scale(1); } to { opacity: 0; transform: perspective(1000px) rotateX(2deg) translateY(20px) scale(0.94); } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-16) var(--space-24);
  border-bottom: 1px solid var(--border-subtle);
  background: #f9fafb;
}
.modal-header .modal-title {
  font-family: "Oswald", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: var(--space-12);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  transition: all var(--transition);
}
.modal-close:hover {
  background: var(--danger-subtle);
  border-color: rgba(220, 38, 38, 0.3);
  color: var(--danger);
}
.modal-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-24);
  background: #f3f4f6;
  min-height: 200px;
  max-height: 65vh;
  overflow: auto;
}
.modal-body img { max-width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius-sm); }
.modal-body video { max-width: 100%; max-height: 60vh; border-radius: var(--radius-sm); outline: none; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-12) var(--space-24);
  border-top: 1px solid var(--border-subtle);
  background: #f9fafb;
}
.modal-info {
  font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  display: flex;
  gap: var(--space-4);
  align-items: center;
}
.modal-actions { display: flex; gap: var(--space-8); }

/* ============ Utilities ============ */
.hidden { display: none !important; }
.volume-label {
  font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: right;
  margin-top: var(--space-4);
  font-variant-numeric: tabular-nums;
}

/* ============ Upload Progress ============ */
.upload-progress {
  margin-top: var(--space-12);
  display: flex;
  align-items: center;
  gap: var(--space-12);
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.25s ease;
  box-shadow: 0 0 8px rgba(0, 189, 125, 0.3);
}
.progress-text {
  font-family: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .login-card { padding: var(--space-24) var(--space-16) var(--space-32); margin: var(--space-12); max-width: none; }
  .login-brand h2 { font-size: 20px; }
  .topbar { padding: 0 var(--space-16); height: 56px; gap: var(--space-4); }
  .topbar-left h1 { font-size: 14px; }
  .topbar-center { display: none; }
  .topbar-right { gap: var(--space-2); }
  /* Hide playback controls in topbar on mobile — they're in their own card */
  .topbar-right .btn-control,
  .topbar-right .play-btn,
  .topbar-right .topbar-divider { display: none; }
  .btn-logout, .btn-return { padding: var(--space-4) var(--space-10); font-size: 11px; }
  .main-grid { grid-template-columns: 1fr; gap: var(--space-12); padding: var(--space-12); }
  .card { padding: var(--space-12) var(--space-16); }
  .card.full { grid-column: 1; }
  .card-header { margin-bottom: var(--space-16); }
  .card-header h3 { font-size: 14px; }
  .card-header .card-icon { width: 30px; height: 30px; }
  .card-header .card-icon svg { width: 16px; height: 16px; }
  .form-inline { flex-direction: column; gap: var(--space-12); align-items: stretch; }
  .form-group { margin-bottom: var(--space-12); }
  .form-group label { font-size: 11px; }
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
  .media-card .thumb { height: 88px; }
  .thumb-video-wrap { height: 88px; }
  .media-card .body { padding: var(--space-8); }
  .media-card .body .name { font-size: 12px; }
  .media-card .body .actions button { font-size: 11px; padding: var(--space-4) var(--space-8); }
  .toast-container { top: var(--space-12); right: var(--space-12); left: var(--space-12); }
  .toast { max-width: none; font-size: 12px; }
  .btn-primary, .btn-accent, .btn-danger { padding: var(--space-12) var(--space-16); font-size: 12px; }
  .btn-outline { padding: var(--space-8) var(--space-14); font-size: 12px; }
  .modal-overlay { padding: var(--space-16); }
  .modal-panel { max-width: 100%; max-height: 90vh; }
  .modal-body { padding: var(--space-12); max-height: 55vh; }
  .modal-body img, .modal-body video { max-height: 50vh; }
  .modal-header { padding: var(--space-12) var(--space-16); }
  .modal-footer { padding: var(--space-8) var(--space-16); }

  /* Mobile playback control card */
  .playback-controls-card { display: block; }
  .playback-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    padding: var(--space-4) 0;
  }
  .playback-controls-row .btn-control {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: #f9fafb;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    box-shadow: var(--shadow-xs);
  }
  .playback-controls-row .btn-control:hover {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
  }
  .playback-controls-row .btn-control.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 0 16px rgba(0, 189, 125, 0.3);
  }
  .playback-controls-row .play-btn {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }
  .playback-controls-row .btn-control:active { transform: translateY(1px); }
}

@media (max-width: 400px) {
  .topbar-left h1 { font-size: 12px; }
  .topbar-right { gap: 2px; }
  .topbar-right .btn-logout, .topbar-right .btn-return { font-size: 10px; padding: var(--space-2) var(--space-8); }
  .main-grid { gap: var(--space-8); padding: var(--space-8); }
  .card { padding: var(--space-12); }
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
  .playback-controls-row { gap: var(--space-4); }
  .playback-controls-row .btn-control { width: 38px; height: 38px; font-size: 14px; }
  .playback-controls-row .play-btn { width: 44px; height: 44px; font-size: 17px; }
  .form-inline { gap: var(--space-8); align-items: stretch; }
  .form-group { margin-bottom: var(--space-8); }
}

/* =========================================================
   管理后台增强：页面切换 / 立即播放 / URL 展示
   ========================================================= */
.page-switch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.page-switch-btn {
  padding: 12px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #00BD7D);
  background: var(--primary-subtle, rgba(0,189,125,0.07));
  border: 1px solid rgba(0, 189, 125, 0.28);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.page-switch-btn:hover {
  background: rgba(0, 189, 125, 0.14);
  transform: translateY(-1px);
}
.screen-target.active {
  background: #1D5DCE;
  border-color: #1D5DCE;
  color: #fff;
  box-shadow: 0 4px 12px rgba(29, 93, 206, 0.3);
}
.screen-target.active:hover { background: #174fb0; }
.media-url {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 6px;
  padding: 3px 6px;
  min-width: 0;
  background: rgba(0, 189, 125, 0.05);
  border: 1px solid rgba(0, 189, 125, 0.14);
  border-radius: 6px;
}
.media-url span {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.copy-btn {
  flex-shrink: 0;
  padding: 2px 7px;
  font-size: 10px;
  border: none;
  border-radius: 5px;
  background: rgba(0, 189, 125, 0.14);
  color: var(--primary, #00BD7D);
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { background: rgba(0, 189, 125, 0.24); }
.media-card .actions {
  flex-wrap: wrap;
  gap: 5px;
}
@media (max-width: 900px) {
  .page-switch-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   连接状态卡片
   ========================================================= */
.conn-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.conn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(0, 189, 125, 0.04);
  border: 1px solid rgba(0, 189, 125, 0.12);
  border-radius: 8px;
}
.conn-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #d1d5db;
}
.conn-dot.on {
  background: #16A34A;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.7);
  animation: connPulse 1.6s ease-in-out infinite;
}
.conn-dot.off {
  background: #DC2626;
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.6);
}
@keyframes connPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.conn-label {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-secondary, #4b5563);
  width: 72px;
}
.conn-value {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 大屏控制（MQTT 指令）面板 ============ */
.mqtt-group { margin: 10px 0 4px; }
.mqtt-group-title {
  font-size: 12px; font-weight: 600; color: #5a6b8c;
  margin-bottom: 6px; letter-spacing: 0.04em;
}
.mqtt-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-bottom: 6px;
}
.mqtt-input {
  flex: 1; min-width: 180px;
  padding: 6px 10px; border: 1px solid #d7e1f0; border-radius: 8px;
  font-size: 13px; color: #1d2c44; outline: none;
}
.mqtt-input:focus { border-color: #2f6bff; }

/* ============ 弱化连接状态（沉底、紧凑、低调） ============ */
.conn-card { opacity: 0.88; }
.conn-card .card-header { padding-bottom: 6px; }
.conn-card .conn-status { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.conn-card .conn-row { min-width: 150px; }
.conn-card .conn-label { font-size: 11px; }

/* ============ 大屏控制：mqtt-group 按操作优先级排序 ============ */
.mqtt-card { display: flex; flex-direction: column; }
.mqtt-card .mqtt-group { order: 50; }   /* 未显式设置 order 的组默认靠后 */

/* ============ 手机适配（响应式） ============ */
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
}
@media (max-width: 600px) {
  .main-grid { padding: 10px; gap: 12px; }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-center { order: 3; width: 100%; justify-content: flex-start; }
  .page-switch-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .mqtt-row { flex-wrap: wrap; gap: 8px; }
  .page-switch-btn { flex: 1 1 45%; }
  .form-inline { flex-direction: column; }
  .form-row { flex-wrap: wrap; }
  .conn-card .conn-status { flex-direction: column; gap: 6px; }
  .card { padding: 16px; }
}

/* ============ 遥控器式快捷控制条 ============ */
.remote-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  max-width: 1400px;
  margin: 16px auto 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.remote-group { display: flex; gap: 6px; }
.remote-btn {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.remote-btn:hover { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary); }
.remote-target {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  background: var(--primary-subtle);
  border: 1px solid rgba(0,189,125,.2);
  border-radius: var(--radius-md);
}
.remote-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.remote-count { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.remote-target select {
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-size: 13px;
}
.remote-pages { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .remote-bar { margin: 10px; padding: 10px; }
  .remote-target { flex: 1 1 100%; }
  .remote-target select { flex: 1; min-width: 0; }
}

/* 遥控条：页面切换合并模块 + 分隔线 */
.remote-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.remote-sep { width: 1px; height: 26px; background: var(--border-default); margin: 0 4px; }
@media (max-width: 600px) {
  .remote-nav { width: 100%; }
  .remote-sep { display: none; }
}

/* ============ 顶部控制模块（选择屏幕 / 页面切换，独立上下排列） ============ */
.control-stack {
  max-width: 1400px;
  margin: 16px auto 0;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.control-card { margin: 0; }
@media (max-width: 600px) {
  .control-stack { padding: 0 10px; }
}

/* 页面切换：左右箭头独立一行，与下方页面按钮分隔开 */
.page-nav-prev {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.page-nav-links { padding-top: 2px; }
@media (max-width: 600px) {
  .page-nav-prev { justify-content: center; }
  .page-nav-links { justify-content: flex-start; }
}

/* 卡片图标：继承主题主色（appica color -> currentColor） */
.card-header .card-icon { color: var(--primary); }

/* 页面按钮：当前激活页高亮 */
.page-switch-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,189,125,0.35);
}
