/* ============================================================
   夜斗 · 视频作品集
   深色影视风 · 玻璃拟态卡片 · 渐变封面
   ------------------------------------------------------------
   说明：本页面刻意保持深色单主题（影视作品集的视觉基调），
        因此没有做浅色主题切换；颜色仍集中在 :root 里便于统一调整。
   ============================================================ */

:root {
  color-scheme: dark;

  --bg: #08080d;
  --card: #12121c;
  --card-2: #171724;
  --border: rgba(255, 255, 255, .075);
  --border-strong: rgba(255, 255, 255, .14);
  --text: #f2f2f7;
  --muted: #8a8a9e;
  --muted-2: #5d5d73;
  --accent: #a855f7;
  --accent-2: #ec4899;
  --accent-3: #22d3ee;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --maxw: 1140px;

  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 20px;
  --shadow-sm: 0 8px 20px -10px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 56px -28px rgba(0, 0, 0, .95);
  --ring: 0 0 0 4px rgba(168, 85, 247, .22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}
::selection { background: rgba(168, 85, 247, .35); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

.ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; line-height: 0; }
.ico svg { display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* 背景光晕 */
body::before {
  content: '';
  position: fixed;
  top: -260px; left: 50%;
  transform: translateX(-50%);
  width: 1000px; height: 620px;
  background:
    radial-gradient(circle at 32% 42%, rgba(168, 85, 247, .24), transparent 62%),
    radial-gradient(circle at 70% 32%, rgba(236, 72, 153, .16), transparent 62%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

/* ============ 头部 ============ */
header {
  position: relative;
  z-index: 1;
  padding: 76px 0 40px;
}
.head-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
}
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  flex: 0 0 auto;
  /* 品牌标识自带夜空渐变底，这里只负责投影 —— 见 index.html 的 #brandMark */
  filter: drop-shadow(0 8px 20px rgba(139, 92, 246, .55));
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.brand-name small { color: var(--muted-2); font-weight: 500; font-size: 12.5px; margin-left: 4px; }

h1 {
  font-size: clamp(30px, 4.6vw, 48px);
  font-weight: 840;
  letter-spacing: -.038em;
  line-height: 1.12;
  margin-bottom: 14px;
}
h1 .grad {
  background: linear-gradient(110deg, var(--accent) 5%, var(--accent-2) 52%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  max-width: 560px;
}
.sub b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

.contact { display: flex; gap: 10px; flex-wrap: wrap; }
.contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .22s cubic-bezier(.34, 1.4, .64, 1),
              border-color .22s ease, background .22s ease, filter .22s ease;
}
.contact a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: rgba(168, 85, 247, .14);
}
.contact a.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(168, 85, 247, 1);
}
.contact a.primary:hover { filter: brightness(1.08); }
.contact a.on {
  border-color: var(--accent);
  background: rgba(168, 85, 247, .18);
  color: #fff;
}

/* ============ 筛选胶囊 ============ */
.filters {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.chip {
  padding: 9px 19px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: all .22s cubic-bezier(.34, 1.4, .64, 1);
}
.chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.chip.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(168, 85, 247, 1);
}

/* ============ 工具栏 ============ */
.toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.search-box { position: relative; flex: 1 1 220px; max-width: 340px; }
.search-box > .ico {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
  transition: color .2s ease;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.search-box input::placeholder { color: var(--muted-2); }
.search-box input:focus {
  border-color: var(--accent);
  background: rgba(168, 85, 247, .06);
  box-shadow: var(--ring);
}
.search-box:focus-within > .ico { color: var(--accent); }

.select-wrap { position: relative; }
.select-wrap > .ico {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.select-wrap select {
  appearance: none;
  padding: 10px 34px 10px 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .03);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235d5d73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.6 9.6L12 15l5.4-5.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.select-wrap select:hover { border-color: var(--accent); }
.select-wrap select:focus { border-color: var(--accent); box-shadow: var(--ring); }
.select-wrap select option { background: var(--card-2); color: var(--text); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-2);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  white-space: nowrap;
}
.status i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .18);
}
.status.off i { background: var(--warning); box-shadow: 0 0 0 3px rgba(251, 191, 36, .18); }
.status.err i { background: var(--danger); box-shadow: 0 0 0 3px rgba(248, 113, 113, .18); }

