/* ============================================================
   VideoHub — Industrial Dark 主题样式表
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --bg-primary: #161618;
  --bg-secondary: #1e1e22;
  --bg-tertiary: #252528;
  --bg-elevated: #2a2a30;
  --bg-hover: #303036;
  --accent-orange: #f0a500;
  --accent-blue: #4a90d9;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-default: #333338;
  --border-hover: #555558;
  --border-active: #f0a500;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --shadow-panel: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-modal: 0 8px 48px rgba(0,0,0,0.7);
  --ease-fast: 120ms ease;
  --ease-normal: 200ms ease;
  --radius: 2px;
  --radius-lg: 2px;
  --border-width: 1.5px;
  --toolbar-height: 44px;
  --statusbar-height: 28px;
  --sidebar-width: 200px;
  --right-panel-width: 260px;
  --mobile-bottom-nav-height: 56px;
  --accent-orange-15: rgba(240,165,0,0.15);
  --accent-orange-30: rgba(240,165,0,0.30);
}

/* 亮色主题 */
[data-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #e8e8ec;
  --bg-tertiary: #dddde2;
  --bg-elevated: #d4d4da;
  --bg-hover: #c8c8d0;
  --accent-orange: #d4880a;
  --accent-blue: #4a90d9;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --text-primary: #1a1a1e;
  --text-secondary: #4a4a52;
  --text-muted: #7a7a85;
  --border-default: #c8c8d0;
  --border-hover: #a0a0aa;
  --border-active: #d4880a;
  --shadow-panel: 0 4px 24px rgba(0,0,0,0.12);
  --shadow-modal: 0 8px 48px rgba(0,0,0,0.2);
  --accent-orange-15: rgba(212,136,10,0.12);
  --accent-orange-30: rgba(212,136,10,0.25);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Lucide SVG 不拦截点击 */
[data-lucide],
svg.lucide,
svg[data-lucide],
.lucide svg,
i[data-lucide],
button svg,
.btn-icon svg,
button [data-lucide] {
  pointer-events: none;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--ease-fast);
}
a:hover { color: var(--accent-orange); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: var(--radius);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  height: var(--toolbar-height);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-bottom: var(--border-width) solid var(--border-default);
  gap: 8px;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.5px;
  transition: color var(--ease-fast);
}
.logo:hover {
  color: var(--accent-orange);
}

.logo-text {
  display: inline;
}

/* ---------- Search Box ---------- */
.search-box {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-tertiary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  padding: 0 8px;
  transition: border-color var(--ease-fast), background var(--ease-fast);
}
.search-box:focus-within {
  border-color: var(--border-active);
  background: var(--bg-elevated);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 0 8px;
  outline: none;
}
.search-input::placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.search-clear {
  display: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
}
.search-clear:hover {
  color: var(--text-primary);
}
.search-submit {
  color: var(--text-muted);
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}
.search-submit:hover {
  color: var(--accent-orange);
  background: var(--accent-orange-15);
  border-color: var(--border-active);
}
/* ---------- Buttons ---------- */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--ease-fast);
  font-size: 13px;
  padding: 0;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.btn-icon:active {
  transform: scale(0.98);
}
.btn-icon.active {
  color: var(--accent-orange);
  border-color: var(--border-active);
  background: var(--accent-orange-15);
}
.btn-icon svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}
/* Text buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--ease-fast);
  white-space: nowrap;
  line-height: 1;
}
.btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: var(--accent-orange-15);
}
.btn-primary:hover {
  background: var(--accent-orange-30);
  color: var(--accent-orange);
  border-color: var(--accent-orange);
}
.btn-danger {
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ---------- Layout ---------- */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--toolbar-height) - var(--statusbar-height));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: var(--border-width) solid var(--border-default);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--ease-normal), width var(--ease-normal);
  flex-shrink: 0;
}
.sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--ease-fast);
  border: var(--border-width) solid transparent;
  cursor: pointer;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  color: var(--accent-orange);
  background: var(--accent-orange-15);
  border-color: var(--border-active);
}
.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-divider {
  height: var(--border-width);
  background: var(--border-default);
  margin: 8px 12px;
}

