:root {
    --primary-color: #0056b3;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --border-color: #e1e4e8;
    --text-primary: #333;
    --text-secondary: #666;
}

/* ---------------------------------------------------- */
/* 登录/覆盖层样式 */
/* ---------------------------------------------------- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
    z-index: 1001; /* 确保它在导航栏之上 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-panel {
    background: white;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    width: 350px;
    text-align: center;
}

.login-panel h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 30px;
}

.login-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
}

.login-row label {
    font-weight: bold;
    min-width: 80px;
}

.login-panel select,
.login-panel input[type="password"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    min-width: 180px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.login-note {
    font-size: 12px;
    color: #888;
    margin-top: 15px;
}

/* ---------------------------------------------------- */
/* 导航栏更新 (显示信息) */
/* ---------------------------------------------------- */
.nav-info {
    font-weight: bold;
    font-size: 1.1em;
    padding-right: 20px;
    border-right: 1px solid #555;
    
    /* 核心修改：让信息文本和按钮组可以弹性换行 */
    display: flex; 
    align-items: center; 
    flex-wrap: wrap; /* 允许内部元素换行（即文本和按钮组） */
    gap: 5px 15px; /* 设置文本和按钮组之间的间距 */
    white-space: nowrap; /* 确保信息文本本身不会断行 */
}




/* 导航栏固定定位和基础样式 */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #333; /* 深色背景 */
    color: white;
    padding: 10px 20px;
    z-index: 1000; /* 确保它在所有元素之上 */
    display: flex;
    flex-wrap: wrap; /* 允许子项在空间不足时自动换行 */
    gap: 10px 20px; /* 设置行间距和列间距 */
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    justify-content: space-between; /* 确保信息和按钮在两端 */
}

/* ---------------------------------------------------- */
/* 导航栏信息区域按钮组样式 (nav-info-btn-group) */
/* ---------------------------------------------------- */
.nav-info-btn-group {
    /* 使用 Flexbox 排列内部按钮 */
    display: flex;
    align-items: center;
    gap: 8px; /* 按钮之间的间距 */
    flex-shrink: 0; /* 防止按钮组被过度压缩 */
    /* 确保按钮组作为一个整体不会在内部断行，除非元素设置了 flex-wrap */
    white-space: nowrap; 
}

.nav-actions {
    display: flex;
    flex-wrap: wrap; /* 【新增：允许内部按钮换行】 */
    gap: 15px;
}

.nav-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.save-btn {
    background-color: #5bc0de; /* 暂存使用蓝色 */
    color: white;
}


.nav-divider {
    /* margin: 0 20px; <--- 删去，改用父元素的 gap */
    color: #555;
    flex-shrink: 0; /* 确保分割线不会被压缩 */
}

.nav-quick-jump {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------------------------------------------------- */
/* 新增：快速操作组样式 (nav-quick-actions-group) */
/* ---------------------------------------------------- */
.nav-quick-actions-group {
    display: flex;
    align-items: center;
    gap: 5px; /* 设置它们之间的小间距，实现“紧挨着”的效果 */
    flex-shrink: 0; /* 确保该组元素不会被压缩 */
}

#quickJumpSelect {
    padding: 6px 10px;
    border-radius: 4px;
    background-color: #444; 
    color: white;
    
    /* 【修改/移除】：移除右侧外边距，使用父容器 .nav-quick-actions-group 的 gap 控制间距 */
    margin-right: 30px; 
    
    /* 建议保留边框，让下拉菜单更清晰 */
    border: 1px solid #777; 
}

/* ---------------------------------------------------- */
/* 辅助/取消按钮样式 (secondary-btn) */
/* ---------------------------------------------------- */
.secondary-btn {
    /* 保持与 primary-btn 相似的尺寸和字体 */
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s, color 0.3s;
    
    /* 核心样式：使用边框和透明背景，或浅色背景 */
    background-color: transparent; /* 透明背景 */
    color: #6c757d; /* 灰色文本 */
    border: 1px solid #6c757d; /* 灰色边框 */
    margin-left: 10px; /* 与主按钮保持距离 */
}

