* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #0f1115; color: #e7eaf0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; background: #171b22; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid #2c3440; }
.topbar h1 { margin: 0; font-size: 22px; }
.topbar nav { display: flex; align-items: center; gap: 12px; }
.topbar a, button, .actions a { background: #2b3442; color: #f8fafc; border: 0; border-radius: 10px; padding: 9px 13px; cursor: pointer; }
.topbar a:hover, button:hover, .actions a:hover { background: #3b4657; }
.inline { display: inline; }
.toolbar { padding: 18px 24px 0; }
.search-form { display: flex; gap: 10px; max-width: 760px; }
.search-form input { flex: 1; }
input, select { background: #171b22; color: #e7eaf0; border: 1px solid #303847; border-radius: 10px; padding: 10px 12px; }
.grid { padding: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: #171b22; border: 1px solid #29313d; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.thumb-wrap { display: block; position: relative; aspect-ratio: 16/9; background: #252a33; }
.thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge, .watched { position: absolute; top: 10px; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; background: rgba(0,0,0,.7); }
.badge { left: 10px; }
.watched { right: 10px; background: rgba(27,120,62,.85); }
.card-body { padding: 14px; }
.card h2 { font-size: 16px; line-height: 1.35; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0 0 12px; color: #aab4c2; font-size: 13px; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions a { font-size: 14px; padding: 8px 10px; }
.actions .primary { background: #2563eb; }
.actions .primary:hover { background: #1d4ed8; }
.empty { color: #aab4c2; padding: 40px; grid-column: 1 / -1; text-align: center; background: #171b22; border-radius: 16px; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: #171b22; border: 1px solid #29313d; border-radius: 18px; padding: 28px; }
.login-card h1 { margin-top: 0; }
.login-card form { display: grid; gap: 10px; }
.login-card button { margin-top: 8px; background: #2563eb; }
.error { background: #7f1d1d; color: #fee2e2; border-radius: 10px; padding: 10px; margin: 12px 0; }
.hint { color: #aab4c2; font-size: 13px; line-height: 1.5; }
.watch { max-width: 1180px; margin: 0 auto; padding: 24px; }
.watch video { width: 100%; max-height: 72vh; background: #000; border-radius: 16px; }
.video-info { margin-top: 18px; background: #171b22; border: 1px solid #29313d; border-radius: 16px; padding: 18px; }
.video-info h2 { margin-top: 0; font-size: 18px; }
.notice { background: #45330f; color: #fde68a; border: 1px solid #785d19; padding: 12px; border-radius: 12px; }
@media (max-width: 640px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .search-form { flex-direction: column; }
  .grid { padding: 14px; grid-template-columns: 1fr; }
}

.breadcrumbs { margin-bottom: 12px; font-size: 14px; }
.breadcrumbs a { color: inherit; text-decoration: none; font-weight: 600; }
.breadcrumbs .sep { opacity: .5; margin: 0 6px; }
.folder-section { padding: 0 18px 10px; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; max-width: 1200px; margin: 0 auto; }
.folder-card { display: block; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.08); color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card:hover { background: rgba(255,255,255,.14); }

.live-list { padding: 24px; max-width: 1180px; margin: 0 auto; }
.live-table { width: 100%; border-collapse: collapse; background: #171b22; border: 1px solid #29313d; border-radius: 16px; overflow: hidden; }
.live-table th, .live-table td { padding: 12px 14px; border-bottom: 1px solid #29313d; text-align: left; vertical-align: top; }
.live-table th { background: #202633; color: #cbd5e1; }
.live-table tr:last-child td { border-bottom: 0; }
.muted { color: #94a3b8; font-size: 12px; }
.live-actions { min-width: 260px; }
.live-actions button { padding: 8px 10px; }
code { background: rgba(255,255,255,.08); padding: 2px 5px; border-radius: 5px; }
@media (max-width: 760px) {
  .live-table, .live-table thead, .live-table tbody, .live-table th, .live-table td, .live-table tr { display: block; }
  .live-table thead { display: none; }
  .live-table tr { border-bottom: 1px solid #29313d; padding: 10px; }
  .live-table td { border-bottom: 0; padding: 6px 4px; }
}

.live-tabs {
  display: flex;
  gap: 10px;
  padding: 16px 24px 4px;
  flex-wrap: wrap;
}
.live-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #334155;
  border-radius: 999px;
  text-decoration: none;
  color: #bfdbfe;
  background: #111827;
}
.live-tab.active {
  background: #1d4ed8;
  color: #fff;
  border-color: #60a5fa;
}
.badge {
  display: inline-block;
  min-width: 1.5em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  text-align: center;
  font-size: .85em;
}
.live-list h2 {
  margin: 18px 24px;
}
.live-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  padding: 0 24px 32px;
}
.live-card {
  border: 1px solid #334155;
  background: #111827;
  border-radius: 14px;
  padding: 14px;
}

.live-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.live-logo {
  width: 54px;
  height: 36px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  flex: 0 0 auto;
}
.live-card-text {
  min-width: 0;
}
.live-service-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.live-meta {
  font-size: .9rem;
}
.live-actions {
  margin-top: 12px;
}
.live-actions button {
  cursor: pointer;
}
@media (max-width: 640px) {
  .live-card-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 24px;
  }
  .live-tabs {
    padding-left: 12px;
    padding-right: 12px;
  }
}
