:root {
  --bg: #0f1410;
  --bg-elevated: #182019;
  --bg-soft: #1e2920;
  --line: rgba(232, 220, 196, 0.12);
  --text: #f3efe6;
  --text-muted: #a8b0a4;
  --accent: #c4a35a;
  --accent-soft: rgba(196, 163, 90, 0.16);
  --danger: #d96b5c;
  --ok: #7cb896;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 163, 90, 0.14), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(80, 120, 90, 0.18), transparent 50%),
    linear-gradient(180deg, #121812 0%, var(--bg) 40%, #0c100d 100%);
  font-family: var(--font-body);
  min-height: 100%;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

img, video {
  max-width: 100%;
  display: block;
}

body.player-only img,
body.player-only video {
  max-width: none;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-brand {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  letter-spacing: 0.08em;
  font-weight: 600;
  margin: 0;
}

.eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.75rem;
  margin: 0 0 0.75rem;
}

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

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
  background: var(--accent);
  color: #1a160c;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: #d4b56b;
}

.btn.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.danger {
  background: transparent;
  border-color: rgba(217, 107, 92, 0.45);
  color: var(--danger);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.field label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(196, 163, 90, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.field.inline input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(217, 107, 92, 0.5);
}

/* Home */
.home {
  min-height: 100vh;
  display: grid;
  align-items: stretch;
}

.home-hero {
  min-height: 100vh;
  display: grid;
  align-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem 0 4rem;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(15,20,16,0.2), rgba(15,20,16,0.75));
  z-index: 0;
}

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

.home-copy {
  max-width: 34rem;
}

.home-copy p {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--text-muted);
  margin: 1rem 0 1.75rem;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.home-orb {
  position: absolute;
  right: -8%;
  bottom: 8%;
  width: min(48vw, 420px);
  aspect-ratio: 1;
  border-radius: 40% 60% 55% 45%;
  background:
    radial-gradient(circle at 30% 30%, rgba(196,163,90,0.55), transparent 42%),
    radial-gradient(circle at 70% 60%, rgba(90,140,110,0.45), transparent 50%),
    rgba(255,255,255,0.04);
  filter: blur(2px);
  animation: morph 12s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes morph {
  from { border-radius: 40% 60% 55% 45%; transform: rotate(0deg) scale(1); }
  to { border-radius: 55% 45% 40% 60%; transform: rotate(12deg) scale(1.05); }
}

/* Share page */
.share-page {
  min-height: 100vh;
  padding: 1.25rem 0 3rem;
}

.share-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.share-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0.2rem 0 0.4rem;
}

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(700px 360px at 20% 10%, rgba(196,163,90,0.12), transparent 55%),
    radial-gradient(600px 320px at 90% 80%, rgba(80,120,90,0.16), transparent 50%),
    #000;
}

