/* ===== 도구 공통 스타일 ===== */
@font-face {
  font-family: 'NEXON Lv2 Gothic';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@2.1/NEXON Lv2 Gothic.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #f7f7fb;
  --card: #fff;
  --ink: #222;
  --muted: #666;
  --line: #e8e8ef;
  --brand: #6b0000;
  --brand-ink: #fff;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(28, 25, 55, .08);
  --accent: #4f46e5;
}

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

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: 'NEXON Lv2 Gothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── 헤더 ── */
.site-header {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
}

.site-header .logo img {
  height: auto;
  width: 180px;
  display: block;
}

.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.site-header .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
}

.site-header .nav-btn:hover {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

.site-header .nav-btn.active {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

/* ── 메인 컨테이너 ── */
.tool-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.tool-container.wide {
  max-width: 1000px;
}

/* ── 페이지 제목 ── */
.tool-hero {
  text-align: center;
  margin-bottom: 28px;
}

.tool-hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
}

.tool-hero p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* ── 카드 ── */
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.tool-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── 입력 ── */
.tool-input,
.tool-textarea,
.tool-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafafe;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .15s;
}

.tool-input:focus,
.tool-textarea:focus,
.tool-select:focus {
  outline: none;
  border-color: var(--brand);
}

.tool-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* ── 버튼 ── */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
  background: var(--brand);
  color: var(--brand-ink);
}

.tool-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.tool-btn:active {
  transform: translateY(0);
}

.tool-btn.secondary {
  background: #e8e8ef;
  color: var(--ink);
}

.tool-btn.secondary:hover {
  background: #d5d5e0;
}

.tool-btn.accent {
  background: var(--accent);
  color: #fff;
}

/* ── 결과 영역 ── */
.tool-result {
  background: #f0f4ff;
  border: 1px solid #d0d8f0;
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
  font-size: 15px;
  word-break: break-all;
}

.tool-result.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.tool-result.error {
  background: #fef2f2;
  border-color: #fecaca;
}

/* ── 통계 박스 ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-box {
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.stat-box .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
}

.stat-box .label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── 광고 슬롯 ── */
.ad-slot {
  background: #fafafa;
  border: 1px dashed var(--line);
  border-radius: 10px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 13px;
  margin: 20px 0;
}

/* ── 푸터 ── */
.site-footer {
  color: var(--muted);
  font-size: 13px;
  padding: 28px 16px;
  text-align: center;
}

/* ── 반응형 ── */
@media (max-width: 600px) {
  .tool-hero h1 {
    font-size: 22px;
  }

  .tool-card {
    padding: 16px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-header .inner {
    padding: 8px 10px;
  }

  .site-header .logo img {
    width: 140px;
  }

  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .tool-item {
    padding: 14px 10px;
  }

  .tool-item .icon {
    font-size: 28px;
    margin-bottom: 6px;
  }

  .tool-item h3 {
    font-size: 13px;
  }

  .tool-item p {
    font-size: 11px;
  }
}

/* ── 도구 목록 그리드 ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.tool-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: .15s;
  text-decoration: none;
  color: var(--ink);
}

.tool-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.tool-item .icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.tool-item h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}

.tool-item p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ── 버튼 그룹 ── */
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ── 탭 ── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
}

.tab-btn.active {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

/* ── 복사 버튼 ── */
.copy-btn {
  position: relative;
}

.copy-btn.copied::after {
  content: '복사됨!';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  animation: fadeUp .8s forwards;
}

@keyframes fadeUp {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px)
  }
}

/* ── 슬라이더 ── */
.tool-range {
  width: 100%;
  accent-color: var(--brand);
}