/* 텍스트 카운터 & 분석기 */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --violet: #7c3aed;
  --violet2: #6d28d9;
  --violet-light: rgba(124,58,237,.08);
  --radius: 14px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif; font-size: 14px; }

.wrap { max-width: 100%; padding: 10px 0 60px; }

/* ── 상단 헤더 ── */
.top { margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
h1 { font-size: 22px; font-weight: 700; }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── 카드 ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }

/* ── 입력 영역 ── */
.input-bar { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.btn-clear {
  padding: 7px 14px; border-radius: 8px; border: 1.5px solid var(--border);
  background: #fff; cursor: pointer; font-size: 13px; color: var(--muted); transition: all .15s;
}
.btn-clear:hover { border-color: #ef4444; color: #ef4444; }
.btn-paste {
  padding: 7px 14px; border-radius: 8px; border: 1.5px solid var(--border);
  background: #fff; cursor: pointer; font-size: 13px; color: var(--text); transition: all .15s;
}
.btn-paste:hover { border-color: var(--violet); color: var(--violet); }
.live-hint { font-size: 12px; color: var(--muted); margin-left: auto; }

textarea.main-input {
  width: 100%; min-height: 200px; padding: 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; line-height: 1.7;
  resize: vertical; outline: none; transition: border-color .15s;
}
textarea.main-input:focus { border-color: var(--violet); }

/* ── 통계 그리드 ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.stat-box {
  padding: 14px 10px; background: #f8fafc; border: 1px solid var(--border);
  border-radius: 10px; text-align: center;
}
.stat-num { font-size: 24px; font-weight: 700; color: var(--violet); line-height: 1.2; }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── 세부 통계 ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f8fafc; border-radius: 8px; font-size: 13px; }
.detail-row strong { font-weight: 700; color: var(--text); }
.detail-row span { color: var(--muted); }

/* ── 독서 시간 ── */
.read-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.read-box { flex: 1; min-width: 120px; padding: 12px; background: var(--violet-light); border-radius: 10px; text-align: center; }
.read-box .r-val { font-size: 18px; font-weight: 700; color: var(--violet); }
.read-box .r-label { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── 중복 단어 ── */
.word-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.word-tag {
  padding: 4px 10px; border-radius: 16px; font-size: 13px;
  background: var(--violet-light); color: var(--violet); font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.word-tag .cnt { font-size: 11px; font-weight: 400; color: var(--muted); }
.no-word { color: var(--muted); font-size: 13px; padding: 8px; }

/* ── 안내 섹션 ── */
.guide-section { margin-top: 24px; padding: 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.guide-section h2 { font-size: 15px; font-weight: 700; margin: 18px 0 8px; }
.guide-section h2:first-child { margin-top: 0; }
.guide-steps { padding-left: 18px; }
.guide-steps li { margin-bottom: 6px; line-height: 1.6; color: var(--muted); }
.guide-features, .guide-usecase { list-style: none; padding: 0; }
.guide-features li, .guide-usecase li { padding: 4px 0 4px 16px; position: relative; color: var(--muted); line-height: 1.6; }
.guide-features li::before { content: '•'; position: absolute; left: 0; color: var(--violet); font-weight: 700; }
.guide-usecase li::before { content: '✓'; position: absolute; left: 0; color: var(--violet); font-weight: 700; }
.guide-privacy { margin-top: 14px; padding: 12px 14px; background: var(--violet-light); border-radius: 8px; font-size: 12px; color: var(--muted); line-height: 1.6; }

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}
