/* =========================================================
   PDF 편집기 - 시안 B (작업공간 사이드바형)
   색상은 모두 아래 토큰으로 관리해요. 다크 모드는 토큰만 바꿔요.
   ========================================================= */

:root {
  --bg: #f6f6f4;            /* 페이지 바탕 */
  --surface: #ffffff;       /* 카드, 패널 */
  --surface-2: #f1f1ee;     /* 살짝 들어간 면 */
  --text: #1f1f1d;
  --text-2: #5f5e5a;        /* 보조 글씨 */
  --text-3: #8b8a85;        /* 힌트 */
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.18);
  --accent: #2463d6;
  --accent-hover: #1d52b5;
  --accent-bg: #e8f0fd;
  --accent-text: #1a4fae;
  --on-accent: #ffffff;
  --danger: #c43c3c;
  --danger-bg: #fdecec;
  --success: #2f7d32;
  --success-bg: #e8f4e8;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-w: 232px;
  color-scheme: light;
}

/* 다크 모드 토큰: 시스템 설정을 따르고, 버튼으로 직접 바꿀 수도 있어요 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161615;
    --surface: #222220;
    --surface-2: #2b2b29;
    --text: #ecebe7;
    --text-2: #b0afa9;
    --text-3: #85847e;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.2);
    --accent: #5b8ff0;
    --accent-hover: #7aa5f4;
    --accent-bg: #1d2c47;
    --accent-text: #a9c4f7;
    --on-accent: #0d1626;
    --danger: #ef7b7b;
    --danger-bg: #3d1f1f;
    --success: #7cc97f;
    --success-bg: #1f3320;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161615;
  --surface: #222220;
  --surface-2: #2b2b29;
  --text: #ecebe7;
  --text-2: #b0afa9;
  --text-3: #85847e;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.2);
  --accent: #5b8ff0;
  --accent-hover: #7aa5f4;
  --accent-bg: #1d2c47;
  --accent-text: #a9c4f7;
  --on-accent: #0d1626;
  --danger: #ef7b7b;
  --danger-bg: #3d1f1f;
  --success: #7cc97f;
  --success-bg: #1f3320;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- 기본 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
.sub { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- 전체 레이아웃 ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- 사이드바 ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 16px;
  padding: 0 8px;
}
.brand .ti { font-size: 22px; color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0; border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item .ti { font-size: 18px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent-text); font-weight: 600; }

.side-stats {
  margin: 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  white-space: pre-line;
  word-break: break-all;
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.privacy {
  display: flex; gap: 8px; margin: 0; padding: 10px;
  font-size: 12px; color: var(--text-2);
  background: var(--surface-2); border-radius: var(--radius);
}
.privacy .ti { font-size: 16px; color: var(--success); flex-shrink: 0; margin-top: 1px; }
.ghost-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text-2);
  cursor: pointer; font-size: 13px;
}
.ghost-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- 작업 영역 ---------- */
.main { padding: 28px 36px 60px; min-width: 0; }
.view { display: none; max-width: 1180px; margin: 0 auto; }
.view.active { display: block; }
.view-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.lib-error {
  margin-bottom: 16px; padding: 12px 14px;
  background: var(--danger-bg); color: var(--danger);
  border-radius: var(--radius);
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn .ti { font-size: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn .ti { font-size: 17px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 입력 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.field.grow { flex: 1; min-width: 220px; }
.field input, .input-wrap {
  height: 38px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
.field > input { padding: 0 12px; font-size: 15px; }
.field input:focus, .input-wrap:focus-within { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.input-wrap { display: flex; align-items: center; padding-right: 12px; }
.input-wrap input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0 0 0 12px; background: transparent; font-size: 15px; outline: none; box-shadow: none !important; }
.input-wrap em { font-style: normal; color: var(--text-3); margin-left: 4px; white-space: nowrap; }
.input-wrap.narrow { width: 170px; }
.hint { font-style: normal; color: var(--text-3); margin-left: 6px; }
.field-error { margin: 0; min-height: 0; color: var(--danger); font-size: 13px; }
.field-error:empty { display: none; }
.field.invalid input { border-color: var(--danger); }

/* ---------- 드롭존 ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 40px 20px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-2); text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone .ti { font-size: 32px; color: var(--accent); margin-bottom: 4px; }
.dropzone strong { color: var(--text); font-weight: 600; }
.dropzone span { font-size: 13px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-bg); }
/* 파일이 있으면 작게 */
.dropzone.compact { flex-direction: row; gap: 10px; padding: 14px 20px; }
.dropzone.compact .ti { font-size: 20px; margin: 0; }
.dropzone.compact span { display: none; }

/* ---------- 결합: 파일 카드 목록 ---------- */
.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  cursor: grab;
}
.file-card:active { cursor: grabbing; }
.file-card .grip { color: var(--text-3); font-size: 18px; }
.file-card .order {
  width: 24px; height: 24px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-bg); color: var(--accent-text);
  font-size: 12px; font-weight: 600;
}
.file-card .mini-thumb {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-radius: 6px; overflow: hidden;
}
.file-card .mini-thumb canvas { display: block; box-shadow: 0 0 0 1px var(--border); background: #fff; }
.file-card .meta { flex: 1; min-width: 0; }
.file-card .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .info { font-size: 13px; color: var(--text-3); }
.file-card .move { display: flex; gap: 2px; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow); }

/* ---------- 하단 액션 바 ---------- */
.action-bar {
  position: sticky; bottom: 16px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.name-field { flex: 1; min-width: 200px; max-width: 360px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 분리: 상단 도구 막대 ---------- */
.file-chip {
  display: flex; align-items: center; gap: 8px;
  max-width: 100%;
  padding: 6px 6px 6px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  font-size: 14px;
}
.file-chip #splitFileName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.file-chip .btn.small { border-radius: 999px; }

.toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px; margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}
.segmented {
  display: inline-flex; align-self: flex-start;
  padding: 3px; gap: 2px;
  background: var(--surface-2); border-radius: 10px;
  max-width: 100%; overflow-x: auto;
}
.seg {
  padding: 6px 14px; border: 0; border-radius: 7px;
  background: transparent; color: var(--text-2);
  cursor: pointer; font-size: 14px; white-space: nowrap;
}
.seg:hover { color: var(--text); }
.seg.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.mode-opt { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.mini-actions { display: flex; gap: 6px; }
.mode-desc { margin: 0; color: var(--text-2); font-size: 14px; }
.toolbar-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.summary { font-size: 14px; color: var(--text-2); }
.summary b { color: var(--text); }

/* ---------- 분리: 페이지 썸네일 격자 ---------- */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.page-card {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, opacity .12s;
}
.page-card:hover { border-color: var(--border-strong); }
.page-card .thumb {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-radius: 6px;
  overflow: hidden;
}
.page-card .thumb canvas {
  display: block; background: #fff;
  box-shadow: 0 0 0 1px var(--border);
  transition: transform .2s;
}
.page-card .thumb .ph { width: 60%; aspect-ratio: 3 / 4; background: var(--surface); border-radius: 3px; }
.page-card .label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 0 2px; }
.page-card .tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); }
.page-card .tools {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity .12s;
}
.page-card:hover .tools, .page-card:focus-within .tools { opacity: 1; }
.page-card .tools .icon-btn { background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,0.18); }
.page-card .check {
  position: absolute; top: 12px; left: 12px;
  width: 24px; height: 24px; border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-size: 15px;
}