.gate .panel,
.gate .gate-panel {
  width: min(420px, 100%);
  padding: 1.75rem 1.5rem 1.4rem;
  border-radius: 20px;
  border: 1px solid rgba(232, 220, 196, 0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 42%),
    rgba(18, 26, 20, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.gate h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.35rem;
}

.gate-desc {
  margin: 0 0 1.2rem;
  font-size: 0.92rem;
}

.gate-error {
  min-height: 1.3em;
  margin: 0 0 0.85rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.gate-submit {
  width: 100%;
}

.gate-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

body.player-only .gate {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: auto;
}

/* 需要密码页：纯白背景 + 左上角 LOGO */
body.gate-white,
body.gate-white #app,
html:has(body.gate-white) {
  background: #fff !important;
  overflow: auto;
}

body.gate-white.player-only {
  background: #fff !important;
}

/* 内置浏览器拦截引导页 */
body.inapp-guide,
body.inapp-guide #app,
html:has(body.inapp-guide) {
  background: #fff !important;
  overflow: auto;
}

.inapp-guide-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.inapp-guide-logo {
  display: block;
  width: min(220px, 72vw);
  height: auto;
  margin: 0 auto 1.25rem;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.inapp-guide-panel {
  width: min(420px, 100%);
  padding: 1.5rem 1.35rem 1.35rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
  text-align: center;
}

.inapp-guide-panel h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.inapp-guide-panel .eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #999;
}

.inapp-guide-desc {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.65;
  text-align: left;
}

.inapp-guide-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #333;
}

.inapp-guide-tip {
  margin: 0;
  font-size: 0.82rem;
  text-align: left;
}

.gate.gate-light {
  background: #fff !important;
  color: #1a1a1a;
  place-items: center;
}

.gate.gate-light .gate-logo {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  width: min(120px, 32vw);
  height: auto;
  object-fit: contain;
  z-index: 6;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.gate.gate-light .gate-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
}

.gate.gate-light h1,
.gate.gate-light .eyebrow {
  color: #1a1a1a;
}

.gate.gate-light .muted,
.gate.gate-light .gate-desc,
.gate.gate-light label {
  color: #666;
}

.gate.gate-light input {
  color: #111;
  background: #f7f7f7;
  border-color: rgba(0, 0, 0, 0.12);
}

/* 禁止下载时的前端防护 */
body.no-download,
body.no-download * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

body.no-download .protected-media,
body.no-download img,
body.no-download video,
body.no-download .protected-video-canvas {
  -webkit-user-drag: none !important;
  user-drag: none !important;
  pointer-events: none !important;
}

body.no-download .protected-video-source {
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -9999 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  -webkit-touch-callout: none !important;
}

.protected-video-canvas {
  background: #000;
  pointer-events: none;
  -webkit-touch-callout: none;
  user-select: none;
}

body.no-download .protected-image {
  pointer-events: none !important;
  -webkit-touch-callout: none !important;
}

body.no-download .media-shield {
  pointer-events: auto !important;
  -webkit-touch-callout: none !important;
}

body.no-download .media-stack-item .media-shield {
  touch-action: pan-y !important;
}

body.no-download .fullscreen-player .media-shield {
  touch-action: manipulation !important;
}

.media-shield {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
}

.protected-media-wrap {
  position: fixed;
  inset: 0;
}

.media-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.image-stage {
  touch-action: pan-x pan-y pinch-zoom;
}

.media-stage img,
.media-stage video,
.media-stage .protected-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center center;
  display: block;
  border: 0;
}

.player-chrome {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  pointer-events: none;
}

.player-chrome[hidden] {
  display: none !important;
}

