/* ============================================
   科技前沿 - Complete Stylesheet
   1:1 Clone of Miaoda SPA Site
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: #1a1a2e;
    background: #f8f9fa;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; }

/* --- Header --- */
.site-header {
    background: hsl(210, 100%, 25%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden;
}
.site-logo svg { flex-shrink: 0;
    overflow: hidden; }
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    overflow: hidden;
}
.nav-link {
    color: rgba(255,255,255,0.85);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}
.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    overflow: hidden;
}
.search-form {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    overflow: hidden;
}
.search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    padding: 8px 12px;
    width: 200px;
    font-size: 0.9rem;
}
.search-input::placeholder { color: rgba(255,255,255,0.6); }
.search-btn {
    background: #2563eb;
    border: none;
    color: #fff;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.search-btn:hover { background: #1d4ed8; }
.login-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s;
    white-space: nowrap;
}
.login-btn:hover { background: rgba(255,255,255,0.2); }
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 0.9rem;
}
.user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.header-link {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
}
.header-link:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Mobile menu */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}
.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 12px 24px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: hsl(210, 100%, 22%);
}
.mobile-menu.open { display: flex; }
.mobile-nav-link {
    color: rgba(255,255,255,0.85);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.95rem;
}
.mobile-search-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.mobile-search-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
}

/* --- Main Content --- */
.site-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 60px - 300px);
}

/* --- Carousel --- */
.carousel-section {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    aspect-ratio: 2.5 / 1;
    background: #1a1a2e;
}
.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}
.carousel-slide {
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    min-width: 100%;
    position: relative;
}
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
}
.carousel-title {
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
    color: #2563eb;
    font-size: 1.2rem;
}
.carousel-btn:hover { background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

/* --- Section Titles --- */
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1a1a2e;
}

/* --- Content Layout: articles + sidebar --- */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
}

