/* ===================================================================
   Naked-Eye-3D — Stylesheet v2
   Layout: header / sidebar + center (banner + row list)
   =================================================================== */

/* ── 1. Design Tokens ─────────────────────────────────────────────── */
:root {
  --bg:           #141418;
  --bg-surface:   #1a1a22;
  --bg-card:      #1f1f2a;
  --bg-hover:     #26263a;

  --red:          #e81c1c;
  --red-hover:    #ff3333;
  --red-glow:     rgba(232, 28, 28, 0.3);
  --red-sub:      rgba(232, 28, 28, 0.1);
  --red-border:   rgba(232, 28, 28, 0.45);

  --txt:          #ededf5;
  --txt-2:        #8888a8;
  --txt-3:        #55556a;
  --border:       rgba(255,255,255,0.07);

  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;

  --hdr-h:        58px;
  --sb-w:         90px;

  --ease:         0.22s cubic-bezier(.4,0,.2,1);
  --font:         'Outfit', 'Inter', system-ui, sans-serif;
}

/* ── 2. Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  height: 100vh;
  overflow: hidden;         /* single-screen */
  display: flex;
  flex-direction: column;
}

/* radial ambient glow */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(232,28,28,.05) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── 3. Header ────────────────────────────────────────────────────── */
.header {
  flex-shrink: 0;
  height: var(--hdr-h);
  background: rgba(14,14,18,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 100%;
  padding: 0 20px;
}

/* Logo */
.logo-link { flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: 9px; }

.logo-img {
  width: 30px; height: 30px;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 0 6px var(--red));
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.3px;
  white-space: nowrap;
}

.logo-accent { color: var(--red); }

.logo-3d {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: .6em;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 2px;
  vertical-align: middle;
  letter-spacing: 1px;
  box-shadow: 0 0 8px var(--red-glow);
}

/* Search */
.search-form {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.search-form:focus-within {
  border-color: var(--red-border);
  box-shadow: 0 0 0 3px var(--red-sub);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 9px 16px;
  font-size: .875rem;
  color: var(--txt);
  font-family: inherit;
}

.search-input::placeholder { color: var(--txt-3); }

.search-btn {
  padding: 7px 13px;
  color: var(--txt-2);
  display: flex;
  align-items: center;
  transition: color var(--ease);
}

.search-btn svg { width: 17px; height: 17px; }
.search-btn:hover { color: var(--red); }

/* Auth area (header right) */
.auth-area {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-btn {
  padding: 7px 16px;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--ease);
  box-shadow: 0 2px 12px var(--red-glow);
}

.auth-btn:hover { background: var(--red-hover); transform: translateY(-1px); }

.auth-user {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 600;
  color: var(--txt);
}

.auth-logout {
  background: transparent;
  color: var(--txt-2);
  border: 1px solid var(--border);
  box-shadow: none;
  padding: 6px 13px;
}

.auth-logout:hover {
  background: var(--red-sub);
  color: var(--red);
  border-color: var(--red-border);
  transform: none;
}

/* ── 4. Page Body ─────────────────────────────────────────────────── */
.page-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ── 5. Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  flex-shrink: 0;
  width: var(--sb-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 10px;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-btn {
  width: 100%;
  padding: 9px 8px;
  border-radius: var(--r-md);
  font-size: .82rem;
  font-weight: 600;
  color: var(--txt-2);
  text-align: center;
  transition: all var(--ease);
  font-family: inherit;
  line-height: 1.2;
  position: relative;
}

.cat-btn:hover {
  background: var(--bg-hover);
  color: var(--txt);
}

.cat-btn.active {
  background: var(--red-sub);
  color: var(--red);
}

.cat-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 55%;
  background: var(--red);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 6px var(--red);
}

/* ── 6. Center Main ───────────────────────────────────────────────── */
.center {
  flex: 1;
  overflow: hidden;
  display: flex;           /* horizontal: banner | video-list */
  flex-direction: row;
  gap: 14px;
  padding: 16px 18px 16px 16px;
}

/* ── 7. Banner Area (left) ────────────────────────────────────────── */
.banner-area {
  flex: 1;                 /* takes remaining space */
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,.7);
}

.banner-wrap {
  flex: 1;
  overflow: hidden;
  border-radius: inherit;
}

.banner-track {
  height: 100%;
}

