/* hook-tools.2ndlifeclass.com 디자인 값 이식 — 출처: src/styles/globals.css · tools-shared.css · vrew.css */
:root {
  --bg: #eef0f6;        /* 배경 */
  --card: #ffffff;      /* 카드 */
  --ink: #1a1f2e;       /* 글자 */
  --sub: #5a6072;       /* 보조 글자 */
  --mut: #9498a8;       /* 흐린 글자 */
  --v1: #4f46b8;        /* 브랜드 */
  --v2: #5b52c9;        /* 브랜드 밝게 */
  --v3: #3f3a9e;        /* 브랜드 진하게 */
  --hero1: #2b2e5c; --hero2: #3b357e; --hero3: #514a9c; /* 히어로 그라데이션 */
  --accent: #0f9d76;    /* 완료 강조 */
  --line: #e6e8f0;      /* 테두리 */
  --shadow: 0 6px 20px rgba(26, 31, 46, 0.06);
  --shadow-lg: 0 22px 50px rgba(43, 46, 92, 0.3);
  --r: 24px; --r-sm: 16px; --r-xs: 12px;
  --font: "맑은 고딕", "Malgun Gothic", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 48px; }

/* 머리말 */
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo {
  width: 54px; height: 54px; border-radius: 18px; flex: none;
  background: linear-gradient(150deg, var(--v1), var(--v2));
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  box-shadow: 0 10px 22px rgba(139, 109, 240, 0.4);
}
.top h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -0.4px; }
.top p { margin: 3px 0 0; color: var(--sub); font-size: 13.5px; }
.pill {
  margin-left: auto; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700; background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; color: var(--sub); white-space: nowrap;
}
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #f0a020; }

/* 히어로 패널 */
.hero {
  border-radius: var(--r); padding: 18px 24px; color: #fff;
  background: linear-gradient(145deg, var(--hero1) 0%, var(--hero2) 55%, var(--hero3) 100%);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; right: -40px; bottom: -70px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.1);
}
.hero .head { display: flex; align-items: center; gap: 20px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .eyebrow { font-size: 11px; letter-spacing: 3px; font-weight: 700; color: rgba(255, 255, 255, 0.55); }
.hero h2 { margin: 5px 0 0; font-size: 21px; font-weight: 800; color: #fff; letter-spacing: -0.4px; }
.stats {
  display: flex; flex: 1; position: relative; z-index: 1; min-width: 280px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-sm); padding: 4px;
}
.stat { flex: 1; padding: 10px 16px; position: relative; }
.stat + .stat::before {
  content: ""; position: absolute; left: 0; top: 22%; height: 56%; width: 1px; background: rgba(255, 255, 255, 0.14);
}
.stat .num { font-size: 26px; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stat .lab { font-size: 11.5px; color: rgba(255, 255, 255, 0.62); margin-top: 6px; font-weight: 600; }
.tag {
  flex: none; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.85);
}

/* 단계 패널(카드) */
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow); padding: 16px; margin: 0;
}
.step h2 { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 800; margin: 0 0 12px; border: 0; padding: 0; }
.no {
  width: 34px; height: 34px; border-radius: 10px; flex: none; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; background: #eceaf7; color: var(--v3);
}
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.muted { color: var(--mut); font-size: 13px; }

