/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', Arial, sans-serif;
  background: #f0f2f5;
}

#app {
  height: 100%;
}

/* ==================== 登录页面 ==================== */
.login-page {
  display: grid;
  grid-template-columns: 3fr 7fr;
  min-height: 100vh;
  overflow: hidden;
}

/* --- 左侧装饰区 --- */
.login-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #409EFF 0%, #667eea 50%, #764ba2 100%);
  padding: 32px 40px;
  color: rgba(255,255,255,0.9);
  position: relative;
  overflow: hidden;
}

.login-left-top {
  position: relative;
  z-index: 2;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}

.login-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.login-brand-name {
  color: #fff;
}

.login-left-bottom {
  position: relative;
  z-index: 2;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* 光晕装饰 */
.login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.login-glow-1 {
  top: 20%;
  right: 10%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.1);
}

.login-glow-2 {
  bottom: 15%;
  left: 15%;
  width: 280px;
  height: 280px;
  background: rgba(255,255,255,0.05);
}

/* --- 卡通角色 --- */
.login-characters {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 338px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.char {
  position: absolute;
  bottom: 0;
  border-radius: 10px 10px 0 0;
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom center;
}

/* 紫色角色 */
.char-purple {
  left: calc(50% - 220px);
  width: 144px;
  height: 270px;
  background-color: #6C3FF5;
  z-index: 1;
  border-radius: 72px 72px 0 0;
}

/* 黑色角色 */
.char-black {
  left: calc(50% - 66px);
  width: 102px;
  height: 212px;
  background-color: #2D2D2D;
  border-radius: 8px 8px 0 0;
  z-index: 2;
}

/* 橙色半圆角色 */
.char-orange {
  left: calc(50% - 160px);
  width: 192px;
  height: 135px;
  background-color: #FF9B6B;
  border-radius: 96px 96px 0 0;
  z-index: 3;
}

/* 黄色圆顶角色 */
.char-yellow {
  left: calc(50% + 12px);
  width: 114px;
  height: 161px;
  background-color: #E8D754;
  border-radius: 57px 57px 0 0;
  z-index: 4;
}

/* 眼球 */
.eyeball {
  width: 18px;
  height: 18px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height 0.15s ease;
}

.eyeball-sm {
  width: 16px;
  height: 16px;
}

.eyeball.blinking {
  height: 2px;
}

.eyeball .pupil {
  width: 7px;
  height: 7px;
  background-color: #2D2D2D;
  border-radius: 50%;
  transition: transform 0.1s ease-out;
}

.eyeball-sm .pupil {
  width: 6px;
  height: 6px;
}

/* 纯瞳孔（橙色/黄色角色） */
.pupil-only {
  width: 12px;
  height: 12px;
  background-color: #2D2D2D;
  border-radius: 50%;
  transition: transform 0.1s ease-out;
}

/* 黄色角色嘴巴 */
.yellow-mouth {
  position: absolute;
  width: 40px;
  height: 4px;
  background-color: #2D2D2D;
  border-radius: 2px;
  transition: all 0.2s ease-out;
}

/* 眼睛容器 */
.char-eyes {
  position: absolute;
  display: flex;
  gap: 24px;
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.char-pupils {
  position: absolute;
  display: flex;
  gap: 24px;
  transition: all 0.2s ease-out;
}

/* --- 右侧登录区 --- */
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: #fff;
}

.login-form-container {
  width: 100%;
  max-width: 400px;
}

.login-mobile-logo {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 32px;
}

.login-brand-icon-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(64, 158, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #409EFF;
}

.login-form-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-form-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #303133;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.login-form-header p {
  font-size: 14px;
  color: #909399;
}

.login-form .login-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #303133;
  margin-bottom: 6px;
}

.login-form .el-form-item {
  margin-bottom: 20px;
}

.login-form .el-input {
  height: 48px;
  border-radius: 8px;
}

.login-form .el-input__wrapper {
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--el-border-color-light) inset;
}

.login-form .el-input__wrapper:hover {
  box-shadow: 0 0 0 1px #409EFF inset;
}

.login-password-wrap {
  position: relative;
  width: 100%;
}

.login-password-wrap .el-input {
  width: 100%;
}

.login-toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #909399;
  padding: 4px;
  line-height: 1;
  z-index: 2;
}

.login-toggle-pwd:hover {
  color: #303133;
}

.pwd-icon-eye-open,
.pwd-icon-eye-closed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.pwd-icon-eye-closed img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.login-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-submit-btn {
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 8px;
}

.login-form-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 13px;
  color: #c0c4cc;
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-left {
    display: none;
  }

  .login-mobile-logo {
    display: flex;
  }

  .login-right {
    background: linear-gradient(135deg, #f0f5ff 0%, #f5f0ff 100%);
    min-height: 100vh;
  }
}

/* ==================== 主布局 ==================== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 左侧菜单 */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: #304156;
  color: #bfcbd9;
  display: flex;
  flex-direction: column;
  transition: width 0.3s;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

.sidebar-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #263445;
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-header .logo {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}

.sidebar-header .logo-mini {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.2s;
  color: #bfcbd9;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
}

.menu-item:hover {
  background: #263445;
  color: #409EFF;
}

.menu-item.active {
  background: #263445;
  color: #409EFF;
  border-right: 3px solid #409EFF;
}

