@charset "utf-8";

/* ==========================================================
   知行课堂 · 全站样式
   风格：白底黑字 + 细灰线，不用色块、不用阴影、不用圆角

   尺度原则：不写死像素
   1) 容器宽度 = 100%，只靠 clamp 留边（16px ~ 80px）
   2) 字号用 clamp(14px, 0.3vw + 11px, 16px)，随屏幕缓慢放大
   3) 其余尺寸一律用 em，跟着字号等比缩放，永远挤不坏
   ========================================================== */

* { box-sizing: border-box; }

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    background: #fff;
    color: #111;
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: clamp(14px, 0.3vw + 11px, 16px);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;

    /* 整页变成一个竖向弹性盒：页头 + 内容 + 页脚，
       内容区自己吃掉剩余高度，不用算 100vh 减多少 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #111;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

hr {
    border: 0;
    border-top: 1px solid #e5e5e5;
    margin: 1.3em 0;
}

/* ---------- 页头 ---------- */
.hd {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;   /* 页头（知行课堂）下留一条浅灰线 */
}

.hd-in {
    width: 100%;
    padding: clamp(1.2em, 1.8vw, 1.8em) clamp(16px, 4vw, 80px);
    min-height: 9.2em;   /* 页头再加高一倍，标题栏更醒目 */
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: clamp(10px, 1.4vw, 24px);
}

/* 左侧 logo 方块 */
.mark {
    justify-self: start;
    width: 3.6em;
    height: 3.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff;
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: .12em;
    text-indent: .12em;
    flex: none;
}

.mark:hover {
    text-decoration: none;
    background: #333;
}

.logo {
    justify-self: center;
    font-size: clamp(2.1em, 2.7vw, 2.7em);
    font-weight: 700;
    letter-spacing: .06em;
    text-align: center;
    white-space: nowrap;
}

.logo:hover {
    text-decoration: none;
}

/* 右侧「我的下载 / 后台」：靠右，与左侧 logo 对称，标题始终居中 */
.hd-in .r {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1.3em;
    text-align: right;
    font-size: .95em;
    color: #666;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .hd-in {
        grid-template-columns: auto 1fr auto;
    }

    .logo {
        white-space: normal;
        font-size: 1.6em;
    }
}

.hd-in .r a {
    color: #666;
}

.hd-in .r a:hover {
    color: #111;
}

