:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  --toggle-circle: #111827;
  --mystery-bg: radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28%), radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.08), transparent 18%);
  --mystery-fill: #f8fafc;
}

body.dark {
  color-scheme: dark;
  --bg: #111316;
  --surface: #1f222a;
  --text: #f8fafc;
  --muted: #a8b0cc;
  --border: rgba(255, 255, 255, 0.12);
  --accent: #9ca5ff;
  --accent-soft: rgba(156, 165, 255, 0.16);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  --toggle-circle: #000000;
  --mystery-bg: radial-gradient(circle at top left, rgba(156, 165, 255, 0.16), transparent 32%), radial-gradient(circle at bottom right, rgba(156, 165, 255, 0.1), transparent 22%);
  --mystery-fill: #111316;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  transition: width 0.24s ease, padding 0.24s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 72px;
  padding: 28px 10px;
}

.sidebar.collapsed .sidebar-header > div,
.sidebar.collapsed .nav-list {
  display: none;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.sidebar-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.sidebar-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.toggle-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  font-size: 0.98rem;
  border-radius: 16px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.2);
}

.main-panel {
  background: var(--bg);
  padding: 24px 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.theme-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--toggle-circle);
  transition: background 0.2s ease;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.brand-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.topbar-page {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
}

.page-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.page-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 560px;
}

.top-link {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.top-link:hover {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.2);
}

.page-badge {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-content {
  margin-top: 28px;
}

.card {
  padding: 26px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.05);
}

.card h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1rem;
}

.mystery-image {
  margin-top: 24px;
  width: 100%;
  max-width: 540px;
  padding: 36px;
  border-radius: 28px;
  background: var(--mystery-bg);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
}

.mystery-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--mystery-fill);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 24px 48px rgba(15, 23, 42, 0.08);
}

.footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 100%;
    padding: 24px;
  }
  .main-panel {
    padding: 24px 20px 40px;
  }
}

@media (max-width: 680px) {
  .sidebar {
    padding: 20px 12px;
  }
  .sidebar-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-item {
    padding: 12px 14px;
  }
}