.secondary-btn:hover {
    background-color: #f8f9fa; /* 鼠标悬停时略微变浅 */
    color: #495057;
    border-color: #495057;
}

/* 确保在 login-panel 中按钮的对齐和布局良好 */
.login-panel button {
    /* 确保按钮在行内有间距 */
    margin-right: 10px;
}


/* ---------------------------------------------------- */
/* 导航栏信息区域按钮样式 (nav-info-btn) */
/* ---------------------------------------------------- */
.nav-info-btn {
    /* 缩小尺寸，使其更像一个链接而不是主按钮 */
    padding: 3px 8px; 
    font-size: 0.8em; /* 字体比导航栏文本略小 */
    font-weight: normal; 
    
    /* 核心样式：使其融入背景 */
    background-color: #555; /* 略深于导航栏背景 */
    color: #fff;
    border: 1px solid #777; 
    border-radius: 3px;
    cursor: pointer;
    margin-left: 10px; /* 与科室名称保持距离 */
    
    /* 垂直对齐：确保它与旁边的文本和 Span 元素中线对齐 */
    vertical-align: middle; 
    display: inline-block;
    line-height: 1.2; /* 紧凑的行高 */
    transition: background-color 0.2s;
}

.nav-info-btn:hover {
    background-color: #666; /* 鼠标悬停时略微变亮 */
    border-color: #888;
}

/* 可选：调整 nav-info 容器，确保内部元素对齐 */
.nav-info {
    /* 确保容器内的所有元素都在垂直方向上居中 */
    display: flex;
    align-items: center; 
    gap: 5px; /* 元素间的默认间距 */
    /* ... 保持原来的 padding-right 和 border-right 样式 ... */
}


/* 禁用按钮样式 */
.nav-btn:disabled,
.primary-btn:disabled {
    opacity: 0.5; /* 透明度降低 */
    cursor: not-allowed; /* 鼠标指针变为禁止符号 */
    filter: grayscale(100%); /* 变为灰色 */
}


/* ---------------------------------------------------- */
/* 替换：居中引导提示蒙版样式 */
/* ---------------------------------------------------- */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* 更深的背景，完全覆盖 */
    z-index: 1002; 
    display: flex; /* 使用 Flexbox 居中 */
    justify-content: center;
    align-items: center;
}

.guide-box-center {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
    width: 400px;
    text-align: center;
    animation: fadeIn 0.5s;
}

.guide-box-center h2 {
    color: #cc0000;
    margin-top: 0;
    font-size: 24px;
}

.guide-box-center p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.large-btn {
    padding: 15px 30px; /* 使按钮更大，更明显 */
    font-size: 18px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}


body {
    font-family: "Microsoft YaHei", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    padding-top: 60px; /* 假设导航栏高度约为 50px，预留足够空间 */
}

