/* ==========================================================================
   栾城区金融管理平台 - 全局样式表
   ==========================================================================
   本文件包含整个应用的布局、组件、表单、表格、模态框等样式定义。
   采用蓝色主题，简洁的政府风格界面。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 全局重置 - 清除浏览器默认边距和内边距
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;  /* 让 padding 和 border 计入元素总宽高 */
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f0f2f5;     /* 浅灰背景 */
    height: 100vh;
    overflow: hidden;         /* 防止 body 滚动，内容区单独滚动 */
}

/* --------------------------------------------------------------------------
   2. 整体布局 - Flex 左右两栏结构
   -------------------------------------------------------------------------- */
.app-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

/* --------------------------------------------------------------------------
   3. 左侧导航栏
   -------------------------------------------------------------------------- */
.sidebar {
    width: 260px;
    background: #1e2a3a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* 顶部 Logo 区域 */
.logo {
    padding: 24px 20px;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid #334155;
    background: #0f172a;
    color: white;
}
/* Logo 内的图标图片 */
.logo img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 4px;
}

/* ---- Sidebar 折叠切换按钮（右上角外侧） ---- */
.sidebar-toggle {
    position: absolute;
    top: 10px;
    right: -37px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: transform 0.25s ease;
    user-select: none;
}
.sidebar-toggle:hover {
    opacity: 0.7;
}
.sidebar-toggle svg {
    fill: #1a1a1a;
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease, fill 0.2s;
    display: block;
}
.sidebar-toggle svg path {
    stroke: #1a1a1a;
    stroke-width: 60;
}
.sidebar-toggle:hover svg {
    fill: #2563eb;
}
.sidebar-toggle:hover svg path {
    stroke: #2563eb;
}
/* 收起时旋转 180° */
.sidebar-toggle.is-active svg {
    transform: rotate(180deg);
}

/* 为 sidebar 设置 relative 定位以支持绝对定位的子元素 */
.sidebar {
    position: relative;
}

/* ---- Sidebar 收起状态（桌面端） ---- */
.sidebar.collapsed {
    width: 64px;
    transition: width 0.25s ease;
}
.sidebar.collapsed .logo {
    padding: 20px 0;
    text-align: center;
    font-size: 1rem;
}
.sidebar.collapsed .logo img {
    margin-right: 0;
}
.sidebar.collapsed .logo span {
    display: none;
}
.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 14px 0;
    margin: 4px 12px;
    text-align: center;
}
.sidebar.collapsed .nav-item i {
    width: auto;
    margin: 0;
}
.sidebar.collapsed .nav-item .nav-text {
    display: none;
}
/* 收起时隐藏底部用户信息区 */
.sidebar.collapsed > div:last-child {
    display: none;
}
/* 收起时导航项悬停 - 自定义快速 tooltip */
.sidebar.collapsed .nav-item {
    position: relative;
}
.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 16px;
    padding: 6px 12px;
    background: #1e293b;
    color: white;
    font-size: 0.8rem;
    white-space: nowrap;
    border-radius: 6px;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
/* 过渡动画 */
.sidebar,
.sidebar .logo,
.sidebar .nav-item {
    transition: width 0.25s ease, padding 0.25s ease;
}
.sidebar .logo img,
.sidebar .nav-item i {
    transition: margin 0.25s ease;
}

/* 手机端隐藏折叠按钮且不受折叠影响 */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: none;
    }
    .sidebar.collapsed {
        width: 100%;
    }
    .sidebar.collapsed .logo {
        padding: 10px 0;
        text-align: left;
        font-size: 1rem;
    }
    .sidebar.collapsed .logo img {
        margin-right: 6px;
    }
    .sidebar.collapsed .logo span {
        display: inline;
    }
    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 14px 16px;
    }
    .sidebar.collapsed .nav-item .nav-text {
        display: inline;
    }
    .sidebar.collapsed > div:last-child {
        display: none;
    }
}


/* 手机端用户信息：桌面端隐藏 */
.user-info-mobile {
    display: none;
}

/* 导航菜单容器 */
.nav {
    flex: 1;                   /* 占满中间剩余空间 */
    padding: 20px 0;
}

/* 单个导航项 */
.nav-item {
    padding: 12px 20px;
    margin: 4px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;      /* 悬停/激活动画过渡 */
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}
.nav-item i {
    width: 24px;
    font-style: normal;        /* 去掉 <i> 默认斜体 */
    font-weight: 500;
}
.nav-item:hover {
    background: #334155;       /* 悬停高亮 */
}
/* 当前激活的导航项 - 蓝色高亮 */
.nav-item.active {
    background: #2563eb;
    color: white;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* --------------------------------------------------------------------------
   4. 右侧主内容区
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;                   /* 占满剩余宽度 */
    overflow-y: auto;          /* 内容超长时垂直滚动 */
    padding: 24px 32px;
}

/* --------------------------------------------------------------------------
   5. 卡片 - 白色圆角容器，用于承载每个页面的内容
   -------------------------------------------------------------------------- */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

/* 页面大标题 */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #0f172a;
}

/* --------------------------------------------------------------------------
   6. 表单
   -------------------------------------------------------------------------- */
/* 表单网格 - 自动根据宽度换列的响应式布局 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
/* 单个表单字段容器 */
.form-field {
    display: flex;
    flex-direction: column;    /* label 在上，input 在下 */
    gap: 6px;
}
.form-field label {
    font-weight: 500;
    color: #334155;
    font-size: 0.85rem;
}

/* 输入框、下拉框、按钮的统一样式 */
input, select, button {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
}
input:focus, select:focus {
    outline: none;
    border-color: #3b82f6;    /* 聚焦时蓝色边框 */
    ring: 2px solid #bfdbfe;
}

