/* 全局统一样式 - 绩效管理平台 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    background-color: #f5f7fa;
    color: #333;
}

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

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    background-color: #f5f7fa;
}

/* 页面标题 */
.page-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 面包屑（全站统一字号） */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    background: #f7faff;
    border: 1px solid #dce8f5;
    border-radius: 4px;
    padding: 10px 16px;
}

.action-bar-btns {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.action-bar-btns .btn-default,
.action-bar-btns .search-btn.btn-default {
    color: #478ae1;
    border-color: #91caff;
    background: #fff;
    font-size: 14px;
}

.action-bar-btns .btn-default:hover,
.action-bar-btns .search-btn.btn-default:hover {
    color: #478ae1;
    border-color: #478ae1;
    background: #e6f4ff;
}

.action-bar-btns .search-btn {
    font-size: 14px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 14px;
    line-height: 22px;
    color: #595959;
}

.breadcrumb .home-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #bfbfbf;
    font-size: 14px;
    line-height: 22px;
    font-weight: 400;
}

.breadcrumb .link {
    color: #595959;
    cursor: pointer;
    font-size: 14px;
    line-height: 22px;
    font-weight: 400;
}

.breadcrumb .link:hover {
    color: #478ae1;
}

.breadcrumb .current {
    color: #478ae1;
    font-size: 14px;
    line-height: 22px;
    font-weight: 500;
}

