/* 主样式文件 - 基础布局和通用组件 */
/* Bootstrap 风格优化版本 v2.0 */

/* 基础样式 */
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bs-gray-100, #f8f9fa);
}

/* 头部样式 - 现代渐变风格 */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    color: #ffffff;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    border-bottom: none;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.15);
}

/* Logo 区域 - 品牌标识 */
.logo {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Logo 图标 */
.logo-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* 头部右侧区域统一样式 */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #ffffff;
}

.header-right > * {
    display: flex;
    align-items: center;
}

/* 头部登出按钮 - 适配深色背景 */
.header .logout-btn,
.header .logout-btn.ant-btn {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 6px !important;
    font-weight: 500;
    font-size: 13px !important;
    height: 32px !important;
    padding: 0 12px !important;
    transition: all 0.2s ease;
}

.header .logout-btn span,
.header .logout-btn .ant-btn > span {
    color: #ffffff !important;
}

.header .logout-btn:hover,
.header .logout-btn.ant-btn:hover {
    background-color: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* 头部选择器统一样式 */
.header .tenant-selector,
.header .language-selector {
    min-width: 100px;
}

.header .tenant-selector .ant-select-selector,
.header .language-selector .ant-select-selector {
    height: 32px !important;
    line-height: 30px !important;
    box-sizing: border-box;
    border-radius: 6px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    color: #ffffff !important;
    transition: all 0.2s;
}

.header .tenant-selector .ant-select-selection-item,
.header .language-selector .ant-select-selection-item {
    line-height: 30px !important;
    font-size: 13px !important;
    color: #ffffff !important;
}

.header .tenant-selector .ant-select-arrow,
.header .language-selector .ant-select-arrow {
    color: rgba(255, 255, 255, 0.8) !important;
}

.header .tenant-selector:hover .ant-select-selector,
.header .tenant-selector.ant-select-focused .ant-select-selector,
.header .language-selector:hover .ant-select-selector,
.header .language-selector.ant-select-focused .ant-select-selector {
    border-color: rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.25) !important;
}

.header #language-switcher:hover {
    border-color: rgba(255, 255, 255, 0.6);
}

.header #language-switcher:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

/* 审批通知按钮 */
.header .ant-btn-text {
    color: #6b7280 !important;
    height: 32px !important;
    width: 32px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.header .ant-btn-text:hover {
    background: #f3f4f6 !important;
    color: #3b82f6 !important;
}

/* 用户名显示 */
.header .user-info {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

/* 头部分隔线 */
.header .header-divider {
    width: 1px;
    height: 20px;
    background: #e5e7eb;
}

/* 头部图标按钮 */
.header .header-icon-btn {
    height: 32px !important;
    width: 32px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    background: transparent !important;
}

.header .header-icon-btn:hover {
    background: #f3f4f6 !important;
}

/* 头部徽章 - 确保计数指示器可见（不被 overflow 裁剪） */
.header .ant-badge {
    overflow: visible !important;
}
.header .ant-badge .ant-badge-count {
    z-index: 10;
    pointer-events: none;
}

/* 头部图标统一大小 */
.header .header-icon {
    font-size: 16px;
    line-height: 1;
}

/* 主体布局 */
.content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 侧边栏样式 - Bootstrap 风格 */
.sider {
    width: 220px;
    background: var(--bs-white, #ffffff);
    border-right: 1px solid var(--bs-gray-200, #e9ecef);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

/* 侧边栏菜单容器 - 确保菜单可以滚动 */
.sider .ant-menu {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    background: transparent;
}

/* 自定义滚动条样式 - 更精致 */
.sider .ant-menu::-webkit-scrollbar {
    width: 6px;
}

.sider .ant-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sider .ant-menu::-webkit-scrollbar-thumb {
    background: var(--bs-gray-300, #dee2e6);
    border-radius: 3px;
}

.sider .ant-menu::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-400, #ced4da);
}

/* 主内容区 - Bootstrap 风格 */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--bs-gray-100, #f8f9fa);
    /* 添加 flex 布局支持，让内部 height:100% 生效 */
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 底部样式 - Bootstrap 风格 */
.footer {
    text-align: center;
    padding: 12px 24px;
    background: var(--bs-white, #ffffff);
    border-top: 1px solid var(--bs-gray-200, #e9ecef);
    font-size: 0.8125rem;
    color: var(--bs-gray-600, #6c757d);
}

/* 通用组件样式 */
.loading {
    text-align: center;
    padding: 20px;
}

/* 工单表格交互样式 */
.workorder-table .ant-table-tbody > tr > td {
    cursor: pointer;
}

.workorder-table .ant-table-tbody > tr:hover > td {
    background-color: #fafafa;
}

/* 工单表格选中行高亮 */
.workorder-table .ant-table-tbody > tr.workorder-row-selected > td {
    background-color: #e6f7ff !important;
    border-color: #91d5ff;
}

.workorder-table .ant-table-tbody > tr.workorder-row-selected:hover > td {
    background-color: #bae7ff !important;
}

/* ==================== 位置档案管理专用样式 ==================== */
.location-node {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.location-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-name {
    font-weight: 500;
    color: #262626;
}

.location-meta {
    color: #8c8c8c;
    font-size: 12px;
}

.location-actions {
    display: flex;
    gap: 8px;
}

.ant-tree-node-content-wrapper:hover .location-actions {
    opacity: 1;
}

/* ==================== 部门档案管理专用样式 ==================== */
.department-node {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
}

.department-info {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.department-name {
    font-weight: 500;
    color: #262626;
}

.department-meta {
    color: #8c8c8c;
    font-size: 12px;
}

.department-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.ant-tree-node-content-wrapper:hover .department-actions {
    opacity: 1;
}

.form-section {
    margin-bottom: 16px;
}

.form-section-title {
    font-weight: 500;
    margin-bottom: 12px;
    color: #262626;
}