/* 按钮基类 */
button {
    background: #f1f5f9;
    cursor: pointer;
    transition: 0.2s;
}
/* 主要按钮 - 蓝色 */
button.primary {
    background: #2563eb;
    color: white;
    border: none;
}
button.primary:hover {
    background: #1d4ed8;
}
/* 危险操作按钮 - 红色 */


/* --------------------------------------------------------------------------
   7. 数据表格
   -------------------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;  /* 合并相邻边框 */
    font-size: 0.85rem;
}
th, td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: left;
}
th {
    background: #f8fafc;       /* 表头浅灰背景 */
    font-weight: 600;
}
.org-table th, .org-table td {
    text-align: center;
}


/* --------------------------------------------------------------------------
   8. Toast 提示 - 右下角浮出消息
   -------------------------------------------------------------------------- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: white;
    padding: 10px 18px;
    border-radius: 40px;
    font-size: 0.85rem;
    z-index: 1000;
    opacity: 0;                /* 默认隐藏，showToast() 动态设置 */
    transition: opacity 0.2s;
    pointer-events: none;      /* 不可点击，不遮挡下方元素 */
}

/* --------------------------------------------------------------------------
   9. 模态框 - 居中弹窗，背景半透明遮罩
   -------------------------------------------------------------------------- */
.modal {
    display: none;              /* 默认隐藏 */
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);  /* 半透明黑色遮罩 */
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
/* 模态框内部白色卡片 */
.modal-content {
    background: white;
    border-radius: 20px;
    width: 500px;
    max-width: 90%;            /* 手机等窄屏自适应 */
    padding: 24px;
}

/* 模态框内水平表单 - label 右对齐，input 在右侧 */
.modal-form {
    margin-top: 8px;
}
.modal-form-row {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}
.modal-form-row label {
    flex-shrink: 0;
    width: 100px;
    text-align: right;
    margin-right: 8px;
    font-size: 0.9rem;
    color: #334155;
}
.modal-form-row input,
.modal-form-row select {
    flex: 1;
    max-width: 260px;
    min-width: 0;
}
/* 模态框底部按钮行 - 与输入框等宽，居中 */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex: 1;
    max-width: 260px;
    margin-top: 6px;
}
/* ---- 编辑弹窗美化 ---- */
.edit-modal {
    max-height: 80vh;
    overflow-y: auto;
    padding: 4px 0;
}
.edit-modal-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}
.edit-modal-meta {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}
.edit-modal-section {
    margin-bottom: 16px;
}
.edit-modal-section-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 10px;
    line-height: 1.4;
}
.edit-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}
.edit-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px 16px;
}
.edit-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.edit-field label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}
.edit-field input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.edit-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.edit-field input[type="number"] {
    -moz-appearance: textfield;
}
.edit-field input[type="number"]::-webkit-inner-spin-button,
.edit-field input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
}
.edit-modal-footer .edit-save-btn {
    min-width: 100px;
    padding: 9px 28px;
    font-size: 0.9rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.edit-modal-footer .edit-save-btn:hover {
    background: #1d4ed8;
}
.edit-modal-footer .cancel-btn {
    min-width: 80px;
    padding: 9px 24px;
    font-size: 0.9rem;
}
/* 编辑弹窗容器宽度：桌面端640px */
.modal-content:has(.edit-modal) {
    width: 640px;
}
/* 手机端编辑弹窗窄屏适配 */
@media (max-width: 768px) {
    .modal-content:has(.edit-modal) {
        width: 95%;
        padding: 16px;
    }
    .edit-grid-2col,
    .edit-grid-3col {
        grid-template-columns: 1fr;
    }
    .edit-modal-header {
        font-size: 1rem;
    }
    .edit-modal-footer {
        flex-direction: column-reverse;
    }
    .edit-modal-footer .confirm-btn,
    .edit-modal-footer .cancel-btn {
        width: 100%;
    }
}

/* 模态框确认/取消按钮 - 与删除弹窗样式一致 */
.confirm-btn {
    min-width: 80px;
    padding: 8px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}
.confirm-btn:hover {
    background: #1d4ed8;
}
.cancel-btn {
    min-width: 80px;
    padding: 8px 24px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}
.cancel-btn:hover {
    background: #e2e8f0;
}

/* --------------------------------------------------------------------------
   10. 通用工具类（辅助用）
   -------------------------------------------------------------------------- */
.flex-between {
    display: flex;
    justify-content: space-between;  /* 左右两端对齐 */
    align-items: center;
}
.mt-4 { margin-top: 16px; }         /* margin-top: 16px */
.mb-2 { margin-bottom: 8px; }       /* margin-bottom: 8px */
.text-center { text-align: center; }
.text-sm { font-size: 0.8rem; }     /* 小号文字 */
.badge {
    background: #e2e8f0;
    border-radius: 8px;
    font-size: 0.75rem;
}
.overflow-x { overflow-x: auto; }   /* 水平滚动，用于宽表格 */

/* 顺序号输入框 — 美化版本 */
.order-input {
    width: 80px;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}
.order-input::-webkit-outer-spin-button,
.order-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.order-input:hover {
    border-color: #93c5fd;
    background: #fff;
}
.order-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.order-input:disabled {
    background: #f1f5f9;
    border-color: #e2e8f0;
    cursor: not-allowed;
}



/* 机构管理操作按钮 */
.edit-org {
    padding: 4px 14px;
    height: 30px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    margin-right: 4px;
}
.edit-org:hover {
    background: #1d4ed8;
}
.del-org {
    padding: 4px 14px;
    height: 30px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    background: #ef4444;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.del-org:hover {
    background: #dc2626;
}

/* 轮次信息提示 - 响应式表格 */
.round-info-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 4px;
}
/* ---- 头部 ---- */
.round-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.ri-header-icon {
    font-size: 1.1rem;
    line-height: 1;
}
.ri-header-text {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
}
.ri-header-text em {
    font-style: normal;
    color: #2563eb;
    font-weight: 700;
}
/* ---- 表格（桌面端） ---- */
.round-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.round-info-table thead th {
    background: #eef2f6;
    color: #475569;
    font-weight: 600;
    padding: 8px 12px;
    text-align: center;
    white-space: nowrap;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border-bottom: 2px solid #d1d9e6;
}
.round-info-table tbody td {
    padding: 10px 14px;
    text-align: center;
    border-bottom: 1px solid #e8edf4;
    color: #334155;
    vertical-align: middle;
}
/* 轮次列窄一些 */
.round-info-table tbody td:first-child,
.round-info-table thead th:first-child {
    width: 1%;
    white-space: nowrap;
}
.round-info-table tbody tr:hover {
    background: #eef2f6;
}
/* 当前轮次输入行 */
.current-round-row {
    background: #dceeff !important;
}
.current-round-row td {
    padding: 0;
    border-bottom: none !important;
}
.current-round-row td:first-child {
    padding: 6px 8px;
}
.ri-input {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 38px;
    padding: 0 8px;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    text-align: center;
    color: #1e293b;
    box-sizing: border-box;
    -moz-appearance: textfield;
    outline: none;
    cursor: text;
}
.ri-input:hover {
    background: #fff;
}
.ri-input:focus {
    background: #fff;
    box-shadow: inset 0 0 0 2px #93c5fd;
    border-radius: 4px;
}
.ri-input::-webkit-outer-spin-button,
.ri-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
@media (max-width: 768px) {
    .round-info-table,
    .round-info-table thead,
    .round-info-table tbody,
    .round-info-table tr,
    .round-info-table th,
    .round-info-table td {
        display: block;
    }
    .round-info-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .round-info-table thead {
        display: none;
    }
    .round-info-table tbody tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-left: 3px solid #94a3b8;
        border-radius: 10px;
        padding: 10px 14px;
        margin-bottom: 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }
    .round-info-table tbody tr:hover {
        background: #fff;
    }
    .round-info-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        border-bottom: 1px solid #f1f4f9;
        font-size: 0.82rem;
        line-height: 1.6;
    }
    .round-info-table tbody td::before {
        content: attr(data-label);
        color: #94a3b8;
        font-size: 0.75rem;
        flex-shrink: 0;
        width: 190px;
        text-align: right;
        margin-right: 8px;
        white-space: nowrap;
    }
    .round-info-table tbody td:last-child {
        border-bottom: none;
        color: #64748b;
    }
    .round-info-table tbody td:first-child {
        font-size: 0.9rem;
        padding-top: 0;
    }
    .round-info-table tbody td:first-child::before {
        display: none;
    }

}
/* ---- 手机端轮次区微调 ---- */
@media (max-width: 768px) {
    #roundInfo.badge {
        background: transparent;
    }
    .round-info-header {
        align-items: flex-start;
    }
    .ri-header-text {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .round-info-wrap {
        background: transparent;
        border: none;
        padding: 12px 0;
        border-radius: 0;
    }
    .round-info-table tbody td {
        padding: 4px 0;
    }
    .round-info-table tbody td:first-child {
        padding: 2px 0 6px;
    }
    .current-round-row {
        border-left: 3px solid #2563eb !important;
        background: #f5faff !important;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
    }
    .current-round-row td:first-child {
        padding: 4px 0 !important;
        margin-bottom: 6px;
    }
    .current-round-row td .ri-input {
        min-width: 0;
        max-width: 130px;
    }
    .current-round-row td::before {
        color: #60a5fa;
        white-space: nowrap;
    }
    .current-round-row td:last-child {
        display: none;
    }
    .current-round-row td .ri-input {
        font-size: 16px;
        padding: 6px 8px;
        min-height: 36px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        text-align: center;
    }
    .current-round-row td .ri-input:focus {
        border-color: #93c5fd;
        box-shadow: 0 0 0 2px #bfdbfe;
    }
}
/* 轮次标签 */
.round-badge {
    display: inline-block;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}
