/*
 * Theme Name: 极简北欧 (Nordic Minimalism)
 * Author: Manus AI
 * Description: A minimalist, content-focused theme inspired by Scandinavian design principles.
 * Version: 1.0
 */

/* 1. Root Variables & Global Styles
-------------------------------------------------------------- */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --line-color: #e5e5e5;
    --meta-color: #999999;
    --accent-color: #4a90d9;
    --warm-bg-color: #f5f0eb;
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: "Georgia", "Times New Roman", serif;
    --content-width: 800px;
    --transition-speed: 0.3s;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.5rem; }
p { margin-bottom: 1.2em; }

.container {
    max-width: calc(var(--content-width) + 300px); /* 800px content + 300px sidebar + gap */
    margin: 0 auto;
    padding: 0 20px;
}

.hidden-stats {
    display: none;
}

/* 2. Header
-------------------------------------------------------------- */
.header {
    padding: 25px 0;
    border-bottom: 1px solid var(--line-color);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    width: 160px;
    height: auto;
}

.navigation ul {
    display: flex;
}

.navigation li a {
    padding: 10px 15px;
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
}

.navigation li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-speed) ease;
}

.navigation li a:hover::after {
    width: 80%;
}

.search-bar {
    position: relative;
}

.search-bar input {
    border: 1px solid var(--line-color);
    border-radius: 20px;
    padding: 8px 15px;
    width: 200px;
    transition: all var(--transition-speed) ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-color);
    width: 230px;
}

.search-bar button {
    display: none; /* Hidden, form submits on enter */
}

/* 3. Main Content & Layout
-------------------------------------------------------------- */
.main-content {
    padding: 40px 0;
}

.content-wrapper {
    display: flex;
    gap: 40px;
}

.main-col {
    flex: 1;
    min-width: 0; /* Prevents flexbox overflow */
}

.side-col {
    flex-basis: 280px;
    flex-shrink: 0;
}

/* Homepage specific: single column */
body:has(.hero-section) .content-wrapper {
    display: block;
}

body:has(.hero-section) .main-col {
    max-width: var(--content-width);
    margin: 0 auto;
}

body:has(.hero-section) .side-col {
    display: none;
}

.section-title-container {
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.section-title {
    font-size: 2.5rem;
    font-family: var(--font-serif);
}

.title-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--line-color);
    overflow: hidden;
}

.title-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--accent-color);
    animation: line-extend 1.5s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes line-extend {
    to {
        left: 0;
    }
}

/* 4. Homepage Styles
-------------------------------------------------------------- */
.hero-section {
    text-align: center;
    padding: 80px 0;
    background-color: var(--warm-bg-color);
    margin-bottom: 60px;
}

.hero-title {
    font-size: 3.5rem;
    font-family: var(--font-serif);
    margin-bottom: 0.2em;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--meta-color);
    max-width: 500px;
    margin: 0 auto;
}

.article-list-fullwidth .card-fullwidth {
    margin-bottom: 60px;
}

.card-fullwidth .card-image-link {
    display: block;
    overflow: hidden;
    margin-bottom: 20px;
}

.card-fullwidth .card-image-wrapper {
    position: relative;
}

.card-fullwidth .card-image {
    width: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-fullwidth .card-image-link:hover .card-image {
    transform: scale(1.02);
}

.card-fullwidth .card-title {
    font-size: 2rem;
    font-weight: 600;
    font-family: var(--font-serif);
}

.card-fullwidth .card-title a {
    background-image: linear-gradient(var(--accent-color), var(--accent-color));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size .3s;
}

.card-fullwidth .card-title a:hover {
    background-size: 100% 2px;
}

/* 5. List Page Styles
-------------------------------------------------------------- */
.breadcrumb-nav {
    padding: 15px 0;
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: var(--meta-color);
    border-bottom: 1px solid var(--line-color);
}

.breadcrumb-nav a:hover {
    color: var(--accent-color);
}

.article-list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 30px;
}

.card-grid .card-image-link {
    display: block;
    overflow: hidden;
    margin-bottom: 15px;
}

.card-grid .card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.card-grid .card-image-link:hover .card-image {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.card-grid .card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.card-grid .card-meta {
    font-size: 0.85rem;
    color: var(--meta-color);
}

.pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid var(--line-color);
    min-width: 40px;
    text-align: center;
    transition: all var(--transition-speed) ease;
}