.banner-slide {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.banner-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.banner-slide:hover img { transform: scale(1.03); }

.banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(14,14,18,.92) 0%, rgba(14,14,18,.55) 30%, transparent 65%);
  display: flex;
  align-items: flex-end;
  padding: 0 32px 26px;
}

.banner-info { max-width: 70%; }

.banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--red);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.banner-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0,0,0,.8);
}

.banner-desc {
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.banner-meta-row {
  display: flex;
  gap: 12px;
  font-size: .73rem;
  color: rgba(255,255,255,.55);
  margin-bottom: 14px;
}

.banner-play {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  padding: 8px 20px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: all var(--ease);
  box-shadow: 0 4px 16px var(--red-glow);
}

.banner-play:hover { background: var(--red-hover); transform: translateY(-2px); box-shadow: 0 6px 22px var(--red-glow); }

/* ── 8. Video List Area (right vertical) ──────────────────────────── */
.video-list-area {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(232,28,28,.2) transparent;
  padding-right: 2px;
}

.video-list-area::-webkit-scrollbar { width: 4px; }
.video-list-area::-webkit-scrollbar-thumb { background: rgba(232,28,28,.2); border-radius: 2px; }
.video-list-area::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ── 9. Video Card ────────────────────────────────────────────────── */
.video-card {
  flex-shrink: 0;
  width: 100%;           /* fills .video-list-area width */
  background: var(--bg-card);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--ease);
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  background: var(--bg-hover);
  border-color: var(--red-border);
  transform: translateY(-4px);
  box-shadow: 0 6px 28px rgba(0,0,0,.6), 0 0 18px var(--red-glow);
}

/* Thumbnail: 2:1 ratio */
.card-thumb {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: #0a0a10;
  flex-shrink: 0;
}

.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.video-card:hover .card-thumb img { transform: scale(1.07); }

.card-play-overlay {
  position: absolute; inset: 0;
  background: rgba(14,14,18,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--ease);
}

.video-card:hover .card-play-overlay { opacity: 1; }

.play-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  color: #fff;
  box-shadow: 0 0 16px var(--red-glow);
  transform: scale(.8);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}

.video-card:hover .play-icon { transform: scale(1); }

.card-badges {
  position: absolute;
  top: 6px; left: 6px;
  display: flex; gap: 4px;
}

.badge {
  font-size: .58rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge-3d { background: var(--red); color: #fff; }
.badge-hd  { background: rgba(255,255,255,.15); color: #fff; backdrop-filter: blur(4px); }
.badge-new { background: #16a34a; color: #fff; }

.card-duration {
  position: absolute;
  bottom: 5px; right: 6px;
  background: rgba(14,14,18,.8);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Card body */
.card-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  transition: color var(--ease);
}

.video-card:hover .card-title { color: var(--red); }

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--txt-3);
}

.card-rating { color: #f59e0b; font-weight: 700; }

/* ── 10. Sort Buttons ─────────────────────────────────────────────── */
.sort-controls { display: flex; gap: 5px; }

.sort-btn {
  padding: 4px 12px;
  font-size: .75rem;
  font-weight: 600;
  border-radius: var(--r-md);
  color: var(--txt-2);
  border: 1px solid var(--border);
  background: transparent;
  font-family: inherit;
  transition: all var(--ease);
}

.sort-btn:hover { color: var(--txt); border-color: rgba(255,255,255,.15); }

.sort-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 8px var(--red-glow);
}

/* ── 11. Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  backdrop-filter: blur(14px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}

.modal-overlay[hidden] { display: none; }

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

.modal {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: 0 12px 60px rgba(0,0,0,.9);
  max-width: 760px;
  width: 100%;
  position: relative;
  animation: slideUp .28s cubic-bezier(.34,1.56,.64,1);
  overflow: hidden;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: var(--txt-2);
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
  transition: all var(--ease);
}

.modal-close svg { width: 14px; height: 14px; }
.modal-close:hover { background: var(--red); color: #fff; }

.modal-video-wrap { aspect-ratio: 16/9; background: #000; overflow: hidden; }

.modal-video-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, #0d0d10, #1a0010);
  color: var(--txt-2);
  font-size: .88rem;
  position: relative;
}

.play-icon-big {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  box-shadow: 0 0 28px var(--red-glow);
  pointer-events: none;
}

.modal-play-trigger {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--ease);
}

.modal-play-trigger:hover { transform: scale(1.06); }
.modal-play-trigger:hover .play-icon-big { background: var(--red-hover); }

.modal-info { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; }

.modal-title { font-size: 1.15rem; font-weight: 700; color: var(--txt); }

.modal-desc { font-size: .84rem; color: var(--txt-2); line-height: 1.6; }

.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions[hidden] { display: none !important; }

/* Buttons */
.btn-primary {
  background: var(--red); color: #fff;
  font-weight: 700; font-size: .85rem;
  padding: 8px 20px;
  border-radius: var(--r-md);
  border: none; cursor: pointer; font-family: inherit;
  transition: all var(--ease);
  box-shadow: 0 2px 12px var(--red-glow);
}

.btn-primary:hover { background: var(--red-hover); transform: translateY(-1px); }

.btn-outline {
  background: transparent; color: var(--txt);
  font-weight: 500; font-size: .85rem;
  padding: 7px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  cursor: pointer; font-family: inherit;
  transition: all var(--ease);
}

.btn-outline:hover { border-color: var(--red-border); color: var(--red); background: var(--red-sub); }

/* ── 12. Content fade animation ───────────────────────────────────── */
.content-fade { animation: cFade .3s ease; }
@keyframes cFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 13. Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232,28,28,.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ── 14. Responsive guards ────────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --sb-w: 56px; }
  .cat-btn { font-size: .7rem; padding: 8px 4px; }
}

