/* SUPERBOOK 디자인 시스템 (2026-11-16, Lovable 앱 시안 기준 — design/lovable, PC 에만) — 지금은 /_design 페이지(body.ds)에서만 적용된다.
   화면별로 승인되면 그 화면에 차례로 넓히고, 마지막에 아래 변수 묶음을 style.css 의 :root 로 옮긴다.
   변수 이름은 style.css 와 같다(--bg, --surface, --primary …). 새로 더한 것은 '추가' 표시.
   규칙: 카드 모서리 12px · 입력칸(버튼 포함) 10px · 책 표지 8px · 그라데이션은 랜딩·로그인·빈 화면에만.
   superbook.js 의 동작과 덜컥이 색 번호는 여기서 다루지 않는다(뷰어 막대·서랍 모양만). */

/* ================================================================ 1. 변수 (토큰) — Lovable 앱 시안 값 (design/lovable 'other page', 2026-11-16) */
.ds {
  /* 바탕 · 글자 */
  --bg: #f7f9fd;            /* 페이지 바탕 (sb-page) */
  --surface: #ffffff;       /* 카드 */
  --band: #f2f5fb;          /* 표 머리 · 눌린 칸 */
  --text: #1f2937;
  --muted: #5b6474;
  --border: #e5e9f2;        /* 머리카락 선 */
  --border-strong: #dce2ee; /* 입력칸 테두리 */
  /* 브랜드 */
  --navy: #0b1530;          /* 제목 글자 (sb-ink) */
  --primary: #2240a3;       /* 버튼 · 링크 · 고른 것 (sb-navy) */
  --primary-hover: #1a3285;
  --primary-text: #ffffff;
  --primary-soft: #eaf0ff;  /* 고른 칸 · hover 바탕 (sb-info-bg) */
  --label: #046cb5;         /* 작은 머리표 (sb-blue) */
  --sky: #7cc4f5;
  --highlight: #ffd400;     /* 형광 노랑: 진행 막대 · 덜컥이 */
  /* 알림 */
  --success-bg: #e6f4ea; --success-text: #1e6b34;
  --error-bg: #fdecec;   --error-text: #a12626;
  --warn-bg: #fff4e0;    --warn-text: #a85a00;
  --info-bg: #eaf0ff;    --info-text: #2240a3;
  /* 모서리: 버튼·배지·토스트는 알약, 입력칸 10px, 카드·표·창 12px, 표지 8px */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-cover: 8px;
  --radius-pill: 999px;
  /* 그림자: 카드는 선만, 떠 있는 것만 그림자 */
  --shadow: none;
  --shadow-float: 0 12px 32px -12px rgba(11, 21, 48, .25);
  --shadow-cover: 0 4px 10px -6px rgba(11, 21, 48, .4);
  --focus-ring: 0 0 0 3px rgba(4, 108, 181, .35);
  /* 빛 번짐 (그라데이션 대신): 로그인 · 빈 화면에만 */
  --glow: radial-gradient(60% 60% at 30% 30%, rgba(124, 196, 245, .55), transparent 70%), radial-gradient(60% 60% at 70% 70%, rgba(34, 64, 163, .35), transparent 70%);
  --gradient-brand: linear-gradient(135deg, #2240a3 0%, #046cb5 100%);
  --gradient-soft: var(--glow);
  /* 글꼴: Pretendard 하나 (명조 없음) */
  --sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  --serif: var(--sans);
  --fs-title: 1.75rem;   /* 28 페이지 제목 */
  --fs-section: 1.25rem; /* 20 섹션 */
  --fs-sub: 1.0625rem;   /* 17 카드 제목 */
  --fs-body: 1.0625rem;  /* 17 본문 (학생), 교사·관리자 15 */
  --fs-table: .875rem;   /* 14 표 */
  --fs-caption: .8125rem;/* 13 설명 */
  font-family: var(--sans);
}
@media (prefers-color-scheme: dark) {
  .ds {
    --bg: #0e1322; --surface: #161c2e; --band: #1a2238; --text: #e3e7ef; --muted: #a6aec0; --border: #2b3349; --border-strong: #36405a;
    --navy: #f1f3f8; --primary: #3352c2; --primary-hover: #3a5ac8; --primary-text: #ffffff; --primary-soft: #1a2547; --label: #a9beff;
    --success-bg: #12301e; --success-text: #7bd69a;
    --error-bg: #3a1618;   --error-text: #ff9c9c;
    --warn-bg: #3a2a10;    --warn-text: #f0b460;
    --info-bg: #1a2547;    --info-text: #a9beff;
    --shadow-float: 0 12px 32px -12px rgba(0, 0, 0, .6); --shadow-cover: 0 4px 10px -6px rgba(0, 0, 0, .6);
    --focus-ring: 0 0 0 3px rgba(124, 196, 245, .45);
    --glow: radial-gradient(60% 60% at 30% 30%, rgba(124, 196, 245, .25), transparent 70%), radial-gradient(60% 60% at 70% 70%, rgba(61, 95, 208, .4), transparent 70%);
  }
}

/* ================================================================ 2. 글자 */
.ds h1 { font-family: var(--serif); font-size: var(--fs-title); line-height: 1.3; letter-spacing: -.01em; }
.ds h2 { font-family: var(--serif); font-size: var(--fs-section); line-height: 1.35; }
.ds h3 { font-size: var(--fs-sub); }
.ds .panel > h2, .ds .panel > h3 { font-family: var(--sans); font-size: var(--fs-sub); }
.ds .eyebrow { display: inline-block; font-size: var(--fs-caption); font-weight: 700; color: var(--label); letter-spacing: .02em; }
.ds .caption { font-size: var(--fs-caption); color: var(--muted); }
.ds .num, .ds td.num { font-variant-numeric: tabular-nums; }

/* ================================================================ 3. 버튼 */
.ds .btn {
  border-radius: var(--radius); min-height: 44px; padding: 10px 20px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(17, 33, 68, .08);
}
.ds .btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.ds .btn:focus-visible, .ds button.link:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.ds .btn.secondary { background: var(--surface); color: var(--navy); border-color: var(--border-strong); box-shadow: none; }
.ds .btn.secondary:hover { background: var(--band); border-color: var(--navy); }
.ds .btn.small { min-height: 36px; padding: 6px 14px; font-size: .875rem; border-radius: 8px; }
.ds .btn.large { min-height: 52px; padding: 14px 28px; font-size: 1.05rem; }
.ds .btn.danger { background: var(--error-text); border-color: var(--error-text); color: #fff; }
.ds .btn.danger:hover { filter: none; background: color-mix(in srgb, var(--error-text) 85%, #000); }
.ds .btn:disabled, .ds .btn[aria-disabled="true"] {
  background: var(--band); border-color: var(--border); color: var(--muted); box-shadow: none; cursor: not-allowed; filter: none;
}
.ds button.link { color: var(--primary); font-weight: 600; text-underline-offset: 3px; border-radius: 4px; }
.ds button.link:hover { text-decoration: underline; }
.ds button.link:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

/* ================================================================ 4. 입력칸 · 양식 */
.ds input:not([type=checkbox]):not([type=radio]):not([type=range]), .ds select, .ds textarea {
  border-radius: var(--radius); border-color: var(--border-strong); min-height: 44px; padding: 10px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.ds textarea { min-height: 96px; }
.ds input:focus, .ds select:focus, .ds textarea:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
.ds input:disabled, .ds select:disabled, .ds textarea:disabled { background: var(--band); color: var(--muted); }
.ds input[type=file] { border-radius: var(--radius); }
.ds .field-help { font-size: var(--fs-caption); color: var(--muted); font-weight: 400; }
.ds .field-error { font-size: var(--fs-caption); color: var(--error-text); font-weight: 600; }
.ds label.invalid input { border-color: var(--error-text); }
.ds fieldset { border-radius: var(--radius-lg); border-color: var(--border); padding: 14px 18px; }
.ds .check-list label.check { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-weight: 500; }
.ds .check-list label.check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.ds .search input { border-radius: var(--radius); }

/* ================================================================ 5. 카드 */
.ds .panel { border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.ds .panel > h2:first-child, .ds .panel > h3:first-child { padding-bottom: 12px; margin-bottom: 16px; }
.ds .form-card { border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-float); }
.ds .form-card h1 { font-size: var(--fs-section); }
/* 로그인·가입 바탕 (그라데이션 허용 화면) */
.ds .auth-bg { background: var(--gradient-soft); padding: 32px 16px; border-radius: var(--radius-lg); }
.ds .auth-bg .form-card { margin: 0 auto; }

/* ================================================================ 6. 알림 (아이콘을 CSS 로 붙여 템플릿을 고치지 않아도 된다) */
.ds .flash {
  display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius); border-inline-start-width: 1px; padding: 12px 16px; line-height: 1.5;
}
.ds .flash::before {
  content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; background: currentColor;
  -webkit-mask: var(--flash-icon) center / contain no-repeat; mask: var(--flash-icon) center / contain no-repeat;
}
.ds .flash.info { --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 7.6v.1'/%3E%3C/svg%3E"); }
.ds .flash.success { --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12.3 2.4 2.4 4.6-5'/%3E%3C/svg%3E"); }
.ds .flash.error { --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 4.3 2.8 17.5A2 2 0 0 0 4.5 20.5h15a2 2 0 0 0 1.7-3L13.7 4.3a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 9.5v4M12 16.8v.1'/%3E%3C/svg%3E"); }

/* ================================================================ 7. 배지 (색만으로 알리지 않게: 확인 필요는 ! 아이콘) */
.ds .badge { border-radius: var(--radius-sm); padding: 2px 9px; font-size: .78rem; line-height: 1.6; gap: 4px; }
.ds .badge.success { background: var(--success-bg); color: var(--success-text); border-color: color-mix(in srgb, var(--success-text) 25%, transparent); }
.ds .badge.warn { background: var(--warn-bg); color: var(--warn-text); border-color: color-mix(in srgb, var(--warn-text) 30%, transparent); }
.ds .badge.warn::before { content: "!"; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--warn-text); color: var(--warn-bg); font-size: .7rem; font-weight: 800; }
.ds .badge.solid { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ================================================================ 8. 표 */
.ds .table-wrap { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.ds table { font-size: var(--fs-table); }
.ds th { font-size: var(--fs-caption); background: var(--band); color: var(--muted); padding: 10px 14px; }
.ds td { padding: 12px 14px; }
.ds .table-wrap tbody tr:nth-child(even) td { background: transparent; }
.ds tbody tr:hover td { background: color-mix(in srgb, var(--band) 70%, transparent); }
/* 넓은 표: 첫 칸(이름) 고정 */
.ds .table-wrap.sticky-first th:first-child, .ds .table-wrap.sticky-first td:first-child {
  position: sticky; inset-inline-start: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border);
}
.ds .table-wrap.sticky-first th:first-child { background: var(--band); }
.ds b.good, .ds b.bad { font-variant-numeric: tabular-nums; }

/* ================================================================ 9. 탭 */
.ds .tabs { gap: 2px; border-bottom-color: var(--border); }
.ds .tabs a { padding: 12px 16px; border-bottom-width: 3px; border-radius: var(--radius) var(--radius) 0 0; min-height: 44px; display: inline-flex; align-items: center; }
.ds .tabs a:hover { background: var(--band); }
.ds .tabs a.active { color: var(--navy); border-bottom-color: var(--primary); }

/* ================================================================ 10. 책 카드 · 진행 막대 */
.ds .cover { border-radius: var(--radius-cover); box-shadow: var(--shadow-cover); }
.ds .book-card:hover .cover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(17, 33, 68, .2); }
.ds .book-title { font-size: .95rem; }
.ds .progress { height: 6px; background: var(--border); border-radius: var(--radius-pill); margin: 6px 0 2px; }
.ds .progress span { background: var(--highlight); border-radius: var(--radius-pill); }
.ds .progress-label { font-size: var(--fs-caption); color: var(--muted); font-variant-numeric: tabular-nums; }
/* 표지 그림이 없을 때(이 페이지의 가짜 책): 제목을 쓴 색 면 */
.ds .cover.fake { display: flex; align-items: flex-end; padding: 12px; color: #fff; font-family: var(--serif); font-weight: 700; line-height: 1.35; font-size: .95rem; }

/* ================================================================ 11. 확인 창 · 토스트 */
.ds .dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-float); padding: 24px; width: min(420px, calc(100vw - 32px));
}
.ds .dialog::backdrop { background: rgba(14, 20, 36, .45); }
.ds .dialog h2 { font-family: var(--sans); font-size: var(--fs-sub); margin: 0 0 8px; }
.ds .dialog p { margin: 0 0 20px; color: var(--muted); }
.ds .dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 480px) { .ds .dialog-actions .btn { flex: 1 1 0; } }
.ds .toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--radius);
  background: var(--navy); color: #fff; box-shadow: var(--shadow-float); font-weight: 500; font-size: .93rem;
}
@media (prefers-color-scheme: dark) { .ds .toast { background: #e8eaf0; color: #0e1424; } }

/* ================================================================ 12. 빈 화면 (그라데이션 허용) */
.ds .empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--muted);
  background-color: var(--surface);
  background-image: linear-gradient(var(--band) 1px, transparent 1px), linear-gradient(90deg, var(--band) 1px, transparent 1px), var(--gradient-soft);
  background-size: 22px 22px, 22px 22px, 100% 100%;
}
.ds .empty .svg-i { width: 40px; height: 40px; color: var(--label); }
.ds .empty p { margin: 0; font-size: 1rem; color: var(--text); }

/* ================================================================ 13. 불러오는 중 */
.ds .skeleton { display: block; background: var(--band); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.ds .skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  animation: ds-shimmer 1.4s infinite;
}
.ds .skeleton.line { height: 12px; margin: 8px 0; }
.ds .skeleton.cover { aspect-ratio: 2 / 3; border-radius: var(--radius-cover); box-shadow: none; }
.ds .loading { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .93rem; }
.ds .spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: ds-spin .8s linear infinite; }
@keyframes ds-shimmer { to { transform: translateX(100%); } }
@keyframes ds-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ds .skeleton::after, .ds .spinner { animation: none; } }