/* 선택됨 (선택 추출 모드에서만 표시) */
.page-grid.selecting .page-card.selected { border-color: var(--accent); background: var(--accent-bg); }
.page-grid.selecting .page-card.selected .check { display: inline-flex; }
.page-grid:not(.selecting) .page-card { cursor: default; }
/* 삭제됨 */
.page-card.deleted .thumb { opacity: .3; }
.page-card.deleted .label { text-decoration: line-through; }
.page-card.deleted .tag.del { background: var(--danger-bg); color: var(--danger); text-decoration: none; }
/* N페이지씩 모드: 묶음 경계 표시 */
.page-card .group { font-size: 11px; color: var(--accent-text); }

/* 터치 기기에서는 도구 버튼 항상 표시 */
@media (hover: none) {
  .page-card .tools { opacity: 1; }
}

/* ---------- 처리 중 ---------- */
.busy {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.35);
}
.busy-box {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; max-width: calc(100vw - 32px);
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.busy-box p { margin: 0; word-break: break-all; }
.spinner {
  width: 24px; height: 24px; flex-shrink: 0;
  border: 3px solid var(--accent-bg); border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 알림 ---------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: toast-in .2s ease-out;
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast .ti { font-size: 18px; margin-top: 1px; }
.toast.error .ti { color: var(--danger); }
.toast.success .ti { color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 모바일 ---------- */
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; z-index: 20;
    height: auto;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .sidebar .brand > span:last-child { display: none; }
  .brand { padding: 0; }
  .nav { flex-direction: row; flex: 1; }
  .nav-item { width: auto; padding: 8px 12px; }
  .side-stats, .privacy { display: none; }
  .side-foot { margin: 0; }
  .ghost-btn span { display: none; }
  .main { padding: 18px 16px 40px; }
  .toolbar { top: 59px; }
  .page-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .dropzone { padding: 28px 16px; }
  .file-card .grip { display: none; }
  .file-chip #splitFileName { max-width: 150px; }
  .action-bar { bottom: 10px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .hint { display: block; margin: 2px 0 0; }
}

/* =========================================================
   업그레이드: 홈, 가이드, 사이트맵, 개인정보처리방침, 애니메이션
   ========================================================= */
:root {
  --violet: #7c4ddb;
  --violet-bg: #f0eafd;
  --teal: #0f8a72;
  --teal-bg: #e2f5ef;
  --amber: #b86e09;
  --amber-bg: #fcf0dc;
  --pink: #c23d73;
  --pink-bg: #fce8f0;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --violet: #b49af2; --violet-bg: #2c2245;
    --teal: #6fd3bb; --teal-bg: #173a32;
    --amber: #f0b45e; --amber-bg: #3d2c12;
    --pink: #f093b9; --pink-bg: #43202f;
  }
}
:root[data-theme="dark"] {
  --violet: #b49af2; --violet-bg: #2c2245;
  --teal: #6fd3bb; --teal-bg: #173a32;
  --amber: #f0b45e; --amber-bg: #3d2c12;
  --pink: #f093b9; --pink-bg: #43202f;
}

a { color: var(--accent); }
a.btn, a.nav-item, a.brand { text-decoration: none; }
a.brand { color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
}
.brand .brand-mark .ti { font-size: 18px; color: inherit; }
.brand:hover .brand-mark { animation: wiggle .5s var(--ease); }
@keyframes wiggle { 30% { transform: rotate(-10deg) scale(1.08); } 60% { transform: rotate(6deg); } }

/* 화면 전환 애니메이션 */
.view.active { animation: view-in .4s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }

/* 스크롤하면 나타나는 요소 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

.help-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 14px; color: var(--text-2); text-decoration: none;
  padding: 6px 10px; border-radius: 999px;
}
.help-link:hover { background: var(--surface); color: var(--accent); }
.head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent-text);
  font-size: 13px; font-weight: 600;
}

/* ---------- 홈: 첫 화면 ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 24px;
  padding: 52px 48px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 24px;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.blob.b1 { width: 320px; height: 320px; background: var(--accent-bg); top: -120px; right: 10%; animation: float 12s ease-in-out infinite; }
.blob.b2 { width: 260px; height: 260px; background: var(--violet-bg); bottom: -120px; left: -60px; animation: float 14s ease-in-out infinite reverse; }
.blob.b3 { width: 200px; height: 200px; background: var(--teal-bg); top: 30%; right: -60px; animation: float 10s ease-in-out infinite 2s; }
@keyframes float { 50% { transform: translate(30px, 24px) scale(1.1); } }
.hero-text, .hero-art { position: relative; }
.hero-title { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.2; letter-spacing: -0.03em; margin: 16px 0 14px; font-weight: 800; }
.grad-text {
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--accent));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.hero-sub { font-size: 17px; color: var(--text-2); margin: 0 0 26px; max-width: 520px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.lg { height: 50px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn.primary.lg { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.lg:hover { transform: translateY(-2px); }
.hero-badges { list-style: none; display: flex; gap: 16px; flex-wrap: wrap; padding: 0; margin: 22px 0 0; font-size: 14px; color: var(--text-2); }
.hero-badges .ti { color: var(--success); margin-right: 4px; }

/* 종이 애니메이션: 흩어진 세 장이 하나로 합쳐졌다가 다시 나뉘어요 */
.hero-art { height: 300px; }
.sheet {
  position: absolute; left: 50%; top: 50%;
  width: 120px; height: 156px; margin: -78px 0 0 -60px;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow);
  animation: 4.8s var(--ease) infinite;
}
.sheet b { height: 10px; width: 60%; border-radius: 3px; margin-bottom: 6px; }
.sheet i { height: 6px; border-radius: 3px; background: var(--surface-2); }
.sheet i:nth-child(3) { width: 85%; } .sheet i:nth-child(5) { width: 60%; }
.sh1 b { background: var(--accent); } .sh2 b { background: var(--violet); } .sh3 b { background: var(--teal); }
.sh1 { animation-name: sheet1; } .sh2 { animation-name: sheet2; } .sh3 { animation-name: sheet3; }
@keyframes sheet1 { 0%, 12% { transform: translate(-110px, -20px) rotate(-14deg); } 42%, 68% { transform: translate(-6px, -6px) rotate(-3deg); } 100% { transform: translate(-110px, -20px) rotate(-14deg); } }
@keyframes sheet2 { 0%, 12% { transform: translate(0, 34px) rotate(3deg); } 42%, 68% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(0, 34px) rotate(3deg); } }
@keyframes sheet3 { 0%, 12% { transform: translate(110px, -20px) rotate(14deg); } 42%, 68% { transform: translate(6px, 6px) rotate(3deg); } 100% { transform: translate(110px, -20px) rotate(14deg); } }
.art-badge {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--success-bg); color: var(--success); font-weight: 600; font-size: 14px;
  animation: badge 4.8s var(--ease) infinite;
}
@keyframes badge { 0%, 40% { opacity: 0; transform: translate(-50%, 10px) scale(.9); } 48%, 66% { opacity: 1; transform: translate(-50%, 0) scale(1); } 76%, 100% { opacity: 0; transform: translate(-50%, 10px) scale(.9); } }
.art-cursor { position: absolute; left: 50%; top: 50%; font-size: 30px; color: var(--text); animation: cursor 4.8s var(--ease) infinite; }
@keyframes cursor { 0% { transform: translate(120px, 80px); opacity: 0; } 15% { opacity: 1; } 34% { transform: translate(30px, 30px) scale(1); } 38% { transform: translate(30px, 30px) scale(.85); } 42%, 60% { transform: translate(30px, 30px) scale(1); opacity: 1; } 75%, 100% { transform: translate(120px, 80px); opacity: 0; } }