/* 查询区 */
.search-section {
    background-color: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #c8d6e9;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.search-label {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

.search-input {
    width: 180px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.search-input:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.search-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    min-width: 60px;
    padding: 0 15px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    line-height: 1;
    box-sizing: border-box;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    min-width: 60px;
    padding: 0 15px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    line-height: 1;
    box-sizing: border-box;
}

.btn-primary {
    width: auto;
    height: 32px;
    min-width: 60px;
    background-color: #478ae1;
    color: #fff;
    border-color: #478ae1;
    padding: 0 15px;
    line-height: 1;
    text-align: center;
}

.btn-primary:hover {
    background-color: #5c9aeb;
    border-color: #5c9aeb;
}

.btn-primary:active {
    background-color: #3a78c9;
    border-color: #3a78c9;
}

.btn-default {
    width: auto;
    height: 32px;
    min-width: 60px;
    background-color: #fff;
    color: #606266;
    border: 1px solid #dcdfe6;
    padding: 0 15px;
    line-height: 1;
    text-align: center;
}

.btn-default:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

/* 查询区按钮尺寸与颜色（与输入框同高） */
.search-section .btn,
.search-section .search-btn,
.search-actions .btn,
.search-actions .search-btn {
    height: 32px;
    min-width: 60px;
    padding: 0 15px;
    font-size: 14px;
    border-radius: 4px;
    line-height: 1;
}

.search-section .btn-primary,
.search-actions .btn-primary,
.search-section .search-btn.btn-primary,
.search-actions .search-btn.btn-primary {
    background-color: #478ae1;
    border-color: #478ae1;
    color: #fff;
    width: auto;
}

.search-section .btn-primary:hover,
.search-actions .btn-primary:hover,
.search-section .search-btn.btn-primary:hover,
.search-actions .search-btn.btn-primary:hover {
    background-color: #5c9aeb;
    border-color: #5c9aeb;
}

.search-section .btn-default,
.search-actions .btn-default {
    color: #606266;
    border-color: #dcdfe6;
    background-color: #fff;
    width: auto;
}

.search-section .btn-default:hover,
.search-actions .btn-default:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

.btn-green {
    background-color: #478ae1;
    color: #fff;
    border-color: #478ae1;
    padding: 0 15px;
}

.btn-green:hover {
    background-color: #5c9aeb;
    border-color: #5c9aeb;
}

.btn-black {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

.btn-black:hover {
    background-color: #444;
    border-color: #444;
}

/* 列表区域 */
.list-section {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #c8d6e9;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 0;
    overflow: hidden;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0;
}

/** 仅含操作按钮的列表头：右对齐 */
.list-header-actions {
    justify-content: flex-end;
}

/** 仅含操作按钮的页头：右对齐 */
.page-title-actions {
    justify-content: flex-end;
    margin-bottom: 16px;
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.btn-success,
.btn-add {
    background-color: #478ae1;
    color: #fff;
    border-color: #478ae1;
}

.btn-success:hover,
.btn-add:hover {
    background-color: #5c9aeb;
    border-color: #5c9aeb;
}

/** 列表头操作按钮与查询主按钮一致 */
.list-header .btn,
.list-header .search-btn,
.list-header-actions .btn,
.list-header-actions .search-btn {
    height: 32px;
    min-width: 60px;
    padding: 0 15px;
    font-size: 14px;
    border-radius: 4px;
    line-height: 1;
}

.list-header .btn-primary,
.list-header .btn-success,
.list-header .btn-add,
.list-header .btn-green,
.list-header .search-btn.btn-primary {
    background-color: #478ae1;
    border-color: #478ae1;
    color: #fff;
}

/* 表格 */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

table th {
    background-color: #e6f4ff;
    color: #0d3d7a;
    font-weight: 600;
    border-bottom: 1px solid #c8d6e9;
}

table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

table tbody tr:hover {
    background-color: #f5f7fa;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* 操作链接 */
.action-link {
    color: #478ae1;
    cursor: pointer;
    text-decoration: none;
    margin-right: 12px;
    font-size: 14px;
}

.action-link:last-child {
    margin-right: 0;
}

.action-link:hover {
    text-decoration: underline;
}

.action-link.calc {
    color: #00b42a;
}

.action-link.calc:hover {
    color: #009024;
}

.action-link.danger {
    color: #ff4d4f;
}

.action-link.danger:hover {
    color: #d9363e;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.status-enabled {
    background-color: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-disabled {
    background-color: #fff1f0;
    color: #ff4d4f;
    border: 1px solid #ffa39e;
}

/* 操作按钮样式 */
.action-btn {
    display: inline-block;
    padding: 2px 4px;
    margin: 0 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.action-btn.edit {
    color: #1677ff;
}

.action-btn.edit:hover {
    color: #4096ff;
}

.action-btn.delete {
    color: #ff4d4f;
}

.action-btn.delete:hover {
    color: #ff7875;
}

.action-btn.toggle-enabled {
    color: #52c41a;
}

.action-btn.toggle-disabled {
    color: #ff4d4f;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background-color: #fff;
    color: #333;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #478ae1;
    color: #478ae1;
    background-color: #fff;
}

.pagination-btn.active {
    background-color: #478ae1;
    color: #fff;
    border-color: #478ae1;
}

.pagination-btn:disabled {
    cursor: not-allowed;
    color: #d9d9d9;
}

.pagination-info {
    margin-top: 0;
    margin-right: 16px;
    text-align: left;
    font-size: 14px;
    color: #666;
}

.pagination-select {
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 16px;
    height: 32px;
    outline: none;
    background: #fff;
}

.pagination-jumper {
    margin-left: 16px;
    color: #666;
    font-size: 14px;
}

.pagination-jumper input {
    width: 40px;
    height: 32px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-align: center;
    margin: 0 4px;
    outline: none;
}

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.45);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background-color: #fff;
    border-radius: 4px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    font-size: 20px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

/* 表单项 */
.form-item {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.form-item:last-child {
    margin-bottom: 0;
}

.form-item label {
    width: 120px;
    text-align: right;
    margin-right: 12px;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.form-item input,
.form-item select {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.form-item input:focus,
.form-item select:focus {
    outline: none;
    border-color: #1677ff;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 多选下拉框样式 */
.multi-select-wrapper {
    width: 100%;
    position: relative;
}

.multi-select-trigger {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.multi-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 240px;
    overflow-y: auto;
}

.multi-select-dropdown.show {
    display: block;
}

.multi-select-search {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.multi-select-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
}

.multi-select-options {
    padding: 4px 0;
}

.multi-select-option {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
}

.multi-select-option:hover {
    background-color: #e6f7ff;
}

.multi-select-option input[type="checkbox"] {
    margin-right: 8px;
}

.multi-select-footer {
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.multi-select-footer button {
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    background: #fff;
    margin-left: 8px;
}

/* 树形结构 */
.tree-indent {
    display: inline-block;
    width: 20px;
}

.tree-expand {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}

.tree-expand:hover {
    color: #1677ff;
}

.tree-expand.expanded {
    transform: rotate(90deg);
}

.tree-leaf {
    display: inline-block;
    width: 16px;
    height: 16px;
}

.tree-hidden {
    display: none;
}