.current-badge {
    color: #2563eb;
    font-weight: 700;
    padding: 0 12px;
}
/* ---- 操作列按钮（编辑/删除） ---- */
.action-cell {
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}
.btn-edit-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 0.75rem;
    border: 1px solid #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 8px;
    transition: background 0.15s;
}
.btn-edit-row:hover {
    background: #dbeafe;
}
.btn-delete-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 0.75rem;
    border: 1px solid #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-delete-row:hover {
    background: #fee2e2;
}
/* 手机端：操作按钮在卡片底部铺满 */
@media (max-width: 768px) {
    .round-info-table tbody td.action-cell {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
        padding: 10px 0 4px;
        border-top: 1px solid #e2e8f0;
        margin-top: 6px;
    }
    .round-info-table tbody td.action-cell::before {
        display: none;
    }
    .btn-edit-row,
    .btn-delete-row {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.82rem;
    }
}

/* --------------------------------------------------------------------------
   19. 员工管理卡片网格布局
   -------------------------------------------------------------------------- */
/* 响应式网格容器 */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
/* 单个员工卡片 */
.staff-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #fafbfc;
    transition: box-shadow 0.2s;
}
.staff-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
/* 卡片顶部：姓名 + 在职状态 */
.staff-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.staff-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}
.staff-card-badge {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.staff-card-badge.badge-active {
    background: #dcfce7;
    color: #166534;
}
.staff-card-badge.badge-inactive {
    background: #fef2f2;
    color: #991b1b;
}
/* 卡片内容字段行 */
.staff-card-body {
    margin-bottom: 10px;
}
.staff-card-field {
    display: flex;
    padding: 3px 0;
    font-size: 0.85rem;
}
.staff-card-label {
    width: 56px;
    color: #64748b;
    flex-shrink: 0;
}
.staff-card-value {
    color: #334155;
}
/* 卡片底部操作按钮 */
.staff-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}
.staff-card-actions button {
    flex: 1;
    text-align: center;
}

