/* ============================================================
   OA 系统样式
   风格：白色仪表盘（参考 PostHog / Sentry），干净、留白足
   ============================================================ */

:root {
    --primary: #1677ff;
    --primary-soft: #e6f2ff;
    --success: #52c41a;
    --warning: #fa8c16;
    --danger: #ff4d4f;
    --text: #1f2328;
    --text-2: #656d76;
    --text-3: #8c959f;
    --border: #d8dee4;
    --bg: #f6f8fa;
    --card: #ffffff;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(31, 35, 40, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 登录页 ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f5ff 0%, #f6f8fa 100%);
}
.login-box {
    width: 380px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 36px;
    box-shadow: 0 8px 24px rgba(31, 35, 40, 0.08);
}
.login-box h1 {
    font-size: 22px;
    margin-bottom: 6px;
    font-weight: 600;
}
.login-box .sub {
    color: var(--text-3);
    font-size: 13px;
    margin-bottom: 28px;
}
.login-tip {
    margin-top: 18px;
    padding: 10px 12px;
    background: var(--primary-soft);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.7;
}

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 210px;
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 10;
}
.sidebar .brand {
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar .brand .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary);
}
.menu { flex: 1; overflow-y: auto; padding: 12px 0; }
.menu-group {
    padding: 14px 20px 6px;
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 0.5px;
}
.menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--text-2);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.menu a:hover { background: #f6f8fa; text-decoration: none; }
.menu a.active {
    background: var(--primary-soft);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}
.menu a .badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 0 6px;
    border-radius: 9px;
    min-width: 18px;
    text-align: center;
}