/* ---------- 홈: 도구 카드 ---------- */
.tool-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.tool-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s, opacity .6s var(--ease);
}
.tool-card:hover, .tool-card.over { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.tool-card.split:hover, .tool-card.split.over { border-color: var(--violet); }
.tool-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 26px;
  background: var(--accent-bg); color: var(--accent);
  transition: transform .3s var(--ease);
}
.tool-card.split .tool-icon { background: var(--violet-bg); color: var(--violet); }
.tool-card:hover .tool-icon { transform: scale(1.1) rotate(-6deg); }
.tool-body { display: flex; flex-direction: column; gap: 2px; }
.tool-body strong { font-size: 19px; }
.tool-body span { color: var(--text-2); font-size: 14px; }
.tool-drop {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; border: 1.5px dashed var(--border-strong); border-radius: 12px;
  color: var(--text-3); font-size: 13px;
  transition: background .2s, color .2s, border-color .2s;
}
.tool-card:hover .tool-drop, .tool-card.over .tool-drop { background: var(--accent-bg); color: var(--accent-text); border-color: var(--accent); }
.tool-card.split:hover .tool-drop, .tool-card.split.over .tool-drop { background: var(--violet-bg); color: var(--violet); border-color: var(--violet); }

/* ---------- 홈: 특징, 단계 ---------- */
.section { margin-top: 64px; }
.section-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; text-align: center; margin: 0 0 24px; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.feature {
  padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .6s var(--ease);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature h3 { font-size: 16px; margin: 14px 0 6px; }
.feature p { margin: 0; font-size: 14px; color: var(--text-2); }
.f-icon, .h-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 22px;
}
.c1 { background: var(--accent-bg); color: var(--accent); }
.c2 { background: var(--violet-bg); color: var(--violet); }
.c3 { background: var(--teal-bg); color: var(--teal); }
.c4 { background: var(--amber-bg); color: var(--amber); }
.c5 { background: var(--pink-bg); color: var(--pink); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.step {
  position: relative; text-align: center;
  padding: 28px 20px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
}
.step-num {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px;
}
.step-icon { font-size: 34px; color: var(--accent); display: inline-block; }
.step.in .step-icon { animation: pop .6s var(--ease) both; animation-delay: calc(var(--d, 0ms) + 300ms); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.step h3 { margin: 10px 0 4px; font-size: 16px; }
.step p { margin: 0; color: var(--text-2); font-size: 14px; }
.section-more { text-align: center; margin: 22px 0 0; }
.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.link-arrow .ti { transition: transform .2s var(--ease); }
.link-arrow:hover .ti { transform: translateX(4px); }

/* ---------- 문서형 화면 (가이드, 사이트맵, 개인정보) ---------- */
.view.doc { max-width: 860px; }
.doc-head { margin-bottom: 24px; }
.doc-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 14px 0 6px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.toc a {
  padding: 7px 14px; border-radius: 999px; font-size: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: border-color .2s, color .2s, transform .2s var(--ease);
}
.toc a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.doc-card {
  padding: 28px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  scroll-margin-top: 80px;
}
.doc-card h2 { display: flex; align-items: center; gap: 12px; font-size: 21px; margin: 0 0 18px; letter-spacing: -0.01em; }
.doc-card.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 transparent; } 25% { box-shadow: 0 0 0 4px var(--accent-bg), 0 0 0 5px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.doc-card p { color: var(--text-2); }
.timeline { list-style: none; counter-reset: st; padding: 0; margin: 0 0 22px; }
.timeline li { position: relative; padding: 0 0 20px 46px; counter-increment: st; }
.timeline li::before {
  content: counter(st); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-bg); color: var(--accent-text); font-weight: 700; font-size: 14px;
}
.timeline li::after { content: ""; position: absolute; left: 14.5px; top: 34px; bottom: 4px; width: 1px; background: var(--border-strong); }
.timeline li:last-child::after { display: none; }
.timeline strong { display: block; font-size: 16px; padding-top: 3px; }
.timeline p { margin: 4px 0 0; }
.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.mode-cards div { padding: 12px 14px; background: var(--surface-2); border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.mode-cards span { font-size: 13px; color: var(--text-2); }
.table-wrap { overflow-x: auto; margin: 12px 0; }
.ex-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ex-table th, .ex-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.ex-table th { color: var(--text-2); font-weight: 600; background: var(--surface-2); }
.ex-table th:first-child { border-radius: 8px 0 0 8px; }
.ex-table th:last-child { border-radius: 0 8px 8px 0; }
code, kbd { font-family: ui-monospace, Consolas, monospace; font-size: 13px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text); }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; }
.doc-card .note { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-bg); color: var(--accent-text); margin: 0; font-size: 14px; }
.note .ti { font-size: 18px; margin-top: 1px; }
.tips { margin: 0; padding-left: 20px; color: var(--text-2); }
.tips li { margin-bottom: 10px; }
.tips li::marker { color: var(--amber); }

