:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #5c6b7a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e2e8f0;
  --sidebar-w: 280px;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Yu Gothic UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
}

.lang-switcher {
  display: flex;
  gap: 0.35rem;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: var(--radius);
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 8px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 5rem;
}

.sidebar-hint {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.guide-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.guide-link {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.75rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.guide-link:hover {
  background: var(--bg);
}

.guide-link.active {
  background: #eff6ff;
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.content {
  min-width: 0;
}

.video-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.video-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.video-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.video-wrap {
  position: relative;
  background: #0f172a;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
  background: linear-gradient(145deg, #1e293b, #0f172a);
}

.video-loading,
.video-placeholder[hidden],
.video-loading[hidden] {
  display: none !important;
}

.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: #94a3b8;
  background: linear-gradient(145deg, #1e293b, #0f172a);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(148, 163, 184, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.pick-folder-btn {
  margin-top: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}

.pick-folder-btn:hover {
  background: var(--accent-hover);
}

.pick-folder-btn[hidden] {
  display: none !important;
}

.placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.video-placeholder code {
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  color: #cbd5e1;
}

.tips {
  margin-top: 1.25rem;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.tips li {
  margin-bottom: 0.35rem;
}

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

@media (max-width: 768px) {
  .main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .guide-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
