:root {
    --primary-color: #91000e;
    --secondary-color: #ffd700;
    --text-color: #333;
    --bg-color: #f8f8f8;
    --card-bg-color: #ffffff;
    --footer-bg-color: #2c2c2c;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', '微软雅黑', sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
}

.container {
    width: 95%;
    max-width: 1320px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: #c0392b;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin: 0 0 0.5em 0;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 15px;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--secondary-color);
}

/* Navigation */
.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list li {
    position: relative;
    margin: 0 10px;
}

.nav-list a {
    color: white;
    padding: 10px 15px;
    display: block;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-list > li > a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    color: var(--text-color);
    padding: 10px 20px;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: var(--bg-color);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}
.mobile-nav-toggle .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Common Section Styles */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0;
}

.more-link {
    font-size: 1rem;
}

section {
    padding: 3rem 0;
}

/* Main Feature Section */
.main-feature-section .feature-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.large-card a {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.large-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
}

.large-card h3 {
    margin: 0;
    font-size: 1.8rem;
}

.side-news-list h2 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}
.side-news-list h2:first-child {
    margin-top: 0;
}
.side-news-list ul {
    list-style: square;
    padding-left: 20px;
}
.side-news-list li {
    margin-bottom: 0.8rem;
}

.feature-card-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card-row .feature-card a {
    display: block;
    background-color: var(--card-bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card-row .feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.feature-card-row .feature-card img {
    height: 150px;
    object-fit: cover;
}

.feature-card-row .feature-card h4 {
    padding: 1rem;
    margin: 0;
    font-size: 1rem;
}

/* News List Section */
.news-list-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.news-list-column h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}

.news-list-column ul {
    list-style: none;
}
.news-list-column li {
    padding: 0.8rem 0;
    border-bottom: 1px dotted #ccc;
}
.news-list-column li:last-child {
    border-bottom: none;
}

/* Important Discourse Section */
.discourse-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.discourse-list ul { list-style: none; }
.discourse-list li {
    font-size: 1.1rem;
    padding: 0.8rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}
.discourse-list li:hover {
    background-color: #e9e9e9;
}

.discourse-video a {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
}
.video-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.discourse-video a:hover .video-overlay {
    opacity: 1;
}
.play-button {
    width: 60px;
    height: 60px;
    background-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    margin-bottom: 1rem;
    position: relative;
}
.play-button::after {
    content: '';
    position: absolute;
    top: 50%; left: 55%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 20px solid var(--primary-color);
}
.video-overlay h4 {
    font-size: 1.2rem;
    padding: 0 1rem;
}

/* Media Gallery Section */
.card-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}
.card-grid-large .card {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s;
}
.card-grid-large .card:hover {
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}
.card-grid-large .card img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Content Grid Section */
.content-grid-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}
.content-column .main-card {
    margin-bottom: 1rem;
}
.content-column .main-card img {
    border-radius: 8px;
    margin-bottom: 1rem;
}
.content-column .main-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.content-column .main-card p {
    margin: 0;
    color: #666;
}
.content-column > ul {
    list-style: square;
    padding-left: 20px;
}
.content-column > ul li {
    margin-bottom: 0.5rem;
}

/* Bookshelf section */
.bookshelf-section {
    background-color: #e9e9e9;
}
.books-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.books-grid img {
    height: 300px;
    width: auto;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.books-grid a:hover img {
    transform: scale(1.05);
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}
.gallery-card {
    background: var(--card-bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
.gallery-card img {
    height: 180px;
    width: 100%;
    object-fit: cover;
}
.gallery-card-content {
    padding: 1rem;
}
.gallery-card-content h3 {
    font-size: 1.2rem;
    margin: 0 0 0.5rem 0;
}
.gallery-card-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background-color: var(--footer-bg-color);
    color: #aaa;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}
.footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* Accordion Section */
.accordion {
    max-width: 100%;
    margin: 0 auto;
}
.accordion-item {
    background-color: var(--card-bg-color);
    border: 1px solid #ddd;
    margin-bottom: -1px; /* Collapse borders */
}
.accordion-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.accordion-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-bottom: 0;
}
.accordion-header {
    background-color: transparent;
    border: none;
    width: 100%;
    text-align: left;
    padding: 1.2rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    color: var(--text-color);
    transition: background-color 0.3s;
}
.accordion-header:hover {
    background-color: #f0f0f0;
}
.accordion-header::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary-color);
}
.accordion-item.active .accordion-header::after {
    content: '−';
}

.accordion-content {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.accordion-content p {
    margin: 0;
    padding-bottom: 1.5rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-feature-section .feature-grid {
        grid-template-columns: 1fr;
    }
    .side-news-list {
        margin-top: 2rem;
    }
    .feature-card-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .discourse-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.8rem; }
    .section-header h2 { font-size: 1.5rem; }

    /* Mobile Navigation */
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100vh;
        background-color: var(--footer-bg-color);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        padding-top: 60px;
    }
    .nav.active {
        transform: translateX(0);
    }
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-list li {
        width: 100%;
        margin: 0;
    }
    .nav-list a {
        padding: 15px 25px;
        width: 100%;
        border-radius: 0;
        box-sizing: border-box;
    }
    .dropdown:hover .dropdown-menu { display: none; } /* Disable hover on mobile */
    .dropdown-menu {
        position: static;
        display: none;
        background-color: #444;
        box-shadow: none;
        width: 100%;
    }
    .dropdown.active .dropdown-menu { display: block; }
    .dropdown-menu li a {
        padding-left: 40px;
        color: #ccc;
    }

    .mobile-nav-toggle {
        display: block;
        z-index: 1001;
        width: 30px;
        height: 30px;
    }
    .mobile-nav-toggle::before,
    .mobile-nav-toggle::after {
        content: '';
        position: absolute;
        width: 30px;
        height: 3px;
        background-color: white;
        transition: transform 0.3s, top 0.3s;
    }
    .mobile-nav-toggle::before {
        top: 30px;
    }
    .mobile-nav-toggle::after {
        top: 42px;
    }
    .nav-open .mobile-nav-toggle::before {
        top: 36px;
        transform: rotate(45deg);
    }
    .nav-open .mobile-nav-toggle::after {
        top: 36px;
        transform: rotate(-45deg);
    }

    .news-list-section, .content-grid-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .feature-card-row {
        grid-template-columns: 1fr;
    }
}

/* AI Chat Assistant */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s;
    z-index: 1001;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-toggle-btn img {
    width: 32px;
    height: 32px;
}

.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
    z-index: 1000;
}

.chat-widget.active {
    transform: scale(1);
}

.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close-chat-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.chat-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    max-width: 90%;
}

.chat-message p {
    margin: 0;
    padding: 0.8rem 1rem;
    border-radius: 18px;
    line-height: 1.5;
}

.chat-message.user {
    justify-content: flex-end;
    margin-left: auto;
}

.chat-message.user p {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.ai p {
    background-color: #e9e9eb;
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.chat-footer {
    padding: 0.8rem;
    border-top: 1px solid #ddd;
}

.chat-form {
    display: flex;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 0.7rem 1.2rem;
    margin-left: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.chat-form button:hover {
    background-color: #a1000f;
}