.sidebar .user {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.sidebar .user .name { font-weight: 600; }
.sidebar .user .role { color: var(--text-3); font-size: 12px; }

.main {
    flex: 1;
    margin-left: 210px;
    padding: 24px 28px;
    min-width: 0;
}

/* 移动端汉堡按钮与抽屉遮罩：默认隐藏，仅 ≤768px 显示 */
.menu-toggle { display: none; }
.sidebar-mask { display: none; }

/* ---------- 通用组件 ---------- */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-head h2 { font-size: 20px; font-weight: 600; }
.page-head .desc { color: var(--text-3); font-size: 13px; margin-top: 2px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.card-body { padding: 18px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: #0958d9; color: #fff; }
.btn-danger { color: var(--danger); border-color: #ffccc7; }
.btn-danger:hover { background: #fff2f0; color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item label { font-size: 13px; color: var(--text-2); }
.form-item.full { flex: 1; min-width: 200px; }

input[type=text], input[type=password], input[type=date],
input[type=time], input[type=number], select, textarea {
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    outline: none;
    min-width: 140px;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}
textarea { resize: vertical; min-height: 80px; width: 100%; }
input.full, select.full, textarea.full { width: 100%; }
input.block { width: 100%; margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    text-align: left;
    padding: 10px 12px;
    background: #f6f8fa;
    font-weight: 600;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f4;
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
.table-wrap { overflow-x: auto; }

.tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 19px;
    white-space: nowrap;
}
.tag-blue   { background: #e6f2ff; color: #0958d9; }
.tag-green  { background: #f0f9eb; color: #389e0d; }
.tag-orange { background: #fff4e6; color: #d46b08; }
.tag-red    { background: #fff2f0; color: #cf1322; }
.tag-gray   { background: #f0f2f5; color: #656d76; }

.empty {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 14px;
}
.empty .icon { font-size: 32px; margin-bottom: 8px; opacity: 0.4; }

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.stat-card .label { color: var(--text-3); font-size: 13px; }
.stat-card .value {
    font-size: 26px;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1.2;
}

/* 排班表格 */
.schedule-table { font-size: 12px; }
.schedule-table th, .schedule-table td {
    padding: 6px 8px;
    text-align: center;
    border: 1px solid #eef1f4;
    min-width: 62px;
}
.schedule-table th.staff-col,
.schedule-table td.staff-col {
    text-align: left;
    position: sticky;
    left: 0;
    background: #fff;
    min-width: 100px;
    z-index: 2;
}
.schedule-table th.staff-col { background: #f6f8fa; }
.shift-cell {
    border-radius: 4px;
    padding: 3px 4px;
    font-size: 11px;
    cursor: pointer;
    line-height: 1.4;
}
.shift-cell.empty-cell { color: #c6cdd4; }
.weekend { background: #fcfcfd; }

/* 弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(31, 35, 40, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal {
    background: #fff;
    border-radius: 10px;
    width: 620px;
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(31, 35, 40, 0.18);
}
.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-head .close { cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; }
.modal-head .close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 提示条 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    z-index: 200;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* 人员多选 */
.person-picker {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.person-chip {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    font-size: 13px;
    background: #fff;
    user-select: none;
}
.person-chip:hover { border-color: var(--primary); }
.person-chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}
.file-item .name { flex: 1; min-width: 0; word-break: break-all; }
.file-item .meta { color: var(--text-3); font-size: 12px; }

.timeline { position: relative; padding-left: 18px; }
.timeline-item {
    position: relative;
    padding-bottom: 16px;
    border-left: 2px solid #eef1f4;
    padding-left: 16px;
    margin-left: -18px;
}
.timeline-item:last-child { border-left-color: transparent; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 5px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary);
}
.timeline-item .meta { color: var(--text-3); font-size: 12px; }
.timeline-item .text { margin-top: 2px; white-space: pre-wrap; }

.pager {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 18px;
    font-size: 13px;
    color: var(--text-2);
}

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; }

/* 公告卡 */
.notice-item {
    padding: 14px 18px;
    border-bottom: 1px solid #eef1f4;
    cursor: pointer;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: #fafbfc; }
.notice-item .title { font-weight: 500; font-size: 15px; }
.notice-item .summary {
    color: var(--text-3);
    font-size: 13px;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notice-item .meta { color: var(--text-3); font-size: 12px; margin-top: 6px; }
.dot-unread {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--danger);
    margin-right: 6px;
    vertical-align: middle;
}

/* ============================================================
   移动端适配（≤768px）—— 全部包在媒体查询内，不影响桌面端
   侧边栏 → 抽屉（汉堡按钮滑出）；弹窗 → 底部抽屉式全屏；
   登录页自适应；按钮/输入触控目标加大
   ============================================================ */
@media (max-width: 768px) {

    /* 侧边栏：默认收起，.open 滑出 */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 240px;
        max-width: 85vw;
        z-index: 20;
    }
    .sidebar.open {
        transform: none;
        box-shadow: 0 0 24px rgba(31, 35, 40, 0.2);
    }
    .sidebar-mask {
        position: fixed;
        inset: 0;
        background: rgba(31, 35, 40, 0.45);
        z-index: 15;
    }
    .menu-toggle {
        display: flex;
        position: fixed;
        top: 10px; left: 10px;
        z-index: 25;
        width: 40px; height: 40px;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #fff;
        color: var(--text);
        font-size: 20px;
        line-height: 1;
        box-shadow: var(--shadow);
        cursor: pointer;
    }
    .menu-toggle:active { background: #f0f2f5; }

    /* 主区：全宽，顶部留出汉堡按钮空间 */
    .main {
        margin-left: 0;
        padding: 56px 12px 20px;
    }

    /* 弹窗：底部抽屉式全屏 */
    .modal-mask {
        padding: 0;
        align-items: flex-end;
    }
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 14px 14px 0 0;
    }
    .modal-head { padding: 16px; }
    .modal-body { padding: 16px; }
    .modal-foot {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .modal-foot .btn { flex: 1; justify-content: center; }

    /* 登录页：自适应宽度 */
    .login-wrap { padding: 20px; }
    .login-box {
        width: 100%;
        max-width: 400px;
        padding: 32px 24px;
    }

    /* 触控目标加大（16px 输入防 iOS 聚焦自动缩放） */
    .btn { padding: 10px 16px; font-size: 14px; }
    .btn-sm { padding: 7px 12px; font-size: 13px; }
    input[type=text], input[type=password], input[type=date],
    input[type=time], input[type=number], select, textarea {
        padding: 10px 12px;
        font-size: 16px;
        min-width: 0;
        width: 100%;
    }
    .form-item.full { min-width: 0; }

    /* 标题与卡片留白收紧 */
    .page-head h2 { font-size: 17px; }
    .page-head { margin-bottom: 12px; }
    .card-head { padding: 12px 14px; }
    .card-body { padding: 14px; }

    /* 表格保留横滑，行距略紧凑 */
    th, td { padding: 8px 10px; white-space: nowrap; }
    .pager { padding: 10px; justify-content: center; }
    .pager .btn { padding: 8px 14px; }

    /* 时间线类组件缩进微调 */
    .timeline { padding-left: 12px; }
    .timeline-item { padding-left: 12px; margin-left: -12px; }

    /* 统计卡片手机端一行 2 个 */
    .stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}

/* ============================================================
   移动端逐页精修（≤768px）—— 覆盖各页面 inline 样式，不影响桌面端
   ============================================================ */
@media (max-width: 768px) {

    /* 页面头右侧主操作按钮（新增/发布/申请等）：全宽，拇指友好 */
    .page-head > button.btn { width: 100%; justify-content: center; }

    /* 打卡页：上班/下班按钮均分一行 */
    .card-head #clockIn, .card-head #clockOut { flex: 1; justify-content: center; }

    /* 工作地图：地图容器改半屏左右，露出下方统计/列表 */
    #mf-map {
        height: 50vh !important;
        min-height: 280px !important;
    }
    /* 案件指派：地图改半屏以下，露出列表 */
    #af-map {
        height: 45vh !important;
        min-height: 260px !important;
    }

    /* 地图详情面板：手机端改底部抽屉式，不挡地图主体 */
    #mf-panel, #af-panel {
        top: auto !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: 55% !important;
        border-radius: 12px 12px 0 0 !important;
        box-shadow: 0 -6px 24px rgba(31, 35, 40, 0.16) !important;
    }

    /* 地图图例：收窄字号，贴合角落 */
    #mf-tip, #af-tip {
        font-size: 10px !important;
        padding: 5px 8px !important;
        bottom: 8px !important;
        right: 8px !important;
    }

    /* toolbar 内固定宽输入：全宽（覆盖 inline style 的 width） */
    #mf-staff, #af-month { width: 100% !important; }

    /* 案件指派主按钮：独占一行 */
    #af-new { width: 100%; }

    /* 排班表：姓名列收窄、日期列紧凑（保留 sticky 姓名列与横向滚动） */
    .schedule-table th, .schedule-table td { min-width: 42px; padding: 5px 4px; }
    .schedule-table th.staff-col, .schedule-table td.staff-col { min-width: 64px; }

    /* 工作记录缩略图：手机端 2 列网格 */
    .wl-imgs { display: grid !important; grid-template-columns: repeat(2, 1fr); }
    .wl-imgs img { width: 100% !important; height: 96px; }

    /* 弹窗内表单行：手机端纵向堆叠，避免挤压 */
    .form-row { flex-direction: column; }
}

/* ---------- 中秋慰问品套餐投票 ---------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.vote-mine { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.pkg-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.pkg-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pkg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pkg-name { font-size: 16px; font-weight: 600; }
.pkg-sum { color: var(--text-3); font-size: 12px; }

.pkg-table { font-size: 12px; }
.pkg-table th, .pkg-table td { padding: 5px 6px; text-align: left; }

.vote-bar-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; }
.vote-bar-label { font-size: 12px; color: var(--text-3); }
.vote-bar { flex: 1; height: 8px; background: #eef1f4; border-radius: 4px; overflow: hidden; }
.vote-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.vote-bar-num { font-size: 13px; font-weight: 600; min-width: 24px; text-align: right; }

.pkg-foot { margin-top: auto; text-align: right; }

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

/* ---------- 中秋国庆离邕接龙 ---------- */
.chain-list { display: flex; flex-direction: column; gap: 8px; }
.chain-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.chain-no { flex: 0 0 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 600; font-size: 13px; }
.chain-main { flex: 1; min-width: 0; }
.chain-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chain-meta { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.chain-dest { margin-top: 4px; color: var(--text); }
.chain-act { flex: 0 0 auto; display: flex; gap: 6px; }
.chain-unreported { display: flex; flex-wrap: wrap; gap: 8px; }
.chain-unreported span { padding: 4px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; font-size: 13px; }
.radio { margin-right: 14px; }

/* ============================================================
   侧边栏增强（2026-09-27）
   1) 分组可折叠  2) 整栏可收缩  3) 网站导航  4) 本地直连优先开关
   ============================================================ */

/* ---------- 分组折叠 ---------- */
.menu-group {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.menu-group .caret {
    font-size: 9px;
    color: var(--text-3);
    transition: transform .2s ease;
}
.menu-group.collapsed .caret { transform: rotate(-90deg); }
.menu-sub.collapsed { display: none; }

/* 折叠按钮（侧边栏标题内，右侧） */
.collapse-btn {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--text-3);
    font-size: 15px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
}
.collapse-btn:hover { background: #f0f2f5; }

/* ---------- 网站导航链接 ---------- */
.nav-list { padding: 2px 0 6px; }
.nav-link {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 7px 20px 7px 30px !important;
    color: var(--text-2);
    font-size: 13px;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.nav-link:hover { background: #f6f8fa; text-decoration: none; }
.nav-link .nav-title { font-weight: 500; }
.nav-link .nav-desc {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 168px;
}
.nav-admin {
    padding: 6px 20px 6px 30px !important;
    font-size: 12px;
    color: var(--primary) !important;
    cursor: pointer;
}
.nav-admin:hover { background: #f6f8fa; text-decoration: none; }
.nav-empty {
    padding: 8px 20px 8px 30px;
    font-size: 12px;
    color: var(--text-3);
}

/* 本地直连优先开关 */
.local-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-3);
    cursor: pointer;
}

/* ---------- 导航管理弹窗 ---------- */
.nav-form label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--text-2); }
.nav-manage { max-height: 60vh; overflow: auto; }
.nav-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border);
}
.nav-row-main { display: flex; flex-direction: column; min-width: 0; }
.nav-row-title { font-weight: 600; font-size: 14px; }
.nav-row-url {
    font-size: 11px; color: var(--text-3);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-row-meta { grid-column: 1; font-size: 11px; color: var(--text-3); align-self: center; }
.nav-row-act { grid-row: 1 / span 2; align-self: center; display: flex; gap: 6px; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; }
.tag-0 { background: #fdecec; color: #c0392b; }
.tag-1 { background: #e8f4ff; color: #1f6feb; }
.tag-2 { background: #eafaf0; color: #1a7f4b; }

/* ---------- 桌面端：侧边栏整体收缩 ---------- */
@media (min-width: 769px) {
    .sidebar { transition: transform .25s ease; }
    .layout.collapsed .sidebar { transform: translateX(-100%); box-shadow: none; }
    .layout.collapsed .main { margin-left: 0; }

    .reopen-btn {
        display: none;
        position: fixed;
        top: 10px; left: 10px;
        z-index: 25;
        width: 40px; height: 40px;
        align-items: center; justify-content: center;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #fff;
        color: var(--text);
        font-size: 20px;
        line-height: 1;
        box-shadow: var(--shadow);
        cursor: pointer;
    }
    .layout.collapsed .reopen-btn { display: flex; }
}

/* ============================================================
   网站导航中心（右侧主页面卡片网格）—— 2026-09-27 调整
   ============================================================ */
.nav-center-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.nav-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.nav-search {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    min-width: 160px;
    width: auto;
}
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.nav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.nav-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(31,35,40,.10);
}
.nav-card-ico {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}
.nav-card-body { min-width: 0; flex: 1; }
.nav-card-title { font-weight: 600; font-size: 15px; }
.nav-card-desc {
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.nav-card-url {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tag-local { background: #eafaf0; color: #1a7f4b; }
.nav-empty-big {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--text-3);
}
@media (max-width: 640px) {
    .nav-grid { grid-template-columns: 1fr; }
    .head-actions { width: 100%; }
}
