html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; background: #F8FAFC; }

/* Main content area */
.content-wrapper {
    display: flex;
    min-height: calc(100vh - 56px);
}
.main-content {
    flex: 1;
    min-width: 0;
    padding: 24px 32px;
}

/* Category card */
.category-card {
    background: white;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    padding: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #2563EB;
}

/* Article list */
.article-item {
    background: white;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s;
    display: block;
    text-decoration: none;
}
.article-item:hover {
    border-color: #2563EB;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Article cards grid */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.article-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.article-card:hover {
    border-color: #2563EB;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.article-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.article-card-content {
    padding: 16px;
}
.article-card-meta {
    font-size: 12px;
    color: #94A3B8;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.article-card-meta::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: 0.6;
}
.article-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 8px;
    line-height: 1.4;
}
.article-card-excerpt {
    font-size: 14px;
    color: #64748B;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile: sidebar collapsed by default */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    .main-content {
        height: auto;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .grid-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .article-card img {
        height: 160px;
    }
}
/* Article viewer styles (extracted from inline) */
.article-viewer {
      background: white;
      border-radius: 12px;
      border: 1px solid #E2E8F0;
      overflow: hidden;
    }
    .article-header {
      padding: 30px;
      border-bottom: 1px solid #E2E8F0;
      background: white;
      border-radius: 8px;
      margin-bottom: 20px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .article-title {
      font-weight: 600;
      font-size: 1.8em;
      color: #1a1a1a;
      margin-bottom: 10px;
    }
    .article-meta {
      display: flex;
      align-items: center;
      gap: 5px;
      color: #666;
      font-size: 0.9em;
    }
    .article-meta::before {
      content: '';
      display: inline-block;
      width: 14px;
      height: 14px;
      background: currentColor;
      -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") center/contain no-repeat;
      opacity: 0.6;
    }
    .article-content {
      background: white;
      padding: 30px;
      border-radius: 8px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .article-content img {
      max-width: 100%;
      width: auto;
      height: auto;
      border-radius: 4px;
      margin: 15px auto;
      display: block;
    }
    .article-content video {
      max-width: 100%;
      border-radius: 4px;
      margin: 15px 0;
    }
    .article-content pre {
      overflow-x: auto;
      margin: 16px 0;
      font-size: 14px;
      background: #f4f4f4;
      padding: 15px;
      border-radius: 4px;
    }
    .article-content p {
      margin-bottom: 16px;
      line-height: 1.8;
    }
    .article-content ul, .article-content ol {
      margin: 16px 0;
      padding-left: 24px;
    }
    .article-content li {
      margin-bottom: 8px;
    }
    .article-content h2 {
      font-size: 20px;
      font-weight: 600;
      margin: 24px 0 12px;
      color: #1E293B;
    }
    .article-content h3 {
      font-size: 16px;
      font-weight: 600;
      margin: 20px 0 10px;
      color: #334155;
    }
    .article-content a {
      color: #2563EB;
    }
    .article-content table {
      width: 100%;
      border-collapse: collapse;
      margin: 15px 0;
    }
    .article-content th, .article-content td {
      text-align: left;
      border: 1px solid #ddd;
      padding: 8px;
    }
    .article-content th {
      background: #f5f5f5;
    }
    .article-content blockquote {
      border-left: 4px solid #667eea;
      padding-left: 16px;
      margin: 16px 0;
      color: #64748B;
    }
    .back-link {
      display: inline-block;
      margin-bottom: 20px;
      color: #3b82f6;
      text-decoration: none;
    }
    .back-link:hover {
      text-decoration: underline;
    }

/* Mobile responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 12px;
    }
    .article-viewer {
        border-radius: 8px;
    }
    .article-header {
        padding: 16px;
    }
    .article-title {
        font-size: 20px;
    }
    .article-content {
        padding: 16px;
    }
    .article-content h2 {
        font-size: 18px;
    }
    .article-content h3 {
        font-size: 15px;
    }
    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .article-content ul, .article-content ol {
        padding-left: 20px;
    }
    .article-header {
        padding: 20px;
    }
    .article-title {
        font-size: 1.5em;
    }
    .article-content {
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 8px;
    }
    .article-header {
        padding: 12px;
    }
    .article-content {
        padding: 12px;
    }
    .article-title {
        font-size: 18px;
    }
    .article-meta {
        font-size: 12px;
    }
}