/* ---------- 容器：铺满窗口，只靠 padding 留边 ---------- */
.wrap {
    width: 100%;
    margin: 0;
    padding: 0 clamp(16px, 4vw, 80px);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ---------- 标题区 ---------- */
.bar {
    display: flex;
    align-items: baseline;
    gap: .9em;
    padding: 2em 0 1em;
    flex-wrap: wrap;
}

.bar h1 {
    margin: 0;
    font-size: 1.35em;
    font-weight: 700;
    letter-spacing: .03em;
}

.bar .n {
    font-size: .86em;
    color: #888;
}

/* 铺满一屏时标题区收紧，别吃掉格子的高度 */
.bar-sm {
    padding: .9em 0 .6em;
}

/* ---------- 文件清单 ---------- */
.list {
    border-top: 1px solid #dcdcdc;
}

.row {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: .65em 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: .96em;
}

.row:hover {
    background: #fafafa;
}

.row .idx {
    flex: none;
    width: 2.2em;
    color: #bbb;
    font-size: .86em;
    text-align: right;
}

.row .nm {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row .nm a {
    font-weight: 500;
}

/* 大小列：右缘固定，数字短也照样右对齐成一列 */
.row .sz {
    flex: none;
    min-width: 4.6em;
    text-align: right;
    color: #888;
    font-size: .86em;
    font-variant-numeric: tabular-nums;
}

/* 按钮列不设宽，由按钮自身撑开，字号变了也不会裁 */
.row .ac {
    flex: none;
    text-align: right;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    border: 1px solid #111;
    background: #111;
    color: #fff;
    padding: .5em 1.1em;
    font-size: .93em;
    line-height: 1.2;
    cursor: pointer;
    font-family: inherit;
    border-radius: 2px;
    white-space: nowrap;
}

.btn:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

.btn-sm {
    padding: .22em .7em;
    font-size: .86em;
}

.btn-line {
    background: #fff;
    color: #111;
}

.btn-line:hover {
    background: #f2f2f2;
    color: #111;
}

/* ---------- 空状态 / 页脚 ---------- */
.empty {
    padding: 2.8em 0;
    color: #999;
    font-size: .93em;
    text-align: center;
}

/* ---------- 后台：分类标签 + 分页 ---------- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.tab {
    display: inline-block;
    padding: .42em .9em;
    border: 1px solid #e5e5e5;
    color: #555;
    font-size: .92em;
    line-height: 1.4;
}

.tab:hover {
    text-decoration: none;
    border-color: #999;
    color: #111;
}

.tab.on {
    border-color: #111;
    color: #111;
    font-weight: 700;
}

.tab b {
    font-weight: 400;
    color: #999;
    margin-left: .3em;
    font-variant-numeric: tabular-nums;
}

.tab.on b {
    color: #111;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 16px 0 30px;
    font-size: .92em;
}

.pg {
    min-width: 2.4em;
    padding: .32em .7em;
    text-align: center;
    border: 1px solid #e5e5e5;
    color: #555;
}

.pg:hover {
    text-decoration: none;
    border-color: #999;
    color: #111;
}

.pg.on {
    border-color: #111;
    color: #111;
    font-weight: 700;
}

/* 后台栏目管理：一行一个名字输入框 */
.catlines {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    margin-bottom: 14px;
}

/* 栏目区与上传区：左右并排一大块，中间竖线分开 */
.box-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(24px, 3vw, 64px);
    align-items: start;
}

.box-col {
    min-width: 0;
}

.box-col.sep {
    border-left: 1px solid #ececec;
    padding-left: clamp(20px, 2vw, 48px);
}

@media (max-width: 1100px) {
    .box-row {
        grid-template-columns: 1fr;
        row-gap: 20px;
    }

    .box-col.sep {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid #ececec;
        padding-top: 18px;
    }
}

/* 同一个盒子内，栏目区与上传区之间的分隔线 */
.box-sep {
    border-top: 1px solid #ececec;
    margin: 18px 0 16px;
}

.catline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catline input[type="text"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

/* 更多页（单栏目全列表）：区内两栏 + 分页 */
.list-cat {
    column-count: 2;
    column-gap: clamp(20px, 2.2vw, 60px);
    column-rule: 1px solid #eeeeee;
}

.list-cat .row {
    break-inside: avoid;
    align-items: center;
}

/* 两个按钮横向并排；按钮组定宽并右对齐，每行上下对齐成一条竖线 */
.list-cat .ac {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: none;
    width: 10.8em;
    margin-left: .7em;
}

.list-cat .ac .btn {
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
}

/* 大小这一列也定宽，跟按钮组一起对齐 */
.list-cat .sz {
    flex: none;
    width: 5.4em;
    text-align: right;
}

@media (max-width: 1100px) {
    .list-cat {
        column-count: 1;
        column-rule: 0;
    }
}

/* 后台文件列表：左右两栏 */
.list2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(24px, 3vw, 72px);
}

.list2 > .row {
    min-width: 0;
}

@media (max-width: 1200px) {
    .list2 {
        grid-template-columns: 1fr;
    }
}

.ft {
    margin-top: 1em;
    padding: 1.2em 0;
    border-top: 1px solid #e5e5e5;   /* 页脚（知行课堂 · 本机调试）上方一条浅灰线 */
    color: #aaa;
    font-size: .86em;
    text-align: center;
}

/* ---------- 后台表单 ---------- */
.box {
    border: 1px solid #e0e0e0;
    padding: clamp(14px, 1.6vw, 26px);
    margin-bottom: 1.2em;
}

/* 保存成功后的提示小条 */
.save-toast {
    position: fixed;
    left: 50%;
    bottom: 8vh;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: .7em 1.4em;
    font-size: .95em;
    border-radius: 3px;
    z-index: 9999;
    opacity: 1;
    transition: opacity .5s;
}
.save-toast-hide { opacity: 0; }

.fld {
    margin-bottom: 1em;
}

label {
    display: block;
    font-size: .86em;
    color: #666;
    margin: 0 0 .45em;
}

input[type=text],
input[type=password],
input[type=number] {
    width: 100%;
    border: 1px solid #d5d5d5;
    padding: .65em .8em;
    font-size: .93em;
    font-family: inherit;
    border-radius: 2px;
    outline: none;
    background: #fff;
}

input:focus {
    border-color: #111;
}

.msg {
    padding: .7em 1em;
    font-size: .93em;
    margin-bottom: 1.1em;
    border-left: 3px solid #111;
    background: #f6f6f6;
    color: #111;
}

.msg.err {
    border-left-color: #a4322a;
    background: #fdf2f1;
    color: #a4322a;
}

select {
    border: 1px solid #d5d5d5;
    background: #fff;
    color: #111;
    padding: .3em .5em;
    font-size: .86em;
    font-family: inherit;
    border-radius: 2px;
    outline: none;
    max-width: 100%;
}

select:focus {
    border-color: #111;
}

/* ---------- 后台文案 ---------- */
.lead {
    margin: 0 0 .3em;
    font-size: 1.15em;
    font-weight: 600;
}

.sub {
    margin: 0 0 1.2em;
    font-size: .86em;
    color: #777;
}

.hint {
    font-size: .8em;
    color: #999;
    line-height: 1.9;
    margin-bottom: 1em;
}

.form-foot {
    padding: 1em 0 .3em;
}

/* ---------- 四栏分区：2×2 ---------- */
.grid4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(24px, 3vw, 72px);
    row-gap: 0;
    padding-bottom: .7em;
}

