* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif; background: #f8f9fa; color: #1a1a2e; min-height: 100vh; display: flex; flex-direction: column; }
a { color: #6c63ff; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
header { background: #fff; border-bottom: 1px solid #e9ecef; padding: 1.25rem 0; }
.container { max-width: 960px; margin: 0 auto; padding: 0 1.5rem; }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.25rem; font-weight: 700; color: #1a1a2e; text-decoration: none; }
.logo span { color: #6c63ff; }
.logo:hover { text-decoration: none; }
.back-link { font-size: 0.875rem; color: #6c757d; text-decoration: none; }
.back-link:hover { color: #6c63ff; text-decoration: none; }
main { flex: 1; padding: 2.5rem 0; }
footer { background: #fff; border-top: 1px solid #e9ecef; padding: 1.5rem 0; text-align: center; color: #6c757d; font-size: 0.8rem; line-height: 1.8; }
footer a { color: #6c63ff; text-decoration: none; }

/* Index page */
h1.page-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.subtitle { color: #6c757d; margin-bottom: 2.5rem; font-size: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.card { background: #fff; border: 1px solid #e9ecef; border-radius: 12px; padding: 1.75rem; transition: box-shadow 0.2s; display: flex; flex-direction: column; justify-content: space-between; }
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.card-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.25rem; }
.card-icon-img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.card-desc { color: #6c757d; font-size: 0.85rem; line-height: 1.4; margin: 0; }
.badge { font-size: 0.65rem; background: #fff3cd; color: #856404; padding: 0.15rem 0.5rem; border-radius: 99px; font-weight: 500; vertical-align: middle; white-space: nowrap; }
.card-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.card-links a { color: #6c63ff; font-size: 0.875rem; font-weight: 500; padding: 0.4rem 0.75rem; border: 1px solid #6c63ff; border-radius: 6px; transition: all 0.2s; text-decoration: none; }
.card-links a:hover { background: #6c63ff; color: #fff; text-decoration: none; }

/* Document header */
.doc-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid #e9ecef; }
.doc-meta { display: flex; align-items: center; gap: 0.5rem; }
.doc-app { font-size: 1.25rem; font-weight: 700; color: #6c63ff; }
.doc-type { font-size: 1.25rem; font-weight: 600; color: #1a1a2e; }
.doc-meta .doc-app::after { content: "/"; margin-left: 0.5rem; color: #dee2e6; font-weight: 400; }
.version-select { display: flex; align-items: center; gap: 0.5rem; }
.version-select label { font-size: 0.875rem; color: #6c757d; }
.version-select select { font-size: 0.875rem; padding: 0.35rem 0.6rem; border: 1px solid #dee2e6; border-radius: 6px; background: #fff; color: #1a1a2e; cursor: pointer; }
.loading { color: #6c757d; font-style: italic; }

/* Document prose content (rendered markdown) */
.prose { max-width: 48rem; }
.prose h1 { font-size: 1.5rem; font-weight: 700; margin-top: 2rem; margin-bottom: 1rem; }
.prose h1:first-child { margin-top: 0; }
.prose h2 { font-size: 1.25rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.75rem; }
.prose h3 { font-size: 1.125rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose h4 { font-size: 1rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.5rem; }
.prose p { margin-bottom: 1rem; line-height: 1.7; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.prose ul ul { margin-bottom: 0; margin-top: 0.25rem; }
.prose li { line-height: 1.7; margin-bottom: 0.25rem; }
.prose hr { border: none; border-top: 1px solid #e9ecef; margin: 2rem 0; }
.prose blockquote { border-left: 4px solid rgba(108, 99, 255, 0.3); padding-left: 1rem; font-style: italic; margin: 1rem 0; }
.prose table { width: 100%; border-collapse: collapse; border: 1px solid #e9ecef; margin-bottom: 1rem; font-size: 0.9rem; }
.prose thead { background: #f1f3f5; }
.prose th { border: 1px solid #e9ecef; padding: 0.5rem 1rem; text-align: left; font-weight: 600; }
.prose td { border: 1px solid #e9ecef; padding: 0.5rem 1rem; }

@media (max-width: 640px) {
    .doc-header { flex-direction: column; align-items: flex-start; }
    .prose table { font-size: 0.8rem; }
    .prose th, .prose td { padding: 0.4rem 0.5rem; }
}