.menu-item .menu-icon {
  width: 24px;
  min-width: 24px;
  text-align: center;
  margin-right: 12px;
  font-size: 18px;
}

.menu-item .menu-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右侧内容区 */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* 顶部导航栏 */
.top-navbar {
  height: 60px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  z-index: 10;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.collapse-btn {
  font-size: 20px;
  cursor: pointer;
  color: #606266;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 4px;
}

.collapse-btn:hover {
  color: #409EFF;
}

.breadcrumb-area {
  font-size: 14px;
  color: #606266;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.online-users {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
}

.online-user-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.online-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #409EFF;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  position: relative;
  cursor: default;
  flex-shrink: 0;
}

.online-user-avatar .online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background: #67C23A;
  border-radius: 50%;
  border: 2px solid #fff;
}

.online-user-name {
  font-size: 13px;
  color: #303133;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.online-user-count {
  font-size: 12px;
  color: #909399;
  white-space: nowrap;
  padding-left: 4px;
  border-left: 1px solid #DCDFE6;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.user-info:hover {
  background: #f5f7fa;
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #409EFF;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.user-name-text {
  font-size: 14px;
  color: #303133;
}

/* 内容区域 */
.main-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: #f0f2f5;
}

.page-container {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  min-height: calc(100vh - 140px);
}

/* ==================== 页面通用样式 ==================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 {
  font-size: 20px;
  color: #303133;
  font-weight: 600;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar .search-input {
  width: 250px;
}

/* 表格样式增强 */
.el-table .editing-row {
  background-color: #fdf6ec !important;
}

.el-table .editing-row:hover > td {
  background-color: #faecd8 !important;
}

/* 金额显示 */
.amount-cell {
  color: #f56c6c;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

/* 状态标签 */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 编辑锁定提示 */
.btn-purple {
  --el-button-bg-color: #9b59b6 !important;
  --el-button-border-color: #8e44ad !important;
  --el-button-text-color: #fff !important;
  --el-button-hover-bg-color: #a569bd !important;
  --el-button-hover-border-color: #9b59b6 !important;
}

.lock-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #e6a23c;
  font-size: 12px;
  margin-left: 8px;
}

.lock-indicator .el-icon {
  font-size: 14px;
}

/* ==================== 对话框样式 ==================== */
.phase-staff-table {
  margin-top: 12px;
}

.phase-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 16px;
  background: #f5f7fa;
  border-radius: 4px;
  font-size: 14px;
}

.phase-total-bar.over-100 {
  background: #fef0f0;
  color: #f56c6c;
}

.phase-info-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: #f5f7fa;
  border-radius: 4px;
  font-size: 14px;
}

/* 协同编辑警告提示 */
.collab-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 16px;
  background: #fdf6ec;
  border: 1px solid #f5dab1;
  border-radius: 4px;
  color: #e6a23c;
  font-size: 14px;
}

.collab-warning .el-icon {
  font-size: 16px;
  color: #e6a23c;
}

/* ==================== 产值汇总页面 ==================== */
.statistics-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.statistics-tabs .el-tabs__header {
  margin-bottom: 16px;
}

/* ==================== 数据备份页面 ==================== */
.backup-actions {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.backup-card {
  flex: 1;
  text-align: center;
  padding: 40px;
  border: 2px dashed #dcdfe6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.backup-card:hover {
  border-color: #409EFF;
  background: #ecf5ff;
}

.backup-card .backup-icon {
  font-size: 48px;
  color: #409EFF;
  margin-bottom: 16px;
}

.backup-card h3 {
  font-size: 16px;
  color: #303133;
  margin-bottom: 8px;
}

.backup-card p {
  font-size: 13px;
  color: #909399;
}

/* ==================== 响应式布局 ==================== */
@media (max-width: 768px) {
  .sidebar {
    width: 64px;
    min-width: 64px;
  }

  .sidebar .menu-text {
    display: none;
  }

  .sidebar-header .logo {
    display: none;
  }

  .main-content {
    padding: 12px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar .search-input {
    width: 100%;
  }

  .statistics-filters {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==================== 过渡动画 ==================== */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* 文件上传区域 */
.upload-area {
  text-align: center;
  padding: 20px;
}

/* 在线用户弹出层 */
.online-users-popup {
  max-height: 300px;
  overflow-y: auto;
}

.online-user-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.online-user-list-item .online-dot-indicator {
  width: 8px;
  height: 8px;
  background: #67C23A;
  border-radius: 50%;
}

/* WebSocket 断连提示 */
.ws-disconnected-badge {
  color: #f56c6c;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ws-connected-badge {
  color: #67C23A;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==================== 项目管理-统计概览栏 ==================== */
.project-summary-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  padding: 12px 20px;
  background: #f5f7fa;
  border-radius: 8px;
  border-left: 4px solid #409EFF;
}

.summary-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.summary-item .el-icon {
  font-size: 18px;
}

.summary-item strong {
  font-size: 18px;
  font-family: 'Courier New', monospace;
  margin-left: 2px;
}

.summary-green {
  color: #67C23A;
}

.summary-green strong {
  color: #67C23A;
}

.summary-yellow {
  color: #E6A23C;
}

.summary-yellow strong {
  color: #E6A23C;
}
