/* Layui Aura Theme */
:root {
    --aura-primary: #ff5722; /* Layui default orange-red, very vibrant */
    --aura-blue: #1e9fff;
    --aura-bg: #f8f9fa;
    --aura-card: #ffffff;
    --aura-text: #333333;
    --aura-muted: #999999;
    --aura-border: #eeeeee;
    --aura-glass: rgba(255, 255, 255, 0.85);
    --aura-radius: 12px;
    --aura-radius-lg: 16px;
    --aura-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    --aura-shadow-card: 0 4px 12px rgba(0, 0, 0, 0.08);
    --aura-duration: .24s;
    --aura-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    background-color: var(--aura-bg) !important;
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: var(--aura-text);
}

html {
    scroll-behavior: smooth;
}

/* Header Adjustments */
.aura-header {
    background: var(--aura-glass) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--aura-border);
    position: fixed !important;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    transition: background-color var(--aura-duration) var(--aura-ease), box-shadow var(--aura-duration) var(--aura-ease), border-color var(--aura-duration) var(--aura-ease);
}

.aura-header.aura-header-scrolled {
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.aura-header .layui-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.aura-logo {
    color: var(--aura-primary) !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 22px;
    width: auto !important;
    line-height: normal;
}

.aura-logo a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.site-logo-wrap { position: relative; padding: 0; }
.site-logo-link { display: flex; align-items: center; gap: 8px; color: var(--aura-primary); }
.site-logo-icon { font-size: 26px; }
.site-logo-text { font-weight: 700; font-family: 'Outfit'; font-size: 24px; }

.aura-nav, .aura-nav-right {
    background: transparent !important;
    padding: 0;
}

.aura-nav {
    flex: 1;
    margin-left: 20px;
}
.site-nav {
    display: flex;
    align-items: center;
    background: transparent;
    padding: 0 0 0 20px;
}

.aura-nav .layui-nav-item, .aura-nav-right .layui-nav-item {
    line-height: 60px;
}

.aura-nav .layui-nav-item a { color: #333 !important; font-weight: 500; transition: color var(--aura-duration) var(--aura-ease); }
.aura-nav .layui-nav-item.layui-this:after { background-color: var(--aura-primary) !important; top: auto; bottom: 0; }
.aura-nav-right .layui-nav-item a { color: #555 !important; }

/* Main Container Padding */
.aura-main-container {
    padding-top: 80px; /* Offset for fixed header */
    min-height: calc(100vh - 200px);
}

/* Card Styling inspired by Reference Site */
.layui-card {
    border-radius: var(--aura-radius) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    border: 1px solid var(--aura-border) !important;
    margin-bottom: 20px;
    transition: transform var(--aura-duration) var(--aura-ease), box-shadow var(--aura-duration) var(--aura-ease), border-color var(--aura-duration) var(--aura-ease);
}

.layui-card:hover {
    box-shadow: var(--aura-shadow-card) !important;
}

.layui-card-header {
    font-weight: 700;
    font-family: 'Outfit';
    border-bottom: 1px solid var(--aura-border) !important;
    padding: 0 20px !important;
    height: 50px !important;
    line-height: 50px !important;
}

.aura-article-list-container {
    background: #fff;
    border-radius: var(--aura-radius);
    border: 1px solid var(--aura-border);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Article List Item */
.article-item {
    display: flex;
    padding: 20px;
    gap: 20px;
    background-color: #fdfdfd; /* Even lighter gray, almost white */
    border: 1px solid var(--aura-border, #f0f0f0);
    border-radius: 12px; /* Slightly more rounded */
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); /* Smoother transition */
}

.article-item:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08); /* More pronounced, softer shadow */
    border-color: var(--aura-primary, #1e9fff);
    transform: translateY(-4px); /* Upward float effect */
}

.article-item:last-child { margin-bottom: 0; }

.article-thumb-wrap {
    flex-shrink: 0;
    width: 220px;
    height: 140px;
    overflow: hidden;
    border-radius: 6px;
}

.article-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.article-item:hover .article-thumb { transform: scale(1.05); }

.article-content { flex: 1; }
.article-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
    transition: 0.2s;
}

.article-item:hover h3 { color: var(--aura-primary); }

.article-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    font-size: 14px; /* Increased from 12px for better readability */
    color: #888;
    display: flex;
    gap: 20px;
    align-items: center;
}

.article-meta span { display: inline-flex; align-items: center; gap: 4px; }
.article-meta span i { color: var(--aura-primary); font-size: 15px; }
.article-meta a { color: inherit; transition: color .3s; }
.article-meta a:hover { color: var(--aura-primary); }

/* Sidebar Widgets */
.sidebar-box { margin-bottom: 10px; }

.blogger-card {
    position: relative;
    text-align: center;
    padding: 35px 25px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all .4s ease;
}

.blogger-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(135deg, rgba(255,87,34,0.1) 0%, rgba(255,87,34,0.02) 100%);
    z-index: 0;
}