.pagination a:hover, .pagination span.current {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.pagination span.current {
    cursor: default;
}

/* 6. Show Page Styles
-------------------------------------------------------------- */
.article-content {
    max-width: var(--content-width);
    margin: 0 auto;
}

.article-title {
    font-size: 3.2rem;
    font-family: var(--font-serif);
    margin-bottom: 20px;
    text-align: center;
}

.article-meta {
    text-align: center;
    color: var(--meta-color);
    margin-bottom: 40px;
    font-size: 0.9rem;
}

.article-meta span {
    margin: 0 15px;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-body p {
    margin-bottom: 1.5em;
}

.article-body h2, .article-body h3 {
    margin-top: 2em;
    margin-bottom: 1em;
}

.video-player-container, .article-poster-image {
    margin-bottom: 30px;
    width: 100%;
}

.article-pagination {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--line-color);
    display: flex;
    justify-content: space-between;
    color: var(--meta-color);
}

.related-articles {
    margin-top: 60px;
}

/* 7. Sidebar (Right)
-------------------------------------------------------------- */
.sidebar .widget {
    margin-bottom: 40px;
    padding: 20px;
    background-color: var(--warm-bg-color);
}

.sidebar .widget-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-color);
    position: relative;
}

.sidebar .widget-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 1px;
    background-color: var(--accent-color);
}

.widget-ranking li {
    margin-bottom: 15px;
}

.widget-ranking a {
    display: flex;
    align-items: baseline;
}

.widget-ranking span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--meta-color);
    margin-right: 10px;
    min-width: 20px;
}

.widget-recommend li {
    display: flex;
    margin-bottom: 15px;
}

.widget-thumb {
    flex-shrink: 0;
    width: 80px;
    margin-right: 15px;
}

.widget-thumb img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.widget-info h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.widget-info p {
    font-size: 0.8rem;
    color: var(--meta-color);
    margin: 0;
}

.widget-category ul li a, .widget-links ul li a {
    display: block;
    padding: 8px 0;
    border-bottom: 1px dashed var(--line-color);
}

/* 8. Footer
-------------------------------------------------------------- */
.footer {
    background-color: var(--text-color);
    color: #a0a0a0;
    padding: 60px 0 0;
    font-size: 0.9rem;
}

.footer a {
    color: #a0a0a0;
}

.footer a:hover {
    color: var(--bg-color);
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding-bottom: 40px;
}

.footer-column h3 {
    color: var(--bg-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding: 25px 0;
    text-align: center;
    color: #666;
}

/* 9. Animations & Effects
-------------------------------------------------------------- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

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

/* Staggered animations for lists */
.fade-in-up:nth-child(1) { animation-delay: 0.1s; }
.fade-in-up:nth-child(2) { animation-delay: 0.2s; }
.fade-in-up:nth-child(3) { animation-delay: 0.3s; }
.fade-in-up:nth-child(4) { animation-delay: 0.4s; }
.fade-in-up:nth-child(5) { animation-delay: 0.5s; }
.fade-in-up:nth-child(6) { animation-delay: 0.6s; }

.text-fade-in {
    opacity: 0;
    animation: textFadeIn 1s ease forwards;
}

@keyframes textFadeIn {
    to {
        opacity: 1;
    }
}

/* 10. FAQ Section
-------------------------------------------------------------- */
.faq-section {
    max-width: var(--content-width);
    margin: 60px auto 0;
}

.faq-item {
    border-bottom: 1px solid var(--line-color);
}

.faq-question {
    font-size: 1.2rem;
    font-weight: 500;
    padding: 20px 0;
    cursor: pointer;
    position: relative;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform var(--transition-speed) ease;
}

.faq-item.active .faq-question::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.faq-answer p {
    padding: 0 10px 20px;
    font-size: 1rem;
    color: #555;
}

/* 11. Anti-Interference Styles
-------------------------------------------------------------- */
.xf7k2m .qw3p8n, .zt9v1x {
    opacity: 0.99;
    position: relative;
    z-index: 1;
}

.hidden-text-chunk {
    display: none;
    visibility: hidden;
}

/* 12. Responsive Design
-------------------------------------------------------------- */

/* For Tablets (<= 1024px) */
@media (max-width: 1024px) {
    :root {
        --content-width: 100%;
    }

    .container {
        max-width: 960px;
    }

    .content-wrapper {
        flex-direction: column;
    }

    .side-col {
        flex-basis: auto;
        margin-top: 40px;
    }

    .navigation {
        display: none; /* Simple responsive, could be replaced by a mobile menu */
    }

    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* For Mobile (<= 768px) */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .article-title { font-size: 2.5rem; }

    .header .container {
        flex-direction: column;
        gap: 20px;
    }

    .hero-section {
        padding: 60px 20px;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .article-list-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .article-meta span {
        display: block;
        margin: 5px 0;
    }

    .footer-columns {
        grid-template-columns: 1fr;
    }
}

/* For Small Mobile (<= 480px) */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    .article-title { font-size: 2rem; }

    .main-content {
        padding: 20px 0;
    }

    .container {
        padding: 0 15px;
    }

    .search-bar input {
        width: 100%;
    }

    .search-bar input:focus {
        width: 100%;
    }

    .pagination a, .pagination span {
        padding: 8px 12px;
        min-width: 35px;
    }
}