/* ── 15. Auth / loading ─────────────────────────────────────────── */
.modal-sm { max-width: 420px; }
.auth-body { padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.auth-tip { font-size: .84rem; color: var(--txt-2); line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.auth-label { display: flex; flex-direction: column; gap: 6px; font-size: .82rem; color: var(--txt-2); }
.auth-label input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--txt);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  transition: border-color var(--ease);
}
.auth-label input:focus { border-color: var(--red-border); box-shadow: 0 0 0 3px var(--red-sub); }
.auth-error { font-size: .82rem; color: #f87171; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }
.list-loading, .list-empty, .banner-empty {
  padding: 30px 20px;
  color: var(--txt-3);
  font-size: .88rem;
  text-align: center;
}
.is-hidden { display: none !important; }
#modal-video-player { object-fit: contain; }

/* ── 16. 个人中心 ─────────────────────────────────────────────── */
.auth-btn.auth-center {
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--border);
  box-shadow: none;
  padding: 6px 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.auth-btn.auth-center:hover {
  background: var(--red-sub);
  color: var(--red);
  border-color: var(--red-border);
  transform: none;
}

body.uc-page {
  overflow: hidden;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.uc-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  width: 100%;
  margin: 0;
  padding: 12px 20px 20px 16px;
  gap: 16px;
}

.uc-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 12px;
  height: fit-content;
  position: sticky;
  top: 12px;
}
.uc-sidebar-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--txt-3);
  padding: 0 10px 12px;
}
.uc-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.uc-menu-item {
  display: block;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--txt-2);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
}
.uc-menu-item:hover {
  color: var(--txt);
  background: var(--bg-hover);
}
.uc-menu-item.is-active {
  color: #fff;
  background: var(--red);
}

.uc-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.uc-panel[hidden] { display: none !important; }

.uc-placeholder {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 64px 24px;
  text-align: center;
  color: var(--txt-2);
  font-size: 1.1rem;
  font-weight: 600;
}

.uc-account-card,
.uc-device-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
  max-width: 480px;
}
.uc-device-form-card { max-width: 640px; margin-bottom: 0; }
.uc-back-btn {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--txt-2);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.uc-back-btn:hover { color: var(--red); }
#uc-device-list-view[hidden],
#uc-device-form-view[hidden],
#uc-group-form-view[hidden],
#uc-program-list-view[hidden],
#uc-program-form-view[hidden] {
  display: none !important;
}

