/* ============================================================
   프롬모아 — 스타일 (v3, 라이트 편집 테마)
   따뜻한 종이색 배경 + 잉크 텍스트 + 단색 포인트(에메랄드).
   색은 :root 값만 바꾸면 전체가 바뀝니다.
   ============================================================ */
:root {
  --bg: #f6f4ee;          /* 따뜻한 종이색 배경 */
  --surface: #ffffff;     /* 카드/패널 */
  --surface-2: #f3f0e8;   /* 코드블록 등 */
  --border: #e5e0d4;
  --border-soft: #ece8de;

  --text: #20201d;        /* 잉크 블랙 */
  --text-dim: #6c685f;
  --text-mute: #9c978c;

  --accent: #147a52;      /* 포인트: 차분한 에메랄드 */
  --accent-ink: #0d5c3d;  /* 진한 버전(호버) */
  --accent-soft: #e6f1ec; /* 옅은 틴트 */
  --hot-bg: #fdeede;      /* '인기' 배지 */
  --hot-ink: #b4540e;

  --radius: 16px;
  --radius-sm: 11px;
  --maxw: 1120px;
  --shadow-sm: 0 1px 2px rgba(33,30,20,.05);
  --shadow: 0 2px 8px rgba(33,30,20,.06);
  --shadow-lg: 0 16px 40px -18px rgba(33,30,20,.28);
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font-family: var(--font); line-height: 1.6; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.hidden { display: none !important; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246,244,238,.82); backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 66px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: #fff; box-shadow: var(--shadow-sm);
}
.tabs { display: flex; gap: 4px; margin-left: auto; background: var(--surface-2); padding: 4px; border-radius: 999px; border: 1px solid var(--border-soft); }

/* 언어 선택 */
.lang-select { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 7px; font-family: inherit; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s;
}
#lang-btn-label { white-space: nowrap; }
.lang-btn:hover { border-color: var(--text-mute); }
.lang-btn svg { color: var(--text-mute); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); min-width: 168px;
}
.lang-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text-dim); cursor: pointer; transition: .12s;
}
.lang-item:hover { background: var(--surface-2); color: var(--text); }
.lang-item.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.lang-flag { font-size: 16px; }
.tab {
  border: 0; background: transparent; color: var(--text-dim); font-family: inherit; white-space: nowrap;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .16s;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

/* ---------- 패널 ---------- */
.panel { display: none; padding: 40px 0 72px; animation: rise .35s ease both; }
.panel.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 히어로 ---------- */
.hero { text-align: center; margin: 28px 0 30px; }
.hero-badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 14px; line-height: 1.22; font-weight: 800; letter-spacing: -0.035em; }
.hero h1 strong { color: var(--accent); font-weight: 800; }
.hero-sub { color: var(--text-dim); margin: 0 auto 26px; font-size: clamp(15px, 2vw, 17px); max-width: 560px; }

.search-box { position: relative; max-width: 600px; margin: 0 auto; }
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text-mute); pointer-events: none; }
#search {
  width: 100%; padding: 16px 116px 16px 50px; font-size: 16px; font-family: inherit;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; box-shadow: var(--shadow-sm); transition: .16s;
}
#search::placeholder { color: var(--text-mute); }
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-btn {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px; font-family: inherit;
  background: var(--accent); color: #fff; border: 0; border-radius: 11px;
  padding: 10px 15px; font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s;
}
.search-btn:hover { background: var(--accent-ink); }
.search-btn svg { display: block; }

.hero-stats { list-style: none; display: flex; justify-content: center; gap: 12px; padding: 0; margin: 22px 0 0; flex-wrap: wrap; }
.hero-stats li { display: flex; align-items: baseline; gap: 6px; background: var(--surface); border: 1px solid var(--border); padding: 9px 16px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.hero-stats strong { font-size: 18px; font-weight: 800; color: var(--text); }
.hero-stats span { font-size: 13px; color: var(--text-dim); }

/* ---------- 사용 방법 3단계 ---------- */
.steps {
  list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  padding: 0; margin: 0 auto 30px; max-width: 760px;
}
.step { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px 18px; }
.step-num { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: 15px; }
.step b { font-size: 15px; }
.step p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }

/* ---------- 카테고리 칩 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin: 8px 0 20px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-family: inherit;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--text-mute); }
.chip.is-active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.chip-count { font-size: 11px; font-weight: 700; color: var(--text-mute); margin-left: 3px; }
.chip.is-active .chip-count { color: var(--accent-ink); }
.chip-fav { color: #b8860b; }
.chip-fav.is-active { background: #fff4d6; color: #9a6b00; border-color: #f0c14b; }
.chip-fav.is-active .chip-count { color: #9a6b00; }

.result-count { text-align: center; color: var(--text-mute); font-size: 13px; margin: 4px 0 4px; }
.fill-hint { text-align: center; color: var(--text-dim); font-size: 12.5px; margin: 0 0 20px; }

/* ---------- 프롬프트 카드 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s, box-shadow .16s; overflow: hidden;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); opacity: 0; transition: opacity .16s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.card:hover::before { opacity: 1; }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-cat { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 10px; border-radius: 7px; letter-spacing: .2px; }
.card-hot { font-size: 11.5px; font-weight: 800; color: var(--hot-ink); background: var(--hot-bg); padding: 4px 9px; border-radius: 7px; }
.card-fav { margin-left: auto; background: none; border: 0; cursor: pointer; font-size: 20px; line-height: 1; color: var(--text-mute); padding: 0 2px; transition: transform .12s, color .12s; }
.card-fav:hover { color: #f5a623; transform: scale(1.15); }
.card-fav.is-faved { color: #f5a623; }
.card-title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.card-desc { font-size: 13.5px; color: var(--text-dim); margin: 0; }
.card-body {
  position: relative; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 14px; font-size: 13px; line-height: 1.65; color: #43403a; white-space: pre-wrap;
  max-height: 126px; overflow: hidden; font-family: var(--font);
}
.card-body:not(.is-open)::after { content: ""; position: absolute; inset: auto 0 0 0; height: 46px; background: linear-gradient(to bottom, transparent, var(--surface-2)); }
.card-body.is-open { max-height: none; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11.5px; color: var(--text-dim); background: var(--surface-2); padding: 3px 9px; border-radius: 6px; }
.card-actions { display: flex; gap: 9px; margin-top: 4px; }
.btn-copy, .btn-ghost { padding: 10px 14px; border-radius: 11px; font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit; transition: .15s; border: 1px solid transparent; }
.btn-copy { flex: 1; background: var(--accent); color: #fff; }
.btn-copy:hover { background: var(--accent-ink); }
.btn-copy.is-copied { background: var(--accent-ink); }
.btn-ghost { flex: 0 0 auto; background: var(--surface); color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-mute); }

.empty { text-align: center; color: var(--text-dim); padding: 56px 0; }

/* ---------- 광고 ---------- */
.ad-slot { display: block; width: 100%; min-height: 0; margin: 0; overflow: hidden; }
.ad-incontent { margin: 30px 0; text-align: center; }
.ad-incontent ins { display: block; }

