/* ============================================================
   资料库：列表页 + 详情页
   ============================================================ */
body.zl-body {
    display: block;
    justify-content: flex-start;
    align-items: stretch;
    padding: 26px 20px 150px;
    min-height: 100vh;
}

.zl-wrap { width: 100%; max-width: 1180px; margin: 0 auto; }

.zl-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}
.zl-head h1 {
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 6px;
    color: #3d3328;
    font-family: "Times New Roman", "Songti SC", serif;
}
.zl-head h1 span {
    display: inline-block;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 20px;
    color: #fff;
    background: #b53b3b;
    padding: 2px 12px 4px;
    border-radius: 4px;
    transform: translateY(-2px) rotate(-1.5deg);
    font-family: "KaiTi", "楷体", serif;
    box-shadow: 0 3px 10px rgba(181, 59, 59, 0.25);
}
.zl-sub { font-size: 13px; color: #8a7a6a; letter-spacing: 1px; margin-bottom: 20px; }

/* ===== 列表 ===== */
.zl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.zl-card {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 253, 250, 0.95);
    border: 1px solid rgba(184, 164, 140, 0.28);
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 6px 22px rgba(60, 45, 30, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    min-width: 0;
}
.zl-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(60, 45, 30, 0.14);
    border-color: rgba(139, 92, 246, 0.45);
    text-decoration: none;
}
.zl-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: linear-gradient(150deg, #f6f2ea, #e8ddcc);
    box-shadow: inset 0 0 0 1px rgba(184, 164, 140, 0.3);
}
.zl-info { min-width: 0; flex: 1; }
.zl-name {
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #1a1008;
    font-family: "Songti SC", "Times New Roman", serif;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zl-desc {
    font-size: 12.5px;
    line-height: 1.7;
    color: #8a7a6a;
    font-family: "KaiTi", "楷体", serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.zl-meta { font-size: 11.5px; color: #a99c8d; letter-spacing: 0.5px; }

.zl-empty {
    text-align: center;
    color: #9a8a7a;
    padding: 70px 24px;
    font-size: 14px;
    letter-spacing: 1px;
    background: rgba(255, 253, 250, 0.9);
    border: 1px solid rgba(184, 164, 140, 0.28);
    border-radius: 18px;
}
.zl-empty .big { font-size: 44px; opacity: 0.45; margin-bottom: 14px; }

/* ===== 详情页 ===== */
.zl-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 16px;
    font-size: 13.5px;
    color: #8a7a6a;
    text-decoration: none;
    letter-spacing: 1px;
}
.zl-back:hover { color: #b53b3b; text-decoration: none; }

.zl-detail {
    background: rgba(255, 253, 250, 0.95);
    border: 1px solid rgba(184, 164, 140, 0.28);
    border-radius: 18px;
    padding: 24px 26px;
    box-shadow: 0 10px 34px rgba(60, 45, 30, 0.07);
}
.zl-detail-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(184, 164, 140, 0.25);
    flex-wrap: wrap;
}
.zl-detail-head .zl-icon { width: 64px; height: 64px; font-size: 32px; }
.zl-detail-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #1a1008;
    font-family: "Songti SC", "Times New Roman", serif;
    line-height: 1.4;
}
.zl-detail-meta { font-size: 12.5px; color: #8a7a6a; margin-top: 6px; letter-spacing: 0.5px; }
.zl-detail-desc {
    font-size: 14.5px;
    line-height: 2;
    color: #3d3328;
    margin-bottom: 18px;
    white-space: pre-wrap;
}
.zl-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.zl-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    background: #2b2b30;
    color: #fff;
    border: 1px solid #2b2b30;
    transition: 0.2s;
}
.zl-btn:hover { background: #000; color: #fff; text-decoration: none; transform: translateY(-1px); }
.zl-btn.gray { background: #efe8de; color: #3d3328; border-color: #e0d5c6; }
.zl-btn.gray:hover { background: #e3d9cb; color: #3d3328; }

.zl-viewer {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(184, 164, 140, 0.3);
    background: #f7f3ee;
}
.zl-viewer iframe { display: block; width: 100%; height: 76vh; min-height: 460px; border: 0; background: #fff; }
.zl-viewer pre {
    margin: 0;
    padding: 20px 22px;
    max-height: 76vh;
    overflow: auto;
    font: 13.5px/1.9 Consolas, "Microsoft YaHei", monospace;
    color: #2b2b30;
    white-space: pre-wrap;
    word-break: break-word;
}
.zl-viewer .zl-noview {
    padding: 44px 20px;
    text-align: center;
    color: #8a7a6a;
    font-size: 14px;
    line-height: 2;
}
.zl-viewer .zl-noview .big { font-size: 44px; opacity: 0.5; margin-bottom: 10px; }

/* 暗色模式 */
body.dark-mode .zl-head h1 { color: #e8e0d4; }
body.dark-mode .zl-card,
body.dark-mode .zl-detail,
body.dark-mode .zl-empty { background: rgba(28, 32, 46, 0.92); border-color: rgba(120, 130, 180, 0.25); }
body.dark-mode .zl-name,
body.dark-mode .zl-detail-title { color: #ece8e0; }
body.dark-mode .zl-detail-desc { color: #d8d2c8; }
body.dark-mode .zl-icon { background: linear-gradient(150deg, #2a2f3e, #1e2330); }
body.dark-mode .zl-viewer { background: #1b1f2a; border-color: rgba(120, 130, 180, 0.25); }
body.dark-mode .zl-viewer pre { color: #d8d2c8; }
body.dark-mode .zl-viewer iframe { background: #fff; }
body.dark-mode .zl-btn.gray { background: #2a2f3e; color: #d8d2c8; border-color: #3a4152; }

@media (max-width: 700px) {
    body.zl-body { padding: 0px 12px 92px; }
    .zl-head h1 { font-size: 18px; letter-spacing: 4px; }
    .zl-head h1 span { font-size: 20px; }
    .zl-grid { grid-template-columns: 1fr; gap: 12px; max-width: 460px; margin: 0 auto; }
    .zl-detail { padding: 18px 16px; }
    .zl-detail-title { font-size: 18px; letter-spacing: 1px; }
    .zl-viewer iframe { height: 62vh; min-height: 340px; }
}