.modal-uc-program-pick {
  max-width: 860px;
  width: min(860px, calc(100vw - 24px));
  max-height: 92vh;
  overflow: auto;
}
.modal-uc-program-publish {
  max-width: 640px;
  width: min(640px, calc(100vw - 24px));
  max-height: 92vh;
  overflow: auto;
}
.modal-uc-device-programs {
  max-width: 720px;
  width: min(720px, calc(100vw - 24px));
  max-height: 92vh;
  overflow: auto;
}
.uc-device-program-block {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  overflow: hidden;
}
.uc-device-program-block:last-child { margin-bottom: 0; }
.uc-device-program-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.uc-device-program-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--txt);
}
.uc-device-program-meta {
  font-size: .75rem;
  color: var(--txt-3);
}
.uc-device-program-videos {
  list-style: none;
  margin: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.uc-device-program-video {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  overflow: hidden;
}
.uc-device-program-video img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 0;
  background: #111;
}
.uc-device-program-video-body {
  min-width: 0;
  padding: 0 8px 8px;
}
.uc-device-program-video-title {
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uc-device-program-video-key {
  margin-top: 2px;
  font-size: .7rem;
  color: var(--txt-3);
}
.uc-publish-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 16px;
}
.uc-publish-mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 14px 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.uc-publish-mode-card:hover {
  border-color: var(--red-border);
}
.uc-publish-mode-card input {
  position: absolute;
  left: 14px;
  top: 16px;
  margin: 0;
  accent-color: var(--red);
}
.uc-publish-mode-card:has(input:checked) {
  border-color: var(--red);
  background: var(--red-sub);
  box-shadow: 0 0 0 1px var(--red-border);
}
.uc-publish-mode-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--txt);
}
.uc-publish-mode-desc {
  font-size: .75rem;
  line-height: 1.45;
  color: var(--txt-3);
}
.uc-publish-device-head {
  margin-top: 2px;
  margin-bottom: 8px;
}
.uc-publish-device-list {
  margin-top: 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
}
.uc-publish-group {
  border-bottom: 1px solid var(--border);
}
.uc-publish-group:last-child { border-bottom: none; }
.uc-publish-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  font-size: .88rem;
  font-weight: 600;
}
.uc-publish-group-head .uc-publish-meta {
  margin-left: auto;
  font-weight: 500;
  font-size: .75rem;
  color: var(--txt-3);
}
.uc-publish-device-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 34px;
  font-size: .85rem;
  border-top: 1px solid var(--border);
}
.uc-publish-device-row .uc-publish-code {
  margin-left: auto;
  color: var(--txt-3);
  font-size: .75rem;
}
.uc-pick-selected {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.uc-pick-selected-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: .85rem;
  color: var(--txt-2);
}
.uc-pick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}
.uc-pick-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 99px;
  background: var(--red-sub);
  border: 1px solid var(--red-border);
  color: var(--txt);
  font-size: .78rem;
}
.uc-pick-tag button {
  color: var(--txt-2);
  font-size: .9rem;
  line-height: 1;
}
.uc-pick-tag button:hover { color: var(--red); }
.uc-pick-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.uc-pick-toolbar input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--txt);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
}
.uc-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  padding: 2px;
}
.uc-pick-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  overflow: hidden;
  cursor: pointer;
}
.uc-pick-card.is-selected {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red-border);
}
.uc-pick-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #111;
}
.uc-pick-card-body {
  padding: 8px;
}
.uc-pick-card-title {
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uc-pick-card-meta {
  margin-top: 2px;
  font-size: .72rem;
  color: var(--txt-3);
}
.uc-pick-card-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
}
.uc-pick-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--txt-2);
  font-size: .85rem;
}
.uc-program-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.uc-program-table th,
.uc-program-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
}
.uc-program-table th {
  color: var(--txt-3);
  font-size: .75rem;
  font-weight: 600;
  background: rgba(255,255,255,0.02);
}
.uc-program-table tr:last-child td { border-bottom: none; }

