@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: #e2e8f0;
    background: #0f172a;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #06b6d4, #6366f1);
    z-index: 100;
    transition: width 0.1s ease;
}

header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #06b6d4;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #06b6d4, #6366f1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.1);
}

.cta-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px;
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 32px;
}

.toc-sidebar {
    position: sticky;
    top: 96px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.toc-sidebar::-webkit-scrollbar { width: 4px; }
.toc-sidebar::-webkit-scrollbar-track { background: transparent; }
.toc-sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.toc-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 20px;
}

.toc-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-list { list-style: none; }
.toc-list li { margin-bottom: 4px; }

.toc-link {
    display: block;
    padding: 10px 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
    border-left-color: #06b6d4;
}

.toc-link.active {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.15);
    border-left-color: #06b6d4;
    font-weight: 600;
}

.article {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 48px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #06b6d4;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 32px;
    transition: all 0.2s;
    font-size: 14px;
}

.back-link:hover { transform: translateX(-4px); }

.article h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #06b6d4, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #334155;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-content {
    font-size: 17px;
    color: #cbd5e1;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 32px;
    font-weight: 800;
    color: #e2e8f0;
    margin: 48px 0 24px;
    scroll-margin-top: 100px;
}

.article-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: #06b6d4;
    margin: 32px 0 16px;
}

.article-content p { margin-bottom: 20px; }
.article-content ul, .article-content ol { margin: 20px 0 20px 28px; }
.article-content li { margin-bottom: 12px; }
.article-content strong { color: #e2e8f0; font-weight: 700; }

.feature-box, .use-case, .scenario {
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 16px;
    padding: 32px;
    margin: 32px 0;
    scroll-margin-top: 100px;
}

.tip {
    background: rgba(6, 182, 212, 0.1);
    border-left: 4px solid #06b6d4;
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 8px;
}

.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    padding: 20px 24px;
    margin: 24px 0;
    border-radius: 8px;
}

.cta-section {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    padding: 48px;
    border-radius: 20px;
    text-align: center;
    margin: 48px 0;
}

.cta-section h3 { color: white !important; margin-top: 0; margin-bottom: 16px; }

.cta-btn-large {
    display: inline-block;
    background: white;
    color: #6366f1;
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    margin-top: 20px;
    transition: all 0.2s;
}

.cta-btn-large:hover { transform: scale(1.05); }

.sidebar {
    position: sticky;
    top: 96px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.sidebar-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s;
}

.sidebar-card:hover { border-color: #475569; }

.sidebar-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-card p {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 16px;
    line-height: 1.6;
}

.sidebar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    width: 100%;
}

.sidebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

.feature-list { list-style: none; }

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #cbd5e1;
}

.check-icon { color: #10b981; font-size: 16px; }
.cross-icon { color: #ef4444; font-size: 16px; }

.related-post {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: rgba(6, 182, 212, 0.05);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    margin-bottom: 12px;
}

.related-post:hover {
    background: rgba(6, 182, 212, 0.1);
    transform: translateX(4px);
}

.related-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #06b6d4, #6366f1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.related-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 4px;
}

.related-content p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-container { 
        grid-template-columns: 1fr 280px; 
        gap: 24px; 
    }
    .toc-sidebar { display: none; }
    .article { padding: 36px; }
}

@media (max-width: 992px) {
    .main-container { 
        grid-template-columns: 1fr; 
        gap: 24px; 
        padding: 32px 20px; 
    }
    .sidebar { 
        position: static;
        max-height: none;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    .article { padding: 32px; }
    .article h1 { font-size: 36px; }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 16px;
        height: 64px;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .logo-text { font-size: 16px; }
    .logo-subtitle { font-size: 10px; }
    
    .nav-links { display: none; }
    
    .cta-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .main-container { 
        padding: 24px 16px; 
        gap: 20px;
    }
    
    .article { 
        padding: 24px 20px;
        border-radius: 16px;
    }
    
    .article h1 { 
        font-size: 28px;
        margin-bottom: 16px;
    }
    
    .meta {
        font-size: 13px;
        gap: 12px;
        margin-bottom: 24px;
        padding-bottom: 20px;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    .article-content h2 { 
        font-size: 22px;
        margin: 32px 0 16px;
    }
    
    .article-content h3 { 
        font-size: 18px;
        margin: 24px 0 12px;
    }
    
    .feature-box, .use-case, .scenario {
        padding: 20px;
        margin: 24px 0;
    }
    
    .tip, .warning {
        padding: 16px 20px;
        margin: 20px 0;
    }
    
    .cta-section {
        padding: 32px 24px;
        margin: 32px 0;
    }
    
    .cta-section h3 {
        font-size: 20px;
    }
    
    .cta-btn-large {
        padding: 14px 28px;
        font-size: 14px;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar-card {
        padding: 20px;
    }
    
    .toc-sidebar, .sidebar { display: flex; }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 12px;
        height: 60px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .logo-text { 
        font-size: 14px;
    }
    
    .logo-subtitle { 
        font-size: 9px;
    }
    
    .cta-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .main-container { 
        padding: 20px 12px; 
    }
    
    .article { 
        padding: 20px 16px;
    }
    
    .article h1 { 
        font-size: 24px;
        line-height: 1.3;
    }
    
    .back-link {
        font-size: 13px;
        margin-bottom: 24px;
    }
    
    .meta {
        font-size: 12px;
        gap: 10px;
    }
    
    .article-content {
        font-size: 15px;
    }
    
    .article-content h2 { 
        font-size: 20px;
        margin: 28px 0 14px;
    }
    
    .article-content h3 { 
        font-size: 17px;
        margin: 20px 0 10px;
    }
    
    .article-content ul, .article-content ol {
        margin: 16px 0 16px 20px;
    }
    
    .feature-box, .use-case, .scenario {
        padding: 16px;
        margin: 20px 0;
        border-radius: 12px;
    }
    
    .tip, .warning {
        padding: 14px 16px;
        margin: 16px 0;
        font-size: 14px;
    }
    
    .cta-section {
        padding: 24px 20px;
        margin: 28px 0;
        border-radius: 16px;
    }
    
    .cta-section h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .cta-section p {
        font-size: 14px;
    }
    
    .cta-btn-large {
        padding: 12px 24px;
        font-size: 13px;
        width: 100%;
    }
    
    .sidebar-card {
        padding: 18px;
    }
    
    .sidebar-card h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .sidebar-card p {
        font-size: 13px;
        margin-bottom: 14px;
    }
    
    .sidebar-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .feature-list li {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .related-post {
        padding: 12px;
    }
    
    .related-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .related-content h4 {
        font-size: 13px;
    }
    
    .related-content p {
        font-size: 11px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .article h1 { font-size: 26px; }
    .article-content h2 { font-size: 20px; }
    .main-container { padding: 20px 16px; }
}

/* Tablet specific */
@media (min-width: 769px) and (max-width: 992px) {
    .sidebar {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-link, .toc-link, .sidebar-btn, .cta-btn, .back-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    .related-post {
        min-height: 60px;
    }
}
