/* ✅ 페이지 전체에 적용할 다크/라이트 변수 예시 */
  :root {
    --bg: #ffffff;
    --text: #111827;
  }
  :root[data-theme="dark"] {
    --bg: #0b1220;
    --text: #e5e7eb;
  }
  body {
    background: var(--bg);
    color: var(--text);
  }

  /* ✅ 토글 UI */
  .theme-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    line-height: 0;
  }

  .toggle-track {
    width: 56px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 3px;
    box-sizing: border-box;

    /* 트랙 배경 */
    background: rgba(17, 24, 39, 0.10);
    border: 1px solid rgba(17, 24, 39, 0.15);
    transition: background 200ms ease, border-color 200ms ease;
  }

  /* 다크모드일 때 트랙 */
  .theme-toggle.is-dark .toggle-track {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
  }

  .toggle-thumb {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: grid;
    place-items: center;

    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transform: translateX(0);
    transition: transform 220ms ease;
  }

  /* ✅ 클릭 시 오른쪽으로 이동 */
  .theme-toggle.is-dark .toggle-thumb {
    transform: translateX(26px);
    background: rgba(255, 255, 255, 0.85);
  }

  .toggle-icon {
    font-size: 14px;
    transform: translateY(-0.5px);
    user-select: none;
  }

  /* 접근성: 키보드 포커스 */
  .theme-toggle:focus-visible .toggle-track {
    outline: 3px solid rgba(59, 130, 246, 0.55);
    outline-offset: 3px;
  }

  /* 모션 최소화 설정 사용자의 경우 */
  @media (prefers-reduced-motion: reduce) {
    .toggle-track, .toggle-thumb {
      transition: none;
    }
  }