/* 한자 독음 라이브러리 가이드 전용 스타일 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --doc-ff: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Noto Sans KR', sans-serif;
    --doc-primary: #4a6da7;
    --doc-bg: #fdfdfd;
    --doc-card-bg: #ffffff;
    --doc-text: #2c3e50;
    --doc-text-light: #7f8c8d;
    --doc-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --doc-shadow-hover: 0 10px 40px rgba(74, 109, 167, 0.1);
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
}

.doc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: row-reverse;
    gap: 3rem;
    animation: fadeIn 0.6s ease-out;
    font-family: var(--doc-ff);
    position: relative;
    justify-content: flex-start;
    /* Main content to center/left, TOC to right */
}

.doc-main-content {
    flex: 1;
    min-width: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Breadcrumb - subtle style */
.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--doc-text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb a {
    color: var(--doc-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

/* Hero Section - Premium Look */
.hero-section {
    position: relative;
    padding: 4rem 3rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border-radius: 24px;
    margin-bottom: 4rem;
    box-shadow: var(--doc-shadow);
    border: 1px solid rgba(74, 109, 167, 0.05);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(74, 109, 167, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-title-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.hero-icon {
    width: 70px;
    height: 70px;
    background: white;
    box-shadow: 0 4px 15px rgba(74, 109, 167, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    font-size: 2rem;
    color: var(--doc-primary);
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #1a2a44;
    margin: 0;
    letter-spacing: -0.02em;
}

.hero-description {
    font-size: 1.3rem;
    color: #5d6d7e;
    max-width: 700px;
    line-height: 1.6;
}

/* Sections */
.doc-section {
    margin-bottom: 4rem;
}

.doc-section h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1a2a44;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--doc-ff);
    letter-spacing: -0.01em;
}

.doc-section p {
    margin-bottom: 2rem;
    color: #5d6d7e;
    line-height: 1.6;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-item {
    padding: 2.5rem 2rem;
    background: white;
    border-radius: 20px;
    border: 1px solid #f0f3f8;
    box-shadow: var(--doc-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--doc-shadow-hover);
    border-color: rgba(74, 109, 167, 0.2);
}

.feature-item i {
    font-size: 2rem;
    color: var(--doc-primary);
    margin-bottom: 1.5rem;
    display: block;
}

.feature-item h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a2a44;
}

.feature-item p {
    color: #5d6d7e;
    line-height: 1.6;
}

/* Code Blocks - Modern Dark */
.code-container {
    background: var(--code-bg);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-lang {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.code-container pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--code-text);
    overflow-x: auto;
    white-space: pre;
    padding-bottom: 0.5rem;
    /* Space for scrollbar */
}

/* Copy Button */
.code-header .copy-btn {
    color: #cfd8dc;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
}

.code-header .copy-btn:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

/* Minimal Scrollbar for Code Blocks */
.code-container pre::-webkit-scrollbar {
    height: 4px;
}

.code-container pre::-webkit-scrollbar-track {
    background: transparent;
}

.code-container pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.code-container pre::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.code-container .keyword {
    color: #569cd6;
}

.code-container .string {
    color: #ce9178;
}

.code-container .function {
    color: #dcdcaa;
}

.code-container .comment {
    color: #6a9955;
}

.code-container.compact-block {
    padding: 1rem 1.25rem;
    margin: 1rem 0 0 0;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.code-container.compact-block pre {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Method Cards */
.method-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--doc-shadow);
    border: 1px solid #f0f3f8;
}

.method-badge {
    display: inline-flex;
    padding: 4px 12px;
    background: #f0f4ff;
    color: var(--doc-primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    letter-spacing: 0.02em;
}

.method-card h3 {
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
    color: #1a2a44;
    font-family: var(--doc-ff);
    font-weight: 700;
}

.method-desc {
    font-size: 1.05rem;
    color: #5d6d7e;
    margin-bottom: 1.5rem;
}

.param-list {
    background: #f8faff;
    border-radius: 12px;
    padding: 1.5rem;
    list-style: none;
}

.param-list li {
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
}

.param-list li:last-child {
    margin-bottom: 0;
}

.param-name {
    font-weight: 700;
    color: var(--doc-primary);
    min-width: 100px;
    font-family: 'JetBrains Mono', monospace;
}

/* Alert Boxes */
.doc-info-box {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: #f0f7ff;
    border-radius: 16px;
    color: #2e5a88;
    font-size: 1rem;
    margin: 4rem 0;
}

.doc-info-box i {
    font-size: 1.25rem;
    color: var(--doc-primary);
}


/* TOC - Notion Style Floating */
.doc-toc {
    width: 240px;
    position: sticky;
    top: 100px;
    height: fit-content;
    padding: 1rem 0;
    font-family: var(--doc-ff);
}

.doc-toc h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--doc-text-light);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    font-weight: 700;
}

#toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: none;
    /* Removed ugly border */
}

#toc-nav li {
    margin-bottom: 0.35rem;
}

.toc-link {
    display: block;
    padding: 0.6rem 0.5rem;
    color: var(--doc-text-light);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.4;
    transition: all 0.2s ease;
    border-left: none;
    /* Removed ugly border */
    border-radius: 8px;
}

.toc-link:hover {
    color: var(--doc-primary);
    background: rgba(74, 109, 167, 0.05);
}

.toc-link.active {
    color: #1a2a44;
    font-weight: 800;
    background: rgba(74, 109, 167, 0.1);
    box-shadow: inset 0 0 0 1px rgba(74, 109, 167, 0.1);
}

/* Nested TOC Styling */
.toc-sub {
    list-style: none;
    padding-left: 2rem;
    /* 들여쓰기 대폭 확대 */
    margin-top: 0.2rem;
    margin-bottom: 0.5rem;
    border-left: 2px solid #eef0f2;
    /* 가이드 라인 강조 */
    margin-left: 0.5rem;
}

.toc-sub .toc-link {
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
    color: var(--doc-text-light);
    opacity: 0.85;
}

.toc-sub .toc-link:hover {
    opacity: 1;
}

.toc-sub .toc-link.active {
    opacity: 1;
    font-weight: 700;
}

.doc-sub-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #f0f2f5;
}

.doc-sub-section h3 {
    font-size: 1.5rem;
    color: var(--doc-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@media (max-width: 1024px) {
    .doc-container {
        flex-direction: column;
    }

    .doc-toc {
        display: none;
    }

    .hero-section {
        padding: 3rem 1.5rem;
    }

    .hero-title-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .hero-section h1 {
        font-size: 2.25rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .method-card {
        padding: 1.5rem;
    }
}