@charset "utf-8";

/* Layout */
.book-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0; /* Prevent overflow */
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* Article Styles */
article {
    line-height: 1.8;
}

article h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.4;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

article h2 {
    font-size: 22px;
    color: #003c7b;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

article h3 {
    font-size: 18px;
    color: #333;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 600;
}

article p {
    font-size: 16px;
    color: #444;
    margin-bottom: 15px;
    text-align: justify;
}

article strong {
    color: #333;
    font-weight: 700;
}

article mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Code & Pre */
article pre {
    background: #f6f8fa;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #e1e4e8;
}

article code {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 14px;
    color: #24292e;
    background-color: rgba(27,31,35,0.05);
    padding: 2px 4px;
    border-radius: 3px;
}

article pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 13px;
    line-height: 1.5;
    display: block;
}

/* Table */
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 15px;
}

article th, article td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

article th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

article tr:nth-child(even) {
    background-color: #fcfcfc;
}

article tr:hover {
    background-color: #f1f1f1;
}

/* Lists */
article ul, article ol {
    margin-bottom: 15px;
    padding-left: 20px;
    list-style: disc;
}

article ol {
    list-style: decimal;
}

article li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #444;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    color: #666;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination a:hover {
    color: #fff;
    background-color: #003c7b;
    border-color: #003c7b;
}

/* New Info Module in Content */
.new_info {
    margin-top: 30px;
}

.new_info h3 {
    font-size: 18px;
    border-left: 4px solid #003c7b;
    padding-left: 10px;
    margin-bottom: 15px;
    color: #333;
}

.new_info ul {
    list-style: none;
    padding: 0;
}

.new_info li {
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.new_info li:last-child {
    border-bottom: none;
}

.new_info a {
    display: flex;
    text-decoration: none;
    color: #333;
    gap: 15px;
}

.new_info .new_img {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    overflow: hidden;
    border-radius: 4px;
}

.new_info .new_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.new_info a:hover .new_img img {
    transform: scale(1.05);
}

.new_info .new_cont {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.new_info .new_cont h3 {
    margin: 0 0 5px 0;
    font-size: 14px;
    padding: 0;
    border: none;
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.new_info .new_p {
    margin: 0;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Styles */
.sidebar > div {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.sidebar h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    color: #666;
    font-size: 14px;
    transition: color 0.3s;
    display: block;
    line-height: 1.5;
}

.sidebar a:hover {
    color: #003c7b;
}

/* Sidebar Serial Numbers */
.sidebar .serial {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background: #f0f0f0;
    color: #666;
    border-radius: 4px;
    margin-right: 8px;
    font-size: 12px;
}

.sidebar .serial_ht {
    background: #e6f7ff;
    color: #1890ff;
}

.sidebar .serial_zx {
    background: #f6ffed;
    color: #52c41a;
}

.sidebar li:nth-child(1) .serial {
    background: #ff4d4f;
    color: #fff;
}

.sidebar li:nth-child(2) .serial {
    background: #fa8c16;
    color: #fff;
}

.sidebar li:nth-child(3) .serial {
    background: #fadb14;
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .book-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }
    
    article h1 {
        font-size: 24px;
    }
    
    article table {
        display: block;
        overflow-x: auto;
    }
}
