/* ============ 全局 ============ */
:root {
  --primary: #4f6ef7;
  --primary-dark: #3d55d8;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2430;
  --text-2: #6b7280;
  --border: #e5e8f0;
  --danger: #e5484d;
  --success: #2fa26b;
  --warning: #d97706;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
}

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

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

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

/* ============ 顶部导航 ============ */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .logo {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .logo .icon { font-size: 20px; }
.topbar nav { display: flex; gap: 6px; }
.topbar nav a {
  padding: 6px 14px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
}
.topbar nav a.active, .topbar nav a:hover {
  background: rgba(79, 110, 247, 0.08);
  color: var(--primary);
  text-decoration: none;
}
.topbar .spacer { flex: 1; }
.config-tip {
  font-size: 12px;
  color: var(--warning);
  background: rgba(217, 119, 6, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}

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

/* ============ 解析表单 ============ */
.parse-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
}
.parse-card h2 { font-size: 16px; margin-bottom: 14px; }
.parse-form { display: flex; gap: 10px; flex-wrap: wrap; }
.parse-form input[type="text"] {
  flex: 1;
  min-width: 260px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.parse-form input[type="text"]:focus { border-color: var(--primary); }
.btn {
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost {
  background: #f1f3f9;
  color: var(--text);
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.btn-ghost:hover { background: #e6e9f3; }
.btn-danger { background: var(--danger); color: #fff; height: 36px; padding: 0 14px; font-size: 13px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }

/* 解析结果提示 */
.result-box { margin-top: 14px; display: none; }
.result-box.show { display: block; }
.result-box .ok {
  background: rgba(47, 162, 107, 0.1);
  color: var(--success);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
}
.result-box .err {
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
}

/* ============ 记录列表 ============ */
.list-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.list-head h2 { font-size: 16px; }
.list-head .search {
  flex: 1;
  min-width: 200px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  outline: none;
}
.list-head .search:focus { border-color: var(--primary); }
.stat { font-size: 13px; color: var(--text-2); }

.record-list { display: flex; flex-direction: column; gap: 12px; }
.record-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: box-shadow 0.2s;
}
.record-item:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, 0.1); }
.cover {
  width: 92px;
  height: 62px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef0f6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 11px;
}
.record-info { flex: 1; min-width: 0; }
.record-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef1ff;
  color: var(--primary);
}
.badge.video { background: rgba(79, 110, 247, 0.1); color: var(--primary); }
.badge.image { background: rgba(217, 119, 6, 0.1); color: var(--warning); }
.badge.audio { background: rgba(47, 162, 107, 0.1); color: var(--success); }
.badge.failed { background: rgba(229, 72, 77, 0.1); color: var(--danger); }
.record-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-2);
}
.pagination .page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.empty {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 60px 20px;
  text-align: center;
  color: var(--text-2);
}
.empty .emoji { font-size: 40px; margin-bottom: 10px; }

/* ============ 详情页 ============ */
.detail-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.detail-head .cover {
  width: 140px;
  height: 94px;
  border-radius: 10px;
}
.detail-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.detail-meta { font-size: 13px; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-content { font-size: 13px; color: var(--text-2); }
.detail-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .num {
  font-size: 11px;
  color: var(--text-2);
  background: #eef0f6;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.video-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.video-wrap video { width: 100%; max-height: 60vh; display: block; }

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.image-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #eef0f6;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
}
.image-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-item .live-tag {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
}

.music-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8f9fc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.music-box .music-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.music-box audio { flex: 1; min-width: 200px; }

/* 图片放大查看（lightbox） */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 8px;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(20, 24, 34, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(47, 162, 107, 0.95); }
.toast.error { background: rgba(229, 72, 77, 0.95); }

@media (max-width: 640px) {
  .record-item { flex-wrap: wrap; }
  .record-actions { width: 100%; justify-content: flex-end; }
  .detail-head .cover { width: 100px; height: 67px; }
}