.sec {
    padding: clamp(16px, 1.6vw, 30px) 0;
    min-width: 0;   /* 网格里允许收缩，长文件名才会出省略号而不是撑破 */
}

.sec-hd {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .8em;
    border-bottom: 1px solid #111;
    padding-bottom: .2em;   /* 标题下沿贴紧第一行文件 */
}

.sec-hd h2 {
    margin: 0;
    font-size: 1.35em;   /* 区标题放大一号，一眼能抓住 */
    font-weight: 700;
    letter-spacing: .09em;
}

.sec-hd .cnt {
    flex: none;
    font-size: .82em;
    color: #999;
    font-variant-numeric: tabular-nums;
}

/* ---------- 首页版式 ----------
   只剩四个栏目区（2 行 × 2 列），四区平分窗口剩余高度
   区内内容按内容多少排，多的在区里滚动，撑不破窗口 */
.page3 {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: clamp(10px, 1.6vh, 26px);
    padding-bottom: .6em;
}

/* 首个区不再加顶线（已按用户要求去掉） */
.page3 .row-mid > .sec:first-child .sec-hd {
    border-top: 0;
    padding-top: 0;
}

/* 四个栏目：两行两列，区与区之间拉开距离，跟"区内两栏"区分开 */
.row-mid {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    align-content: start;
    column-gap: clamp(36px, 4vw, 96px);
    row-gap: clamp(4px, .6vh, 10px);
    min-height: 0;
}

/* 每个区：区头横跨整区 + 下面的清单吃满剩余高度 */
.page3 .sec {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: clamp(2px, .4vw, 8px) 0 0;
}

.page3 .sec-hd,
.page3 .sec-more {
    flex: none;
}

.page3 .sec .list {
    display: block;
    flex: 0 1 auto;   /* 内容少就不撑高；内容超出区高时收缩，在区里滚动 */
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-top: 0;
    align-content: start;
}

/* 上下两个整行区：内部横排四列，把整行宽度用起来 */
.page3 .sec-wide .list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: clamp(14px, 1.8vw, 44px);
}

/* 中间四个栏目区：区内左右两栏，中间用一条竖线分开，
   这样一眼看出"这是同一个区的两栏"，不会数成八个区 */
.page3 .row-mid .sec .list {
    display: block;
    column-count: 2;
    column-gap: clamp(12px, 1.4vw, 28px);
    column-rule: 1px solid #eeeeee;
}

.page3 .row-mid .sec .row {
    break-inside: avoid;   /* 一行文件不许被拆到两栏 */
}