/* 입력칸 */
label { font-size: 13px; color: var(--sub); font-weight: 700; }
input, select, textarea {
  font-family: var(--font); font-size: 13px; color: var(--ink);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none;
}
textarea { width: 100%; font-size: 13.5px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--v2); }
.file-label {
  border: 2px dashed #cfd3e4; border-radius: var(--r-xs); padding: 8px 14px; cursor: pointer;
  color: var(--v3); font-weight: 800; background: #f0f1f7; transition: 0.15s;
}
.file-label:hover { border-color: var(--v2); background: #e9e7f8; }
.file-label input { display: none; }

/* 버튼 */
button {
  border: 0; border-radius: 14px; font-family: var(--font); font-weight: 800; cursor: pointer;
  padding: 13px 20px; font-size: 14px; transition: 0.15s; color: #fff;
  background: linear-gradient(145deg, var(--v1), var(--v3));
  box-shadow: 0 8px 18px rgba(79, 70, 184, 0.28);
}
button:hover { transform: translateY(-1px); filter: brightness(1.05); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
button.primary { background: linear-gradient(145deg, #12a077, #0b7d5c); box-shadow: 0 8px 18px rgba(15, 157, 118, 0.28); }
button.big { font-size: 16px; padding: 16px 26px; }
#btn-back-s2 {
  background: #eceaf7; color: var(--v3); box-shadow: none; padding: 11px 18px;
}

/* 표 */
#speaker-table, #casting-table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { color: var(--mut); font-size: 12px; letter-spacing: 0.5px; font-weight: 700; }
td.ex, td.num { font-size: 12.5px; color: var(--sub); }

/* 화자 탭(알약) */
#spk-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
#spk-tabs button {
  border-radius: 999px; padding: 9px 16px; font-size: 13px;
  background: #fff; color: var(--sub); border: 1px solid var(--line); box-shadow: var(--shadow);
}
#spk-tabs button.active { background: linear-gradient(145deg, var(--v1), var(--v3)); color: #fff; border-color: transparent; }
#spk-tabs button.done::after { content: " ✓"; color: var(--accent); }
#spk-tabs button.active.done::after { color: #fff; }

/* 성우 목록 */
.filters select, .filters input { font-size: 13px; padding: 9px 10px; }
.voice-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-xs); background: #fff; }
.voice-item { display: flex; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.voice-item:last-child { border-bottom: 0; }
.voice-item.playing { background: #e9e7f8; }
.voice-item .vname { min-width: 130px; font-weight: 800; }
.voice-item .vmeta { color: var(--sub); font-size: 12.5px; flex: 1; }
.voice-item .vtags { color: var(--mut); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-item .play, .voice-item .pick {
  padding: 8px 13px; font-size: 12.5px; border-radius: 10px; box-shadow: none; background: #eceaf7; color: var(--v3);
}
.voice-item .pick { background: linear-gradient(145deg, var(--v1), var(--v3)); color: #fff; }
.voice-item .pick:disabled { background: #eceaf7; color: var(--v3); }
audio { width: 100%; margin-top: 8px; }

/* 결과·알림 */
#result .ok { background: #e9f6ef; border: 1px solid #a8d8b9; border-radius: var(--r-sm); padding: 18px; margin-top: 10px; font-size: 13.5px; color: #0b7d5c; font-weight: 700; line-height: 1.8; }
#result .ok code, #result .err code { background: #f2f3f8; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
#result .err { background: #fdeceb; border: 1px solid #f0b3ae; border-radius: var(--r-sm); padding: 18px; margin-top: 10px; font-size: 13.5px; color: #b3261e; font-weight: 700; }
.warn { color: #a9762a; font-size: 13px; background: #fffaf0; border: 1px solid #f2d49a; border-radius: var(--r-xs); padding: 10px 14px; }

/* 모바일 */
@media (max-width: 640px) {
  .wrap { padding: 14px 14px 36px; gap: 12px; }
  .hero { padding: 16px; }
  .stats { min-width: 100%; }
  .pill { margin-left: 0; }
  .voice-item .vtags { display: none; }
  .step { padding: 14px; }
}

/* ===== 사용 설명서(guide.html) 추가분 — 기존 스타일 재사용, 여기서부터는 guide 전용 ===== */
.nav-link {
  margin-left: auto; padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 800;
  text-decoration: none; color: var(--v3); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  white-space: nowrap;
}
.nav-link:hover { border-color: var(--v2); background: #e9e7f8; }
.guide-intro p { margin: 4px 0; font-size: 13.5px; color: var(--sub); line-height: 1.8; }
.cap {
  display: block; width: 100%; border: 1px solid var(--line); border-radius: var(--r-xs);
  box-shadow: var(--shadow); margin: 6px 0 10px; background: #fff;
}
.todo { margin: 6px 0 8px; padding-left: 20px; font-size: 13.5px; line-height: 1.8; color: var(--ink); }
.todo li + li { margin-top: 6px; }
.todo code { background: #f2f3f8; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.mistake {
  font-size: 13px; color: #a9762a; background: #fffaf0; border: 1px solid #f2d49a;
  border-radius: var(--r-xs); padding: 9px 14px; margin: 8px 0 0;
}
.script-ex pre {
  margin: 8px 0 0; padding: 12px 14px; background: #f8f9fc; border: 1px solid var(--line);
  border-radius: var(--r-xs); font-size: 12px; line-height: 1.9; color: var(--sub); overflow-x: auto; white-space: pre;
}
.phrase { border: 1px solid var(--line); border-radius: var(--r-xs); padding: 12px 14px; margin: 10px 0; background: #fafbff; }
.phrase-head { font-size: 12px; font-weight: 800; color: var(--v3); margin-bottom: 6px; }
.phrase blockquote { margin: 0 0 8px; font-size: 13.5px; line-height: 1.8; color: var(--ink); }
.phrase .copy { padding: 9px 16px; font-size: 12.5px; border-radius: 10px; background: #eceaf7; color: var(--v3); box-shadow: none; }
#prompt-box summary { cursor: pointer; font-size: 12px; font-weight: 800; color: var(--v3); margin: 4px 0 2px; user-select: none; }
#prompt-box details[open] summary { margin-bottom: 6px; }
#prompt-text { white-space: pre-line; }
.cost { background: #e9e7f8; border: 1px solid #cfcbee; border-radius: var(--r-xs); padding: 12px 14px; margin: 10px 0; font-size: 13px; line-height: 1.9; color: var(--ink); }
.g5 .warn, .step .warn { margin: 10px 0 0; line-height: 1.8; }
.faq h3 { font-size: 13.5px; font-weight: 800; margin: 14px 0 4px; }
.faq p { margin: 0; font-size: 13.5px; line-height: 1.8; color: var(--sub); }
.guide-foot { text-align: center; padding: 8px 0; }
/* 2차 — 5단계 세분화 + 예시 상자 정렬 */
.sub { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 800; margin: 18px 0 8px; color: var(--ink); }
.sub:first-of-type { margin-top: 10px; }
.no-sm {
  flex: none; min-width: 40px; text-align: center; padding: 4px 8px; border-radius: 8px;
  font-size: 12px; font-weight: 800; background: #eceaf7; color: var(--v3);
}
.cap.narrow { width: 100%; max-width: 720px; }
/* 페이지 세로 길이 줄이기 — guide.html 에서만 이미지 표시 폭 제한 */
body.guide-page .cap { max-width: 880px; }
body.guide-page .cap.wide { max-width: 100%; }
body.guide-page .cap.narrow { max-width: 560px; }
.gen-note {
  background: #f8f9fc; border: 1px dashed #cfd3e4; border-radius: var(--r-xs);
  padding: 12px 14px; margin: 6px 0 10px; font-size: 13px; line-height: 1.9; color: var(--sub);
}
.ex-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ex-row:last-child { border-bottom: 0; }
.ex-row .ex-line { flex: 1; font-size: 12.5px; line-height: 1.8; color: var(--ink); }
.ex-row .ex-tag {
  flex: none; font-size: 11px; font-weight: 800; color: var(--sub);
  background: #eceaf7; border-radius: 8px; padding: 4px 9px; white-space: nowrap;
}