/* --------------------------------------------------------------------------
   11. 汇总报表页面专用样式
   -------------------------------------------------------------------------- */
/* 查询条件行 - 三列定宽，垂直居中 */
.query-grid {
    grid-template-columns: 120px 120px auto !important;
    align-items: center;
}
/* 查询按钮 - 适中宽度 */
.query-grid button.primary {
    min-width: 100px;
    padding: 10px 24px;
}
/* 汇总表格宽度 */
.summary-table {
    min-width: 1100px;
}
/* 汇总表格数据居中对齐 */
.summary-table th,
.summary-table td {
    text-align: center;
}
/* 合计行 */
/* 合计行 */
.total-row td {
    font-weight: 700;
    background: #f8fafc;
    border-top: 1px solid #cbd5e1;
    padding: 10px 12px;
    font-size: 0.82rem;
}
/* 表头机构列 */
.col-org {
    min-width: 110px;
    text-align: center;
}
.col-category {
    min-width: 100px;
    text-align: center;
    font-size: 0.8rem;
}
/* 跨年同期查询行 - 浅蓝色背景 */
.row-cross-year {
    background: #dceeff !important;
}
.row-cross-year td {
    background: #dceeff;
}
/* 差异单元格 - 绿色(增大) / 红色(减小) */
.cell-diff-up {
    background: #c6efce !important;
}
.cell-diff-down {
    background: #ffc7ce !important;
}
/* 合并列组标题 - 居中 */
.col-group-header {
    text-align: center;
}
/* 第二行具体字段标题 - 居中 */
.col-sub-header {
    text-align: center;
}
/* 表头多选下拉组件 */
.multi-select {
    position: relative;
    display: inline-block;
    width: 100%;
    text-align: left;
}
.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    padding: 2px 0;
    font-weight: bold;
    font-size: 0.82rem;
    user-select: none;
}
.multi-select-trigger:hover {
    opacity: 0.75;
}
.multi-select-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    min-width: 0;
}
.multi-select-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.multi-select.open .multi-select-arrow {
    transform: rotate(180deg);
}
.multi-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    min-width: 160px;
    max-width: 280px;
    max-height: 260px;
    overflow-y: auto;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    padding: 4px 0;
    margin-top: 4px;
}
.multi-select.open .multi-select-dropdown {
    display: block;
}
.multi-select-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0 6px 24px;
    cursor: pointer;
    font-size: 0.82rem;
    white-space: nowrap;
    font-weight: normal;
    color: #334155;
}
.multi-select-option:hover {
    background: #f1f5f9;
}
.multi-select-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #2563eb;
    margin: 0;
    flex-shrink: 0;
}
.option-all {
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

/* 图例说明 */
.legend {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.8;
    color: #475569;
}
.legend-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #334155;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.legend-box {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    flex-shrink: 0;
}
.legend-arrow {
    font-size: 0.9rem;
}
.legend-eq {
    font-weight: bold;
    color: #334155;
}
.legend-dash {
    color: #94a3b8;
    font-weight: bold;
}
.legend-note {
    margin-top: 6px;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   12. 表单区段标题（填报/审核人信息）
   -------------------------------------------------------------------------- */
.section-header {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}
.section-header.mt-20 {
    margin-top: 20px;
}

/* --------------------------------------------------------------------------
   13. 员工选择相关
   -------------------------------------------------------------------------- */
/* "从员工库选择"链接 */
.staff-picker-link {
    color: #2563eb;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 400;
}
/* 员工列表容器 */
.staff-list {
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}
/* 空员工提示 */
.staff-empty {
    padding: 8px 12px;
    color: #94a3b8;
}
/* 员工列表项 */
.staff-item {
    padding: 8px 12px;
    margin: 4px 0;
    cursor: pointer;
    border-radius: 6px;
    background: #f8fafc;
}
/* 员工列表项悬停 */
.staff-item:hover {
    background: #e2e8f0;
}
/* 手动填写链接容器 */
.manual-link-wrapper {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}
/* 手动填写链接 */
.manual-link {
    color: #2563eb;
    cursor: pointer;
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   14. 历史补录 - 12 行月度录入表格
   -------------------------------------------------------------------------- */
/* 查询条件行：机构 + 年份 + 月份 */
.hist-query-grid {
    grid-template-columns: 200px 150px 150px !important;
}
/* 提示文字 */
.hist-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #64748b;
}
/* 说明文字 */
.hist-note {
    font-size: 0.8rem;
    color: #64748b;
}
.hist-fill-table {
    width: 66%;
    border-collapse: collapse;
    margin: 16px 0;
}
.hist-fill-table th {
    background: #f1f5f9;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    text-align: center;
}
.hist-fill-table td {
    border: 1px solid #e2e8f0;
    padding: 4px 8px;
    text-align: center;
    vertical-align: middle;
}

.hist-fill-table input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    text-align: center;
    outline: none;
    box-sizing: border-box;
}
/* 隐藏数字输入框的上下箭头 */
.hist-fill-table input[type="number"]::-webkit-inner-spin-button,
.hist-fill-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.hist-fill-table input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ==========================================================================
   15. 手机端适配（≤ 768px）
   ========================================================================== */