/* 자주 묻는 질문 (열고 닫기) */
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 2px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2); font-size: 18px; font-weight: 400;
  transition: transform .3s var(--ease), background .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--accent-bg); color: var(--accent); }
.faq summary:hover { color: var(--accent); }
.faq details p { margin: 0 0 16px; padding-right: 36px; animation: faq-in .35s var(--ease); }
@keyframes faq-in { from { opacity: 0; transform: translateY(-6px); } }

/* 사이트맵 */
.sitemap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sm-group { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; }
.sm-group h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0 0 12px; }
.sm-group h2 .ti { color: var(--accent); font-size: 20px; }
.sm-group ul { list-style: none; margin: 0; padding: 0; }
.sm-group li { padding: 9px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.sm-group li a { font-weight: 600; text-decoration: none; }
.sm-group li a:hover { text-decoration: underline; }
.sm-group li span { font-size: 13px; color: var(--text-3); }

/* 개인정보처리방침 */
.summary-box {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px 22px; margin-bottom: 18px;
  background: var(--success-bg); border-radius: 18px;
}
.summary-box > .ti { font-size: 28px; color: var(--success); }
.summary-box strong { color: var(--success); }
.summary-box p { margin: 4px 0 0; color: var(--text); }
.policy h3 { font-size: 16px; margin: 26px 0 8px; }
.policy h3:first-of-type { margin-top: 10px; }
.policy ul { color: var(--text-2); padding-left: 20px; }
.policy li { margin-bottom: 4px; }
.policy .contact { list-style: none; padding: 0; }
.policy .contact li { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.policy .contact span { width: 60px; color: var(--text-3); }

/* ---------- 바닥글 ---------- */
.site-footer {
  max-width: 1180px; margin: 80px auto 0; padding: 32px 0 0;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px;
}
.foot-brand p { margin: 10px 0 0; color: var(--text-2); font-size: 14px; }
.foot-brand .brand { padding: 0; }
.foot-cols { display: flex; gap: 48px; }
.foot-cols h4 { margin: 0 0 10px; font-size: 13px; color: var(--text-3); font-weight: 600; }
.foot-cols a { display: block; font-size: 14px; color: var(--text-2); text-decoration: none; padding: 3px 0; }
.foot-cols a:hover { color: var(--accent); }
.foot-cols a b { color: var(--text); }
.copyright { grid-column: 1 / -1; margin: 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }

/* ---------- 맨 위로 버튼 ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow); cursor: pointer; font-size: 20px;
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--accent); }
.toasts { bottom: 76px; }

/* ---------- 목록·썸네일 등장 애니메이션 ---------- */
.file-card { animation: card-in .35s var(--ease) both; }
.page-card { animation: card-in .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.page-card .thumb canvas { animation: fade-in .3s ease-out; }
@keyframes fade-in { from { opacity: 0; } }
.page-grid.selecting .page-card.selected .check { animation: pop .3s var(--ease); }
.toast { transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateX(16px); }
.dropzone.over .ti { animation: bounce .8s var(--ease) infinite; }
@keyframes bounce { 50% { transform: translateY(-6px); } }

/* ---------- 반응형 ---------- */
@media (max-width: 1100px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 36px 28px; }
  .hero-art { height: 240px; }
}
@media (max-width: 760px) {
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex-shrink: 0; padding: 8px 10px; gap: 6px; }
  .hero { padding: 28px 20px; border-radius: 20px; }
  .hero-sub { font-size: 15px; }
  .hero-cta .btn { flex: 1; }
  .hero-art { height: 210px; transform: scale(.85); }
  .tool-cards, .steps, .sitemap, .mode-cards, .features { grid-template-columns: minmax(0, 1fr); }
  .steps { gap: 24px; }
  .section { margin-top: 48px; }
  .doc-card { padding: 20px; }
  .doc-head h1 { font-size: 24px; }
  .site-footer { grid-template-columns: minmax(0, 1fr); margin-top: 56px; }
  .foot-cols { gap: 28px; flex-wrap: wrap; }
  .to-top { right: 16px; bottom: 16px; }
}

/* 움직임 줄이기 설정을 켠 사용자에게는 애니메이션을 끄기 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .sh1 { transform: translate(-80px, -10px) rotate(-10deg); }
  .sh3 { transform: translate(80px, -10px) rotate(10deg); }
  .art-badge, .art-cursor { display: none; }
}