/* 사이드 광고: 아주 넓은 화면(1500px+)에서만 노출, 그 외엔 숨김 → 모바일/노트북 방해 0 */
.side-ad { display: none; }
@media (min-width: 1500px) {
  .side-ad {
    display: block; position: fixed; top: 96px; z-index: 40; width: 160px;
  }
  .side-ad-left { left: 24px; }
  .side-ad-right { right: 24px; }
}

/* ---------- 생성기 ---------- */
.gen-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.gen-controls, .gen-output { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.gen-output { position: sticky; top: 90px; }
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font-size: 14.5px; font-family: inherit;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 11px; outline: none; transition: .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-mute); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.field textarea { resize: vertical; min-height: 70px; }
.field select { cursor: pointer; }
.gen-output-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.gen-output-head > span { font-size: 13.5px; font-weight: 600; color: var(--text-dim); }
.gen-output-head .btn-copy { flex: 0 0 auto; padding: 8px 18px; }
.gen-result {
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 18px; font-size: 14px; line-height: 1.7; color: #3a3833; white-space: pre-wrap; word-break: break-word;
  min-height: 240px; font-family: var(--font); margin: 0;
}
.gen-tip { font-size: 12.5px; color: var(--text-mute); margin: 14px 0 0; }

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 48px; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; max-width: 460px; }
.footer-mark { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; }
.footer-brand b { font-size: 15px; }
.footer-brand .muted { margin: 4px 0 0; }
.footer-copy { margin: 0; align-self: flex-end; }
.muted { color: var(--text-mute); font-size: 13px; line-height: 1.55; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 13px 24px; border-radius: 999px;
  font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: .24s; z-index: 100; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 반응형 ---------- */
@media (max-width: 760px) {
  .gen-layout { grid-template-columns: 1fr; }
  .gen-output { position: static; }
  .steps { grid-template-columns: 1fr; }
  /* 헤더: 브랜드+언어는 1행, 탭은 2행 전체폭 → 언어 버튼 잘림 방지
     (탭이 있는 '앱 헤더'에만 적용 — SEO 페이지 헤더는 영향 없게 :has로 한정) */
  .header-inner { height: auto; padding: 12px 0; gap: 10px; }
  .header-inner:has(.tabs) .brand { order: 1; }
  .header-inner:has(.tabs) .lang-select { order: 2; margin-left: auto; }
  .header-inner:has(.tabs) .tabs { order: 3; flex-basis: 100%; margin-left: 0; }
  .tab { flex: 1; text-align: center; }
  .footer-inner { flex-direction: column; }
  .footer-copy { align-self: flex-start; }
}
/* 아주 좁은 화면: 검색 버튼은 아이콘만 */
@media (max-width: 480px) {
  #search-btn-label { display: none; }
  .search-btn { padding: 10px 12px; }
  #search { padding-right: 56px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ============================================================
   SEO 카테고리 페이지 (정적 생성)
   ============================================================ */
.seo-main { padding: 32px 0 64px; }
.seo-breadcrumb { font-size: 13px; color: var(--text-mute); margin: 4px 0 16px; }
.seo-breadcrumb a { color: var(--accent); text-decoration: none; }
.seo-breadcrumb a:hover { text-decoration: underline; }
.seo-breadcrumb span { margin: 0 4px; }
.seo-main h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 12px; }
.seo-intro { color: var(--text-dim); font-size: 16px; max-width: 680px; margin: 0 0 24px; line-height: 1.7; }
.seo-main .grid { margin-top: 8px; }
.seo-prompt {
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 14px; font-size: 13px; line-height: 1.65; color: #43403a;
  white-space: pre-wrap; word-break: break-word; font-family: var(--font); margin: 0;
}
.seo-main .card .btn-copy { margin-top: 2px; }
.cat-nav-wrap { margin: 44px 0 8px; }
.cat-nav-wrap h2 { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 9px; }
.cat-link {
  display: inline-block; border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; transition: .15s;
}
.cat-link:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.seo-cta { text-align: center; margin: 36px 0; }

/* 메인 앱 푸터의 카테고리 링크 */
.footer-cats { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 18px 0 0; }
.footer-cats a { color: var(--text-dim); text-decoration: none; font-size: 13.5px; }
.footer-cats a:hover { color: var(--accent); text-decoration: underline; }