/* ---- 汉堡按钮（默认桌面端隐藏） ---- */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* ---- 手机端：≤ 768px ---- */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 0 12px;
        min-height: 52px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    .logo {
        padding: 10px 0;
        font-size: 1rem;
        border-bottom: none;
        background: transparent;
        flex: 1;
        min-width: 0;
    }
    .logo img {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .hamburger {
        display: block;
    }

    /* 导航默认隐藏，点击汉堡展开 */
    .nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1e2a3a;
        padding: 8px 0 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        border-radius: 0 0 12px 12px;
        max-height: 80vh;
        overflow-y: auto;
    }
    .nav.open {
        display: flex;
    }
    .nav-item {
        margin: 2px 12px;
        padding: 12px 16px;
        font-size: 0.9rem;
        white-space: nowrap;
        border-radius: 8px;
    }
    .nav-item i {
        font-size: 0.9rem;
    }

    /* 手机端导航显示用户信息 */
    .nav .user-info-mobile {
        display: block;
        border-top: 1px solid #334155;
        margin-top: 8px;
        padding: 12px 16px 4px;
        font-size: 0.8rem;
        color: #94a3b8;
    }

    .sidebar > div:last-child {
        display: none;
    }

    .main-content {
        margin-top: 52px;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 16px));
    }

    /* 标题可换行，状态徽章保持固定 */
    .si-top .si-title {
        flex: 1;
        min-width: 0;
        word-break: break-word;
    }
    .si-top .status-badge {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* 操作按钮不换行，缩放适应 */
    .si-actions {
        flex-wrap: nowrap;
    }
    .si-actions button {
        padding: 0 6px;
        font-size: 0.72rem;
        flex-shrink: 1;
        min-width: 0;
        white-space: nowrap;
    }

    .detail-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .detail-actions::-webkit-scrollbar {
        display: none;
    }
    .detail-actions button {
        flex-shrink: 0;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }
    .page-title {
        font-size: 1.15rem;
        margin-bottom: 14px;
    }
    #mainContent .card > .page-title:first-child {
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
        margin-bottom: 16px;
    }
    #fillFormGrid {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
    }
    #fillFormGrid .form-field {
        flex: 1;
        min-width: 0;
    }
    #fillFormGrid .form-field label {
        font-size: 0.72rem;
    }
    #fillFormGrid .form-field select {
        padding: 8px 6px;
        font-size: 0.82rem;
    }

    /* 汇总报表：年份、月份、查询一行显示 */
    .query-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: end;
    }
    .query-grid .form-field {
        flex: 1;
        min-width: 0;
    }
    .query-grid .form-field label {
        font-size: 0.75rem;
    }
    .query-grid .form-field input,
    .query-grid .form-field select {
        padding: 8px 8px;
        font-size: 0.85rem;
    }
    .query-grid button.primary {
        padding: 8px 12px;
        min-width: 0;
        font-size: 0.82rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .multi-select-arrow {
        font-size: 0.85rem;
    }

    input, select, button {
        padding: 10px 12px;
        font-size: 16px;
    }
    input::placeholder {
        font-size: 0.8rem;
        color: #94a3b8;
        font-style: italic;
    }

    /* 填报/审核人信息区段美化 */
    .section-header {
        font-size: 0.85rem;
        border-bottom: none;
        margin-bottom: 10px;
        padding-bottom: 0;
    }
    .section-header.mt-20 {
        margin-top: 16px;
    }
    .form-field label {
        font-size: 0.78rem;
        color: #64748b;
    }
    .staff-picker-link {
        font-size: 0.72rem;
    }
    #submitFillBtn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
        border-radius: 10px;
    }

    /* 督办页面顶部操作按钮适当缩小 */
    #btnCreateSupervise,
    #btnViewSummary {
        padding: 6px 10px;
        font-size: 0.82rem;
    }

    /* 详情页头部：返回按钮独占一行，标题在下 */
    #superviseDetailContainer .flex-between {
        flex-wrap: wrap;
        gap: 8px;
    }
    #superviseDetailContainer .flex-between > div:first-child {
        width: 100%;
    }
    #btnBackToList {
        display: block;
        margin-right: 0 !important;
        margin-bottom: 4px;
        padding: 4px 8px;
        font-size: 0.78rem;
    }
    #btnBackFromSummary {
        padding: 4px 8px;
        font-size: 0.78rem;
    }

    table {
        font-size: 0.78rem;
    }
    th, td {
        padding: 6px 8px;
    }
    .overflow-x {
        margin: 0 -8px;
        padding: 0 8px;
    }

    .query-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: end;
    }
    .query-grid .form-field {
        flex: 1;
        min-width: 0;
    }
    .hist-fill-table {
        width: 100%;
    }
    .hist-fill-table th,
    .hist-fill-table td {
        padding: 4px 6px;
    }
    .hist-fill-table input[type="number"] {
        padding: 8px 4px;
        font-size: 16px;
    }

    .modal {
        align-items: flex-start;
        padding: 16px 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-content {
        width: 95%;
        padding: 14px;
        border-radius: 12px;
        margin: auto;
    }
    .modal-content h3 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .modal-form-row {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 8px;
    }
    #sv_target_fields,
    #sv_edit_target_fields {
        display: flex;
        flex-direction: row;
        gap: 8px;
    }
    #sv_target_fields .modal-form-row,
    #sv_edit_target_fields .modal-form-row {
        flex: 1;
        flex-direction: column;
        margin-bottom: 0;
    }
    #sv_target_fields .modal-form-row label,
    #sv_edit_target_fields .modal-form-row label {
        text-align: center;
        padding-bottom: 2px;
    }
    .modal-form-row label {
        width: auto;
        text-align: left;
        padding-right: 0;
        padding-bottom: 2px;
        font-size: 0.78rem;
    }
    .modal-form-row input,
    .modal-form-row select {
        max-width: none;
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    #sv_target_fields .modal-form-row select,
    #sv_edit_target_fields .modal-form-row select {
        padding: 6px 6px;
        font-size: 0.82rem;
    }
    .modal-actions {
        max-width: none;
        gap: 16px;
        margin-top: 4px;
    }
    .modal-actions button {
        padding: 6px 16px;
        font-size: 0.82rem;
    }

    .staff-list {
        max-height: 240px;
    }

    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        text-align: center;
        border-radius: 40px;
    }

    .hist-query-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .summary-table {
        min-width: 800px;
    }
    .summary-table th,
    .summary-table td {
        white-space: nowrap;
        font-size: 0.7rem;
    }
    .td-trend {
        font-size: 0.85rem;
    }
    .legend {
        font-size: 0.72rem;
        padding: 8px 12px;
    }
    .legend-note {
        font-size: 0.68rem;
    }
}

