/* hanjaDB 학습·관리 화면 (boosooDB 부수 학습과 분리) */

.hanja-app {
  min-height: 100vh;
  background: var(--paper, #f7f3eb);
  padding-bottom: 24px;
}

.hanja-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}

.hanja-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hanja-brand strong { font-size: 1.1rem; }
.hanja-brand p { margin: 0; font-size: 0.8rem; color: #666; }

.hanja-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hanja-stats-bar {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  overflow-x: auto;
}

.hanja-stat {
  flex: 0 0 auto;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  min-width: 88px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.hanja-stat strong {
  display: block;
  font-size: 1.2rem;
  font-family: 'Noto Serif KR', serif;
}

.hanja-stat span { font-size: 0.75rem; color: #666; }

.hanja-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 20px 12px;
  flex-wrap: wrap;
}

.hanja-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.hanja-grade-tabs {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
  overflow-x: auto;
}

.hanja-grade-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}

.hanja-grade-tab.is-active {
  background: #2c4a3e;
  color: #fff;
  border-color: #2c4a3e;
}

.hanja-main { padding: 0 20px; }

.hanja-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}

.hanja-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.hanja-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hanja-card-glyph {
  font-family: 'Noto Serif KR', serif;
  font-size: 2rem;
  line-height: 1.2;
}

.hanja-card-meta {
  font-size: 0.7rem;
  color: #666;
  margin-top: 4px;
}

.hanja-card-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef5f0;
  color: #2c4a3e;
}

.hanja-card-badge.is-excluded {
  background: #fdecea;
  color: #b42318;
}

.hanja-sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hanja-sheet[hidden] { display: none; }

.hanja-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.hanja-sheet-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px;
}

.hanja-sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: #f0f0f0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.hanja-detail-hero {
  text-align: center;
  padding: 12px 0 20px;
}

.hanja-detail-glyph {
  font-family: 'Noto Serif KR', serif;
  font-size: 5rem;
  line-height: 1;
}

.hanja-detail-reading {
  font-size: 1.1rem;
  margin-top: 8px;
}

.hanja-detail-grade {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef5f0;
  font-size: 0.85rem;
}

.hanja-stroke-svg-wrap {
  background: #faf8f4;
  border-radius: 12px;
  padding: 12px;
  margin: 16px 0;
}

.hanja-stroke-svg {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: block;
}

.hanja-stroke-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.hanja-section {
  margin-top: 20px;
}

.hanja-section h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #333;
}

.hanja-component-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hanja-component-chip {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.hanja-component-chip strong {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.2rem;
  margin-right: 6px;
}

.hanja-example {
  background: #fafafa;
  border-left: 3px solid #2c4a3e;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 0 8px 8px 0;
}

.hanja-example p { margin: 0 0 4px; }
.hanja-example small { color: #666; }

/* 관리자 hanjaDB */
.hanja-db-compare {
  margin: 0 0 20px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
}

.hanja-db-compare h3 { margin: 0 0 12px; font-size: 1rem; }

.hanja-db-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.hanja-db-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 14px;
  font-size: 0.9rem;
}

.hanja-db-card.is-active {
  border-color: #2c4a3e;
  background: #f6faf8;
}

.hanja-db-card strong { display: block; margin-bottom: 6px; }
.hanja-db-card p { margin: 0 0 8px; color: #555; font-size: 0.85rem; }
.hanja-db-card a { color: #2c4a3e; }

.hanja-flag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

.hanja-flag-read { background: #e8f0fe; color: #1a56db; }
.hanja-flag-write { background: #e8f5e9; color: #2e7d32; }
.hanja-flag-excluded { background: #fdecea; color: #b42318; }

.hadb-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.hadb-detail-grid dt { font-size: 0.75rem; color: #666; }
.hadb-detail-grid dd { margin: 0 0 8px; font-size: 0.95rem; }

.pill-muted {
  background: #eee;
  color: #555;
}

@media (max-width: 600px) {
  .hanja-detail-glyph { font-size: 4rem; }
  .hanja-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}