/* 下排两个区（校园文明建设 / 教育教学理论）：最后一行文件下面收一条黑线 */
.page3 .sec-end .list {
    border-bottom: 1px solid #111;
}

/* 滚动条细一点，不抢视觉 */
.page3 .sec .list::-webkit-scrollbar {
    width: 6px;
}

.page3 .sec .list::-webkit-scrollbar-thumb {
    background: #dcdcdc;
}

.page3 .sec .list::-webkit-scrollbar-track {
    background: transparent;
}

/* 一行信息更密：文件名 + 大小，行距略收 */
.page3 .sec .row {
    padding: .3em 0;
    gap: .6em;
    font-size: 1.05em;   /* 文件名放大，一眼看清 */
}

/* ---------- 分区内的清单：再分两栏，一行并排两份 */
.sec .list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(16px, 2vw, 44px);
    align-content: start;
    /* 区头已经有一条黑线了，这里不要再叠一条灰线 */
    border-top: 0;
}

/* 分区内的行：只留文件名 + 大小 */
.sec .row {
    padding: .55em 0;
    gap: .85em;
    font-size: .93em;
    border-bottom: 1px solid #f2f2f2;
}

.sec .row .sz {
    min-width: 0;
    font-size: .84em;
    color: #9a9a9a;
}

.sec-more {
    padding: .7em 0 0;
    font-size: .86em;
    color: #777;
    text-align: right;
}

/* 空栏目的占位行：跨满整行 */
.row.void {
    grid-column: 1 / -1;
    column-span: all;
}

.row.void .nm {
    color: #b8b8b8;
    font-size: .92em;
}

/* ---------- 方案 B：单列四段（备用） ---------- */
.stack .sec {
    padding: 1.6em 0;
}

.stack .sec-hd h2 {
    font-size: 1.05em;
}

.stack .sec .row {
    padding: .48em 0;
}

/* 窗口收窄后，区块本身变窄，区内再分两栏会把文件名压成省略号，
   所以先退回单栏，保证文件名读得全 */
@media (max-width: 1400px) {
    .sec .list {
        grid-template-columns: 1fr;
    }

    /* 区块变窄后区内两栏会挤成省略号，退回单栏 */
    .page3 .row-mid .sec .list {
        column-count: 1;
        column-rule: 0;
    }
}

/* ---------- 断点：只在"结构必须变"的地方切 ----------
   宽度本身是流体的，这里只管列数能不能并排 */
@media (max-width: 900px) {
    .grid4 {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    /* 窄屏不再强求铺满一屏，三行顺着往下排，整页自然滚动 */
    .page3 {
        flex: 0 0 auto;
        grid-template-rows: auto;
    }

    .row-mid {
        grid-template-columns: 1fr;
        row-gap: 0;
    }

    .page3 .sec .list {
        overflow: visible;
    }

    .page3 .sec-wide .list {
        grid-template-columns: 1fr 1fr;
    }
}

/* ---------- 阅读页 ---------- */
.rd-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6em;
    padding: .1em 0 1em;
    font-size: .92em;
}

.rd-warn {
    color: #b06a00;
    font-size: .85em;
}

.rd {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 1em;
}

/* 文本：等宽、自动换行、内容超出就在框里滚动 */
.rd-txt {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    margin: 0;
    padding: 1.4em 1.6em;
    background: #fafafa;
    border: 1px solid #eee;
    font-family: Consolas, "Courier New", monospace;
    font-size: .95em;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
    tab-size: 4;
}

/* Word / Excel / PPT 解析出来的正文：用正文字体，不走等宽 */
.rd-doc {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    margin: 0;
    padding: 1.6em 2em;
    background: #fff;
    border: 1px solid #eee;
    font-family: inherit;
    font-size: 1em;
    line-height: 2;
    white-space: pre-wrap;
    word-break: break-word;
    tab-size: 8;
}

/* Excel 用等宽字体，列才对得齐 */
.rd-sheet {
    font-family: Consolas, "Courier New", monospace;
    tab-size: 8;
    line-height: 1.95;
}