h1 {
    font-size: 20px;
    margin: 0;
    color: var(--primary-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.header-panel {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border-top: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between; /* 保持标题和控制组分开 */
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 20px; /* 年份和科室之间的间距 */
}

.year-select-group,
.dept-select-group {
    display: flex;
    align-items: center;
    gap: 10px; /* 标签和下拉框之间的间距 */
}

select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card-header {
    background-color: #f8f9fa;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    color: var(--primary-color);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header:hover {
    background-color: #e9ecef;
}

.card-header::after {
    content: '▼';
    font-size: 12px;
    color: #999;
}

.card.collapsed .card-body {
    display: none;
}

.card.collapsed .card-header::after {
    content: '▲';
}

.card-body {
    padding: 10px 0;
}

.form-row {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    border-bottom: 1px solid #f5f5f5;
}

.form-row:last-child {
    border-bottom: none;
}

.form-row:hover {
    background-color: #fafafa;
}



.label-col {
    flex: 1;
    font-size: 14px;
    color: #444;
    padding-right: 15px;
}


/* ---------------------------------------------------- */
/* 修复：使用 Grid 布局完美解决单选框垂直排列对齐问题 */
/* ---------------------------------------------------- */

.input-col {
    /* 基础布局属性 */
    flex-grow: 1;
    min-width: 250px;
    
    /* 【核心修改】使用 Grid 网格布局 */
    display: grid;
    /* 定义两列：第一列自适应(放圆圈)，第二列占据剩余空间(放文字) */
    grid-template-columns: max-content auto; 
    /* 垂直方向居中对齐 */
    align-items: center;
    /* 设置间距：第一个值是行间距(8px)，第二个值是圆圈和文字的间距(8px) */
    gap: 8px 8px;
    
    /* 强制靠左对齐，覆盖原有的 text-align: right */
    text-align: left;
}

/* 1. 调整标签文字样式 */
.input-col label {
    font-size: 15px; /* 【问题一解决】调大字体，原为14px或更小 */
    line-height: 1.5;
    margin: 0; /* 清除多余边距，由 Grid gap 控制 */
    cursor: pointer;
}

/* 2. 调整 Radio 按钮样式 */
.input-col input[type="radio"] {
    margin: 0; /* 清除默认边距 */
    cursor: pointer;
    transform: translateY(1px); /* 微调位置，视觉上更居中 */
}

/* 3. 【重要】防止影响普通输入框 (如数字输入框) */
/* 如果 .input-col 里放的是普通输入框，让它跨越两列并占满宽度 */
.input-col input:not([type="radio"]):not([type="checkbox"]) {
    grid-column: 1 / -1; /* 跨越所有列 */
    width: 100%;
}


input[type="number"], input[type="text"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
    font-size: 14px;
    transition: border 0.3s;
}



input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,86,179,0.1);
}

.unit {
    margin-left: 5px;
    color: #888;
    font-size: 12px;
    width: 30px;
    display: inline-block;
}

.btn-area {
    text-align: center;
    padding: 30px;
}

.btn-save {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 60px;
    font-size: 16px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,86,179,0.2);
    transition: transform 0.2s;
}

.btn-save:hover {
    background-color: #004494;
    transform: translateY(-2px);
}

.sub-section-title {
    padding: 5px 20px;
    background: #fffbe6;
    font-size: 14px;
    color: #856404;
    font-weight: bold;
    border-bottom: 1px solid #f0f0f0;
}


.sub-sub-section-title {
    padding: 4px 30px;
    background: #f8f9fa;
    font-size: 13px;
    color: #495057;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    margin: 2px 0;
}

/* custom-note 类的 CSS 样式 */
.custom-note {
    /* 容器外观：使用浅色背景和左侧强调边框，使其在表单中突出 */
    background-color: #f7f9fc; /* 浅米色/淡蓝色背景，与白色卡片区分 */
    border: 1px solid #e0e6ed; /* 浅色边框 */
    border-left: 5px solid #007bff; /* 左侧蓝色粗边，作为强调色和视觉焦点 */
    padding: 15px; /* 内边距 */
    margin: 15px 0; /* 上下外边距，与上下卡片内容隔开 */
    border-radius: 4px; /* 轻微圆角 */
    font-size: 14px; /* 字体略小，适合注释说明 */
    line-height: 1.6; /* 提高行高，增强可读性 */
    color: #333; /* 标准文本颜色 */
}

/* 调整 custom-note 内部段落的间距 */
.custom-note p {
    margin: 0 0 8px 0;
}

/* 消除最后一个段落的底部间距 */
.custom-note p:last-child {
    margin-bottom: 0;
}

/* 强调说明或定义文字 */
.custom-note p strong {
    color: #0056b3; /* 使用略深的蓝色，与左侧强调色搭配 */
    font-weight: 700; /* 加粗 */
    margin-right: 5px; /* 标题与内容间留出空隙 */
}

.highlight-warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-weight: bold;
    margin: 0 2px;
}