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

body {
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #428bca;
    transition: color 0.3s;
}

a:hover {
    color: #3071a9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #428bca;
}

.nav {
    margin-left: 40px;
    flex: 1;
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav ul li {
    margin-right: 25px;
}

.nav ul li a {
    color: #666;
    font-size: 15px;
    font-weight: 500;
}

.nav ul li a:hover {
    color: #428bca;
}

.search-bar {
    position: relative;
}

.search-bar input {
    padding: 8px 35px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    width: 220px;
    font-size: 14px;
}

.search-bar button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
}

/* Main Layout */
.main-content {
    display: flex;
    margin-top: 20px;
    margin-bottom: 40px;
}

.content-area {
    flex: 1;
    margin-right: 20px;
    min-width: 0;
    overflow: hidden;
}

.sidebar {
    width: 300px;
}

/* Article List */
.article-list {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}

.article-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
}

.article-item:last-child {
    border-bottom: none;
}

.article-thumb {
    width: 220px;
    height: 140px;
    margin-right: 20px;
    overflow: hidden;
    border-radius: 4px;
}

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

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

.article-info {
    flex: 1;
}

.article-info h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.article-info h2 a {
    color: #333;
}

.article-info h2 a:hover {
    color: #428bca;
}

.article-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

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

.article-summary {
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Content images - prevent overflow */
.content-body img,
.download-body img {
    max-width: 100%;
    height: auto;
}

/* Sidebar Widgets */
.widget {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.widget h3 {
    font-size: 16px;
    border-left: 4px solid #428bca;
    padding-left: 10px;
    margin-bottom: 15px;
}

.hot-list {
    list-style: none;
}

.hot-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 14px;
}

.hot-list li:last-child {
    border-bottom: none;
}

/* Nav Toggle (hamburger - mobile only) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    margin-right: 10px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #428bca;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* Nav search (inside mobile menu) */
.nav-search {
    display: none;
    padding: 15px 20px;
}

.nav-search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.nav-search button {
    display: none;
}

/* Article detail */
.article-detail {
    word-break: break-word;
}

.content-body video,
.content-body iframe,
.download-body video,
.download-body iframe {
    max-width: 100%;
    height: auto;
}

.pagination {
    flex-wrap: wrap;
}

.pagination .page-link {
    min-width: 36px;
    text-align: center;
}

/* ===========================================
   Responsive - Tablet (max-width: 992px)
   =========================================== */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }

    .content-area {
        margin-right: 0;
    }

    .sidebar {
        width: 100%;
        margin-top: 20px;
    }

    .article-item {
        flex-direction: column;
    }

    .article-thumb {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .header {
        height: 56px;
    }

    .nav ul li {
        margin-right: 15px;
    }

    .nav ul li a {
        font-size: 14px;
    }

    .search-bar input {
        width: 160px;
    }

    .logo a {
        font-size: 20px;
    }

    .article-detail {
        padding: 20px !important;
    }

    .download-section {
        padding: 20px !important;
    }
}

/* ===========================================
   Responsive - Phone (max-width: 768px)
   =========================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    /* Header mobile */
    .header .container {
        justify-content: flex-start;
    }

    .nav-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: #fff;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
        padding-top: 70px;
        transition: right 0.3s ease;
        overflow-y: auto;
        z-index: 999;
    }

    .nav.active {
        right: 0;
    }

    .nav ul {
        flex-direction: column;
    }

    .nav ul li {
        margin-right: 0;
    }

    .nav ul li a {
        display: block;
        padding: 12px 20px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 15px;
    }

    .nav-search {
        display: block;
    }

    .search-bar {
        display: none;
    }

    /* Article list */
    .article-thumb {
        height: 180px;
    }

    .article-info h2 {
        font-size: 16px;
    }

    .article-summary {
        font-size: 13px;
    }

    .article-meta {
        font-size: 11px;
    }

    .article-meta span {
        margin-right: 10px;
    }

    /* Detail page */
    .detail-header h1 {
        font-size: 20px !important;
    }

    .detail-content {
        font-size: 15px !important;
    }

    .download-section h3 {
        font-size: 16px !important;
    }

    /* Pagination */
    .pagination {
        gap: 5px;
    }

    .pagination .page-link {
        padding: 4px 10px;
        font-size: 13px;
    }

    /* Sidebar */
    .widget {
        padding: 15px;
    }

    .widget h3 {
        font-size: 15px;
    }

    .hot-list li {
        font-size: 13px;
    }

    /* Table (for any inline tables) */
    .content-body table,
    .download-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ===========================================
   Responsive - Small Phone (max-width: 480px)
   =========================================== */
@media (max-width: 480px) {
    .header {
        height: 50px;
    }

    .logo a {
        font-size: 17px;
    }

    .article-item {
        padding: 15px;
    }

    .article-thumb {
        height: 150px;
    }

    .article-info h2 {
        font-size: 15px;
    }

    .article-meta {
        font-size: 11px;
    }

    .detail-header h1 {
        font-size: 18px !important;
    }

    .article-detail {
        padding: 15px !important;
    }

    .summary-box {
        padding: 12px !important;
    }

    .download-section {
        padding: 15px !important;
        margin-top: 30px !important;
    }

    .footer {
        padding: 20px 0;
        font-size: 12px;
    }
}

/* Footer */
.footer {
    background: #fff;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 13px;
}

.footer p {
    margin-bottom: 5px;
}