.uc-field-label {
  margin-bottom: 8px;
  font-size: .82rem;
  color: var(--txt-2);
}
.uc-program-type {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.uc-program-type-opt {
  position: relative;
  cursor: pointer;
}
.uc-program-type-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.uc-program-type-opt span {
  display: block;
  min-width: 88px;
  padding: 8px 18px;
  border-radius: calc(var(--r-md) - 2px);
  text-align: center;
  font-size: .88rem;
  font-weight: 600;
  color: var(--txt-2);
  transition: background .15s ease, color .15s ease;
}
.uc-program-type-opt:hover span {
  color: var(--txt);
}
.uc-program-type-opt:has(input:checked) span {
  background: var(--red);
  color: #fff;
}
.uc-program-type.is-locked .uc-program-type-opt {
  cursor: default;
}
.uc-program-type.is-locked .uc-program-type-opt:not(:has(input:checked)) {
  opacity: .45;
  pointer-events: none;
}
.uc-program-type-hint {
  margin: 8px 0 0;
  font-size: .78rem;
  color: var(--txt-3);
  line-height: 1.4;
}
#uc-program-subtitle-fields[hidden] { display: none !important; }
.uc-inline-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--txt);
  font-family: inherit;
  font-size: .88rem;
  line-height: 1.5;
  outline: none;
}
.uc-inline-form textarea:focus {
  border-color: var(--red-border);
  box-shadow: 0 0 0 3px var(--red-sub);
}
.uc-subtitle-style {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  margin-top: 12px;
}
.uc-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.uc-color-row input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: transparent;
  cursor: pointer;
}
.uc-color-row input[type="text"] {
  flex: 1;
}
.uc-subtitle-preview {
  margin-top: 12px;
  padding: 18px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: #111;
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}
.uc-device-subtitle-block {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  overflow: hidden;
}
.uc-device-subtitle-lines {
  padding: 12px 14px 14px;
  background: #111;
}
.uc-device-subtitle-line {
  padding: 6px 0;
  text-align: center;
  word-break: break-word;
}

.uc-tabs {
  display: flex;
  gap: 4px;
  margin: -4px 0 18px;
  padding: 4px;
  background: var(--bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.uc-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: calc(var(--r-md) - 2px);
  color: var(--txt-2);
  font-size: .86rem;
  font-weight: 600;
  transition: background var(--ease), color var(--ease);
}
.uc-tab:hover { color: var(--txt); }
.uc-tab.is-active {
  background: var(--red);
  color: #fff;
}
.uc-tab-panel[hidden] { display: none !important; }

.uc-toast {
  position: fixed;
  top: calc(var(--hdr-h) + 18px);
  left: 50%;
  z-index: 200;
  min-width: 160px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 99px;
  background: rgba(24, 24, 32, 0.96);
  border: 1px solid var(--border);
  color: var(--txt);
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.uc-toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.uc-toast.is-success {
  border-color: rgba(52, 211, 153, .45);
  color: #a7f3d0;
}
.uc-toast.is-error {
  border-color: rgba(248, 113, 113, .45);
  color: #fecaca;
}

.uc-watermark-box {
  margin-bottom: 14px;
}
.uc-watermark-preview {
  margin: 0 0 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.uc-watermark-preview img {
  max-width: 100%;
  max-height: 180px;
  margin: 0 auto;
  object-fit: contain;
}
.uc-watermark-empty {
  margin: 0 0 12px;
  color: var(--txt-3);
  font-size: .88rem;
}
.uc-watermark-empty[hidden] { display: none !important; }
.uc-watermark-box .uc-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.uc-account-card .uc-upload-row .btn-outline {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--txt-2);
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
}
.uc-account-card .auth-form input[type="text"],
.uc-account-card .auth-form input[type="password"] {
  width: 100%;
}
.uc-card-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
}
.uc-inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.uc-inline-form .uc-full { grid-column: 1 / -1; }
.uc-inline-form input,
.uc-inline-form select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--txt);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  width: 100%;
}
.uc-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.uc-device-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.uc-device-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.uc-device-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.uc-device-group-title {
  font-weight: 700;
  font-size: .95rem;
}
.uc-device-group-meta {
  color: var(--txt-3);
  font-size: .78rem;
  font-weight: 500;
  margin-left: 8px;
}
.uc-device-group-actions {
  display: flex;
  gap: 8px;
}
.uc-device-group-actions button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .75rem;
  cursor: pointer;
  font-family: inherit;
}
.uc-device-group-actions button:hover { color: var(--red); border-color: var(--red-border); }
.uc-device-group-actions .danger:hover { color: #f87171; border-color: #f87171; }

.uc-device-table {
  width: 100%;
  border-collapse: collapse;
}
.uc-device-table th,
.uc-device-table td {
  padding: 10px 16px;
  text-align: left;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.uc-device-table th {
  color: var(--txt-3);
  font-weight: 600;
  font-size: .75rem;
}
.uc-device-table tr:last-child td { border-bottom: none; }
.uc-device-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--txt-2);
  font-size: .8rem;
}
.uc-device-empty {
  padding: 20px 16px;
  color: var(--txt-3);
  font-size: .85rem;
}
.uc-device-row-actions {
  display: flex;
  gap: 6px;
}
.uc-device-row-actions button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .75rem;
  cursor: pointer;
  font-family: inherit;
}
.uc-device-row-actions button:hover { color: var(--red); border-color: var(--red-border); }
.uc-device-row-actions .danger:hover { color: #f87171; border-color: #f87171; }

@media (max-width: 860px) {
  .uc-shell {
    grid-template-columns: 1fr;
    padding-top: 12px;
  }
  .uc-sidebar {
    position: static;
    padding: 12px;
  }
  .uc-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .uc-menu-item {
    flex: 1 1 auto;
    text-align: center;
    padding: 8px 10px;
    font-size: .82rem;
  }
  .uc-inline-form {
    grid-template-columns: 1fr;
  }
  .uc-device-table th:nth-child(4),
  .uc-device-table td:nth-child(4) {
    display: none;
  }
}

.uc-nav {
  margin-left: 24px;
  display: flex;
  align-items: center;
}
.uc-nav-link {
  color: var(--txt-2);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
}
.uc-nav-link:hover { color: var(--red); }

.uc-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.uc-page-head h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}
.uc-page-desc {
  margin: 6px 0 0;
  color: var(--txt-2);
  font-size: .9rem;
}

