/* ========== 全局样式 ========== */
* { 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;
  color: #303133;
  background: #f0f2f5;
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
ul, li { list-style: none; }

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

/* 侧边栏 */
.sidebar {
  width: 220px;
  background: #1f2d3d;
  color: #bfcbd9;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}
.sidebar-logo {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid #2b3a4b;
  background: #1a2736;
}
.sidebar-menu {
  padding: 8px 0;
  display: block;
  width: 100%;
}
.menu-item {
  cursor: pointer;
  user-select: none;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  float: none;
  clear: both;
}
.menu-title {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #bfcbd9;
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;
  width: 100%;
  box-sizing: border-box;
}
.menu-title:hover { background: #2b3a4b; color: #fff; }
.menu-title.active { background: #409eff; color: #fff; }
.menu-title .menu-icon {
  width: 20px;
  margin-right: 10px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}
.menu-title .menu-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.menu-item.open .menu-arrow { transform: rotate(90deg); }

/* ========== details/summary 菜单（无JS依赖）========== */
.menu-group {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}
.menu-group > summary {
  list-style: none;
  cursor: pointer;
  outline: none;
}
.menu-group > summary::-webkit-details-marker {
  display: none;
}
.menu-group[open] .menu-arrow {
  transform: rotate(90deg);
}
.menu-group .submenu {
  display: block !important;
}
.menu-group:not([open]) .submenu {
  display: none !important;
}

/* ===== 子菜单：强制纵向单列 ===== */
.submenu {
  display: none !important;
  background: #1a2736;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  float: none;
  clear: both;
}
.menu-item.open > .submenu {
  display: block !important;
}
.submenu-item {
  display: block !important;
  width: 100%;
  padding: 10px 20px 10px 50px;
  color: #bfcbd9;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  box-sizing: border-box;
  float: none !important;
  clear: both !important;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  border: none;
}
.submenu-item:hover { background: #2b3a4b; color: #fff; }
.submenu-item.active { color: #409eff; background: #2b3a4b; }

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部导航 */
.header {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #e4e7ed;
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-title {
  font-size: 16px;
  font-weight: 500;
  color: #303133;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #409eff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* 面包屑 */
.breadcrumb {
  padding: 16px 24px 0;
  font-size: 14px;
  color: #606266;
}
.breadcrumb span { color: #c0c4cc; }
.breadcrumb a { color: #606266; }
.breadcrumb a:hover { color: #409eff; }
.breadcrumb .current { color: #303133; }

/* 内容区 */
.content {
  padding: 16px 24px 24px;
  flex: 1;
}

/* ========== Element UI 风格组件 ========== */

/* 卡片 */
.card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  padding: 20px;
  margin-bottom: 16px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #606266;
  cursor: pointer;
  transition: all 0.2s;
  gap: 4px;
  white-space: nowrap;
}
.btn:hover { color: #409eff; border-color: #c6e2ff; background: #ecf5ff; }
.btn-primary { background: #409eff; border-color: #409eff; color: #fff; }
.btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; }
.btn-success { background: #67c23a; border-color: #67c23a; color: #fff; }
.btn-success:hover { background: #85ce61; border-color: #85ce61; color: #fff; }
.btn-warning { background: #e6a23c; border-color: #e6a23c; color: #fff; }
.btn-warning:hover { background: #ebb563; border-color: #ebb563; color: #fff; }
.btn-danger { background: #f56c6c; border-color: #f56c6c; color: #fff; }
.btn-danger:hover { background: #f78989; border-color: #f78989; color: #fff; }
.btn-info { background: #909399; border-color: #909399; color: #fff; }
.btn-info:hover { background: #a6a9ad; border-color: #a6a9ad; color: #fff; }
.btn-text {
  border: none;
  background: transparent;
  color: #409eff;
  padding: 4px 8px;
  font-size: 13px;
}
.btn-text:hover { color: #66b1ff; background: transparent; }
.btn-text.danger { color: #f56c6c; }
.btn-text.danger:hover { color: #f78989; }
.btn-text.warning { color: #e6a23c; }
.btn-text.warning:hover { color: #ebb563; }
.btn-text.disabled { color: #c0c4cc; cursor: not-allowed; }
.btn-text.disabled:hover { color: #c0c4cc; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 12px; }

/* 输入框 */
.input {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  color: #606266;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}
.input:focus { border-color: #409eff; }
.input::placeholder { color: #c0c4cc; }

/* 下拉选择 */
.select {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  color: #606266;
  outline: none;
  background: #fff;
  cursor: pointer;
  min-width: 140px;
}
.select:focus { border-color: #409eff; }

/* 搜索栏 */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-item label {
  font-size: 14px;
  color: #606266;
  white-space: nowrap;
}
.search-item .input { width: 180px; }
.search-item .select { width: 160px; }
.search-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* 操作栏 */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.action-left { display: flex; gap: 8px; }
.action-right { display: flex; gap: 8px; }

/* Tab 切换 */
.tabs {
  display: flex;
  border-bottom: 2px solid #e4e7ed;
  margin-bottom: 20px;
}
.tab-item {
  padding: 12px 24px;
  font-size: 14px;
  color: #606266;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  margin-bottom: -2px;
}
.tab-item:hover { color: #409eff; }
.tab-item.active {
  color: #409eff;
  font-weight: 500;
}
.tab-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #409eff;
}

/* 表格 */
.table-wrapper {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  background: #f5f7fa;
  color: #909399;
  font-weight: 500;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #ebeef5;
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #ebeef5;
  color: #606266;
}
tbody tr:hover { background: #f5f7fa; }
tbody tr:last-child td { border-bottom: none; }

/* 标签/状态 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 3px;
  border: 1px solid;
  line-height: 1.5;
}
.tag-primary { color: #409eff; border-color: #b3d8ff; background: #ecf5ff; }
.tag-success { color: #67c23a; border-color: #c2e7b0; background: #f0f9eb; }
.tag-warning { color: #e6a23c; border-color: #f5dab1; background: #fdf6ec; }
.tag-danger { color: #f56c6c; border-color: #fbc4c4; background: #fef0f0; }
.tag-info { color: #909399; border-color: #d3d4d6; background: #f4f4f5; }

/* 分页 */
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
}
.pagination .page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
  color: #606266;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pagination .page-btn:hover { color: #409eff; border-color: #409eff; }
.pagination .page-btn.active {
  background: #409eff;
  border-color: #409eff;
  color: #fff;
}
.pagination .page-info { color: #606266; font-size: 13px; margin-right: 8px; }

/* 操作列按钮组 */
.action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ========== 弹窗 ========== */
.modal-mask {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  overflow-y: auto;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 4px;
  width: 800px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.modal-sm { width: 480px; }
.modal-lg { width: 1000px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #ebeef5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 500; color: #303133; }
.modal-close {
  font-size: 20px;
  color: #909399;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}
.modal-close:hover { color: #409eff; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #ebeef5;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* 表单 */
.form-item {
  display: flex;
  margin-bottom: 18px;
  align-items: flex-start;
}
.form-label {
  width: 120px;
  text-align: right;
  padding-right: 12px;
  padding-top: 8px;
  color: #606266;
  font-size: 14px;
  flex-shrink: 0;
}
.form-label.required::before {
  content: '*';
  color: #f56c6c;
  margin-right: 4px;
}
.form-content {
  flex: 1;
}
.form-content .input { width: 100%; max-width: 400px; }
.form-content .select { width: 100%; max-width: 400px; }
.form-content textarea {
  width: 100%;
  max-width: 400px;
  min-height: 80px;
  padding: 8px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  color: #606266;
  outline: none;
  resize: vertical;
  font-family: inherit;
}
.form-content textarea:focus { border-color: #409eff; }

/* 详情分组 */
.detail-section {
  margin-bottom: 24px;
}
.detail-section-title {
  font-size: 15px;
  font-weight: 500;
  color: #303133;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ebeef5;
  position: relative;
  padding-left: 10px;
}
.detail-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 8px;
  width: 3px;
  background: #409eff;
  border-radius: 2px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.detail-item {
  display: flex;
  font-size: 14px;
  line-height: 1.8;
}
.detail-item .label {
  color: #909399;
  min-width: 100px;
  flex-shrink: 0;
}
.detail-item .value {
  color: #303133;
  flex: 1;
}

/* 树状结构 */
.tree-item {
  padding: 6px 0;
}
.tree-item .tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
}
.tree-item .tree-node:hover { background: #f5f7fa; }
.tree-item .tree-icon {
  font-size: 12px;
  color: #909399;
  width: 16px;
  text-align: center;
}
.tree-children {
  padding-left: 24px;
  display: none;
}
.tree-item.open .tree-children { display: block; }

/* 数据统计 */
.stats-section {
  margin-bottom: 24px;
}
.stats-section:last-child { margin-bottom: 0; }
.stats-section-title {
  font-size: 15px;
  font-weight: 500;
  color: #303133;
  margin-bottom: 16px;
  padding-left: 10px;
  position: relative;
}
.stats-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: #409eff;
  border-radius: 2px;
}
.stats-row {
  display: flex;
  gap: 24px;
  align-items: center;
}
.stats-list {
  flex: 1;
}
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #ebeef5;
  font-size: 13px;
}
.stat-item:last-child { border-bottom: none; }
.stat-item .stat-label { color: #606266; }
.stat-item .stat-value { color: #303133; font-weight: 500; }
.stat-chart {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.donut-chart {
  width: 120px;
  height: 120px;
  position: relative;
}
.donut-chart svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-center .num {
  font-size: 20px;
  font-weight: 600;
  color: #303133;
}
.donut-center .txt {
  font-size: 12px;
  color: #909399;
}

/* 生成报告 */
.report-options {
  margin-bottom: 20px;
}
.report-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.report-btn-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}
.report-btn-card:hover {
  border-color: #409eff;
  background: #ecf5ff;
}
.report-icon {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.report-icon.word { background: #2b7cff; color: #fff; }
.report-icon.excel { background: #21a369; color: #fff; }
.report-icon.pdf { background: #f56c6c; color: #fff; }
.report-info .report-name {
  font-size: 14px;
  color: #303133;
  font-weight: 500;
  margin-bottom: 2px;
}
.report-info .report-desc {
  font-size: 12px;
  color: #909399;
}
.report-notice {
  background: #fdf6ec;
  border: 1px solid #faecd8;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  color: #e6a23c;
}
.report-notice p { margin-bottom: 4px; }
.report-notice p:last-child { margin-bottom: 0; }

/* 终止弹窗 */
.terminate-options {
  display: flex;
  gap: 16px;
  margin: 16px 0;
}
.terminate-option {
  flex: 1;
  padding: 20px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.terminate-option:hover { border-color: #409eff; background: #ecf5ff; }
.terminate-option.selected { border-color: #409eff; background: #ecf5ff; }
.terminate-option .opt-icon {
  font-size: 32px;
  margin-bottom: 8px;
  color: #409eff;
}
.terminate-option .opt-title {
  font-size: 14px;
  color: #303133;
  font-weight: 500;
  margin-bottom: 4px;
}
.terminate-option .opt-desc {
  font-size: 12px;
  color: #909399;
}

/* 审批节点流 */
.approval-flow {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.flow-node {
  display: flex;
  align-items: center;
  gap: 4px;
}
.flow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dcdfe6;
}
.flow-dot.done { background: #67c23a; }
.flow-dot.active { background: #409eff; }
.flow-dot.rejected { background: #f56c6c; }
.flow-line {
  width: 20px;
  height: 2px;
  background: #dcdfe6;
}
.flow-line.done { background: #67c23a; }
.flow-label {
  font-size: 12px;
  color: #909399;
  white-space: nowrap;
}
.flow-label.done { color: #67c23a; }
.flow-label.active { color: #409eff; }

/* 选择状态条 */
.selection-bar {
  background: #ecf5ff;
  border: 1px solid #b3d8ff;
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: #409eff;
}
.selection-bar .clear-btn {
  color: #409eff;
  cursor: pointer;
  text-decoration: underline;
}
.selection-bar .total-points {
  margin-left: auto;
  font-weight: 500;
}

/* 仪表盘 */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.stat-card .stat-title {
  font-size: 14px;
  color: #909399;
  margin-bottom: 8px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 4px;
}
.stat-card .stat-desc {
  font-size: 12px;
  color: #909399;
}
.stat-card.primary .stat-value { color: #409eff; }
.stat-card.success .stat-value { color: #67c23a; }
.stat-card.warning .stat-value { color: #e6a23c; }
.stat-card.danger .stat-value { color: #f56c6c; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

/* 快捷入口 */
.quick-entries {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.quick-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.quick-entry:hover {
  border-color: #409eff;
  background: #ecf5ff;
}
.quick-entry .entry-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ecf5ff;
  color: #409eff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}
.quick-entry .entry-name {
  font-size: 13px;
  color: #606266;
}

/* ========== 待办事项 ========== */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.todo-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #f5f7fa;
  border-radius: 4px;
  font-size: 14px;
}
.todo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 12px;
  flex-shrink: 0;
}
.todo-dot.primary { background: #409eff; }
.todo-dot.success { background: #67c23a; }
.todo-dot.warning { background: #e6a23c; }
.todo-dot.danger { background: #f56c6c; }
.todo-text {
  flex: 1;
  color: #606266;
}
.todo-item .btn-text {
  margin-left: auto;
  font-size: 13px;
}

/* ========== 标签 ========== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border: 1px solid;
  border-radius: 3px;
  line-height: 1.5;
  white-space: nowrap;
}



/* 复选框 */
.checkbox {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 6px;
}
.checkbox input {
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.checkbox span { font-size: 14px; color: #606266; }

/* 单选 */
.radio-group {
  display: flex;
  gap: 20px;
}
.radio {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 6px;
}
.radio input {
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.radio span { font-size: 14px; color: #606266; }

/* 日期选择器外观 */
.date-range {
  display: flex;
  align-items: center;
  gap: 4px;
}
.date-range .input { width: 130px; }
.date-range .separator { color: #c0c4cc; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f5f7fa; }
::-webkit-scrollbar-thumb { background: #dcdfe6; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c0c4cc; }

/* 响应式 */
@media (max-width: 1200px) {
  .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