.sidebar-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 4px 12px 8px;
}

.sidebar-categories {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 8px 12px;
}

.sidebar-category-group {
  margin-bottom: 4px;
}

.sidebar-category-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 8px 4px;
  opacity: 0.7;
}

.sidebar-category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--ease-fast);
  border: var(--border-width) solid transparent;
}
.sidebar-category-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar-category-item.active {
  color: var(--accent-orange);
  background: var(--accent-orange-15);
  border-color: var(--border-active);
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-primary);
  position: relative;
}

/* Right Panel */
.right-panel {
  width: var(--right-panel-width);
  min-width: var(--right-panel-width);
  background: var(--bg-secondary);
  border-left: var(--border-width) solid var(--border-default);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: margin-right var(--ease-normal), width var(--ease-normal);
  flex-shrink: 0;
}
.right-panel.collapsed {
  margin-right: calc(-1 * var(--right-panel-width));
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: var(--border-width) solid var(--border-default);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.panel-close {
  color: var(--text-muted);
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  height: var(--statusbar-height);
  padding: 0 12px;
  background: var(--bg-secondary);
  border-top: var(--border-width) solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  gap: 12px;
}
.status-left { flex: 0 0 auto; }
.status-center { flex: 1; text-align: center; }
.status-right { flex: 0 0 auto; }

/* ---------- Loading Bar ---------- */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--bg-tertiary);
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--ease-fast);
}
.loading-bar.active {
  opacity: 1;
}
.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-orange), transparent);
  animation: loading-slide 1.2s ease infinite;
}
@keyframes loading-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* ---------- Page Content ---------- */
.page {
  padding: 16px;
  animation: fadeIn var(--ease-fast);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ---------- Video Grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.video-card {
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.video-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-panel);
}
.video-card:active {
  transform: scale(0.98);
}

.video-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-tertiary);
  overflow: hidden;
}
.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--ease-normal);
}
.video-card:hover .video-card-thumb img {
  transform: scale(1.05);
}

.video-card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  border-radius: var(--radius);
  pointer-events: none;
}

.video-card-body {
  padding: 10px 12px;
}

.video-card-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.video-card-type {
  padding: 1px 6px;
  background: var(--accent-orange-15);
  color: var(--accent-orange);
  border-radius: var(--radius);
  font-size: 10px;
}

/* ---------- Video Detail Panel ---------- */
.detail-cover {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-bottom: 12px;
}