.blogger-avatar {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    margin-bottom: 18px;
    transition: all .5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    object-fit: cover;
}

.blogger-card:hover .blogger-avatar { 
    transform: scale(1.08); 
    box-shadow: 0 15px 35px rgba(255,87,34,0.2);
}

.blogger-name { 
    position: relative;
    font-weight: 800; 
    font-size: 19px; 
    margin-bottom: 8px; 
    color: #1a1a1a;
    z-index: 1;
}

.blogger-motto { 
    position: relative;
    font-size: 13.5px; 
    color: #777; 
    margin-bottom: 25px; 
    line-height: 1.6;
    z-index: 1;
}

.blogger-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid #f5f5f5;
    padding-top: 20px;
    z-index: 1;
}

.stat-item .count { font-weight: 800; color: #111; font-size: 17px; display: block; margin-bottom: 2px; }
.stat-item .label { font-size: 12px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }

/* Hot Articles (Sidebar) */
.hot-article-list { padding: 10px 0; }
.hot-article-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 12px;
    transition: 0.2s;
}

.hot-article-item:hover { background: #fefefe; }

.hot-rank {
    width: 24px;
    height: 24px;
    background: #eee;
    color: #666;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 700;
}

.hot-rank.rank-1 { background: #ff5722; color: #fff; }
.hot-rank.rank-2 { background: #ffb800; color: #fff; }
.hot-rank.rank-3 { background: #5fb878; color: #fff; }

.hot-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.hot-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    gap: 4px;
}

.hot-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #444;
}

.hot-meta {
    font-size: 12px;
    color: #999;
}

/* Popular Recommendations (Bottom) - Series Stack Effect */
.aura-popular-grid {
    margin-top: 30px;
}

.popular-card-wrap {
    position: relative;
}

.popular-card-inner {
    background: #fff;
    border: 1px solid var(--aura-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    z-index: 5;
    transition: 0.3s;
}

.popular-card-wrap:hover .popular-card-inner { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.popular-img { width: 100%; height: 160px; object-fit: cover; }
.popular-body { padding: 15px; }
.popular-body h4 { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: #333; }

/* Footer */
.aura-footer {
    background: #ffffff !important;
    border-top: 1px solid var(--aura-border);
    padding: 60px 0 30px !important;
    margin-top: 60px;
    height: auto !important;
    line-height: normal !important;
}

.footer-logo { font-size: 24px; font-weight: 700; color: var(--aura-primary); margin-bottom: 20px; font-family: 'Outfit', sans-serif;}
.footer-logo-icon { font-size: 26px; vertical-align: middle; margin-right: 5px; }
.footer-title { color: #333; margin-bottom: 25px; font-weight: 700; font-size: 16px; }
.footer-desc { color: #777; font-size: 14px; line-height: 1.8; padding-right: 50px; }
.footer-nav a { display: block; color: #666; margin-bottom: 12px; font-size: 14px; transition: 0.2s;}
.footer-nav-columns { display: flex; gap: 40px; }
.footer-nav a:hover { color: var(--aura-primary); transform: translateX(3px); }
.footer-contact { color: #666; font-size: 14px; margin-bottom: 15px; }
.footer-contact-icon { margin-right:8px; font-size: 18px; vertical-align: middle; }
.copyright { padding-top: 30px; font-size: 13px; color: #aaa; border-top: 1px solid var(--aura-border); margin-top: 20px; }

.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.section-label::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--aura-primary);
    border-radius: 2px;
}

/* Article Sort Navigation */
.article-sort-nav {
    display: flex;
    gap: 20px;
    font-size: 14px;
    font-weight: 400;
}

.article-sort-nav a {
    color: #888;
    transition: 0.2s;
}

.article-sort-nav a:hover, .article-sort-nav a.active {
    color: var(--aura-primary);
}

.text-center { text-align: center; }

a,
button,
.layui-btn {
    transition: all var(--aura-duration) var(--aura-ease);
}

/* Mobile Navigation */
.aura-mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    display: none;
    padding: 8px;
    margin-right: -8px;
    transition: color 0.3s;
}

.aura-mobile-menu-toggle:hover {
    color: var(--aura-primary);
}

.aura-mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #fff;
    z-index: 2000;
    box-shadow: 5px 0 25px rgba(0,0,0,0.1);
    transition: left 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.aura-mobile-drawer.active {
    left: 0;
}

.aura-mobile-drawer-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}

.aura-mobile-drawer-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.aura-mobile-nav {
    padding: 20px 0;
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.aura-mobile-nav-item {
    padding: 0 24px;
}

.aura-mobile-nav-item a {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    font-weight: 500;
    color: #444;
    border-bottom: 1px solid #f9f9f9;
}

.aura-mobile-nav-item.active a {
    color: var(--aura-primary);
    font-weight: 700;
}

.aura-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.aura-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .aura-main-container {
        padding-top: 72px;
    }

    .aura-mobile-menu-toggle {
        display: block;
    }

    .aura-nav {
        display: none !important;
    }

    .site-logo-text {
        font-size: 20px;
    }

    /* Carousel Adaptation */
    .home-carousel-title {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }
    
    .home-carousel-desc {
        font-size: 13px !important;
        -webkit-line-clamp: 1 !important;
    }

    .home-carousel-content {
        padding: 20px !important;
    }

    .article-item {
        flex-direction: column;
        gap: 14px;
        padding: 15px;
    }

    .article-thumb-wrap {
        width: 100%;
        height: 180px;
    }

    .article-content h3 {
        font-size: 16px;
    }

    .article-meta {
        font-size: 12.5px !important;
        flex-wrap: wrap;
        gap: 6px 10px;
    }

    /* Hide tags, top, and recommend badges in mobile article lists */
    .article-tags,
    .article-title-link .layui-badge {
        display: none !important;
    }

    .aura-footer-row {
        margin: 0 !important;
    }

    .aura-footer-row > div {
        padding: 0 !important;
    }

    .aura-footer {
        padding: 40px 20px 20px !important;
        text-align: center;
        background: #fafafa !important;
    }

    .footer-logo {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 15px;
    }

    .footer-desc {
        padding: 0 10px;
        font-size: 13px;
        color: #888;
        margin-bottom: 30px;
        line-height: 1.6;
    }
    
    .footer-title {
        margin-top: 30px;
        margin-bottom: 20px;
        font-size: 15px;
        color: #333;
        border-top: 1px dashed #eee;
        padding-top: 30px;
        display: inline-block;
        width: 60%;
    }

    .footer-nav-columns {
        justify-content: center;
        gap: 20px;
        margin-bottom: 10px;
    }

    .footer-nav-columns a {
        padding: 10px;
        background: #fff;
        border-radius: 6px;
        border: 1px solid #f0f0f0;
        margin-bottom: 10px;
        width: 120px;
    }
    
    .footer-contact-wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .footer-contact {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
        background: #fff;
        padding: 12px 20px;
        border-radius: 8px;
        border: 1px solid #f0f0f0;
        width: 80%;
    }

    .footer-contact-icon {
        margin-right: 10px;
        color: var(--aura-primary);
    }

    .copyright {
        padding-top: 25px;
        margin-top: 25px;
        border-top: 1px solid #eee;
        color: #bbb;
    }

    /* Popular Grid */
    .home-topic-grid .layui-col-md3 {
        width: 50%;
        float: left;
    }
}

@media (max-width: 480px) {
    .home-topic-grid .layui-col-md3 {
        width: 100%;
        float: none;
    }

    .article-thumb-wrap {
        height: 150px;
    }
    
    .aura-carousel-overlay {
        padding: 15px !important;
    }
    
    .home-carousel-title {
        font-size: 18px !important;
    }
}

/* Article Detail Mobile Styles */
@media (max-width: 992px) {
    .article-detail-layout .layui-col-md4 {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .article-detail-card {
        padding: 20px 15px !important;
    }

    .article-detail-title {
        font-size: 22px !important;
        line-height: 1.4 !important;
    }

    .article-detail-meta {
        flex-direction: column;
        gap: 8px !important;
        align-items: flex-start !important;
    }

    .article-detail-content {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }

    .article-detail-content img {
        margin: 15px 0 !important;
    }

    .article-prevnext-title {
        font-size: 13px !important;
    }

    .article-author-card {
        display: none; /* Hide author card on mobile detail since it is at the bottom anyway and we have basic meta at top */
    }

    .article-toc-wrap {
        display: none; /* Hide TOC on mobile by default to avoid clutter at the bottom */
    }

    .article-comment-fields-row .layui-col-md6 {
        margin-bottom: 10px;
    }

    .article-recommend-card {
        margin-bottom: 10px;
    }
}

/* Series Hero Mobile Styles */
@media (max-width: 768px) {
    .series-hero-card {
        padding: 0 10% !important; /* To perfectly match carousel */
        height: 220px !important;
        min-height: 220px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important; /* Vertically center like carousel */
        align-items: flex-start !important; /* Left align like carousel */
        text-align: left !important;
    }

    .topic-page-header,
    .hero-section {
        padding: 0 10% !important; /* To perfectly match carousel */
        height: 220px !important;
        min-height: 220px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important; /* Vertically center like carousel */
        align-items: flex-start !important; /* Left align like carousel */
        text-align: left !important;
    }

    .series-hero-title,
    .hero-title {
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
    }

    .series-hero-desc,
    .hero-desc {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin-bottom: 0 !important;
        display: -webkit-box;
        -webkit-line-clamp: 1 !important;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .series-hero-badge,
    .series-hero-meta {
        display: none !important; /* Hide badges and meta stats ONLY in classification archive */
    }

    .news-list-pagination-wrap {
        padding: 20px 0 !important;
    }
}

/* About Page Mobile Styles */
@media (max-width: 768px) {
    .aura-about-container {
        padding: 0 15px !important;
    }

    .about-hero-title {
        font-size: 28px !important;
    }

    .about-hero-subtitle {
        font-size: 14px !important;
    }

    .tech-badges {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px !important;
    }

    .tech-badge {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }

    .about-tech-grid {
        display: block !important;
    }

    .about-tech-item {
        margin-bottom: 20px;
    }

    .social-links {
        gap: 15px !important;
    }
}

/* Links Page Mobile Styles */
@media (max-width: 768px) {
    .links-page-title {
        font-size: 26px !important;
    }

    .links-page-desc {
        font-size: 14px !important;
    }

    .link-card {
        padding: 15px !important;
        margin-bottom: 10px !important;
    }

    .links-apply-title {
        font-size: 20px !important;
        margin-top: 20px !important;
    }

    .links-form-card {
        margin-top: 20px !important;
    }
}
