* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #050810;
  --panel: rgba(10, 15, 40, 0.5);
  --border: rgba(100, 180, 255, 0.1);
  --accent: #4ea1ff;
  --accent-dim: rgba(78, 161, 255, 0.12);
  --green: #00ff88;
  --radius: 12px;
}

body {
  background: var(--bg);
  color: #fff;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  overflow-x: hidden;
}

/* ── 顶部 ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(to right, #060d1e, #0a1530, #060d1e);
  border-bottom: 1px solid rgba(78, 161, 255, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.logo span { color: var(--accent); }

.status { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.7; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); animation: blink 2s infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ── 源选择栏 ── */
.source-bar {
  display: flex; gap: 0; overflow-x: auto;
  background: #080d1a; border-bottom: 1px solid rgba(78, 161, 255, 0.1);
}
.source-bar button {
  flex-shrink: 0; padding: 12px 16px;
  background: transparent; border: none; border-bottom: 3px solid transparent;
  color: #fff; cursor: pointer; font-size: 13px; white-space: nowrap;
  transition: all 0.2s; display: flex; align-items: center; gap: 6px;
}
.source-bar button:hover { background: rgba(78, 161, 255, 0.06); }
.source-bar button.active {
  border-bottom-color: var(--accent);
  background: rgba(78, 161, 255, 0.08);
  color: var(--accent);
}
.source-bar button .badge {
  font-size: 10px; padding: 1px 5px; border-radius: 6px;
  background: rgba(0, 255, 136, 0.15); color: var(--green);
}

/* ── 主区域 ── */
.main { padding: 16px; max-width: 1400px; margin: 0 auto; }

.viewer-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
}
.title-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 8px; flex-wrap: wrap;
}
.title-row h2 { font-size: 16px; letter-spacing: 1px; }
.title-row .meta { font-size: 11px; opacity: 0.5; }
.title-row .actions { display: flex; gap: 6px; }
.title-row .actions button {
  padding: 5px 12px; border-radius: 8px;
  background: var(--accent-dim); border: 1px solid rgba(78, 161, 255, 0.2);
  color: var(--accent); font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.title-row .actions button:hover { background: rgba(78, 161, 255, 0.25); }

/* ── 媒体 ── */
.media-frame {
  position: relative; width: 100%; background: #000;
  display: flex; align-items: center; justify-content: center; min-height: 350px;
}
.media-frame video { width: 100%; height: auto; display: block; max-height: 560px; background: #000; }
.media-frame img { width: 100%; height: auto; display: block; max-height: 560px; object-fit: contain; }
.media-frame iframe { width: 100%; height: 560px; border: none; }
.media-frame .note {
  position: absolute; bottom: 10px; right: 12px; z-index: 6;
  font-size: 10px; padding: 4px 10px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px);
  opacity: 0.7; pointer-events: none;
}
.err-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg); z-index: 5; text-align: center; padding: 20px;
}
.err-overlay .icon { font-size: 48px; margin-bottom: 12px; }
.err-overlay .msg { font-size: 14px; opacity: 0.6; margin-bottom: 8px; }
.err-overlay .sub { font-size: 12px; opacity: 0.3; }

/* ── 信息卡 ── */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.info-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.info-card h3 { font-size: 14px; margin-bottom: 10px; color: var(--accent); }
.info-card .row {
  display: flex; justify-content: space-between; padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04); font-size: 12px;
}
.info-card .row:last-child { border-bottom: none; }
.info-card .row .k { opacity: 0.5; }
.info-card .desc { font-size: 11px; opacity: 0.4; line-height: 1.6; margin-top: 8px; }

/* ── 缩略图 ── */
.thumb-wrap { padding: 16px; }
.thumb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;
}
.thumb {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; cursor: pointer; transition: all 0.25s;
}
.thumb:hover { border-color: rgba(78, 161, 255, 0.3); transform: translateY(-2px); }
.thumb img { width: 100%; height: 120px; object-fit: cover; display: block; background: #0a1530; }
.thumb .label { padding: 8px 10px; }
.thumb .label .name { font-size: 12px; font-weight: 600; }
.thumb .label .time { font-size: 10px; opacity: 0.4; margin-top: 1px; }

/* ── 页脚 ── */
.footer { text-align: center; padding: 24px; font-size: 11px; opacity: 0.3; line-height: 1.8; }

@media (max-width: 600px) {
  .header { padding: 10px 16px; }
  .logo { font-size: 16px; }
  .main { padding: 12px; }
  .media-frame iframe { height: 380px; }
  .info-grid { grid-template-columns: 1fr; }
}