/* ---- 小屏手机：≤ 480px ---- */
@media (max-width: 480px) {
    .main-content {
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 20px));
    }
    .card {
        padding: 12px;
        border-radius: 10px;
    }
    .page-title {
        font-size: 1.05rem;
    }

    .query-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: end;
    }
    .query-grid .form-field {
        flex: 1;
        min-width: 0;
    }

    .summary-table {
        min-width: 700px;
    }

    .modal-content {
        width: 98%;
        padding: 14px;
    }

    .hist-fill-table th,
    .hist-fill-table td {
        padding: 2px 4px;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   16. 手机端 - 页面级适配
   ========================================================================== */

@media (max-width: 768px) {
    /* ---- 机构管理（页面含 #batchUpdateOrder）：隐藏注册地址列 ---- */
    .card:has(#batchUpdateOrder) table th:nth-child(4),
    .card:has(#batchUpdateOrder) table td:nth-child(4) {
        display: none;
    }

    /* ---- 填报历史：隐藏审核人列（第7列） ---- */
    #historyListContainer table th:nth-child(7),
    #historyListContainer table td:nth-child(7) {
        display: none;
    }

    /* ---- 员工选择弹窗：增大 touch 目标 ---- */
    .staff-item {
        padding: 12px 16px !important;
        font-size: 1rem !important;
    }
    .manual-link {
        font-size: 1rem !important;
        padding: 8px 0;
        display: inline-block;
    }
    .staff-list h3 {
        font-size: 1.1rem;
    }

    /* ---- 报表面板标题 + 导出按钮折行 ---- */
    .card > .flex-between:first-child {
        flex-wrap: wrap;
        gap: 10px;
    }
    .card > .flex-between:first-child .page-title {
        margin-bottom: 0;
    }
    .card > .flex-between:first-child button {
        flex-shrink: 0;
    }

    /* ---- 机构管理顺序号输入框 ---- */
    /* 机构管理卡片式行 */
    .org-table tbody tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 10px 12px;
        margin-bottom: 8px;
        display: block;
        box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    }
    .org-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border: none;
        border-bottom: 1px solid #f1f4f9;
        font-size: 0.82rem;
    }
    .org-table tbody td:last-child {
        border-bottom: none;
        padding-top: 8px;
    }
    .org-table tbody td:last-child .edit-org {
        margin-left: auto;
    }
    .org-table tbody td:last-child .del-org {
        margin-left: 6px;
    }
    .org-table tbody td:last-child::before {
        display: inline;
    }
    .org-table thead {
        display: none;
    }
    .org-table tbody td::before {
        content: attr(data-label);
        color: #94a3b8;
        font-size: 0.75rem;
        flex-shrink: 0;
        width: 100px;
        text-align: right;
        margin-right: 12px;
    }
    .edit-org, .del-org {
        padding: 5px 10px;
        font-size: 0.82rem;
        border-radius: 6px;
    }
    #batchUpdateOrder {
        width: 100%;
        padding: 10px;
        font-size: 0.88rem;
        border-radius: 8px;
        margin-bottom: calc(8px + env(safe-area-inset-bottom, 8px));
    }
    #addOrgBtn,
    #exportOrgBtn {
        padding: 5px 10px;
        font-size: 0.82rem;
        margin-bottom: 8px;
    }
    .card .flex-between:has(#exportOrgBtn),
    .card .flex-between:has(#addOrgBtn) {
        align-items: center;
    }
    .card .flex-between:first-child > div {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .order-input {
        width: 72px;
        padding: 7px 6px;
        font-size: 0.88rem;
        text-align: center;
        border: 1.5px solid #d1d5db;
        border-radius: 8px;
        background: #f9fafb;
        font-weight: 500;
        color: #1e293b;
        transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    }
    .order-input:focus {
        border-color: #3b82f6;
        background: #fff;
        outline: none;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }
    /* ---- 员工管理手机端美化 ---- */
    .staff-card {
        border: 1px solid #e2e8f0;
        border-left: 3px solid #94a3b8;
        border-radius: 10px;
        padding: 12px 14px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    }
    .staff-card-top {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    .staff-card-name {
        font-size: 1rem;
    }
    .staff-card-body {
        margin-bottom: 8px;
    }
    .staff-card-field {
        font-size: 0.82rem;
        padding: 2px 0;
    }
    .staff-card-label {
        width: 50px;
        font-size: 0.75rem;
    }
    .staff-card-actions {
        padding-top: 8px;
        gap: 6px;
    }
    .staff-card-actions button {
        padding: 5px 10px;
        font-size: 0.78rem;
        border-radius: 6px;
    }
    .card .flex-between:has(#addStaffBtn) {
        align-items: center;
        gap: 8px;
    }
    #staffOrgSelect {
        font-size: 0.82rem;
        padding: 4px 6px;
        max-width: 120px;
    }
    #addStaffBtn {
        font-size: 0.82rem;
    }
    /* ---- 历史补录手机端美化 ---- */
    .hist-query-grid {
        grid-template-columns: 1fr 1fr auto !important;
        gap: 8px;
    }
    .hist-query-grid .form-field label {
        font-size: 0.72rem;
    }
    /* ---- 自定义下拉组件（通用） ---- */
    .custom-select-container {
        position: relative;
        display: block;
    }
    .custom-select-trigger {
        padding: 8px 28px 8px 10px;
        font-size: 0.85rem;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
        position: relative;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .custom-select-trigger::after {
        content: '▾';
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        color: #64748b;
        font-size: 0.85rem;
        pointer-events: none;
    }
    .custom-select-trigger:active {
        border-color: #93c5fd;
        box-shadow: 0 0 0 2px #bfdbfe;
    }
    .custom-select-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        margin-top: 4px;
        max-height: 180px;
        overflow-y: auto;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .custom-select-dropdown.open {
        display: block;
    }
    .custom-select-item {
        padding: 10px 12px;
        cursor: pointer;
        font-size: 0.82rem;
        border-bottom: 1px solid #f1f5f9;
    }
    .custom-select-item:last-child {
        border-bottom: none;
    }
    .custom-select-item:hover {
        background: #f1f5f9;
    }
    .custom-select-item.selected {
        background: #e8f0fe;
        color: #1e40af;
        font-weight: 500;
    }
    .hist-fill-table {
        width: 100%;
        border-collapse: collapse;
    }
    .hist-fill-table thead {
        display: none;
    }
    .hist-fill-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-left: 3px solid #94a3b8;
        border-radius: 10px;
        padding: 10px 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    }
    .hist-fill-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        border: none;
        border-bottom: 1px solid #f1f4f9;
        font-size: 0.82rem;
    }
    .hist-fill-table tbody td:last-child {
        border-bottom: none;
    }
    .hist-fill-table tbody td::before {
        content: attr(data-label);
        color: #94a3b8;
        font-size: 0.75rem;
        flex-shrink: 0;
        margin-right: 8px;
    }
    .hist-fill-table tbody td:first-child {
        font-size: 0.9rem;
        font-weight: 600;
        padding-top: 0;
    }
    .hist-fill-table tbody td:first-child::before {
        display: none;
    }
    .hist-fill-table input[type="number"] {
        width: auto;
        min-width: 100px;
        max-width: 140px;
        padding: 6px 8px;
        font-size: 16px;
        text-align: right;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        background: #f9fafb;
    }
    .hist-fill-table input[type="number"]:focus {
        border-color: #93c5fd;
        background: #fff;
        outline: none;
        box-shadow: 0 0 0 2px #bfdbfe;
    }
    .hist-hint {
        font-size: 0.78rem;
        margin-bottom: 12px;
    }
    .hist-note {
        font-size: 0.72rem;
        margin-top: 8px;
        margin-bottom: calc(8px + env(safe-area-inset-bottom, 12px));
    }
    #submitHistBtn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
        border-radius: 10px;
        margin-top: 4px;
    }
    /* ---- 填报历史手机端美化 ---- */
    #historyListContainer {
        margin-top: 12px;
    }
    .history-list-table thead {
        display: none;
    }
    .history-list-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-left: 3px solid #94a3b8;
        border-radius: 10px;
        padding: 10px 14px;
        margin-bottom: 10px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.03);
    }
    .history-list-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        border: none;
        border-bottom: 1px solid #f1f4f9;
        font-size: 0.8rem;
    }
    .history-list-table tbody td:last-child {
        border-bottom: none;
    }
    .history-list-table tbody td::before {
        content: attr(data-label);
        color: #94a3b8;
        font-size: 0.72rem;
        flex-shrink: 0;
        margin-right: 8px;
    }
    .history-list-table tbody td:first-child {
        font-size: 0.85rem;
        font-weight: 600;
        padding-top: 0;
    }
    .history-list-table tbody td:first-child::before {
        display: none;
    }
    /* 填报历史查询表单：机构、年份、月份、查询一行显示 */
    #historyListPage .form-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: end;
    }
    #historyListPage .form-grid > div {
        flex: 1;
        min-width: 0;
    }
    #historyListPage .form-grid > div label {
        font-size: 0.72rem;
    }
    #historyListPage .form-grid select {
        width: 100%;
        padding: 8px 6px;
        font-size: 0.82rem;
    }
    #historyListPage .form-grid > button {
        flex-shrink: 0;
        padding: 8px 10px;
        font-size: 0.82rem;
        white-space: nowrap;
    }
    #historyListPage {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 16px));
    }
}
    /* 移动端恢复第一个 td 的内边距 */
    .org-table td:first-child {
        padding: 4px 0;
    }
}
/* ---- 小屏极窄（≤ 480px） ---- */
@media (max-width: 480px) {
    /* 填报历史：再隐藏预测手续费列（第5列） */
    #historyListContainer table th:nth-child(5),
    #historyListContainer table td:nth-child(5) {
        display: none;
    }

    .nav-item {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   17. 登录页样式
   ========================================================================== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #f0f2f5;
}
.p-16 { padding:16px !important; }


