/* ==========================================================
   课程资料共享与管理系统 · 样式表
   设计基调：简约 / 大气 / 专业，主色采用北大红
   ========================================================== */

:root {
    --brand:        #8B1B1B;
    --brand-2:      #A52727;
    --brand-soft:   #FBEEEE;
    --brand-line:   #EFD3D3;

    --bg:           #F5F6F8;
    --surface:      #FFFFFF;
    --surface-2:    #FAFBFC;
    --line:         #E7E9ED;
    --line-2:       #D9DDE3;

    --text:         #15181D;
    --text-2:       #5B6472;
    --muted:        #8A93A0;

    --ok:           #1F9254;
    --ok-soft:      #EAF6EF;
    --warn:         #B8760F;
    --warn-soft:    #FDF3E3;
    --danger:       #C0392B;
    --danger-soft:  #FCEDEB;

    --radius:       12px;
    --radius-lg:    16px;
    --radius-sm:    8px;
    --shadow-sm:    0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
    --shadow:       0 4px 16px rgba(16, 24, 40, .07);
    --shadow-lg:    0 18px 48px rgba(16, 24, 40, .14);
    --topbar-h:     62px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
p { margin: 0 0 10px; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
code { font-family: "JetBrains Mono", Consolas, Menlo, monospace; background: #F2F3F5; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

.icon { vertical-align: -3px; flex: none; }

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 9px;
    background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all .16s ease; white-space: nowrap;
}
.btn:hover { background: #F7F8FA; border-color: #C9CED6; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; box-shadow: 0 4px 12px rgba(139, 27, 27, .22); }
.btn-outline { background: #fff; border-color: var(--brand-line); color: var(--brand); }
.btn-outline:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #F2F3F5; color: var(--text); }
.btn-danger { color: var(--danger); border-color: #EDD3CF; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 29px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 24px; font-size: 15px; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: #F5F6F8; color: var(--text); }

/* ---------------- 标签 ---------------- */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500;
    background: #F1F3F5; color: var(--text-2); white-space: nowrap;
}
.tag-public { background: var(--ok-soft); color: var(--ok); }
.tag-private { background: var(--warn-soft); color: var(--warn); }
.tag-brand { background: var(--brand-soft); color: var(--brand); }
.tag-line { background: transparent; border: 1px solid var(--line-2); color: var(--text-2); }
.tag-money { background: #F7F3EA; color: #7B5A22; font-weight: 600; }

/* ---------------- 课程中心 · 筛选模块（参考「腾讯视频」筛选栏） ---------------- */
/* 常驻工具条：排序方式 + 筛选开关 */
.filter-bar {
    display: flex; align-items: center; gap: 8px;
    min-height: 48px; padding: 7px 12px 7px 16px; margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.fb-title { flex: none; font-size: 13px; color: var(--muted); margin-right: 2px; }
.fb-sorts { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.sort-tab {
    display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px;
    border-radius: 7px; font-size: 13.5px; color: var(--text-2); white-space: nowrap;
    transition: color .15s, background .15s;
}
.sort-tab:hover { color: var(--brand); background: var(--brand-soft); }
.sort-tab.active { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.sort-tab .dir { font-size: 11.5px; font-weight: 400; opacity: .8; }

.fb-toggle {
    flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
    border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
    font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .16s ease;
}
.fb-toggle:hover { border-color: var(--brand); color: var(--brand); }
.fb-toggle.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.fb-toggle .caret { transition: transform .2s ease; }
.fb-toggle.on .caret { transform: rotate(180deg); }
.fb-count {
    min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
    background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}

/* 展开后的筛选面板：一行一个维度，左侧标签 + 右侧平铺文字选项 */
.filter-panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 2px 16px 0; margin: 0 0 12px;
}
.filter-panel[hidden] { display: none; }
.frow { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; }
.frow + .frow { border-top: 1px solid var(--line); }
.flabel { flex: none; width: 60px; padding-top: 5px; font-size: 13px; color: var(--muted); }
.fopts { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1px 2px; }
.fopt {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px;
    font-size: 13.5px; color: var(--text-2); white-space: nowrap;
    transition: color .15s, background .15s;
}
.fopt:hover { color: var(--brand); background: var(--brand-soft); }
.fopt.active { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.frange {
    display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; padding-left: 14px;
    border-left: 1px solid var(--line);
}
.fsep, .funit { flex: none; font-size: 12.5px; color: var(--muted); }
.input-sm { height: 28px; padding: 0 9px; font-size: 13px; border-radius: 7px; }
.input-sm[type=date] { width: 132px; }
.input-sm[type=number] { width: 88px; }
.factions { display: flex; align-items: center; gap: 10px; padding: 11px 0 13px; border-top: 1px solid var(--line); }
.fhint { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); }

/* ---------------- 已选条件 ---------------- */
.filter-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 14px; }
.ftag-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ftag {
    display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
    border-radius: 13px; background: var(--brand-soft); color: var(--brand);
    font-size: 12px; font-weight: 600; text-decoration: none; transition: background .15s;
}
.ftag:hover { background: #F7DEDE; }
.ftag .icon { opacity: .65; }
.ftag-clear { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.ftag-clear:hover { color: var(--brand); }

/* ---------------- 接口文档 / 代码块 ---------------- */
.codebox {
    position: relative; margin: 0 0 12px; padding: 12px 14px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
    font-family: "JetBrains Mono", Consolas, Menlo, monospace;
    font-size: 12.5px; line-height: 1.8; color: var(--text-2);
    white-space: pre-wrap; word-break: break-all; overflow-x: auto;
}
.codebox b { color: var(--text); font-weight: 600; }
.codebox .cmt { color: var(--muted); }
.codebox-wrap { position: relative; }
.codebox-wrap .code-copy { position: absolute; top: 8px; right: 8px; z-index: 2; }
.secret-box {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 14px; margin-bottom: 16px;
    background: var(--warn-soft); border: 1px solid #F2E0BE; border-radius: 10px;
}
.secret-box .secret-val {
    flex: 1; min-width: 240px; padding: 8px 10px; background: #fff; border: 1px dashed #E0C79A; border-radius: 8px;
    font-family: "JetBrains Mono", Consolas, Menlo, monospace; font-size: 13px; color: #8A5A0B;
    word-break: break-all;
}
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th { text-align: left; padding: 9px 12px; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.doc-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table code { font-size: 12px; color: var(--brand); background: var(--brand-soft); }

/* ---------------- 表单 ---------------- */
.form { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-full { grid-column: 1 / -1; }
.label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.label .req { color: var(--brand); }
.input, .select, .textarea {
    width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 9px;
    background: #fff; color: var(--text); font-size: 14px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.7; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(139, 27, 27, .09); }
.input::placeholder, .textarea::placeholder { color: #B4BBC4; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A93A0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.hint { font-size: 12px; color: var(--muted); }
.checkbox-line, .switch-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.checkbox-line input, .switch-line input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }

/* 上传控件 */
.uploader {
    border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 16px;
    background: var(--surface-2); display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.uploader input[type=file] { font-size: 13px; color: var(--text-2); max-width: 100%; }

/* ---------------- 提示条 ---------------- */
.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; white-space: pre-line; }
.alert-success { background: var(--ok-soft); border-color: #CBE9D8; color: #14683C; }
.alert-error { background: var(--danger-soft); border-color: #F0D3CF; color: #96271B; }
.alert-warn { background: var(--warn-soft); border-color: #F2E0BE; color: #8A5A0B; }
.alert-info { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand); }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; font-weight: 600; color: var(--text-2); font-size: 12.5px;
    padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFC; }
.table .num { font-variant-numeric: tabular-nums; }

/* ---------------- 卡片 ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 15.5px; }
.card-body { padding: 18px 20px; }
.card + .card { margin-top: 18px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
    position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-inner {
    height: var(--topbar-h); max-width: 1560px; margin: 0 auto; padding: 0 22px;
    display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(145deg, var(--brand), var(--brand-2));
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
    letter-spacing: 0; box-shadow: 0 3px 10px rgba(139, 27, 27, .25);
}
.brand-name { font-size: 16.5px; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }

.topnav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.nav-link {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px;
    color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: all .15s;
}
.nav-link:hover { background: #F2F3F5; color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* 导航栏主操作按钮（新增课程） */
.topnav .btn-nav {
    height: 34px; padding: 0 14px; margin: 0 5px; border-radius: 9px;
    font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
    box-shadow: 0 2px 8px rgba(139, 27, 27, .18); transition: filter .15s, transform .15s;
}
.topnav .btn-nav:hover { filter: brightness(1.07); transform: translateY(-1px); }
.topnav-mobile .nav-add { background: var(--brand); color: #fff; font-weight: 600; }

/* 行内紧凑格式角标（课程卡片用） */
.mini-badge {
    display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .3px; line-height: 1.5;
}

/* 课程资料 · 模块化区块 */
.mat-blocks {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
    gap: 14px; align-items: start;
}
.mat-block {
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
    overflow: hidden; transition: box-shadow .18s, border-color .18s;
}
.mat-block:hover { border-color: #E2E4E8; box-shadow: 0 3px 12px rgba(20,22,28,.05); }
.mat-block.wide { grid-column: 1 / -1; }
.mb-head {
    display: flex; align-items: center; gap: 9px; padding: 11px 14px;
    border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #FCFCFD, #F7F8F9);
}
.mb-ico {
    width: 28px; height: 28px; border-radius: 8px; flex: none; background: var(--brand-soft); color: var(--brand);
    display: inline-flex; align-items: center; justify-content: center;
}
.mb-title { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.mb-count {
    margin-left: auto; padding: 2px 9px; border-radius: 20px; flex: none;
    font-size: 11.5px; font-weight: 600; background: #F1F2F4; color: var(--muted);
}
.mb-count.on { background: var(--brand-soft); color: var(--brand); }
.mb-body { padding: 13px 14px 14px; }
.mb-body .media-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.mb-body .mc-thumb { height: 92px; }
.mb-body .mc-add { min-height: 92px; }
.mb-empty { padding: 14px 0 4px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* 资料缩略图网格 */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
.mc {
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
    overflow: hidden; transition: box-shadow .16s, transform .16s, border-color .16s;
}
.mc:hover { border-color: var(--brand-line); box-shadow: 0 5px 16px rgba(20,22,28,.09); transform: translateY(-2px); }
.mc-thumb {
    position: relative; height: 104px; background: #F1F2F4; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.mc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; cursor: zoom-in; }
.mc-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; background: #20242B; }
.mc-doc { display: inline-flex; }
.mc-badge {
    position: absolute; left: 7px; top: 7px; padding: 2px 6px; border-radius: 5px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .4px; color: #fff; background: rgba(0,0,0,.42);
}
.mc-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.mc-play span {
    width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.42); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
}
.mc-text {
    width: 100%; height: 100%; padding: 11px 12px; overflow: hidden;
    font-size: 11.5px; line-height: 1.6; color: #6A7280; word-break: break-all;
}
.mc-ops {
    position: absolute; right: 6px; top: 6px; display: flex; gap: 4px;
    opacity: 0; transform: translateY(-3px); transition: all .16s;
}
.mc:hover .mc-ops { opacity: 1; transform: none; }
.mc-op {
    width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(255,255,255,.55);
    background: rgba(255,255,255,.95); color: var(--text); display: inline-flex;
    align-items: center; justify-content: center; cursor: pointer; transition: all .14s;
}
.mc-op:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.mc-op.danger:hover { background: var(--danger); border-color: var(--danger); }
.mc-op-form { margin: 0; display: inline-flex; }
.mc-body { padding: 8px 10px 10px; }
.mc-name {
    font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.45; word-break: break-all;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mc-meta { margin-top: 3px; font-size: 11px; color: var(--muted); }

/* 网格内的添加块 */
.mc-add {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 104px; border: 1.5px dashed var(--line-2); border-radius: 12px;
    background: var(--surface-2); color: var(--muted); cursor: pointer; transition: all .16s; text-align: center;
}
.mc-add:hover, .mc-add.dragover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.mc-add-ico {
    width: 33px; height: 33px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
    display: inline-flex; align-items: center; justify-content: center; color: var(--brand);
}
.mc-add > span:nth-child(2) { font-size: 12.5px; font-weight: 600; }
.mc-add-sub { font-size: 11px; opacity: .8; padding: 0 6px; }

/* 上传行 */
.mat-upload { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.dz-row {
    flex: 1 1 260px; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
    border: 1.5px dashed var(--line-2); border-radius: 11px; background: var(--surface);
    cursor: pointer; transition: all .16s;
}
.dz-row:hover, .dz-row.dragover { border-color: var(--brand); background: var(--brand-soft); }
.dz-row input[type=file] { display: none; }
.dz-ico { color: var(--brand); display: inline-flex; flex: none; }
.dz-txt { font-size: 13px; font-weight: 600; color: var(--text); }
.dz-files { color: var(--brand); font-weight: 600; }
.dz-sub { margin-left: auto; font-size: 11.5px; color: var(--muted); flex: none; }
.mat-up-side { display: flex; gap: 8px; align-items: center; }
.mat-up-side .input { flex: 1 1 auto; min-width: 0; }
.mat-text-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.mat-text-form .btn { align-self: flex-start; }
.dropzone input[type=file] { display: none; }

@media (hover: none) {
    .mc-ops { opacity: 1; transform: none; }
}
@media (max-width: 560px) {
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
    .mc-thumb { height: 84px; }
    .mat-up-side { width: 100%; }
    .mat-up-side .input { flex: 1; width: auto; }
    .dz-sub { display: none; }
}

/* 账号管理 · 我的权限 */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.perm-item {
    display: flex; align-items: center; gap: 9px; padding: 11px 13px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13.5px;
}
.perm-item.on { border-color: var(--brand-line); background: var(--brand-soft); }
.perm-item.off { opacity: .62; }
.perm-ico {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 22px; height: 22px; border-radius: 50%;
}
.perm-item.on .perm-ico { background: var(--brand); color: #fff; }
.perm-item.off .perm-ico { background: #EDF0F3; color: var(--muted); }
.perm-name { flex: 1; font-weight: 500; color: var(--text); }
.perm-item b { font-size: 12px; font-weight: 600; white-space: nowrap; }
.perm-item.on b { color: var(--brand); }
.perm-item.off b { color: var(--muted); }

.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.searchbox { position: relative; }
.searchbox input {
    width: 210px; height: 34px; padding: 0 12px 0 34px; border-radius: 9px;
    border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; color: var(--text); font-family: inherit;
}
.searchbox input:focus { outline: none; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(139, 27, 27, .08); }
.searchbox .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.usermenu { position: relative; }
.usermenu-trigger {
    display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 4px;
    border: 1px solid var(--line-2); border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; color: var(--text);
}
.usermenu-trigger:hover { background: #F7F8FA; }
.avatar {
    width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none;
}
.usermenu-panel {
    position: absolute; right: 0; top: 42px; min-width: 190px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.usermenu.open .usermenu-panel { display: block; }
.usermenu-panel a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; }
.usermenu-panel a:hover { background: #F5F6F8; color: var(--text); }
.usermenu-panel .divider { height: 1px; background: var(--line); margin: 5px 4px; }

.topnav-mobile { display: none; }
.menu-toggle { display: none; }

/* ---------------- 主体布局 ---------------- */
.app-shell { max-width: 1560px; margin: 0 auto; padding: 22px; display: flex; gap: 22px; align-items: flex-start; }
.sidebar { width: 236px; flex: none; position: sticky; top: calc(var(--topbar-h) + 22px); }
.side-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px; margin-bottom: 16px; }
.side-title { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .1em; padding: 4px 8px 10px; }
.side-nav a {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px;
    color: var(--text-2); font-size: 13.5px; transition: all .15s;
}
.side-nav a:hover { background: #F5F6F8; color: var(--text); }
.side-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.side-nav .count { margin-left: auto; font-size: 12px; color: var(--muted); background: #F2F3F5; border-radius: 6px; padding: 0 6px; }
.side-nav a.active .count { background: rgba(139, 27, 27, .12); color: var(--brand); }
.side-nav .add-link { color: var(--brand); font-size: 13px; }
.side-mini { padding: 12px 14px; }
.side-mini .mini-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 5px 0; }
.side-mini .mini-row b { color: var(--text); font-weight: 600; }

.content { flex: 1; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.page-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- 仪表盘统计 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::after { content: ""; position: absolute; right: -18px; top: -18px; width: 74px; height: 74px; border-radius: 50%; background: var(--brand-soft); opacity: .55; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; position: relative; z-index: 1; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.2; margin-top: 4px; letter-spacing: -.02em; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--muted); margin-top: 2px; position: relative; z-index: 1; }
.stat-icon { color: var(--brand); opacity: .9; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }

/* ---------------- 课程卡片 ---------------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(392px, 1fr)); gap: 16px; }
.course-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .18s, transform .18s; }
.course-card:hover { box-shadow: var(--shadow); }
.cc-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.cc-title { font-size: 16px; font-weight: 650; line-height: 1.4; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.cc-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.cc-body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.mat-row { display: flex; gap: 12px; align-items: flex-start; }
.mat-label {
    flex: none; width: 74px; font-size: 12.5px; color: var(--muted); font-weight: 600; padding-top: 4px; letter-spacing: .02em;
}
.mat-items { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.mat-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mat-empty { font-size: 12.5px; color: #B4BBC4; }
.mat-sub { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }

/* 卡片内文件操作：查看 · 下载 · 分享 */
.cc-ops { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ops-idx {
    flex: none; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
    font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

/* 宣传物料 · 三列缩略图 */
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile {
    position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); aspect-ratio: 4 / 3;
}
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #F2F3F5; }
.tile img[data-zoom] { cursor: zoom-in; }
.tile-play {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; background: rgba(16,18,22,.26); pointer-events: none;
}
.tile-play .icon { padding: 7px; border-radius: 50%; background: rgba(16,18,22,.55); }
.tile-ops {
    position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 5px; justify-content: flex-end;
    padding: 6px; background: linear-gradient(to top, rgba(16,18,22,.62), rgba(16,18,22,0));
    opacity: 0; transition: opacity .16s;
}
.tile:hover .tile-ops { opacity: 1; }
.tile-btn {
    flex: none; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 7px; cursor: pointer;
    background: rgba(255,255,255,.94); color: var(--text); text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .14s, color .14s;
}
.tile-btn:hover { background: #fff; color: var(--brand); }

/* 文字物料 · 单行省略 */
.tl {
    display: flex; align-items: center; gap: 8px; padding: 7px 9px 7px 12px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.tl-txt { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl .btn { flex: none; }

.cc-foot { padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------- 空状态 ---------------- */
.empty {
    border: 1.5px dashed var(--line-2); border-radius: var(--radius-lg); padding: 46px 20px; text-align: center;
    background: var(--surface); color: var(--muted);
}
.empty h4 { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }
.empty p { font-size: 13px; margin-bottom: 14px; }

/* ---------------- 成交笔记 ---------------- */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.note {
    border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 16px 12px;
    background: #FDF5E6; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-height: 148px;
    position: relative; transition: box-shadow .18s;
}
.note:hover { box-shadow: var(--shadow); }
.note-content { font-size: 13.5px; color: #2A2F38; white-space: pre-wrap; word-break: break-word; flex: 1; line-height: 1.7; }
.note-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(0, 0, 0, .12); }
.note-foot .muted { font-size: 12px; }
.note-actions { margin-left: auto; display: flex; gap: 4px; }
.note-add { border: 1.5px dashed var(--line-2); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.note-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------------- 话术 / 列表条目 ---------------- */
.list-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.list-item { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #FAFBFC; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-size: 14.5px; font-weight: 600; }
.li-content { font-size: 13.5px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.li-side { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.li-meta { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }

/* ---------------- 宣传资料 ---------------- */
.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.promo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.promo-cover { height: 150px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--muted); border-bottom: 1px solid var(--line); overflow: hidden; }
.promo-cover img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.promo-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.promo-title { font-size: 14.5px; font-weight: 600; }
.promo-text { font-size: 13px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; max-height: 90px; overflow: auto; }
.promo-foot { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { height: 30px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; cursor: pointer; }
.chip:hover { background: #F5F6F8; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------- 弹窗 / 提示 ---------------- */
.modal-mask { position: fixed; inset: 0; background: rgba(18, 22, 30, .48); backdrop-filter: blur(2px); z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { font-size: 16px; }
.modal-close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); }
.share-box { display: flex; gap: 8px; }
.share-box input { flex: 1; }
.qr-box { text-align: center; margin-top: 16px; }
.qr-box img { width: 180px; height: 180px; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; }

#toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast-item { background: rgba(21, 24, 29, .93); color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow); animation: pop .18s ease; }

/* ---------------- 登录页 ---------------- */
.login-body { background: linear-gradient(160deg, #F7F4F2 0%, #F5F6F8 45%, #FBEEEE 100%); min-height: 100vh; }
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 18px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 34px 32px 28px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-mark {
    width: 46px; height: 46px; border-radius: 13px; background: linear-gradient(145deg, var(--brand), var(--brand-2));
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
    box-shadow: 0 6px 16px rgba(139, 27, 27, .28);
}
.login-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.login-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .06em; margin: 2px 0 0; }
.login-tip { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 18px; }
.login-foot { font-size: 12px; color: var(--muted); margin-top: 20px; }

/* ---------------- 分享页 ---------------- */
.share-body { background: var(--bg); }
.share-wrap { max-width: 720px; margin: 0 auto; padding: 26px 18px 40px; }
.share-head { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.share-logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(145deg, var(--brand), var(--brand-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; flex: none; }
.share-title { font-size: 19px; font-weight: 700; }
.share-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.share-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin-top: 16px; box-shadow: var(--shadow-sm); }
.share-h2 { font-size: 15px; margin-bottom: 12px; padding-left: 10px; border-left: 3px solid var(--brand); line-height: 1.3; }
.share-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.share-list li:last-child { border-bottom: none; }
.share-file { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-file em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.share-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin-top: 12px; }
.share-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.share-fig { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; margin: 0; }
.share-fig img { width: 100%; height: 140px; object-fit: cover; }
.share-fig figcaption { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 13px; }
.share-fig figcaption span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-text { font-size: 13.5px; color: var(--text-2); line-height: 1.75; }
.share-text-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 10px; }
.share-text-title { font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.share-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 24px; }

/* ---------------- 安装向导 ---------------- */
.install-body { background: linear-gradient(160deg, #F7F4F2, #F5F6F8 50%, #FBEEEE); min-height: 100vh; }
.install-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 42px 18px 60px; }
.install-box { width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 32px 30px; }
.install-wide { max-width: 760px; }
.install-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.install-steps { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.install-steps li { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.install-steps li span { width: 22px; height: 22px; border-radius: 50%; background: #F2F3F5; color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.install-steps li.on { color: var(--text); }
.install-steps li.on span { background: var(--brand); color: #fff; }
.install-h2 { font-size: 17px; margin-bottom: 14px; }
.install-table { font-size: 13px; }
.install-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.install-actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.install-done { text-align: center; }
.install-done-icon { width: 58px; height: 58px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 14px; }
.install-actions.center { justify-content: center; }
.install-tips { margin-top: 20px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.install-tips h3 { font-size: 14px; margin-bottom: 8px; }
.install-tips ul { list-style: disc; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.install-tips li { margin-bottom: 4px; }

/* ---------------- 后台 ---------------- */
.admin-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; }
.perm-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.log-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.log-list li:last-child { border-bottom: none; }
.log-list .log-time { color: var(--muted); font-size: 12px; flex: none; width: 108px; }
.log-list .log-user { color: var(--brand); flex: none; }
.storage-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; background: var(--surface-2); display: none; }
.storage-panel.show { display: block; }

/* ---------------- 数据库升级页 ---------------- */
.upgrade-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.upgrade-item {
    display: flex; align-items: center; gap: 9px; padding: 9px 12px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-2);
}
.upgrade-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.upgrade-item.done .upgrade-dot { background: var(--ok); }
.upgrade-item.skip .upgrade-dot { background: var(--line-2); }
.upgrade-item.error .upgrade-dot { background: var(--danger); }
.upgrade-item.error { background: var(--danger-soft); border-color: #F0D3CF; color: #96271B; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1280px) {
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
    .topnav { display: none; }
    .topnav-mobile { display: flex; gap: 6px; overflow-x: auto; padding: 0 22px 10px; scrollbar-width: none; }
    .topnav-mobile::-webkit-scrollbar { display: none; }
    .menu-toggle { display: inline-flex; }
    .app-shell { padding: 16px; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 70; background: var(--bg);
        padding: 16px; overflow-y: auto; transform: translateX(-100%); transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: none; }
    .side-mask { position: fixed; inset: 0; background: rgba(18, 22, 30, .45); z-index: 65; display: none; }
    .side-mask.open { display: block; }
    .course-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .topbar-inner { padding: 0 14px; gap: 10px; }
    .brand-sub { display: none; }
    .searchbox input { width: 130px; }
    .page-title { font-size: 19px; }
    .mat-row { flex-direction: column; gap: 6px; }
    .mat-label { width: auto; }
    .table { font-size: 12.5px; }
    .table th, .table td { padding: 9px 10px; }
    .install-box { padding: 24px 18px; }
    .share-wrap { padding: 16px 12px 30px; }
    .promo-grid, .note-grid { grid-template-columns: 1fr; }
    /* 筛选模块在窄屏改为上下堆叠 */
    .filter-bar { padding: 8px 12px; gap: 6px; }
    .fb-title { display: none; }
    .fb-toggle { margin-left: auto; }
    .filter-panel { padding: 2px 13px 0; }
    .frow { flex-direction: column; gap: 5px; }
    .flabel { width: auto; padding-top: 0; }
    .frange { width: 100%; margin: 6px 0 0; padding-left: 0; border-left: 0; }
    .input-sm[type=date], .input-sm[type=number] { width: 100%; flex: 1; }
    .factions { flex-wrap: wrap; }
    .fhint { flex: none; width: 100%; }
    .tile-grid { gap: 6px; }
}
