/* cases.css —— H3 案例库（独立暗色主题，单页滚动 + 卡片网格 + 侧滑详情 + 快速筛选条） */
:root {
  --bg: #0d1014;
  --panel: #151920;
  --panel2: #1c222c;
  --line: #262d38;
  --line2: #333c4a;
  --text: #eef2f7;
  --muted: #98a3b2;
  --dim: #6d798a;
  --accent: #6cb6ff;
  --accent-dim: #2c4a6b;
  --p0: #ff7a7a;
  --p1: #ffd166;
  --p2: #97a3b4;
  --ok: #7ddba1;
  --warn: #ff9f43;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

/* ===== 顶栏 ===== */
.topbar { border-bottom: 1px solid var(--line); background: #0a0d11; }
.topbar-inner {
  max-width: 1600px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-weight: 700; letter-spacing: .04em; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 6px; }
.nav-link {
  padding: 5px 11px; border-radius: 999px; color: var(--muted); font-size: 13px;
}
.nav-link:hover { background: var(--panel2); text-decoration: none; color: var(--text); }
.nav-link.active { background: var(--accent-dim); color: #fff; }

/* ===== 紧凑头部 ===== */
.page-head {
  max-width: 1600px; margin: 0 auto; padding: 14px 20px 10px;
}
.page-head-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.page-title { display: flex; align-items: baseline; gap: 12px; }
.page-title h1 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.count { color: var(--muted); font-size: 13px; }

.page-search { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; max-width: 720px; }
#q {
  flex: 1; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line2); background: #0b0e13; color: var(--text); font-size: 14px;
}
#q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,182,255,.12); }

/* ===== 快速筛选条 ===== */
.filter-bar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(13,16,20,.96); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.filter-bar-inner {
  max-width: 1600px; margin: 0 auto; padding: 8px 20px;
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex; align-items: center; gap: 6px;
  flex: 1 1 auto; flex-wrap: wrap;
}

/* 下拉筛选按钮 */
.filter-drop {
  position: relative;
}
.filter-drop-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line2); border-radius: 999px;
  padding: 5px 11px; font-size: 13px; cursor: pointer;
  white-space: nowrap;
}
.filter-drop-btn:hover { border-color: var(--accent); }
.filter-drop-btn .caret { color: var(--dim); font-size: 10px; }
.filter-drop-btn .sel-count {
  background: var(--accent-dim); color: #fff;
  border-radius: 999px; padding: 1px 5px; font-size: 11px; margin-left: 3px;
}
.filter-drop.open .filter-drop-btn { border-color: var(--accent); background: #1a2533; }

/* 下拉面板 */
.filter-menu {
  display: none;
  position: absolute; top: calc(100% + 5px); left: 0;
  min-width: 220px; max-width: 300px; max-height: 360px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 40; overflow: hidden;
  flex-direction: column;
}
.filter-drop.open .filter-menu { display: flex; }

.filter-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.filter-menu-head button {
  background: none; border: 0; color: var(--dim); font-size: 12px; cursor: pointer;
}
.filter-menu-head button:hover { color: var(--accent); }

.filter-menu-search {
  padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.filter-menu-search input {
  width: 100%; padding: 5px 9px; border-radius: 6px;
  border: 1px solid var(--line); background: #0b0e13; color: var(--text); font-size: 13px;
}

.filter-options {
  flex: 1; overflow-y: auto; padding: 5px;
}
.filter-option {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 6px 8px; border-radius: 6px;
  background: none; border: 0; color: var(--text); font-size: 13px;
  text-align: left; cursor: pointer;
}
.filter-option:hover { background: var(--panel2); }
.filter-option input { accent-color: var(--accent); cursor: pointer; }
.filter-option .n {
  margin-left: auto; color: var(--dim); font-size: 11px;
}
.filter-option.hi { background: var(--accent-dim); color: #fff; }
.filter-option.hi .n { color: #cfe6ff; }

.filter-extras {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-left: auto;
}

.toggle {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 13px; cursor: pointer;
}
.toggle input { accent-color: var(--accent); cursor: pointer; }
.toggle span { cursor: pointer; }

.filter-sort { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.filter-sort select {
  background: #0b0e13; color: var(--text); border: 1px solid var(--line2);
  border-radius: 7px; padding: 4px 8px; font-size: 13px;
}

/* 已选条件 */
.active-bar {
  max-width: 1600px; margin: 0 auto; padding: 0 20px 8px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px;
}
.active-bar:empty { display: none; }
.active-bar.hidden { display: none; }
.active-label { color: var(--dim); }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.active-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: 999px; padding: 2px 9px; font-size: 12px; color: #fff;
}
.active-chip button {
  background: none; border: 0; color: #cfe6ff; cursor: pointer; font-size: 13px; line-height: 1;
}
.active-chip button:hover { color: #fff; }
#btn-clear-all { color: var(--muted); }

/* ===== 主列表区（单页滚动） ===== */
.main { max-width: 1600px; margin: 0 auto; padding: 12px 20px 60px; }
.list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; font-size: 12.5px; color: var(--muted);
  padding: 8px 0;
}
.hidden-hint { color: var(--warn); font-size: 12px; }

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; cursor: pointer; transition: border-color .1s, background .1s;
  display: flex; flex-direction: column; gap: 8px;
}
.card:hover { border-color: var(--line2); background: var(--panel2); }
.card.active { border-color: var(--accent); background: #1a2333; }

.card-header { display: flex; align-items: flex-start; gap: 8px; }
.card-thumb {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 8px;
  background: #0a0e14; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-thumb { position: relative; }
.card-thumb video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 7px; background: #0a0e14;
  transition: opacity .25s ease;
}
.card-thumb img.card-poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 7px; background: #0a0e14;
  z-index: 1;
}
.thumb-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35); border-radius: 7px; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 2;
}
.thumb-play svg { width: 28px; height: 28px; fill: rgba(255,255,255,.9); }
.thumb-play.has-frame { opacity: .55; }
.card-thumb svg { width: 28px; height: 28px; fill: var(--dim); }
.card-title-wrap { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

.badge {
  display: inline-block; border-radius: 4px; padding: 1px 5px;
  font-size: 10px; font-weight: 700; color: #10131a;
}
.badge.p0 { background: var(--p0); }
.badge.p1 { background: var(--p1); }
.badge.p2 { background: var(--p2); }
.badge.warn { background: var(--warn); color: #1a1208; }
.badge.muted { background: var(--line2); color: var(--muted); }

.card-meta { color: var(--muted); font-size: 11.5px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tagmini {
  font-size: 11px; color: var(--muted); background: #101620;
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}

.empty-list { padding: 40px 12px; color: var(--dim); text-align: center; font-size: 13.5px; }
.list-more { padding: 18px 0 10px; text-align: center; }

/* ===== 通用按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line2); background: #1d2431; color: var(--text);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer;
  line-height: 1.2;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent-dim); border: 1px solid var(--accent); color: #fff; }
.btn.primary:hover { background: #35577e; }
.btn.ghost { background: transparent; border: 1px solid var(--line2); color: var(--muted); }
.btn.tiny { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ===== 详情浮层（侧滑抽屉） ===== */
.detail-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; justify-content: flex-end;
}
.detail-overlay[hidden] { display: none; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.detail-panel {
  position: relative; width: min(760px, 92vw); max-width: 100%;
  background: var(--bg); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(0); transition: transform .18s ease;
}
.detail-close {
  position: absolute; top: 10px; right: 14px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.detail-close:hover { background: var(--line); }
.detail-scroll { flex: 1; overflow-y: auto; padding: 14px 16px 20px; }

/* ===== 详情内部 ===== */
.stage {
  background: #05070a; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
video { display: block; width: 100%; max-height: 50vh; background: #000; }
.empty { padding: 48px 24px; text-align: center; }
.empty-title { margin: 0 0 6px; font-size: 17px; }
.empty-sub { margin: 0 auto; color: var(--muted); font-size: 13.5px; max-width: 460px; }
.video-wrap { position: relative; }
.video-err {
  padding: 14px 16px; background: #2a1418; border-top: 1px solid #4a2228;
  font-size: 13px; color: #ffc9c9;
}
.video-err p { margin: 0 0 6px; }
.video-err p:last-child { margin-bottom: 0; }

.details { padding: 14px 0 0; }
.details h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.35; word-break: break-word; }
.d-sub { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; word-break: break-word; }
.d-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.d-tags .tagmini { font-size: 11.5px; padding: 2px 7px; }
.d-tags .tagmini.ct { border-color: #2f4a6a; color: #bcdcff; }
.d-tags .tagmini.tt { border-color: #33453a; color: #bfe6cb; }
.d-tags .tagmini.st { border-color: #453a55; color: #dcc8f5; }

.d-meta {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 12px; margin: 0 0 12px; padding: 10px 0 0; border-top: 1px solid var(--line);
}
.d-meta div { min-width: 0; }
.d-meta dt { color: var(--dim); font-size: 11.5px; margin-bottom: 1px; }
.d-meta dd { margin: 0; font-size: 12.5px; word-break: break-word; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.toast { margin: 8px 0 0; font-size: 12.5px; color: var(--ok); min-height: 16px; }

.prompt-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.ad-slot { margin-bottom: 10px; }
.prompt-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--dim); margin-bottom: 6px;
}
.prompt-prov { color: var(--muted); }
.prompt-text {
  margin: 0; padding: 12px 13px; background: #0a0e14; border: 1px solid var(--line);
  border-radius: 10px; font-size: 13px; line-height: 1.6; color: #dbe4ef;
  white-space: pre-wrap; word-break: break-word; max-height: 40vh; overflow: auto;
}

.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(120deg, #16202e, #131a24);
  border: 1px solid var(--line2); border-radius: 12px; padding: 14px 15px;
  margin-top: 16px;
}
.cta-title { margin: 0 0 2px; font-weight: 600; font-size: 14px; }
.cta-sub { margin: 0; color: var(--muted); font-size: 12.5px; }

.footer { color: var(--dim); font-size: 11.5px; line-height: 1.7; margin-top: 16px; }
.footer p { margin: 0 0 5px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .page-head-inner { flex-direction: column; align-items: stretch; }
  .page-search { max-width: none; }
  .filter-bar-inner { gap: 8px; }
  .filter-extras { margin-left: 0; width: 100%; justify-content: space-between; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .detail-panel { width: 100%; }
}
@media (max-width: 600px) {
  .topbar-inner { padding: 8px 14px; }
  .page-head, .main { padding-left: 14px; padding-right: 14px; }
  .filter-bar-inner, .active-bar { padding-left: 14px; padding-right: 14px; }
  .filter-drop-btn { padding: 4px 9px; font-size: 12px; }
  .grid { grid-template-columns: 1fr; }
  .card { flex-direction: row; align-items: center; }
  .card-thumb { width: 80px; height: 80px; flex-basis: 80px; }
  .card-title { -webkit-line-clamp: 3; }
  .cta { flex-direction: column; align-items: flex-start; }
}


/* ===== language switcher ===== */
.lang-switch {
  display: flex; align-items: center;
  padding: 5px 11px; border-radius: 999px; font-size: 13px;
  color: var(--muted); border: 1px solid var(--line); text-decoration: none;
}
.lang-switch:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