/* 状态提示类 */
.status-loading { text-align:center; padding:40px; color:#94a3b8; }
.status-error { text-align:center; padding:40px; color:#b91c1c; }
.status-empty { text-align:center; padding:16px; color:#94a3b8; }
.status-querying { text-align:center; padding:16px; color:#94a3b8; }
.td-waiting { text-align:center; color:#94a3b8; padding:24px; }
.td-failed { text-align:center; color:#b91c1c; padding:24px; }
.login-card {
    background: white;
    border-radius: 20px;
    padding: 48px 40px;
    width: 400px;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.login-title {
    margin: 0 0 24px 0;
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 600;
}
.login-error {
    display: none;
    background: #fef2f2;
    color: #b91c1c;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    text-align: left;
}
.login-error.visible {
    display: block;
}
.login-field {
    margin-bottom: 16px;
    text-align: left;
}
.login-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #334155;
    font-weight: 500;
}
.login-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

/* 密码显示切换 */
.pwd-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.pwd-wrapper input {
    padding-right: 40px;
}
.pwd-toggle {
    position: absolute;
    right: 10px;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
}
.pwd-toggle:hover {
    background: #f1f5f9;
}
.pwd-toggle:active {
    background: #e2e8f0;
}
.login-btn {
    width: 100%;
    padding: 10px 0;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
        width: 360px;
    }
    .login-title {
        font-size: 1.1rem;
    }
    .login-field input {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 20px;
        width: 320px;
    }
    .login-icon {
        font-size: 1.5rem;
    }
    .login-title {
        font-size: 1rem;
    }
}

/* ==========================================================================
   18. 提示框（Alert）
   ========================================================================== */
.alert-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.alert-box {
    background: white;
    border-radius: 16px;
    padding: 32px 40px;
    min-width: 280px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.alert-msg {
    font-size: 1rem;
    margin: 0 0 20px 0;
    color: #334155;
    line-height: 1.6;
}
.alert-btn {
    min-width: 100px;
    padding: 8px 24px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}
/* 变化趋势箭头 */
.td-trend {
    font-size: 1.05rem;
    line-height: 1;
}
.td-trend-up {
    color: green;
}
.td-trend-down {
    color: red;
}
/* 表头筛选下拉 */


/* ==========================================================================
   20. 工作督办页面样式
   ========================================================================== */

/* ---- 督办事项列表 ---- */
.supervise-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.supervise-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    background: #fafbfc;
    transition: box-shadow 0.2s;
}
.supervise-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.si-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.si-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
}
.si-meta {
    display: flex;
    gap: 24px;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 10px;
}
.si-actions {
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* 督办列表操作按钮：紧凑小型 */
.si-actions button {
    padding: 0 10px;
    height: 26px;
    font-size: 0.78rem;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 26px;
}

.si-actions button:hover {
    background: #f3f4f6;
}

.si-actions .btn-complete {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.si-actions .btn-complete:hover {
    background: #15803d;
}

.si-actions .btn-cancel,
.si-actions .btn-reopen {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}
.si-actions .btn-cancel:hover,
.si-actions .btn-reopen:hover {
    background: #d97706;
}

.si-actions .btn-delete {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}
.si-actions .btn-delete:hover {
    background: #dc2626;
}

/* 督办详情操作按钮（与列表页保持一致） */
.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detail-actions button,
.detail-actions .detail-btn {
    padding: 0 10px;
    height: 26px;
    font-size: 0.78rem;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    cursor: pointer;
    line-height: 26px;
    transition: background 0.15s;
}

.detail-actions button:hover {
    background: #f3f4f6;
}

.detail-actions .detail-btn-complete {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.detail-actions .detail-btn-complete:hover {
    background: #15803d;
}

.detail-actions .detail-btn-cancel,
.detail-actions .detail-btn-reopen {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}
.detail-actions .detail-btn-cancel:hover,
.detail-actions .detail-btn-reopen:hover {
    background: #d97706;
}

.detail-actions .detail-btn-del {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}
.detail-actions .detail-btn-del:hover {
    background: #dc2626;
}

.detail-actions .detail-btn-share {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
.detail-actions .detail-btn-share:hover {
    background: #4f46e5;
}

/* ---- 状态徽章 ---- */
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.status-badge-active {
    background: #dbeafe;
    color: #1e40af;
}
.status-badge-completed {
    background: #dcfce7;
    color: #166534;
}
.status-badge-cancelled {
    background: #fef2f2;
    color: #991b1b;
}

/* ---- 督办详情 ---- */
.supervise-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    line-height: 1.8;
    font-size: 0.85rem;
    color: #334155;
}

/* ---- 督办排名表格 ---- */
.supervise-table {
    min-width: 700px;
}
.supervise-table th,
.supervise-table td {
    text-align: center;
    padding: 10px 12px;
}
.supervise-table th:first-child,
.supervise-table td:first-child {
    width: 50px;
}
.supervise-table th:nth-child(2),
.supervise-table td:nth-child(2) {
    text-align: left;
}
.supervise-table td:nth-child(4) {
    white-space: nowrap;
}
/* 已报送 */
.cell-submitted {
    color: #166534;
}
/* 未报送 */
.cell-pending {
    color: #b45309;
}
/* 免报 */
.cell-exempted {
    color: #64748b;
}
/* 提前 */
.diff-early {
    color: #16a34a;
    font-weight: 500;
}
/* 超时 */
.diff-late {
    color: #dc2626;
    font-weight: 500;
}
/* 第一个报送的行 */
.tr-first td {
    background: #dcfce7;
}

/* ---- 手机端 ---- */
@media (max-width: 768px) {
    .si-actions {
        flex-wrap: nowrap;
    }
    .si-meta {
        flex-direction: column;
        gap: 4px;
    }
    .supervise-table {
        min-width: 600px;
    }
}

/* ==========================================================================
   测试账号快速登录面板
   ========================================================================== */
.test-accounts {
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}

.test-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    transition: color 0.15s;
}

.test-toggle:hover {
    color: #64748b;
}

#testArrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.test-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.test-panel.hidden {
    display: none;
}

.test-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1.5px solid transparent;
    min-width: 64px;
}

.test-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.test-chip:active {
    transform: translateY(0);
}

/* 管理员 Chip */
.test-chip--admin {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.test-chip--admin:hover {
    background: #dbeafe;
    border-color: #60a5fa;
}

/* 银行用户 Chip */
.test-chip--bank {
    background: #f0fdf4;
    border-color: #86efac;
    color: #15803d;
}

.test-chip--bank:hover {
    background: #dcfce7;
    border-color: #4ade80;
}

.test-chip-id {
    font-size: 13px;
    font-weight: 600;
    font-family: 'SF Mono', 'Consolas', monospace;
    line-height: 1.3;
}

.test-chip-label {
    font-size: 11px;
    opacity: 0.8;
    line-height: 1.2;
}
