/* ============================================
   列表/封面通用样式（分类导航、列表项、分页、Tab切换）
   ============================================ */

/* ===== 主体容器 ===== */
.main-content {
    background: var(--content-bg);
    padding: 24px 32px 32px;
    margin: 0 0 20px 0;
    border-radius: var(--radius-main);
}
/* 封面模板专用（更小的内边距） */
.cover-page {
    padding: 24px 20px 20px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 18px;
    border-left: 4px solid var(--primary);
    padding-left: 16px;
}

/* ===== 区块标题 ===== */
.section-title {
    font-size: 19px;
    font-weight: 700;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title .bar {
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 3px;
    flex-shrink: 0;
}

/* ===== 列表项样式 ===== */
.list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    margin: 0;
}
.list-item:last-child {
    border-bottom: none;
}
.list-col {
    display: flex;
    align-items: center;
}
.list-col-main {
    flex: 1 1 70%;
    min-width: 0;
}
.list-col-extra {
    flex: 0 0 auto;
    text-align: right;
}
.list-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-category {
    display: inline-block;
    margin-right: 8px;
    font-size: 13px;
}
.list-link {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}
.list-link:hover {
    color: var(--primary);
    text-decoration: underline;
}
.list-category .list-link {
    color: var(--primary);
    font-weight: 600;
}
.list-category .list-link:hover {
    color: var(--primary-hover);
}
.list-date {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===== 分页 ===== */
.pagebar {
    text-align: center;
    padding: 20px 0 8px;
    font-size: 14px;
}
.pagebar a, .pagebar .current {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 2px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-main);
}
.pagebar a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pagebar .current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

/* ============================================
   分类导航
   ============================================ */
.category-nav {
    background: #f8f9fc;
    border-radius: 8px;
    padding: 14px 20px;
    margin: 6px 0 20px 0;
    border-left: 4px solid var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 8px;
}
.cat-label {
    font-weight: 700;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.8;
    white-space: nowrap;
}
.cat-link-all {
    font-weight: 600;
    color: var(--primary);
    padding: 0 6px;
    border-radius: 3px;
    line-height: 1.8;
    white-space: nowrap;
}
.cat-link-all:hover {
    background: var(--primary);
    color: #fff;
}
.category-list-wrap {
    flex: 1 1 70%;
    min-width: 200px;
    position: relative;
    max-height: 3.6em;
    overflow: hidden;
    transition: max-height 0.5s ease;
    cursor: pointer;
    line-height: 1.8;
    padding-right: 30px;
}
.category-list-wrap:hover {
    max-height: 600px;
}
.category-list-wrap::after {
    content: "▼";
    position: absolute;
    right: 4px;
    top: 0;
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s;
    pointer-events: none;
    background: #f8f9fc;
    padding-left: 6px;
}
.category-list-wrap:hover::after {
    content: "▲";
}
.category-list-wrap.no-arrow::after {
    display: none;
}
.category-list-wrap a {
    display: inline-block;
    color: var(--text-muted);
    padding: 0 8px;
    margin: 0 2px 2px 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.8;
    transition: background 0.2s, color 0.2s;
    background: transparent;
    white-space: nowrap;
}
.category-list-wrap a:hover {
    background: var(--primary);
    color: #fff !important;
}
.category-list-wrap a:not(:last-child)::after {
    content: "|";
    color: var(--border-light);
    margin-left: 6px;
    font-weight: 300;
}

/* ============================================
   Tab 切换样式
   ============================================ */
.tab-section {
    margin-top: 30px;
}
.tab-container {
    position: relative;
    margin-top: 10px;
}
.tab-container input[type="radio"] {
    display: none;
}
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 0;
    gap: 0;
}
.tab-nav label {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-bottom: -2px;
    background: transparent;
    border-radius: 0;
}
.tab-nav label:hover {
    color: var(--primary);
}
#tab1:checked ~ .tab-nav label[for="tab1"],
#tab2:checked ~ .tab-nav label[for="tab2"],
#tab3:checked ~ .tab-nav label[for="tab3"] {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-content-wrapper {
    padding-top: 10px;
}
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
#tab1:checked ~ .tab-content-wrapper #content1,
#tab2:checked ~ .tab-content-wrapper #content2,
#tab3:checked ~ .tab-content-wrapper #content3 {
    display: block;
}
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ===== 列表/封面响应式 ===== */
@media (max-width: 640px) {
    .main-content { padding: 16px; }
    .page-title { font-size: 20px; }
    .list-item { flex-direction: column; align-items: flex-start; gap: 4px; }
    .list-col-main { flex: 1 1 100%; width: 100%; }
    .list-col-extra { flex: 0 0 auto; width: 100%; text-align: left; }
    .list-title { white-space: normal; word-break: break-word; }
    .category-nav { padding: 10px 14px; flex-direction: column; align-items: stretch; gap: 4px; }
    .category-list-wrap { flex: 1 1 100%; min-width: 0; padding-right: 24px; }
    .category-list-wrap a { font-size: 13px; padding: 0 4px; }
    .tab-nav label { padding: 8px 16px; font-size: 14px; }
}