:root {
  --app-w: 430px;
  --bg: #1a1d21;
  --surface: #f5f6f8;
  --card: #ffffff;
  --text: #1c1e21;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #111827;
  --accent-2: #2563eb;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  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: inherit; text-decoration: none; }

/* 顶部导航 */
.navbar {
  position: sticky; top: 0; z-index: 10;
  max-width: var(--app-w); margin: 0 auto;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.navbar .logo { font-size: 19px; font-weight: 700; letter-spacing: 0.5px; }
.navbar .logo span { color: var(--accent-2); }

/* 主容器 */
.container { max-width: var(--app-w); margin: 0 auto; padding: 16px 16px 48px; background: var(--surface); min-height: 100vh; }
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

/* 分类筛选 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  padding: 6px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); color: var(--text); white-space: nowrap;
}
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* 视频卡片 */
.video-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.video-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s ease;
}
.video-card:active { transform: scale(0.98); }
.video-thumb { position: relative; aspect-ratio: 16/9; background: #111; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-thumb .no-cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; }
.video-thumb .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.9); font-size: 40px; }
.video-body { padding: 10px 12px; }
.video-name { font-size: 14px; font-weight: 600; line-height: 1.4; margin: 0 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.video-cat { color: var(--muted); font-size: 12px; }

/* 播放器弹层 */
.player-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.player-box { width: 100%; max-width: var(--app-w); }
.player-box video { width: 100%; border-radius: 12px; background: #000; display: block; }
.player-title { color: #fff; font-size: 15px; font-weight: 600; margin: 12px 0 6px; }
.player-link { color: #9ca3af; font-size: 12px; margin-bottom: 16px; word-break: break-all; }
.player-close { position: absolute; top: 20px; right: 20px; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 10px; padding: 10px 16px; font-size: 15px; cursor: pointer; background: var(--accent); color: #fff; }
.btn:active { opacity: 0.85; }
.btn.primary { background: var(--accent-2); }
.btn.outline { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: var(--danger); }
.btn.copy { background: #f3f4f6; color: var(--text); border: 1px solid var(--line); }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--text); margin-bottom: 6px; }
.input, .select, .textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; background: #fff; color: var(--text); }
.textarea { min-height: 80px; resize: vertical; }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 15px; }

/* 提示 */
.alert { display: block; padding: 8px 12px; border-radius: 8px; font-size: 14px; margin: 8px 0; }
.alert.success { background: #ecfdf5; color: #047857; }
.alert.error { background: #fef2f2; color: #b91c1c; }

/* 后台 */
body.admin-page { background: #f5f6f8; }
body.admin-page .navbar { max-width: none; margin: 0; }
body.admin-page .navbar-inner { max-width: 1200px; margin: 0 auto; }
body.admin-page .container { max-width: 1200px; margin: 0 auto; padding: 24px 20px 48px; background: transparent; min-height: auto; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 4px; font-size: 20px; }
.panel h3 { margin: 16px 0 10px; font-size: 15px; }
.tabs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 14px; }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; }
.prod-thumb { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; background: #111; }
.prod-thumb-empty { width: 64px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--surface); border-radius: 6px; font-size: 16px; }

/* 弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius); padding: 20px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 16px; }

.hidden { display: none !important; }
