:root {
  color-scheme: dark;
  --bg: #06111f;
  --panel: rgba(13, 25, 42, .82);
  --line: rgba(116, 155, 255, .16);
  --text: #eef7ff;
  --muted: rgba(227, 237, 255, .66);
  --blue: #2297ff;
  --violet: #8f5cff;
  --font-sans: "Source Han Sans SC", "Source Han Sans", "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  color: var(--text);
  background: radial-gradient(circle at 72% 0, rgba(76, 87, 255, .2), transparent 34%), #06111f;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.page-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 34px; }
.topbar {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 27px; font-weight: 700; }
.brand-logo {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  filter: drop-shadow(0 0 15px rgba(42, 163, 255, .45));
}
.brand-logo::after {
  content: "";
  position: absolute;
  inset: -16px;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.68) 48%, transparent 61%);
  transform: translateX(-95%) rotate(8deg);
  animation: brand-logo-shine 5s ease-in-out infinite;
  pointer-events: none;
}
.brand-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: inline-flex; align-items: baseline; gap: 0; font-weight: 700; }
.brand-text span { color: #225cff; }
.top-links {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(101, 151, 255, .16);
  border-radius: 8px;
  color: rgba(232, 241, 255, .76);
  font-size: 14px;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(14, 28, 50, .78), rgba(7, 16, 31, .46));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 34px rgba(0, 9, 28, .18);
}
.top-links button { border: 0; padding: 0; color: inherit; background: transparent; cursor: pointer; }
.top-links a,
.top-links button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 6px;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.top-links a:hover,
.top-links button:hover {
  color: #fff;
  background: rgba(59, 142, 255, .12);
  box-shadow: inset 0 0 0 1px rgba(92, 160, 255, .2), 0 0 18px rgba(40, 156, 255, .12);
}
.top-links a:focus-visible,
.top-links button:focus-visible {
  outline: 2px solid rgba(62, 184, 255, .75);
  outline-offset: 2px;
}
.button-link, button.primary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(91, 145, 255, .42);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.04);
  cursor: pointer;
}
button.primary, .button-link.primary { border: 0; background: linear-gradient(100deg, var(--blue), var(--violet)); font-weight: 600; }
.page-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 22px;
}
.page-hero h1 { margin: 0; font-size: clamp(34px, 4vw, 58px); font-weight: 700; }
.page-hero p { margin: 12px 0 0; color: var(--muted); font-size: 18px; }
.toolbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
  margin: 18px 0 22px;
}
.toolbar input, .toolbar select, .form-grid input, .form-grid select {
  width: 100%;
  height: 46px;
  border: 1px solid rgba(104, 153, 255, .18);
  border-radius: 8px;
  color: #fff;
  background: rgba(7, 16, 30, .9);
  padding: 0 14px;
  outline: none;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 24, 42, .75);
}
.thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, rgba(38,151,255,.25), rgba(143,92,255,.22)); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.video-card:hover img { transform: scale(1.04); }
.play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  backdrop-filter: blur(8px);
}
.play::before { content: ""; display: block; margin: 17px 0 0 22px; border-left: 16px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.badge, .duration {
  position: absolute;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,.62);
  font-weight: 600;
}
.badge { left: 10px; top: 10px; color: #ffd75d; }
.duration { right: 10px; bottom: 10px; color: rgba(255,255,255,.88); font-size: 13px; }
.video-body { padding: 12px 14px 14px; }
.video-body h2 { margin: 0; font-size: 17px; line-height: 1.2; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: rgba(222, 232, 255, .55); font-size: 13px; line-height: 1.2; font-weight: 400; }
.meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .view-count { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; }
.meta .view-icon { width: 13px; height: 13px; object-fit: contain; flex: 0 0 auto; opacity: .74; }
.empty { padding: 44px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); text-align: center; background: rgba(12, 24, 42, .6); }
.tutorial-footer {
  margin-top: clamp(58px, 7vw, 104px);
  padding: 28px 0 0;
  border-top: 1px solid rgba(116, 155, 255, .1);
}
.partners {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px clamp(24px, 4vw, 54px);
  color: rgba(232, 238, 255, .54);
  text-align: center;
  line-height: 1.15;
}
.partners span {
  flex: 0 0 100%;
  color: rgba(232, 238, 255, .62);
  font-size: 20px;
  font-weight: 400;
}
.partners b {
  position: relative;
  display: inline-block;
  padding-bottom: 4px;
  color: rgba(232, 238, 255, .58);
  font-size: 18px;
  font-weight: 400;
  transition: color .22s ease, transform .22s ease, text-shadow .22s ease;
}
.partners b::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(54, 192, 255, .95), transparent);
  box-shadow: 0 0 12px rgba(54, 192, 255, .55);
  transition: left .22s ease, right .22s ease, opacity .22s ease;
  opacity: 0;
}
.partners b:hover {
  color: rgba(236, 248, 255, .96);
  transform: translateY(-2px);
  text-shadow: 0 0 14px rgba(54, 192, 255, .34);
}
.partners b:hover::after {
  left: -4px;
  right: -4px;
  opacity: 1;
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 0 18px;
  color: #596472;
  font-size: 13px;
  line-height: 1.25;
}
.site-footer a {
  color: #697585;
  font-weight: 400;
}
.site-footer a:hover { color: #8793a4; }
.admin-layout { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 20px; }
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
}
.panel h2 { margin: 0 0 16px; }
.form-grid { display: grid; gap: 12px; }
.form-grid label { display: grid; gap: 8px; color: rgba(231, 239, 255, .76); }
.cover-preview { width: 100%; aspect-ratio: 16 / 9; border: 1px dashed rgba(124, 171, 255, .35); border-radius: 8px; object-fit: cover; background: rgba(4, 12, 24, .8); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.table-list { display: grid; gap: 10px; }
.table-item {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(116,155,255,.12);
  border-radius: 8px;
  background: rgba(4, 12, 24, .45);
}
.table-item img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: #07101f; }
.table-item h3 { margin: 0; font-size: 16px; }
.table-item p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.danger { border-color: rgba(255, 91, 91, .42); color: #ffb6b6; }
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 7, 14, .76);
  backdrop-filter: blur(10px);
}
.modal[hidden] { display: none; }
.player {
  width: min(980px, 100%);
  border: 1px solid rgba(112,168,255,.22);
  border-radius: 8px;
  background: #07101f;
  padding: 16px;
}
.player-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.player-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  color: #fff;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}
.player-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; }
video.player-frame { object-fit: contain; }
.toast { min-height: 22px; margin-top: 10px; color: #55dbff; }
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(5, 14, 31, .94), rgba(22, 50, 108, .9));
  backdrop-filter: blur(8px);
}
.login-overlay[hidden] { display: none; }
.login-card {
  width: min(100%, 390px);
  padding: 32px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 18px;
  background: rgba(255,255,255,.97);
  color: #172643;
  box-shadow: 0 24px 60px rgba(0, 7, 28, .34);
}
.login-mark { width: 32px; height: 32px; display: flex; align-items: end; gap: 3px; transform: skewY(-11deg); margin-bottom: 19px; }
.login-mark i { display: block; width: 7px; border-radius: 3px; background: linear-gradient(#8bb1ff,#3674ff); }
.login-mark i:nth-child(1) { height: 15px; }
.login-mark i:nth-child(2) { height: 27px; }
.login-mark i:nth-child(3) { height: 20px; }
.eyebrow { margin: 0 0 8px; color: #8190aa; font-size: 10px; font-weight: 750; letter-spacing: 1.55px; }
.login-card h2 { margin: 0 0 9px; font-size: 21px; letter-spacing: 0; }
.login-card > p:not(.eyebrow):not(.login-error) { margin: 0 0 23px; color: #768399; font-size: 13px; line-height: 1.6; }
.login-card label { display: grid; gap: 8px; color: #55647c; font-size: 12px; font-weight: 700; }
.login-card input { width: 100%; height: 42px; border: 1px solid #dce5f2; border-radius: 9px; padding: 0 12px; font: inherit; color: #172643; outline: none; transition: .18s; }
.login-card input:focus { border-color: #5f8df1; box-shadow: 0 0 0 3px #e8f0ff; }
.login-card button { width: 100%; height: 42px; border: 0; border-radius: 9px; background: linear-gradient(115deg,#2e63d8,#4383f2); color: #fff; font: inherit; font-weight: 750; cursor: pointer; box-shadow: 0 9px 18px rgba(48,103,216,.22); }
.login-card button:disabled { opacity: .65; cursor: wait; }
.login-error { min-height: 18px; margin: 7px 0; color: #d34c5c; font-size: 11px; }
.is-locked .admin-shell { filter: blur(5px); pointer-events: none; user-select: none; }
@media (max-width: 1100px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .page-shell { width: calc(100% - 28px); }
  .topbar {
    height: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 0 8px;
    gap: 9px;
  }
  .brand { justify-content: center; font-size: 24px; }
  .brand-logo { width: 40px; height: 40px; flex-basis: 40px; }
  .top-links {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    gap: 4px;
    padding: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 12px;
  }
  .top-links::-webkit-scrollbar { display: none; }
  .top-links a,
  .top-links button { min-height: 30px; padding: 0 10px; flex: 0 0 auto; }
  .page-hero { display: block; padding: 14px 0 10px; }
  .page-hero h1 { font-size: 25px; line-height: 1.08; }
  .page-hero p { margin-top: 8px; font-size: 13px; line-height: 1.35; }
  .toolbar { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; margin: 10px 0 14px; }
  .toolbar input,
  .toolbar select {
    height: 38px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 7px;
  }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .video-body { padding: 9px 9px 10px; }
  .video-body h2 { font-size: 13px; line-height: 1.18; }
  .meta { margin-top: 6px; font-size: 11px; gap: 8px; }
  .play { width: 32px; height: 32px; }
  .play::before { margin: 10px 0 0 13px; border-left-width: 10px; border-top-width: 6px; border-bottom-width: 6px; }
  .badge { padding: 3px 6px; font-size: 11px; }
  .duration { right: 6px; bottom: 6px; padding: 2px 5px; font-size: 9px; border-radius: 6px; }
  .tutorial-footer { margin-top: 44px; padding-top: 22px; }
  .partners { gap: 8px 24px; min-height: 0; }
  .partners span { font-size: 15px; line-height: 1.08; }
  .partners b { font-size: 14px; line-height: 1.08; }
  .site-footer {
    width: max-content;
    max-width: none;
    margin-left: 50%;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 0 18px;
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%) scale(.78);
    transform-origin: center top;
  }
  .table-item { grid-template-columns: 86px 1fr; }
  .table-item img { width: 86px; }
  .table-actions { grid-column: 1 / -1; }
}
@keyframes brand-logo-shine {
  0%, 28% { transform: translateX(-95%) rotate(8deg); opacity: 0; }
  42% { opacity: .9; }
  62%, 100% { transform: translateX(95%) rotate(8deg); opacity: 0; }
}