/* ================================================================ 14. 그라데이션 쓰는 곳 (랜딩 첫 화면 · 남색 띠 버튼) */
.ds .hero-gradient { background: var(--gradient-brand); color: #fff; border-radius: var(--radius-lg); padding: 32px; }
.ds .hero-gradient h2 { color: #fff; margin: 0 0 8px; }
.ds .hero-gradient p { margin: 0 0 20px; color: rgba(255, 255, 255, .85); }
.ds .btn.on-dark { background: #fff; color: var(--navy); border-color: #fff; }
.ds .btn.on-dark:hover { background: var(--highlight); border-color: var(--highlight); color: #112144; }

/* ================================================================ 15. 뷰어 막대 · 서랍 (모양 미리보기. 실제 뷰어는 reader.css — 승인 후 같은 값으로 옮긴다)
   테마 색(밝게)은 reader.css 그대로. 재생 중에는 막대를 투명하게만(display:none 금지) */
.ds .vw { --vbg: #fffdf8; --chrome: #ffffff; --vtext: #1f2430; --accent: #2240a3; --accent-text: #fff; --soft: #f3f5f9;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--vbg); color: var(--vtext); box-shadow: var(--shadow); position: relative; }
.ds .vw.sepia { --vbg: #f4ecd8; --chrome: #ebe1c8; --vtext: #4a3a2c; --accent: #8a5a1f; --soft: #e3d7ba; --border: #d9cbaa; }
.ds .vw.dark { --vbg: #17181c; --chrome: #202228; --vtext: #d9d6cf; --accent: #9db2ff; --accent-text: #17181c; --soft: #2a2c33; --border: #33343b; }
.ds .vw-top, .ds .vw-bottom { display: flex; align-items: center; gap: 6px; background: var(--chrome); padding: 4px 8px; }
.ds .vw-top { min-height: 52px; border-bottom: 1px solid var(--border); }
.ds .vw-bottom { min-height: 60px; border-top: 1px solid var(--border); gap: 10px; padding-inline: 12px 6px; }
.ds .vw-title { flex: 1; min-width: 0; text-align: center; font-family: var(--serif); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds .vw-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--vtext); border-radius: var(--radius); flex: none; }
.ds .vw-btn:hover { background: var(--soft); }
.ds .vw-btn svg { width: 22px; height: 22px; }
.ds .vw-play { height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 18px 0 14px; border: 0; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; font-size: .9rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); flex: none; }
.ds .vw-play svg { width: 14px; height: 14px; fill: currentColor; }
.ds .vw-chip { flex: none; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: .72rem; color: var(--vtext); opacity: .85; }
.ds .vw-chip b { font-size: .85rem; }
.ds .vw-seek { flex: 1; min-width: 60px; height: 6px; border-radius: var(--radius-pill); background: linear-gradient(to right, var(--highlight) 42%, var(--border) 42%); }
[dir="rtl"] .ds .vw-seek { background: linear-gradient(to left, var(--highlight) 42%, var(--border) 42%); }
.ds .vw-page { padding: 28px clamp(20px, 6vw, 56px); font-family: var(--serif); font-size: 1.15rem; line-height: 2; min-height: 180px; }
.ds .vw-page .cur { background: var(--highlight); color: #1f2430; border-radius: 2px; padding: 0 2px; }
.ds .vw-stage { position: relative; }
.ds .vw-drawer {
  position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(300px, 82%); background: var(--chrome); color: var(--vtext);
  border-inline-end: 1px solid var(--border); border-start-end-radius: var(--radius-lg); border-end-end-radius: var(--radius-lg);
  box-shadow: var(--shadow-float); padding: 16px; overflow: auto;
}
.ds .vw-drawer-head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.ds .vw-drawer-head .cover { width: 44px; flex: none; margin: 0; font-size: 0; padding: 0; }
.ds .vw-drawer-head b { font-family: var(--serif); display: block; line-height: 1.35; }
.ds .vw-drawer-head span { font-size: .8rem; opacity: .75; }
.ds .vw-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.ds .vw-tabs span { flex: 1; text-align: center; padding: 10px 4px; font-size: .88rem; border-bottom: 3px solid transparent; margin-bottom: -1px; opacity: .75; }
.ds .vw-tabs span.on { border-bottom-color: var(--accent); font-weight: 700; opacity: 1; }
.ds .vw-toc { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.ds .vw-toc li { padding: 10px 12px; border-radius: var(--radius); }
.ds .vw-toc li.on { background: var(--soft); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.ds .vw.playing .vw-top, .ds .vw.playing .vw-bottom { opacity: 0; }

/* ================================================================ /_design 페이지 자체의 배치 (다른 화면에는 안 쓴다) */
.ds-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: 40px; }
.ds-section > h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; }
.ds-section > h2 code { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; font-weight: 400; }
.ds-section > .caption { margin: 0 0 18px; }
.ds-demo { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ds-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.ds-swatches { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ds-swatch { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); font-size: var(--fs-caption); }
.ds-swatch i { display: block; height: 56px; border-bottom: 1px solid var(--border); }
.ds-swatch div { padding: 8px 10px; display: flex; flex-direction: column; }
.ds-swatch code { background: none; border: 0; padding: 0; font-size: .75rem; color: var(--muted); }
.ds-type > * { margin: 0 0 10px; }
.ds-shapes { display: flex; flex-wrap: wrap; gap: 16px; }
.ds-shape { width: 120px; height: 80px; display: grid; place-items: center; text-align: center; background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-caption); color: var(--muted); }
.ds-label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 6px; font-family: ui-monospace, Consolas, monospace; }
.ds-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; margin: 0 0 8px; }
.ds-viewers { display: grid; gap: 20px; }
@media (min-width: 1000px) { .ds-viewers { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- 고친 것 (캡처 확인 후) */
.ds .nav .search input[type=search] { padding-inline-start: 38px; }                /* 돋보기와 글자가 겹치지 않게 */
.ds .table-wrap > table th, .ds .table-wrap > table td { white-space: nowrap; } /* 좁은 화면: 글자를 쪼개지 않고 옆으로 밀어 본다 */
.ds th.num { text-align: end; }
.ds .ds-type > h2 { font-family: var(--serif); font-size: var(--fs-section); border: 0; padding: 0; }
.ds .ds-type > h3 { font-family: var(--sans); font-size: var(--fs-sub); }
.ds-grid { align-items: start; }
.ds-page > header { padding-top: 24px; }
.ds .vw-stage { min-height: 320px; }

/* ================================================================ 적용한 화면: 로그인 묶음 (_auth_layout.html — login·register·password_forgot·password_reset)
   옅은 그라데이션 바탕(허용 화면) 위에 떠 있는 카드 */
body.ds.auth { background: var(--gradient-soft) no-repeat, var(--bg); background-size: 100% 620px, auto; }
.ds.auth .form-card { margin: clamp(24px, 7vh, 72px) auto 56px; }
.ds .form-card h1 { margin-bottom: 20px; }
.ds .form-card .flash { margin: 0 0 16px; }
.ds .form-card > p.muted.small { text-align: center; margin: 20px 0 0; }
.ds .form-card form p.muted.small { margin: 0; }
.ds .form-card fieldset { margin: 0; }
@media (max-width: 480px) { .ds .form-card { padding: 28px 20px; box-shadow: var(--shadow); } }
/* 입력칸 이름 옆의 회색 안내 "(8자 이상)" 은 보통 굵기, 동의 체크 문장도 보통 굵기 */
.ds label > .muted.small { font-weight: 400; font-size: var(--fs-caption); }
.ds .form-card label.check { font-weight: 400; align-items: flex-start; }
.ds .form-card label.check input { margin-top: 4px; }

/* ================================================================ 적용한 화면: 내 서재 (library.html) */
.ds .book-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ds .book-sources { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ds .book-sources .badge { font-size: .72rem; padding: 1px 7px; }
/* 대출 만료일: 7일 이하면 빨간색 + ! (색만으로 알리지 않게) */
.ds .loan-due { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-caption); margin-top: 4px; color: var(--info-text); }
.ds .loan-due.soon { color: var(--error-text); }
.ds .loan-due.soon::before { content: "!"; display: inline-grid; place-items: center; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--error-text); color: #fff; font-size: .68rem; font-weight: 800; }
.ds.library-page h1 { margin-bottom: 1.4rem; }
.ds.library-page .book-grid { gap: 32px 20px; }

/* ================================================================ 적용한 화면: 스토어 (index.html) · 책 상세 (book_detail.html)
   책 카드 조각 _book_grid.html 은 랜딩도 같이 쓰므로 고치지 않고, 여기서 모양만 바꾼다 */
.ds.store-page .store-head { margin: 2rem 0 .4rem; }
.ds.store-page .section-head h1 { font-size: var(--fs-title); }
.ds.store-page .store-head + .muted { margin: 0 0 1.6rem; }
.ds.store-page .book-grid { gap: 32px 20px; }
.ds .book-price .badge { background: var(--success-bg); color: var(--success-text); border-color: color-mix(in srgb, var(--success-text) 25%, transparent); }
.ds .ribbon { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
/* 책 상세: 표지 8px, 가격·버튼, 안내 글은 설명 크기 */
.ds .detail { gap: 48px; margin-top: 2.4rem; }
.ds .detail-cover { border-radius: var(--radius-cover); box-shadow: 0 16px 36px -8px rgba(17, 33, 68, .28); }
.ds .detail-body h1 { font-size: var(--fs-title); margin-bottom: .4rem; }
.ds .detail-body > p.muted:first-of-type { font-size: 1.02rem; margin: 0 0 1rem; }
.ds .detail-price { font-size: 1.5rem; font-variant-numeric: tabular-nums; margin: 1rem 0 0; }
.ds .detail .actions { margin: 1.2rem 0 1rem; }
.ds .detail .actions .btn { min-height: 48px; padding-inline: 28px; }
.ds .detail-body p.small { font-size: var(--fs-caption); }
.ds .detail-body h2 { margin: 2rem 0 .8rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.ds .detail .description { line-height: 1.8; }
@media (max-width: 640px) {
  .ds .detail { gap: 28px; margin-top: 1.4rem; }
  .ds .detail-body { text-align: start; }
  .ds .detail .actions .btn, .ds .detail .actions form { width: 100%; }
}

/* ================================================================ Lovable 앱 시안 부품 (2026-11-16) — 위의 같은 이름 규칙을 덮어쓴다
   시안: design/lovable/superbook other page design - lovable/src/styles.css (.btn .panel .flash-* .badge .table-wrap .tabs .empty-state …) */
body.ds { background: var(--bg); color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.ds h1, .ds h2, .ds h3 { color: var(--navy); font-family: var(--sans); letter-spacing: 0; }
.ds h1 { font-size: var(--fs-title); font-weight: 750; line-height: 1.4; }
.ds h2 { font-size: var(--fs-section); font-weight: 700; }
.ds a { color: var(--primary); }
.ds :focus-visible { outline: 3px solid #046cb5; outline-offset: 2px; }

/* 버튼: 알약 */
.ds .btn { border-radius: var(--radius-pill); min-height: 44px; padding: 0 20px; font-size: 1rem; font-weight: 600; box-shadow: none;
  background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.ds .btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.ds .btn.secondary { background: var(--surface); color: var(--primary); border-color: var(--border); }
.ds .btn.secondary:hover { background: var(--primary-soft); border-color: var(--border); }
.ds .btn.small { min-height: 36px; padding: 0 14px; font-size: .875rem; border-radius: var(--radius-pill); }
.ds .btn.large { min-height: 52px; padding: 0 28px; }
.ds .btn.danger { background: #a12626; border-color: #a12626; color: #fff; }
.ds .btn.danger:hover { background: #861e1e; border-color: #861e1e; }
.ds .btn:disabled, .ds .btn[aria-disabled="true"] { opacity: .45; background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.ds .btn.secondary:disabled { background: var(--surface); color: var(--primary); border-color: var(--border); }
.ds .btn.danger:disabled { background: #a12626; border-color: #a12626; }
.ds button.link { text-decoration: underline; text-underline-offset: 3px; }
.ds button.link:hover { text-decoration-thickness: 2px; color: var(--navy); }
.ds button.link:disabled { opacity: .45; }

/* 입력칸 10px */
.ds input:not([type=checkbox]):not([type=radio]):not([type=range]), .ds select, .ds textarea { border-radius: var(--radius); border-color: var(--border); background: var(--surface); }
.ds input:focus, .ds select:focus, .ds textarea:focus { border-color: #046cb5; box-shadow: var(--focus-ring); }
.ds input::placeholder, .ds textarea::placeholder { color: var(--muted); }
.ds label { color: var(--navy); }
.ds .check-list label.check { border-radius: var(--radius); }

/* 카드: 선만 (그림자 없음) */
.ds .panel { border-radius: var(--radius-lg); padding: 20px; box-shadow: none; }
.ds .panel > h2:first-child, .ds .panel > h3:first-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 8px; }
.ds .form-card { border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-float); }

/* 알림: 12px, 동그라미 아이콘 */
.ds .flash { border: 0; border-radius: var(--radius-lg); padding: 14px 16px; font-size: .9375rem; font-weight: 500; }
.ds .flash.error { --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v4.5M12 16v.1'/%3E%3C/svg%3E"); }

/* 배지: 알약 13px. 무료(초록) · 보유 중(흰 바탕 선) · 확인 필요(빨강 + 경고 표시) · 덜컥이(노랑) */
.ds .badge { border-radius: var(--radius-pill); padding: 2px 8px; font-size: 13px; font-weight: 600; border: 1px solid transparent; background: var(--info-bg); color: var(--info-text); }
.ds .badge.muted, .ds .badge.owned { background: var(--surface); color: var(--navy); border-color: var(--border); }
.ds .badge.success, .ds .badge.free { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
.ds .badge.warn { background: var(--error-bg); color: var(--error-text); border-color: transparent; }
.ds .badge.warn::before { content: "\26A0"; width: auto; height: auto; background: none; color: inherit; font-size: .8rem; font-weight: 400; border-radius: 0; }
.ds .badge.dulkeok { background: rgba(255, 212, 0, .25); color: var(--navy); }
.ds .badge.solid { background: var(--primary); color: #fff; border-color: transparent; }

/* 표: 12px, 머리 바탕 = 페이지색, 첫 칸 굵게 */
.ds .table-wrap { border-radius: var(--radius-lg); box-shadow: none; }
.ds th { background: var(--bg); color: var(--muted); font-size: 14px; font-weight: 600; padding: 10px 14px; }
.ds td { padding: 10px 14px; }
.ds .table-wrap.sticky-first th:first-child { background: var(--bg); }
.ds .table-wrap.sticky-first td:first-child { font-weight: 600; color: var(--navy); }

/* 탭: 밑줄 3px, 고른 것은 잉크색 */
.ds .tabs a { border-radius: 0; font-weight: 600; color: var(--muted); padding: 0 16px; }
.ds .tabs a:hover { background: none; color: var(--navy); }
.ds .tabs a.active { color: var(--navy); border-bottom-color: var(--primary); }

/* 책 카드 · 진행 막대 8px 노랑 */
.ds .cover { border-radius: var(--radius-cover); box-shadow: var(--shadow-cover); }
.ds .book-title { color: var(--navy); font-weight: 700; }
.ds .book-author { font-size: .875rem; color: var(--muted); }
.ds .progress { height: 8px; }

/* 빈 화면: 빛 번짐 */
.ds .empty { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); background-image: none; padding: 48px 24px; }
.ds .empty::before { content: ""; position: absolute; inset: -30%; background: var(--glow); filter: blur(30px); z-index: 0; }
.ds .empty > * { position: relative; z-index: 1; }
.ds .empty .svg-i { color: var(--primary); }
.ds .empty p { font-size: 1.125rem; font-weight: 700; color: var(--navy); }

/* 불러오는 중 */
.ds .skeleton { background: linear-gradient(90deg, #e9edf5 25%, #f5f7fb 50%, #e9edf5 75%); background-size: 200% 100%; border-radius: var(--radius-sm); animation: ds-shimmer2 1.4s infinite; }
.ds .skeleton::after { display: none; }
@keyframes ds-shimmer2 { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-color-scheme: dark) { .ds .skeleton { background: linear-gradient(90deg, #222a40 25%, #2c3550 50%, #222a40 75%); background-size: 200% 100%; } }
@media (prefers-reduced-motion: reduce) { .ds .skeleton { animation: none; } }

/* 확인 창 · 토스트 */
.ds .dialog { border-radius: var(--radius-lg); max-width: 380px; padding: 24px; }
.ds .dialog h2 { font-size: 1.125rem; }
.ds .toast { border-radius: var(--radius-pill); background: var(--navy); color: var(--bg); font-weight: 600; }

/* 머리말 (base.html): 흰 막대 · 알약 검색칸 · 메뉴 hover 바탕 · 고른 것 남색 */
.ds .site-header { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.ds .nav .search input[type=search] { border-radius: var(--radius-pill); background: var(--surface); border-color: var(--border); height: 44px; }
.ds .menu { gap: 2px; font-size: 1rem; }
.ds .menu a, .ds .menu button.link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius); color: var(--text); font-weight: 600; text-decoration: none; }
.ds .menu a:hover, .ds .menu button.link:hover { background: var(--primary-soft); color: var(--navy); }
.ds .menu a.active { color: var(--primary); }
.ds .menu .btn { color: var(--primary-text); padding: 0 18px; border-radius: var(--radius-pill); }
.ds .menu .btn:hover { background: var(--primary-hover); color: var(--primary-text); }
.ds .langs a.active { color: var(--navy); text-decoration: underline; text-underline-offset: 4px; }
.ds .tabbar a.active { color: var(--primary); }
@media (max-width: 860px) { .ds .site-header.open .menu > a { border-radius: 0; } }

/* 로그인 묶음: 빛 번짐 바탕 위 카드, 카드 위에 로고 */
body.ds.auth { background: var(--bg); position: relative; }
body.ds.auth::before { content: ""; position: fixed; inset: -10%; background: var(--glow); filter: blur(60px); opacity: .55; z-index: -1; pointer-events: none; }
.ds.auth .form-card { box-shadow: none; border-color: var(--border); margin-top: 0; }
.ds .auth-logo { display: flex; justify-content: center; margin: clamp(24px, 6vh, 56px) 0 20px; }
.ds .auth-logo img { height: 56px; width: auto; display: block; }

/* 내 서재: 선반 (표지 아래 받침 선), 넓은 화면 6권씩 */
.ds.library-page .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 14px; }
@media (min-width: 1024px) { .ds.library-page .book-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px 24px; } }
.ds.library-page .book-card > .cover { margin-bottom: 14px; }
.ds.library-page .book-card .cover + .book-meta { position: relative; }
.ds.library-page .book-card .cover + .book-meta::before { content: ""; position: absolute; inset-inline: -8px; top: -10px; height: 4px; border-radius: 2px; background: var(--border); box-shadow: 0 6px 10px -4px rgba(11, 21, 48, .18); }
.ds .book-sources .badge { font-size: 12px; padding: 1px 8px; }
.ds .loan-due { font-weight: 600; }

/* 스토어 · 책 상세 */
.ds .ribbon { background: var(--primary); }
.ds .detail-price { color: var(--navy); }
.ds .detail .actions .btn { min-height: 48px; border-radius: var(--radius-pill); }

/* 로그인 묶음: 네이버·구글 버튼, '또는' 구분선, 학생 코드 칸 (2026-11-16) */
.ds .social-login { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; }
.ds .social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: 1rem; text-decoration: none; border: 1px solid transparent; }
.ds .social-btn svg { width: 18px; height: 18px; flex: none; }
.ds .social-btn.naver { background: #03c75a; color: #fff; }
.ds .social-btn.naver:hover { background: #02b351; text-decoration: none; }
.ds .social-btn.kakao { background: #fee500; color: rgba(0, 0, 0, .85); }
.ds .social-btn.kakao:hover { background: #f5dc00; text-decoration: none; }
.ds .social-btn.google { background: #fff; color: #1f1f1f; border-color: #747775; }
.ds .social-btn.google:hover { background: #f2f2f2; text-decoration: none; }
.ds .or-line { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--muted); font-size: var(--fs-caption); }
.ds .or-line::before, .ds .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.ds .code-input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; font-size: 1.1rem; }
.ds .code-login { display: flex; flex-direction: column; gap: 12px; }
.ds .verify-resend { margin: 0 0 16px; }
/* 코드 목록 (교사·관리자: 만든 직후 한 번만 보여 준다, 인쇄용) */
.code-sheet { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 16px 0; }
.code-card { border: 1px dashed #9aa3b5; border-radius: 10px; padding: 14px 16px; background: #fff; color: #1f2937; break-inside: avoid; }
.code-card b { display: block; font-size: 1.05rem; }
.code-card code { display: block; margin-top: 6px; font-size: 1.25rem; letter-spacing: .12em; background: none; border: 0; padding: 0; }
.code-card small { display: block; margin-top: 6px; color: #5b6474; }
@media print {
  .site-header, .site-footer, .tabbar, .admin-side, .no-print, .flash { display: none !important; }
  .code-sheet { grid-template-columns: repeat(2, 1fr); }
}
/* 도서 상세 HTML 설명 */
.description-html { line-height: 1.8; overflow-wrap: anywhere; }
.description-html img, .description-html video { max-width: 100%; height: auto; border-radius: 8px; }
.description-html iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; }
.description-html figure { margin: 1.2em 0; }
.description-html figcaption { font-size: .85rem; color: var(--muted, #5b6474); margin-top: 6px; }
.description-html table { border-collapse: collapse; }
.description-html th, .description-html td { border: 1px solid var(--border, #e5e9f2); padding: 6px 10px; }
