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

:root,
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4f6;
  --card: #ffffff;
  --text: #191f28;
  --text-secondary: #6b7684;
  --text-tertiary: #8b95a1;
  --blue: #3182f6;
  --blue-hover: #1b64da;
  --blue-light: #e8f3ff;
  --green: #03b26c;
  --green-bg: #e8faf0;
  --orange: #f59f00;
  --orange-bg: #fff8e6;
  --border: #e5e8eb;
  --surface-hover: #fafbfc;
  --switch-track: #e5e8eb;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117;
  --card: #161b22;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-tertiary: #6e7681;
  --blue: #58a6ff;
  --blue-hover: #79b8ff;
  --blue-light: rgba(56, 139, 253, 0.15);
  --green: #3fb950;
  --green-bg: rgba(63, 185, 80, 0.15);
  --orange: #d29922;
  --orange-bg: rgba(210, 153, 34, 0.15);
  --border: #30363d;
  --surface-hover: rgba(255, 255, 255, 0.04);
  --switch-track: #3182f6;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
}

html {
  min-height: 100%;
  background: var(--bg);
  transition: background-color 0.2s ease;
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.site-header {
  margin-bottom: 32px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  font-size: 0.875rem;
}

.back-link,
.github-link,
.lang-link,
.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-link:hover,
.github-link:hover,
.lang-link:hover,
.toys-link:hover,
.site-footer a:hover {
  color: var(--blue);
}

.toys-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.theme-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-switch-track {
  position: relative;
  display: block;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: var(--switch-track);
  transition: background 0.25s ease;
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  transition: transform 0.28s cubic-bezier(0.34, 1.25, 0.64, 1);
  pointer-events: none;
}

.theme-switch-input:checked + .theme-switch-track .theme-switch-thumb,
html[data-theme="dark"] .theme-switch-thumb {
  transform: translateX(22px);
}

html[data-theme="light"] .theme-switch-thumb {
  transform: translateX(0);
}

.lang-link {
  font-weight: 600;
  color: var(--blue);
}

.hero-emoji {
  font-size: 40px;
  margin-bottom: 12px;
  line-height: 1;
}

h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  margin-top: 8px;
  letter-spacing: -0.01em;
}

.preview-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--orange-bg);
  color: var(--orange);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.55;
  word-break: keep-all;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: var(--card);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.filter-btn:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.filter-btn.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.tool-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loading,
.empty,
.error {
  text-align: center;
  color: var(--text-tertiary);
  padding: 48px 16px;
  font-size: 0.9375rem;
}

.tool-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool-details {
  margin: 0;
}

.tool-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.tool-summary::-webkit-details-marker {
  display: none;
}

.tool-summary:hover {
  background: var(--surface-hover);
}

.tool-summary-main {
  flex: 1;
  min-width: 0;
}

.tool-summary-aside {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  height: 32px;
}

.tool-card h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.35;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.status-stable {
  background: var(--green-bg);
  color: var(--green);
}

.status-beta {
  background: var(--orange-bg);
  color: var(--orange);
}

.tool-chevron {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  position: relative;
  transition: transform 0.2s ease, background 0.15s ease;
}

.tool-chevron::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--text-tertiary);
  border-bottom: 2px solid var(--text-tertiary);
  transform: translate(-50%, -65%) rotate(45deg);
  transition: border-color 0.15s ease;
}

.tool-details[open] .tool-chevron {
  transform: rotate(180deg);
  background: var(--blue-light);
}

.tool-details[open] .tool-chevron::after {
  border-color: var(--blue);
}

.tagline {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 400;
  margin-top: 4px;
  word-break: keep-all;
  line-height: 1.45;
}

.tool-details-body {
  padding: 0 22px 22px;
  border-top: 1px solid var(--border);
  animation: expand-in 0.2s ease;
}

@keyframes expand-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin: 18px 0 16px;
  word-break: keep-all;
  line-height: 1.6;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.meta strong {
  color: var(--text);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-secondary);
}

.install-block {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.install-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.install-block pre {
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--border);
}

.install-advanced {
  margin-bottom: 14px;
}

.install-advanced summary {
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  list-style: none;
}

.install-advanced summary::-webkit-details-marker {
  display: none;
}

.install-advanced pre {
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.site-footer {
  margin-top: 16px;
  padding-bottom: 8px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  line-height: 1.8;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease;
}

.footer-link-btn:hover {
  color: var(--blue);
}

.ad-banner {
  margin-top: 28px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 90px;
}

.ad-banner .adsbygoogle {
  display: block;
  min-height: 60px;
}

.footer-ad {
  margin-top: 32px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  text-align: center;
  max-height: 72px;
  overflow: hidden;
}

.footer-ad .adsbygoogle {
  display: block;
  max-height: 56px;
  min-height: 0;
  overflow: hidden;
}

body.bug-modal-open {
  overflow: hidden;
}

.bug-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.bug-modal[hidden] {
  display: none;
}

.bug-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 31, 40, 0.45);
}

.bug-modal-dialog {
  position: relative;
  width: min(100%, 420px);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.14);
  padding: 24px 22px 22px;
}

.bug-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.bug-modal-close:hover {
  color: var(--text);
}

.bug-modal-dialog h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.bug-modal-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.bug-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bug-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.bug-field select,
.bug-field input,
.bug-field textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s ease;
}

.bug-field select:focus,
.bug-field input:focus,
.bug-field textarea:focus {
  outline: none;
  border-color: var(--blue);
}

.bug-field textarea {
  resize: vertical;
  min-height: 96px;
}

.bug-field-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.bug-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bug-file-btn {
  align-self: flex-start;
  padding: 8px 14px;
  font-size: 0.8125rem;
}

.bug-file-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.bug-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.bug-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.bug-file-size {
  flex-shrink: 0;
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

.bug-file-remove {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}

.bug-file-remove:hover {
  color: var(--blue-hover);
}

.bug-submit-frame {
  display: none;
  width: 0;
  height: 0;
  border: 0;
}

.bug-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

html[data-theme="dark"] .filter-btn {
  box-shadow: none;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(25, 31, 40, 0.92);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 100;
}

html[data-theme="dark"] .toast {
  background: rgba(22, 27, 34, 0.96);
  border: 1px solid var(--border);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 640px) {
  .page {
    padding-top: 48px;
  }

  h1 {
    font-size: 1.75rem;
  }
}

.header-spacer {
  flex: 1;
}

.toys-subtitle {
  color: var(--text-tertiary);
  font-size: 0.9375rem;
}

.toys-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

.toys-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.toys-card:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  box-shadow: 0 4px 16px rgba(245, 159, 0, 0.12);
}

.toys-card-emoji {
  font-size: 2rem;
  line-height: 1;
}

.toys-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.toys-card-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.toys-card-note {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--orange);
  margin-top: 4px;
}