.player-chrome-side {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.player-btn {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  touch-action: manipulation;
}

.player-btn.sound-toggle[aria-pressed="true"] {
  border-color: rgba(196, 163, 90, 0.55);
  background: rgba(196, 163, 90, 0.28);
}

.protected-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  background-color: #000;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: block;
  border: 0;
  pointer-events: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.media-stack-item .media-shield {
  touch-action: pan-y;
}

.fullscreen-player .media-shield {
  touch-action: manipulation;
}

body.devtools-blocked::after {
  content: "";
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

@media (min-width: 900px) {
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
  }
}

.media-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1;
  cursor: pointer;
  isolation: isolate;
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.media-item:hover img,
.media-item:hover video {
  transform: scale(1.04);
}

.media-item .badge {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  backdrop-filter: blur(6px);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 6, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.lightbox.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-inner {
  width: min(1100px, 100%);
  max-height: 92vh;
  display: grid;
  gap: 0.75rem;
}

.lightbox-stage {
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  min-height: 40vh;
}

.lightbox-stage img,
.lightbox-stage video {
  max-height: 78vh;
  width: auto;
  height: auto;
  max-width: 100%;
}

.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Admin — 参考浅色后台：侧栏 + 主区双 Card 表格 */
body.admin-body {
  background: #f0f2f5 !important;
  color: #1f1f1f;
}

body.admin-body,
html:has(body.admin-body) {
  background: #f0f2f5 !important;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px 1fr;
  background: #f0f2f5;
  color: #1f1f1f;
}

@media (max-width: 860px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-nav {
    position: sticky;
    top: 0;
    z-index: 20;
  }
}

.admin-nav {
  border-right: 1px solid #e8e8e8;
  background: #fafafa;
  padding: 1.25rem 0.85rem;
}

.admin-nav .logo {
  margin: 0 0.4rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.admin-nav .logo img {
  display: block;
  width: min(148px, 100%);
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.admin-nav .nav-foot-logo {
  margin: 1.5rem 0.4rem 0;
}

.admin-nav .nav-group {
  display: grid;
  gap: 0.15rem;
  margin-bottom: 0.35rem;
}

.admin-nav .nav-divider {
  height: 1px;
  background: #e8e8e8;
  margin: 0.55rem 0.4rem 0.75rem;
}

.admin-nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #595959;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 0.2rem;
}

.admin-nav button.active,
.admin-nav button:hover {
  background: #e6f4ff;
  color: #1677ff;
}

.admin-nav .muted {
  color: #8c8c8c;
}

.admin-main {
  padding: 1rem 1.25rem 2rem;
  background: #f0f2f5;
  min-width: 0;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.admin-header h1 {
  margin: 0.15rem 0 0;
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 600;
  color: #141414;
}

.admin-breadcrumb {
  font-size: 0.82rem;
  color: #8c8c8c;
}

.admin-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.admin-header-meta {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.server-clock {
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: #595959;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.server-clock::before {
  content: "服务器时间 ";
  color: #8c8c8c;
}

.server-clock-zone {
  font-size: 0.8rem;
  color: #1677ff;
  white-space: nowrap;
}

.server-clock-zone::before {
  content: "· ";
  color: #bfbfbf;
}

.admin-cards {
  display: grid;
  gap: 1rem;
}

.admin-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.admin-card-head {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.admin-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-card-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #141414;
}

.admin-search input[type="search"] {
  width: min(280px, 100%);
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  color: #141414;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

.admin-search input[type="search"]::placeholder {
  color: #bfbfbf;
}

.admin-search input[type="search"]:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.admin-card-body {
  padding: 0.75rem 1rem 1rem;
}

.admin-card-body.table-wrap {
  padding: 0;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 860px;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  color: #262626;
}

.admin-table th {
  background: #fafafa;
  color: #595959;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: #fafafa;
}

.admin-table .table-title {
  font-weight: 600;
  color: #141414;
}

.admin-table .table-sub {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #8c8c8c;
}

.admin-table .table-empty {
  text-align: center;
  color: #bfbfbf;
  padding: 2.5rem 1rem !important;
}

.admin-table .table-actions {
  white-space: nowrap;
}

.btn-mini {
  display: inline-block;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #262626;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  margin: 0 0.15rem 0.15rem 0;
}

.btn-mini:hover {
  color: #1677ff;
  border-color: #1677ff;
}

.btn-mini.danger {
  color: #cf1322;
  border-color: #ffa39e;
}

.btn-mini.danger:hover {
  color: #fff;
  background: #ff4d4f;
  border-color: #ff4d4f;
}

.btn-mini:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-shell .btn {
  background: #1677ff;
  color: #fff;
  border: 0;
}

.admin-shell .btn.secondary {
  background: #fff;
  color: #262626;
  border: 1px solid #d9d9d9;
}

.admin-shell .btn.danger {
  background: #ff4d4f;
  color: #fff;
}

.admin-shell .field label {
  color: #595959;
}

.admin-shell .field input,
.admin-shell .field textarea {
  background: #fff;
  color: #141414;
  border: 1px solid #d9d9d9;
}

.admin-shell .chip {
  border-color: #d9d9d9;
  background: #fafafa;
  color: #595959;
}

.admin-shell .chip.on {
  border-color: #91caff;
  background: #e6f4ff;
  color: #1677ff;
}

.share-list {
  display: grid;
  gap: 0.85rem;
}

.share-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 700px) {
  .share-card {
    grid-template-columns: 1fr;
  }
}

.share-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.65rem 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chip.on {
  border-color: rgba(124, 184, 150, 0.45);
  color: var(--ok);
}

.chip.off {
  border-color: rgba(217, 107, 92, 0.45);
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 60;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
}

/* 后台弹窗：浅色高对比，避免深色主题看不清 */
body.admin-body .modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

body.admin-body .modal {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #141414;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
}

body.admin-body .modal h2 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  color: #141414;
}

body.admin-body .modal .muted,
body.admin-body .modal label {
  color: #595959;
}

body.admin-body .modal .field input,
body.admin-body .modal .field textarea,
body.admin-body .modal .field select {
  background: #fff;
  color: #141414;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
}

body.admin-body .modal .field input::placeholder,
body.admin-body .modal .field textarea::placeholder {
  color: #bfbfbf;
}

body.admin-body .modal .field input:focus,
body.admin-body .modal .field textarea:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

body.admin-body .modal .field.inline label {
  color: #262626;
}

body.admin-body .modal .btn {
  background: #1677ff;
  color: #fff;
  border: 0;
}

body.admin-body .modal .btn.secondary {
  background: #fff;
  color: #262626;
  border: 1px solid #d9d9d9;
}

body.admin-body .modal .btn.danger {
  background: #ff4d4f;
  color: #fff;
  border: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.file-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.file-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}

.qr-box {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #fff;
  border-radius: 16px;
  color: #111;
}

.qr-box img {
  width: min(260px, 70vw);
  height: auto;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
}

.login-wrap {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
  background: #fff;
}

.login-bg {
  display: none;
}

.login-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.55;
  animation: loginFloat 12s ease-in-out infinite;
}

.login-bg .orb-a {
  width: 42vw;
  height: 42vw;
  max-width: 420px;
  max-height: 420px;
  left: -8%;
  top: 10%;
  background: radial-gradient(circle at 30% 30%, rgba(196,163,90,0.35), transparent 70%);
}

.login-bg .orb-b {
  width: 48vw;
  height: 48vw;
  max-width: 480px;
  max-height: 480px;
  right: -10%;
  bottom: 5%;
  background: radial-gradient(circle at 60% 40%, rgba(90,140,110,0.28), transparent 70%);
  animation-delay: -4s;
}

.login-bg .grid-fade {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,220,196,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,220,196,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.7), transparent 75%);
  animation: loginGrid 20s linear infinite;
}

@keyframes loginFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(0, -18px, 0) scale(1.04); }
}

