/* ===== Global Styles ===== */
:root {
  /* Theme: Classic (default) */
  --bg-primary: #2a1810;
  --bg-secondary: #1a0f08;
  --bg-card: #3d2817;
  --bg-elevated: #4a3220;
  --text-primary: #f5e6d3;
  --text-secondary: #c9a876;
  --text-muted: #8b7355;
  --accent: #d4af37;
  --accent-hover: #e8c547;
  --border: #5c3d20;
  --success: #5fb878;
  --danger: #d95858;
  --warning: #e89c4f;
  --info: #5b9bd5;

  /* Layout */
  --header-height: 60px;
  --max-width: 1280px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);

  /* Animation */
  --anim-fast: 150ms;
  --anim-base: 200ms;
  --anim-slow: 300ms;
}

/* Theme: Minimal */
body.theme-minimal {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #fafafa;
  --text-primary: #1f1f1f;
  --text-secondary: #595959;
  --text-muted: #8c8c8c;
  --accent: #1677ff;
  --accent-hover: #4096ff;
  --border: #e8e8e8;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Animation toggle */
body.no-animations *, body.no-animations *::before, body.no-animations *::after {
  animation-duration: 0ms !important;
  transition-duration: 0ms !important;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  overflow-x: hidden;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 100;
}
.site-header__inner {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 18px; color: var(--accent);
}
.site-logo__icon { width: 32px; height: 32px; }
.site-nav {
  display: flex; gap: 24px; flex: 1; justify-content: center;
}
.site-nav__item {
  color: var(--text-secondary); padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--anim-fast);
}
.site-nav__item:hover { color: var(--accent); background: var(--bg-elevated); }
.site-nav__item.active { color: var(--accent); font-weight: 600; }
.site-nav__item.disabled { color: var(--text-muted); cursor: not-allowed; opacity: 0.5; }
.site-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--anim-fast);
}
.icon-btn:hover { color: var(--accent); background: var(--bg-elevated); }
.icon-btn svg { width: 20px; height: 20px; }

.hamburger { display: none; }

/* ===== Main Content ===== */
.site-main {
  padding-top: var(--header-height);
  min-height: 100vh;
}
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--anim-fast);
  min-height: 40px;
}
.btn:hover:not(:disabled) { background: var(--accent); color: white; transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { background: transparent; }
.btn--lg { padding: 14px 28px; font-size: 16px; min-height: 48px; }
.btn--sm { padding: 6px 12px; font-size: 12px; min-height: 32px; }

/* ===== Ad Slots ===== */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 12px;
  margin: 16px 0;
  border-radius: var(--radius-md);
}
.ad-slot::before { content: "Ad"; font-weight: 600; }
.ad-top-banner { height: 90px; max-width: 728px; margin: 16px auto; }
.ad-side-rect { width: 300px; height: 250px; }
.ad-pause-slot { width: 300px; height: 250px; margin: 16px auto; }

/* ===== Modal ===== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0;
  transition: opacity var(--anim-base);
}
.modal-mask.show { display: flex; opacity: 1; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  position: relative;
  transform: scale(0.95);
  transition: transform var(--anim-base);
}
.modal-mask.show .modal { transform: scale(1); }
.modal__title {
  font-size: 22px; font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
  text-align: center;
}
.modal__body { margin-bottom: 20px; color: var(--text-secondary); }
.modal__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.modal__close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--anim-fast);
}
.modal__close:hover { color: var(--danger); background: var(--bg-elevated); }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  animation: toastIn var(--anim-base) ease-out;
  pointer-events: auto;
}
.toast--success { border-color: var(--success); }
.toast--danger { border-color: var(--danger); }
.toast--warning { border-color: var(--warning); }
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 40px;
  padding: 24px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.site-footer a { color: var(--text-secondary); transition: color var(--anim-fast); }
.site-footer a:hover { color: var(--accent); }

/* ===== Mobile Sidebar ===== */
.mobile-sidebar {
  position: fixed; top: 0; right: -100%; bottom: 0;
  width: 280px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  padding: 80px 20px 20px;
  transition: right var(--anim-base);
  overflow-y: auto;
}
.mobile-sidebar.show { right: 0; }
.mobile-sidebar__nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; }
.mobile-sidebar__nav a {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--anim-fast);
}
.mobile-sidebar__nav a:hover { background: var(--bg-elevated); color: var(--accent); }
.mobile-sidebar__nav a.active { background: var(--accent); color: white; }
.mobile-sidebar__actions { display: flex; flex-direction: column; gap: 8px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .hamburger { display: inline-flex; }
  .site-actions .icon-btn:not(.hamburger) { display: none; }
  .container { padding: 12px; }
  .modal { padding: 20px 16px; }
  .modal__title { font-size: 18px; }
}
@media (min-width: 769px) and (max-width: 1200px) {
  .site-nav { gap: 12px; }
  .site-nav__item { padding: 6px 8px; font-size: 13px; }
}