/* ---------- 阅读页：只读、不可复制 ---------- */
.rd,
.rd-txt,
.rd-doc,
.rd-docx,
.rd-img,
.rd-media,
.rd-pdf,
.rd-no {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;   /* 手机长按也不弹"拷贝/存储图片" */
}

.rd img {
    pointer-events: none;          /* 图片不能拖、不能右键另存 */
}

/* 打印时不留正文，只留一句提示 */
@media print {
    .rd { display: none !important; }
    .rd-tools::after {
        content: "本页内容不允许打印或导出，需要留存请点「下载原件」。";
        display: block;
        margin: .8em 0;
        color: #444;
    }
}

/* Word 原排版：正文宋体/Times、首行缩进、表格带框线 */
.rd-docx {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #fff;
    border: 1px solid #eee;
    padding: 2.2em clamp(1.4em, 5vw, 4em);
    font-family: "Times New Roman", "SimSun", "宋体", serif;
    font-size: 1.02em;
    line-height: 2.05;
    color: #111;
}

.rd-docx p {
    margin: .55em 0;
    text-indent: 2em;
}

.rd-docx p.rd-subtitle {
    text-indent: 0;
    text-align: center;
    color: #666;
}

.rd-docx h1,
.rd-docx h2,
.rd-docx h3,
.rd-docx h4 {
    text-indent: 0;
    margin: .9em 0 .5em;
    line-height: 1.6;
    font-family: "Microsoft YaHei", "SimHei", sans-serif;
}

.rd-docx h1 {
    font-size: 1.5em;
    text-align: center;
}

.rd-docx h2 { font-size: 1.28em; }
.rd-docx h3 { font-size: 1.14em; }
.rd-docx h4 { font-size: 1.04em; }

.rd-docx table {
    border-collapse: collapse;
    margin: .8em 0;
}

.rd-docx table td,
.rd-docx table th {
    border: 1px solid #888;
    padding: .35em .7em;
    line-height: 1.7;
}

.rd-docx table p,
.rd-docx table td,
.rd-docx li p {
    text-indent: 0;
}

.rd-docx img {
    max-width: 100%;
    height: auto;
    margin: .5em 0;
}

.rd-docx ul,
.rd-docx ol {
    margin: .5em 0;
    padding-left: 3em;
}

.rd-docx blockquote {
    margin: .6em 2em;
    padding-left: 1em;
    border-left: 2px solid #ddd;
    color: #444;
}

.rd-load,
.rd-empty {
    color: #999;
    padding: 1.2em 0;
}

/* ---------- Excel 渲染出来的表格 ---------- */
.rd-xlsx {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    font-size: .94em;
    line-height: 1.65;
    padding: 1.4em;
    color: #111;
}

.rd-sheet-name {
    font-weight: 700;
    margin: .6em 0 .5em;
    font-size: 1em;
}

.rd-xlsx table {
    border-collapse: collapse;
    margin: 0 0 1.2em;
}

.rd-xlsx td {
    border: 1px solid #ddd;
    padding: .25em .65em;
    white-space: nowrap;
}

.rd-xlsx tr:first-child td {
    background: #f5f6f8;
    font-weight: 600;
}

.rd-img {
    display: block;
    margin: auto;
    max-width: 100%;
    max-height: 76vh;
    border: 1px solid #eee;
}

.rd-pdf {
    flex: 1 1 auto;
    width: 100%;
    min-height: 74vh;
    border: 1px solid #eee;
    background: #fff;
}

.rd-media {
    width: 100%;
    max-height: 74vh;
    margin: auto;
    display: block;
}

.rd-no {
    margin: 2em auto;
    max-width: 34em;
    padding: 2.6em 2em;
    text-align: center;
    color: #666;
    line-height: 2.1;
    border: 1px dashed #ddd;
    font-size: .95em;
}

.rd-no-btn {
    margin-top: 1.4em;
}

@media (max-width: 600px) {
    .wrap,
    .hd-in {
        padding: 0 4vw;
    }

    .row {
        gap: .6em;
    }

    /* 手机屏窄，先让文件名占满，序号和大小让位 */
    .row .idx,
    .row .sz {
        display: none;
    }

    .bar {
        padding: 1.4em 0 .8em;
    }
}