.detail-tag {
  padding: 1px 6px;
  background: var(--bg-tertiary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.detail-info {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.detail-info strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.detail-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 12px;
  padding-top: 12px;
  border-top: var(--border-width) solid var(--border-default);
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ---------- Episode List (in panel) ---------- */
.episode-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.episode-grid-title {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.episode-btn {
  padding: 4px 10px;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.episode-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.episode-btn:active {
  transform: scale(0.98);
}
.episode-btn.active {
  border-color: var(--border-active);
  color: var(--accent-orange);
  background: var(--accent-orange-15);
}

/* ---------- Skip Slider ---------- */
.skip-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  outline: none;
  cursor: pointer;
  border: var(--border-width) solid var(--border-default);
}
.skip-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: var(--radius);
  background: var(--accent-orange);
  border: 1.5px solid var(--accent-orange);
  cursor: pointer;
  transition: all var(--ease-fast);
}
.skip-slider::-webkit-slider-thumb:hover {
  background: var(--bg-primary);
  border-color: var(--accent-orange);
}
.skip-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: var(--radius);
  background: var(--accent-orange);
  border: 1.5px solid var(--accent-orange);
  cursor: pointer;
}
.skip-slider:focus {
  border-color: var(--border-active);
}

/* ---------- History List ---------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--ease-fast);
}
.history-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}
.history-item:active {
  transform: scale(0.98);
}

.history-item-thumb {
  width: 60px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  overflow: hidden;
  flex-shrink: 0;
}
.history-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}
.history-item-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item-episode {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.history-item-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ---------- Settings ---------- */
.settings-section {
  margin-bottom: 16px;
}
.settings-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.settings-item-label {
  font-size: 13px;
  color: var(--text-primary);
}
.settings-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Modal (Player) ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn var(--ease-fast);
}
.modal-overlay.active {
  display: flex;
}

.modal-container {
  display: flex;
  flex-direction: column;
  width: 90vw;
  max-width: 960px;
  height: 85vh;
  max-height: 720px;
  background: var(--bg-secondary);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: modalSlideIn var(--ease-normal);
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: var(--border-width) solid var(--border-default);
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-close {
  color: var(--text-muted);
  flex-shrink: 0;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.player-wrapper {
  width: 100%;
  background: #000;
  position: relative;
}

.video-player {
  width: 100%;
  display: block;
  max-height: 60vh;
  background: #000;
}

.episode-bar {
  padding: 12px 16px;
  flex-shrink: 0;
}
.episode-bar-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}
.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 0;
}
.pagination-btn {
  padding: 6px 12px;
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.pagination-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.pagination-btn:active {
  transform: scale(0.98);
}
.pagination-btn.active {
  border-color: var(--border-active);
  color: var(--accent-orange);
  background: var(--accent-orange-15);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-info {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 8px;
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state-desc {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 300px;
}

/* ---------- Mobile Bottom Nav ---------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-bottom-nav-height);
  background: var(--bg-secondary);
  border-top: var(--border-width) solid var(--border-default);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--ease-fast);
  border: var(--border-width) solid transparent;
}
.mobile-nav-item:hover {
  color: var(--text-secondary);
}
.mobile-nav-item.active {
  color: var(--accent-orange);
}
.mobile-nav-item svg {
  width: 20px;
  height: 20px;
}

/* ---------- Responsive ---------- */
/* Tablet */
@media (max-width: 1024px) {
  .right-panel {
    position: fixed;
    right: 0;
    top: var(--toolbar-height);
    bottom: 0;
    z-index: 200;
    box-shadow: var(--shadow-panel);
  }
  .right-panel.collapsed {
    margin-right: calc(-1 * var(--right-panel-width));
  }
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--toolbar-height);
    bottom: 0;
    z-index: 200;
    box-shadow: var(--shadow-panel);
  }
  .sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .app-layout {
    height: calc(100vh - var(--toolbar-height) - var(--mobile-bottom-nav-height));
  }

  .toolbar-center {
    max-width: none;
    margin: 0;
  }

  .right-panel {
    width: 100%;
    min-width: 0;
  }
  .right-panel.collapsed {
    margin-right: -100%;
  }

  .logo-text {
    display: none;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .page {
    padding: 12px;
  }

  .modal-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: none;
  }
  .sidebar-toggle {
    display: flex !important;
  }

  /* 移动端增大触控区域 */
  .btn-icon {
    width: 40px;
    height: 40px;
  }
  .search-clear,
  .search-submit {
    width: 36px;
    height: 36px;
  }
  .toolbar {
    padding: 0 8px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .logo-text {
    display: none;
  }

  .toolbar {
    padding: 0 8px;
    gap: 4px;
  }

  .search-input {
    font-size: 12px;
  }
}

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 10px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* ---------- Notification Toast ---------- */
.toast {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 8px 16px;
  background: var(--bg-elevated);
  border: var(--border-width) solid var(--border-default);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  z-index: 3000;
  opacity: 0;
  transition: all var(--ease-normal);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.toast.success {
  border-color: var(--accent-green);
  color: var(--accent-green);
}