/* MDhub — 纯净版目录站（移动端优先，深色） */
:root {
  --bg: #0f1014;
  --bg2: #171921;
  --card: #1c1f29;
  --line: #2a2e3a;
  --text: #e8eaf0;
  --dim: #8a90a0;
  --acc: #5aa2ff;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

/* ── 顶栏 ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(15,16,20,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 8px;
}
.logo {
  color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 18px; white-space: nowrap;
}
.search { flex: 1; display: flex; gap: 6px; }
.search input {
  flex: 1; min-width: 0;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 12px;
  color: var(--text); font-size: 14px; outline: none;
}
.search input:focus { border-color: var(--acc); }
.search button {
  background: var(--acc); border: none; border-radius: 9px;
  color: #fff; font-weight: 600; padding: 0 16px; cursor: pointer;
}
.cate-bar {
  max-width: 1080px; margin: 0 auto;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 14px 10px;
  scrollbar-width: none;
}
.cate-bar::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px;
  color: var(--dim); font-size: 13px; text-decoration: none;
  white-space: nowrap; cursor: pointer;
}
.chip.active { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }

/* ── 视频网格 ── */
.view { max-width: 1080px; margin: 0 auto; padding: 14px; }
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card { display: block; text-decoration: none; color: var(--text); }
.card .poster {
  position: relative; aspect-ratio: 10/14;
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
}
.card .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .poster .noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--line);
}
.card .poster .dur {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(0,0,0,.72); border-radius: 6px;
  padding: 2px 7px; font-size: 11px; color: #fff;
}
.card .t {
  margin-top: 7px; font-size: 13px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .tags {
  margin-top: 4px; font-size: 11px; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── 详情页 ── */
.detail { display: flex; flex-direction: column; gap: 14px; }
.back { color: var(--dim); text-decoration: none; font-size: 14px; align-self: flex-start; }
.d-head { display: flex; gap: 14px; }
.d-head .poster {
  width: 130px; flex-shrink: 0; aspect-ratio: 10/14;
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
}
.d-head .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.d-info { min-width: 0; }
.d-info h1 { font-size: 17px; line-height: 1.4; }
.d-meta { margin-top: 8px; font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 6px; }
.d-meta span { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.d-desc { font-size: 13px; color: var(--dim); line-height: 1.7; }
.d-eps h2 { font-size: 15px; margin-bottom: 10px; }
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ep {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 8px;
  color: var(--text); text-decoration: none;
  text-align: center; font-size: 13px; cursor: pointer;
  transition: border-color .15s;
}
.ep:hover, .ep:active { border-color: var(--acc); color: var(--acc); }
.d-tip {
  font-size: 12px; color: var(--dim);
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; line-height: 1.6;
}
.d-tip b { color: #ffd60a; font-weight: 600; }

/* ── 密码页 ── */
.login {
  max-width: 340px; margin: 90px auto 0;
  text-align: center;
}
.login .lock { font-size: 44px; }
.login h1 { font-size: 18px; margin: 10px 0 6px; }
.login p { color: var(--dim); font-size: 13px; }
.login form { display: flex; gap: 8px; margin-top: 18px; }
.login input {
  flex: 1; min-width: 0;
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 14px;
  color: var(--text); font-size: 15px; outline: none; text-align: center;
}
.login input:focus { border-color: var(--acc); }
.login button {
  background: var(--acc); border: none; border-radius: 9px;
  color: #fff; font-weight: 600; padding: 0 22px; cursor: pointer;
}
.login-err { margin-top: 12px; color: #ff9ca0; font-size: 13px; min-height: 18px; }

/* ── 状态 ── */
.skeleton {
  aspect-ratio: 10/14; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--card) 40%, var(--bg2) 50%, var(--card) 60%);
  background-size: 200% 100%; animation: shine 1.2s infinite;
}
@keyframes shine { to { background-position: -200% 0; } }
.sentinel { height: 8px; }
.empty { text-align: center; color: var(--dim); padding: 60px 0; font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: #2c2f3a; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 18px; font-size: 13px; z-index: 99;
}
.toast.error { border-color: #e5484d; color: #ff9ca0; }

/* ── 底部 ── */
.footer {
  max-width: 1080px; margin: 0 auto;
  padding: 20px 14px 30px; text-align: center;
  color: #565b68; font-size: 11px;
}