@keyframes loginGrid {
  from { transform: translateY(0); }
  to { transform: translateY(48px); }
}

@keyframes loginIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 2rem 1.75rem 1.6rem;
  border-radius: 22px;
  border: 1px solid #e8e8e8;
  background: #fff;
  color: #1f1f1f;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
  animation: loginIn 0.55s ease both;
}

.login-card .muted,
.login-card .login-tip {
  color: #8c8c8c;
}

.login-card .field label {
  color: #595959;
}

.login-card .field input {
  background: #fff;
  color: #141414;
  border: 1px solid #d9d9d9;
}

.login-card .field input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.login-card .captcha-btn {
  background: #fafafa;
  border: 1px solid #d9d9d9;
}

.login-card .captcha-btn:hover {
  border-color: #1677ff;
}

.login-card .login-submit {
  background: #1677ff;
  color: #fff;
  border-radius: 12px;
}

.login-card .login-submit:hover {
  background: #4096ff;
}

.login-card-head {
  margin-bottom: 1.4rem;
  text-align: center;
}

.login-card-head .login-logo {
  display: block;
  width: min(220px, 100%);
  height: auto;
  margin: 0 auto 0.75rem;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.login-card-head .muted {
  margin: 0;
  font-size: 0.92rem;
  text-align: center;
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  align-items: stretch;
}

.captcha-btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.captcha-btn:hover {
  border-color: rgba(196, 163, 90, 0.55);
  transform: translateY(-1px);
}

.captcha-btn.is-refreshing {
  opacity: 0.55;
  pointer-events: none;
}

.captcha-btn.is-refreshing img {
  animation: captchaPulse 0.45s ease;
}

@keyframes captchaPulse {
  from { opacity: 0.25; filter: blur(1px); }
  to { opacity: 1; filter: none; }
}

.captcha-btn img {
  display: block;
  width: 140px;
  height: 46px;
}

.login-error {
  min-height: 1.35em;
  margin: 0 0 0.85rem;
  color: var(--danger);
  font-size: 0.9rem;
}

.login-submit {
  width: 100%;
}

.login-tip {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  text-align: center;
}

body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff !important;
  color: #1f1f1f;
}