/* 通用按钮 */
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s cubic-bezier(.34, 1.4, .64, 1),
              border-color .2s ease, background .2s ease, filter .2s ease;
}
.btn-primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(168, 85, 247, 1);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: none; }

.btn-ghost {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); background: rgba(168, 85, 247, .12); transform: translateY(-2px); }

/* ============ 作品网格 ============ */
main { position: relative; z-index: 1; padding: 0 0 80px; }

.works {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.work {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1),
              border-color .3s ease, box-shadow .3s ease;
  animation: rise .55s cubic-bezier(.22, 1, .36, 1) backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.work:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.work:active { transform: translateY(-3px) scale(.995); }

/* 缩略图 */
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--g1), var(--g2));
}
.thumb-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 95% at 16% 8%, rgba(255, 255, 255, .46), transparent 55%),
    radial-gradient(95% 85% at 84% 92%, rgba(0, 0, 0, .46), transparent 60%);
}
.thumb-pattern {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .17) 1px, transparent 1.4px);
  background-size: 15px 15px;
  opacity: .7;
}
.thumb-mark {
  position: absolute;
  right: -16px; bottom: -34px;
  font-size: 112px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.08em;
  color: rgba(255, 255, 255, .14);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

/* 自定义封面（七牛云上传）：铺满整个缩略图，渐变只留作兜底
   图片下面就是渐变底，所以图片没加载出来时不会露出空白 */
.thumb.has-cover { background: linear-gradient(135deg, var(--g1), var(--g2)); }
.thumb-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
  transition: transform .5s cubic-bezier(.2, .7, .3, 1);
}
.work:hover .thumb-img { transform: scale(1.045); }
/* 有封面时，装饰层只留一点点渐变，避免糊在照片上；角标要压到图片上面 */
.thumb.has-cover .thumb-bg { opacity: .28; }
.thumb.has-cover .thumb-pattern { opacity: .18; }
.thumb.has-cover .badge-plat,
.thumb.has-cover .badge-dur,
.thumb.has-cover .go-hint,
.thumb.has-cover .work-acts { z-index: 3; }
.thumb-play {
  position: absolute;
  left: 50%; top: 50%;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #12121c;
  display: grid; place-items: center;
  transform: translate(-50%, -50%) scale(.82);
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .7);
  transition: transform .35s cubic-bezier(.34, 1.6, .64, 1), background .25s ease;
  z-index: 3;
}
.work:hover .thumb-play { transform: translate(-50%, -50%) scale(1); background: #fff; }

.badge-plat {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 4;
  padding: 4px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 750;
  background: rgba(8, 8, 13, .68);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
}
.badge-dur {
  position: absolute;
  bottom: 12px; right: 12px;
  z-index: 4;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 750;
  background: rgba(8, 8, 13, .82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* 跳转提示箭头 */
.go-hint {
  position: absolute;
  right: 12px; top: 12px;
  z-index: 4;
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(8, 8, 13, .72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  opacity: 0;
  transform: translate(-6px, -6px) scale(.8);
  transition: opacity .25s ease, transform .3s cubic-bezier(.34, 1.6, .64, 1);
}
.work:hover .go-hint { opacity: 1; transform: translate(0, 0) scale(1); }
/* 管理模式：右上角让位给编辑/删除按钮 */
body.admin .go-hint { display: none; }

/* 管理模式下的卡片操作按钮 */
.work-acts {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 5;
  display: none;
  gap: 6px;
}
body.admin .work-acts { display: flex; }
.wact {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(8, 8, 13, .78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.wact:hover { transform: scale(1.08); border-color: var(--accent); background: rgba(168, 85, 247, .85); }
.wact.del:hover { border-color: var(--danger); background: rgba(248, 113, 113, .9); }

/* 内容区 */
.work-body { padding: 16px 17px 18px; display: flex; flex-direction: column; flex: 1; }
.work-title {
  font-size: 14.6px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -.012em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.5em * 2);
  transition: color .22s ease;
}
.work:hover .work-title { color: var(--accent); }

.work-meta {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  font-size: 12.4px;
  color: var(--muted);
}
.work-meta .m {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.work-meta .m .ico { opacity: .68; }
.work-meta .cat {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-2);
  background: rgba(236, 72, 153, .12);
  border: 1px solid rgba(236, 72, 153, .2);
}

/* 骨架屏 */
.skeleton {
  height: 300px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 37%, var(--card) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 空状态 */
.empty { text-align: center; color: var(--muted); font-size: 15px; padding: 70px 0; }
.empty .big {
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--muted-2);
}
.empty b { display: block; color: var(--text); font-weight: 650; margin-bottom: 4px; }

/* 页脚 */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-size: 12.5px;
  color: var(--muted-2);
  text-align: center;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ============ 弹窗 ============ */
dialog {
  border: 1px solid var(--border-strong);
  padding: 0;
  border-radius: 22px;
  background: var(--card-2);
  color: var(--text);
  width: min(520px, calc(100vw - 32px));
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .95);
}
dialog::backdrop {
  background: rgba(4, 4, 8, .68);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
dialog form { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { font-size: 18px; font-weight: 780; letter-spacing: -.02em; margin-bottom: 2px; }
dialog label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
dialog input {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  width: 100%;
}
dialog input:focus { border-color: var(--accent); box-shadow: var(--ring); }
dialog input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
dialog .hint { font-size: 12px; color: var(--muted-2); line-height: 1.75; font-weight: 400; }
dialog .err { font-size: 12.5px; color: var(--danger); font-weight: 650; min-height: 18px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ============ 封面图上传（七牛云） ============ */
.cover-field { display: flex; flex-direction: column; gap: 9px; }
.cover-label { font-size: 13px; color: var(--muted); font-weight: 620; }
.cover-row { display: flex; align-items: flex-start; gap: 12px; }
.cover-preview {
  flex: 0 0 auto;
  width: 152px; aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: var(--card-2);
  display: grid; place-items: center;
  overflow: hidden;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-hint { font-size: 11.5px; color: var(--muted-2); }
.cover-acts { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cover-note { font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.cover-note.warn { color: var(--warning); }
.cover-bar {
  height: 4px; border-radius: 999px; overflow: hidden;
  background: var(--card-2);
}
.cover-bar > span {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .18s ease;
}
dialog .cover-acts .btn-ghost { display: inline-flex; align-items: center; gap: 6px; }

.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ============ 轻提示 ============ */
.toast-wrap {
  position: fixed;
  top: 22px; right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  position: relative;
  padding: 12px 17px 12px 19px;
  border-radius: var(--r-md);
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .95);
  font-size: 13.5px;
  font-weight: 600;
  max-width: 330px;
  line-height: 1.6;
  pointer-events: auto;
  animation: toastIn .26s cubic-bezier(.34, 1.4, .64, 1);
}
.toast::before {
  content: '';
  position: absolute;
  left: -1px; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.toast.ok::before { background: var(--success); }
.toast.err::before { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px) scale(.96); } }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .12);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); background-clip: content-box; }

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .works { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  header { padding: 48px 0 30px; }
  .head-inner { gap: 20px; }
  .sub { font-size: 14.5px; }
  .contact { width: 100%; }
  .contact a { flex: 1; justify-content: center; padding: 11px 14px; }
  .works { grid-template-columns: 1fr; gap: 16px; }
  .thumb-play { width: 50px; height: 50px; }
  .thumb-mark { font-size: 92px; }
  main { padding-bottom: 56px; }
  .search-box { max-width: none; }
  .row2, .row3 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
