:root {
  --bg: #0e1116;
  --bg-soft: #161b23;
  --card: #1b222c;
  --line: #262e3a;
  --text: #e6eaf2;
  --muted: #8d97a8;
  --accent: #4f8cff;
  --danger: #ff6b6b;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.small-note { font-size: 13px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.logo { color: var(--accent); font-size: 20px; }
.logo.link:hover { opacity: .8; }
.brand { font-weight: 600; letter-spacing: .5px; }
.brand.small { font-size: 16px; }

input[type="text"], input[type="password"], input[type="search"] {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  min-width: 220px;
}
input:focus { outline: none; border-color: var(--accent); }

button, .button-link {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition: .15s;
}
button:hover, .button-link:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }

/* ---------- 登录页 ---------- */
.center-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  width: 360px;
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input { width: 100%; }

/* ---------- 容器 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }

.panel {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.panel h2 { margin-top: 0; font-size: 16px; }
.upload-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.upload-row input[type="text"] { flex: 1; min-width: 200px; }

.task-list { margin-top: 14px; font-size: 13px; }
.task-item { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.task-bar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.task-bar > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 17px; }

.points {
  background: rgba(79, 140, 255, .12);
  border: 1px solid rgba(79, 140, 255, .35);
  color: #a8c6ff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
}
.points b { color: #fff; font-size: 14px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  z-index: 50;
}
.toast.warn { border-color: var(--danger); color: #ffd2d2; }
.toast.info { border-color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: .18s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1f2937, #111827);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #3b4757;
}
.card-body { padding: 12px 14px; }
.card-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; word-break: break-all; }
.card-meta { font-size: 12px; color: var(--muted); }

/* ---------- 播放页 ---------- */
.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
#player { width: 100%; max-height: 72vh; display: block; background: #000; }