html:has(body.login-page) {
  background: #fff !important;
}

.login-wrap .panel {
  width: min(420px, 100%);
}

html:has(body.player-only) {
  background: #000 !important;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
}

body.player-only {
  margin: 0;
  padding: 0;
  background: #000 !important;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

body.player-only #app {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: #000;
  z-index: 1;
  overflow: hidden;
}

body.player-only .fullscreen-player {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: #000;
  z-index: 2;
  overflow: hidden;
}

body.player-only .media-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

body.player-only .share-media,
body.player-only .fullscreen-player video:not(.protected-video-source),
body.player-only .fullscreen-player img,
body.player-only video#mainVideo:not(.protected-video-source),
body.player-only img#mainImage,
body.player-only .protected-video-canvas {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center center;
  background: #000;
  border: 0;
  margin: 0;
  padding: 0;
}

body.player-only .protected-image,
body.player-only .fullscreen-player .protected-image {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  background-color: #000;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border: 0;
}

body.player-only .toast {
  display: none;
}

/* 多图/多视频竖向全屏流 */
body.player-only.media-stack-mode {
  overflow: hidden;
}

body.player-only.media-stack-mode #app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: 100svh;
  min-height: -webkit-fill-available;
}

.media-stack {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  background: #000;
  z-index: 2;
}

.media-stack-item {
  position: relative;
  width: 100%;
  height: 100dvh;
  height: 100svh;
  min-height: -webkit-fill-available;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  flex-shrink: 0;
  touch-action: pan-y;
  overflow: hidden;
}

.media-stack-item .media-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-stack-item .stack-video,
.media-stack-item .stack-image,
.media-stack-item .protected-image,
.media-stack-item .share-media,
.media-stack-item .protected-video-canvas {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center center;
  background-color: #000;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border: 0;
  pointer-events: none;
  touch-action: pan-y;
}

.player-chrome .sound-toggle,
.sound-toggle {
  position: static;
  right: auto;
  bottom: auto;
}

/* 普通文件分享列表 */
body.files-view {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  background:
    radial-gradient(700px 360px at 15% 0%, rgba(196,163,90,0.10), transparent 55%),
    radial-gradient(560px 300px at 90% 90%, rgba(80,120,90,0.14), transparent 50%),
    #0b100d !important;
  color: var(--text, #e8dcc4);
}

body.files-view #app {
  position: static;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: transparent;
}

.file-share-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: start center;
  padding: 1.5rem 1rem 3rem;
}

.file-share-panel {
  width: min(720px, 100%);
  border: 1px solid rgba(232, 220, 196, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 40%),
    rgba(18, 26, 20, 0.92);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  padding: 1.25rem 1.15rem 1rem;
}

.file-share-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.file-share-head .muted {
  margin: 0;
  font-size: 0.9rem;
}

.file-share-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.1rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 220, 196, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.file-check-all {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem;
}

.file-share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.file-share-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 220, 196, 0.12);
  background: rgba(0, 0, 0, 0.18);
}

.file-share-check {
  display: grid;
  place-items: center;
}

.file-share-name {
  font-weight: 600;
  word-break: break-all;
  line-height: 1.35;
}

.file-share-sub {
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

.file-dl-btn {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .file-share-item {
    grid-template-columns: auto 1fr;
  }

  .file-dl-btn,
  .file-share-item > .muted {
    grid-column: 2;
    justify-self: start;
  }
}