.uc-toolbar {
  display: flex;
  gap: 10px;
}

.uc-toolbar .btn-primary {
  padding: 8px 16px;
  border: none;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  font-family: inherit;
}
.uc-refresh {
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-2);
  font-size: .85rem;
  cursor: pointer;
  font-family: inherit;
}
.uc-refresh:hover {
  border-color: var(--red-border);
  color: var(--txt);
  background: var(--red-sub);
}
.uc-form-actions .uc-refresh {
  padding: 10px 18px;
  border-radius: var(--r-md);
}

.uc-list-page {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 8px 20px 12px;
}

.uc-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.uc-item-thumb {
  width: 96px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-card);
  flex-shrink: 0;
}
.uc-item-body { flex: 1; min-width: 0; }
.uc-item-title {
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uc-item-meta {
  margin-top: 4px;
  font-size: .75rem;
  color: var(--txt-3);
}
.uc-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.uc-item-actions button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt-2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .75rem;
  cursor: pointer;
  font-family: inherit;
}
.uc-item-actions button:hover { color: var(--red); border-color: var(--red-border); }
.uc-item-actions .danger:hover { color: #f87171; border-color: #f87171; }

.modal-uc-edit {
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
}
.uc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.uc-form-grid .uc-full { grid-column: 1 / -1; }
.uc-edit-form textarea,
.uc-edit-form select,
.uc-edit-form input[type="text"] {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  color: var(--txt);
  font-family: inherit;
  font-size: .88rem;
  outline: none;
  width: 100%;
}
.uc-edit-form textarea { resize: vertical; }
.uc-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.uc-upload-row input[type="text"] { flex: 1; }
.uc-upload-row .btn-outline {
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--txt-2);
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
}
.uc-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.uc-progress-bar {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--red);
  width: 0%;
  max-width: 100%;
  transition: width .15s ease;
}
.uc-progress span { font-size: .75rem; color: var(--txt-3); min-width: 36px; }

.uc-res-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.uc-res-head .btn-outline {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--txt-2);
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
}
.uc-resolution-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.uc-res-row {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.uc-res-fields {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.uc-res-fields .uc-mini span {
  display: block;
  font-size: .75rem;
  color: var(--txt-3);
  margin-bottom: 4px;
}
.uc-res-remove {
  padding: 8px 12px;
  border: 1px solid rgba(220, 80, 80, .35);
  border-radius: var(--r-md);
  background: transparent;
  color: #e07070;
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
  white-space: nowrap;
}
.uc-field-hint {
  margin: 6px 0 0;
  font-size: .75rem;
  color: var(--txt-3);
}

@media (max-width: 640px) {
  .uc-form-grid { grid-template-columns: 1fr; }
  .uc-res-fields { grid-template-columns: 1fr; }
}