/* --- Article Cards Grid --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.article-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.article-card:hover .card-image img { transform: scale(1.05); }
.card-badge-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #6b7280;
}
.card-category {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #374151;
    border: 1px solid #e5e7eb;
}
.card-category:hover { background: #e0e0e0; }
.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1a1a2e;
}
.card-title a:hover { color: #2563eb; }
.card-excerpt {
    font-size: 0.85rem;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    flex: 1;
}
.card-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.78rem;
    color: #9ca3af;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}
.card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-stat svg { width: 14px; height: 14px; }

/* --- List page: 3 columns grid --- */
.articles-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* --- Sidebar --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 84px;
}
.sidebar-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}
.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a1a2e;
}
.widget-title svg { color: #2563eb; }
.hot-list { display: flex; flex-direction: column; gap: 12px; }
.hot-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.hot-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    background: #9ca3af;
}
.hot-rank.rank-1 { background: #2563eb; }
.hot-rank.rank-2 { background: #2563eb; }
.hot-rank.rank-3 { background: #2563eb; }
.hot-info { flex: 1; min-width: 0; }
.hot-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a2e;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hot-title:hover { color: #2563eb; }
.hot-views {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-top: 2px;
    display: block;
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    background: #0ea5e9;
    color: #fff;
    transition: all 0.2s;
    font-weight: 500;
}
.tag-badge:hover { background: #0284c7; transform: translateY(-1px); }

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    padding: 16px 0;
}
.page-btn, .page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    transition: all 0.2s;
    min-width: 38px;
    text-align: center;
}
.page-btn:hover, .page-num:hover { background: #f3f4f6; border-color: #d1d5db; }
.page-num.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.page-btn.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    pointer-events: none;
}
.page-dots { color: #9ca3af; padding: 0 4px; }

/* --- Article Detail --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.breadcrumb a { color: #6b7280; }
.breadcrumb a:hover { color: #2563eb; }
.breadcrumb-sep { color: #d1d5db; }
.article-detail { max-width: 100%; }
.article-header { margin-bottom: 24px; }
.article-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #1a1a2e;
}
.article-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.article-info .card-category { font-size: 0.85rem; }
.article-views {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: #6b7280;
}
.article-views svg { width: 16px; height: 16px; }
.article-time { font-size: 0.9rem; color: #9ca3af; }
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.article-tag {
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.article-tag:hover { background: #e0f2fe; }
.article-cover {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    aspect-ratio: 16/9;
}
.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
}
.article-content h1 { font-size: 1.75rem; margin: 28px 0 14px; color: #1a1a2e; font-weight: 700; }
.article-content h2 { font-size: 1.5rem; margin: 24px 0 12px; color: #1a1a2e; font-weight: 700; }
.article-content h3 { font-size: 1.25rem; margin: 20px 0 10px; color: #1a1a2e; font-weight: 600; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 12px 0; padding-left: 24px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 6px; }
.article-content strong { color: #1a1a2e; font-weight: 600; text-decoration: underline; text-decoration-color: #93c5fd; text-underline-offset: 2px; }
.article-content blockquote {
    margin: 16px 0;
    padding: 16px 20px;
    border-left: 4px solid #2563eb;
    background: #f0f9ff;
    border-radius: 0 8px 8px 0;
    color: #1e40af;
}
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 0.9rem;
}
.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e11d48;
}
.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.article-content img {
    border-radius: 8px;
    margin: 16px 0;
}
.article-content a { color: #2563eb; text-decoration: underline; }
.article-content a:hover { color: #1d4ed8; }

/* Article Actions */
.article-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6b7280;
    transition: all 0.2s;
}
.action-btn:hover { background: #f3f4f6; }
.action-btn.active { color: #2563eb; border-color: #93c5fd; background: #eff6ff; }
.action-btn svg { width: 18px; height: 18px; }

/* Prev/Next Navigation */
.prev-next-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}
.pn-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s;
}
.pn-link:hover { border-color: #2563eb; background: #f0f9ff; }
.pn-link.next { text-align: right; justify-content: flex-end; }
.pn-label { font-size: 0.8rem; color: #9ca3af; display: block; }
.pn-title { font-size: 0.95rem; font-weight: 500; color: #1a1a2e; }
.pn-link svg { flex-shrink: 0;
    overflow: hidden; color: #2563eb; }

/* Related Articles */
.related-section { margin-top: 32px; }

/* Comments Section */
.comments-section {
    margin-top: 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
}
.comments-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
}
.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}
.comment-item:last-child { border-bottom: none; }
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
}
.comment-username { font-weight: 600; font-size: 0.9rem; }
.comment-time { font-size: 0.8rem; color: #9ca3af; }
.comment-content { font-size: 0.95rem; color: #374151; }
.comment-form { margin-top: 16px; }
.comment-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    resize: vertical;
    min-height: 80px;
    outline: none;
    font-size: 0.95rem;
}
.comment-input:focus { border-color: #2563eb; }
.comment-submit {
    margin-top: 8px;
    padding: 8px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.comment-submit:hover { background: #1d4ed8; }
.login-prompt {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 0.95rem;
}
.login-prompt a { color: #2563eb; font-weight: 500; }

/* --- Category/Tag/Search Page --- */
.page-header {
    margin-bottom: 24px;
}
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
}
.page-desc {
    font-size: 0.95rem;
    color: #6b7280;
    margin-top: 4px;
}
.search-page-form {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    max-width: 600px;
}
.search-page-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
}
.search-page-input:focus { border-color: #2563eb; }
.search-page-btn {
    padding: 10px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    white-space: nowrap;
}
.search-page-btn:hover { background: #1d4ed8; }
.results-count {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 16px;
}

/* --- Auth Pages --- */
.auth-container {
    max-width: 420px;
    margin: 60px auto;
    padding: 32px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}
.auth-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 24px;
}
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-btn {
    width: 100%;
    padding: 12px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}
.form-btn:hover { background: #1d4ed8; }
.form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: #6b7280;
}
.form-footer a { color: #2563eb; font-weight: 500; }
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }

/* --- 404 Page --- */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-code {
    font-size: 6rem;
    font-weight: 700;
    color: #e5e7eb;
    line-height: 1;
}
.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 16px 0 8px;
}
.error-desc {
    color: #6b7280;
    margin-bottom: 24px;
}
.error-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
}

/* --- Footer --- */
.site-footer {
    background: hsl(210, 100%, 25%);
    color: #fff;
    margin-top: 48px;
    padding-top: 48px;
}
.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 32px;
    display: flex;
    justify-content: space-between;
    gap: 48px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.footer-desc {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 500px;
}
.footer-right h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 12px;
}
.footer-links li { margin-bottom: 8px; }
.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}
.footer-bottom p { margin-bottom: 4px; }
.footer-bottom a { color: rgba(255,255,255,0.7); }
.footer-bottom a:hover { color: #fff; }

/* --- Responsive --- */
@media (max-width: 1200px) {
    .articles-grid { grid-template-columns: repeat(3, 1fr); }
    .content-layout { grid-template-columns: 1fr 300px; }
}

@media (max-width: 992px) {
    .content-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .articles-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-nav, .search-form, .header-right .login-btn, .user-menu { display: none; }
    .mobile-menu-btn { display: block; }
    .header-container { padding: 0 16px; }
    .site-main { padding: 16px; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .articles-grid-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .carousel-section { aspect-ratio: 2/1; }
    .carousel-title { font-size: 1.1rem; }
    .carousel-overlay { padding: 16px; }
    .article-title { font-size: 1.5rem; }
    .prev-next-nav { grid-template-columns: 1fr; }
    .footer-container { flex-direction: column; gap: 24px; }
}

@media (max-width: 480px) {
    .articles-grid { grid-template-columns: 1fr; }
    .articles-grid-3 { grid-template-columns: 1fr; }
}

/* --- Admin Styles --- */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.admin-sidebar {
    background: hsl(210, 100%, 25%);
    color: #fff;
    padding: 20px 0;
}
.admin-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}
.admin-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.admin-nav-link:hover, .admin-nav-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.admin-nav-link svg { width: 20px; height: 20px; }
.admin-main { padding: 24px; background: #f8f9fa; overflow-x: auto; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-title { font-size: 1.5rem; font-weight: 700; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #374151; border-color: #e5e7eb; }
.btn-secondary:hover { background: #f3f4f6; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }

/* Admin Cards / Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: #2563eb; }
.stat-label { font-size: 0.9rem; color: #6b7280; margin-top: 4px; }

/* Admin Tables */
.admin-table {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}
.admin-table table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}
.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f9fafb; }
.table-actions { display: flex; gap: 8px; }

/* Admin Forms */
.admin-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    max-width: 800px;
}
.admin-form .form-group { margin-bottom: 20px; }
.admin-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    min-height: 200px;
    resize: vertical;
    font-size: 0.95rem;
    outline: none;
}
.admin-form textarea:focus { border-color: #2563eb; }
.admin-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    background: #fff;
}
.admin-form select:focus { border-color: #2563eb; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

/* Admin auto-publish */
.config-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.config-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.status-published { background: #dcfce7; color: #16a34a; }
.status-draft { background: #fef3c7; color: #d97706; }
.status-success { background: #dcfce7; color: #16a34a; }
.status-failed { background: #fee2e2; color: #dc2626; }

/* Log table */
.log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-end;
}
.log-filters .form-group { margin-bottom: 0; }
.log-filters .form-input { width: 180px; }
.log-filters select { width: 140px; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 0.9rem; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
}
.empty-state svg { margin-bottom: 12px; }

/* Tag input for admin */
.tag-input-container { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 6px;
    font-size: 0.85rem;
}
.tag-chip button {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

/* Bookmarks page */
.bookmarks-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}
