* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f2f2;
  color: #333;
  height: 100vh;
  overflow: hidden;
}

/* ===== 登录页 ===== */
#loginPage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #e8f4ff 0%, #f0f7ff 100%);
}
.login-container {
  width: 440px;
  max-width: 94%;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(24, 144, 255, 0.15);
  padding: 36px 32px 32px;
  position: relative;
}
.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #00C59B, #1890ff);
  border-radius: 8px 8px 0 0;
}
.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-header .logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 600;
  color: #1890ff;
}
.login-header .logo i {
  font-size: 30px;
}
.login-header .sub {
  font-size: 14px;
  color: #999;
  margin-top: 4px;
}
.login-tabs {
  display: flex;
  border-bottom: 1px solid #e6e6e6;
  margin-bottom: 24px;
}
.login-tabs .tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}
.login-tabs .tab.active {
  color: #00C59B;
  border-bottom-color: #00C59B;
  font-weight: 500;
}
.login-tabs .tab:hover {
  color: #00C59B;
}
.login-form .form-group {
  margin-bottom: 18px;
}
.login-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
}
.login-form .form-group .input-wrap {
  position: relative;
}
.login-form .form-group .input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  font-size: 16px;
}
.login-form .form-group input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  font-size: 14px;
  transition: 0.2s;
  background: #fafafa;
}
.login-form .form-group input:focus {
  border-color: #00C59B;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 197, 155, 0.1);
}
.login-form .form-group .captcha-wrap {
  display: flex;
  gap: 10px;
}
.login-form .form-group .captcha-wrap input {
  flex: 1;
}
.login-form .form-group .captcha-wrap .captcha-btn {
  padding: 10px 16px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  background: #fafafa;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  transition: 0.2s;
}
.login-form .form-group .captcha-wrap .captcha-btn:hover {
  border-color: #00C59B;
  color: #00C59B;
}
/* ===== 渐变按钮通用样式 ===== */
.btn-gradient {
  background: linear-gradient(135deg, #00C59B 0%, #00A8FF 100%);
  color: #fff;
  border: none;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 197, 155, 0.25);
}
.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 197, 155, 0.35);
}
.btn-gradient i {
  font-size: 14px;
}

/* 大号渐变按钮 (登录) */
.btn-gradient-large {
  background: linear-gradient(135deg, #00C59B 0%, #00A8FF 100%);
  color: #fff;
  border: none;
  padding: 11px 24px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(0, 197, 155, 0.3);
}
.btn-gradient-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 197, 155, 0.4);
}
.btn-gradient-large:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 弹窗内渐变按钮 */
.btn-gradient-sm {
  background: linear-gradient(135deg, #00C59B 0%, #00A8FF 100%);
  color: #fff;
  border: none;
  padding: 6px 20px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 197, 155, 0.2);
}
.btn-gradient-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 197, 155, 0.3);
}

.login-footer {
  text-align: center;
  font-size: 12px;
  color: #bbb;
  margin-top: 18px;
}
.login-footer a {
  color: #00C59B;
  text-decoration: none;
}

/* ===== 控制台 ===== */
#dashboardPage {
  display: none;
  height: 100vh;
  flex-direction: column;
}
#dashboardPage.active {
  display: flex;
}

/* 顶部导航 */
.dash-header {
  background: #fff;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.dash-header .left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.dash-header .left .logo {
  font-size: 18px;
  font-weight: 600;
  color: #1890ff;
}
.dash-header .left .logo i {
  margin-right: 6px;
}
.dash-header .left .org-name {
  font-size: 14px;
  color: #333;
  background: #f6faff;
  padding: 4px 14px;
  border-radius: 12px;
  border: 1px solid #e6f0ff;
}
.dash-header .right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-header .right .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #333;
  /* 移除点击事件 */
  cursor: default;
}
.dash-header .right .user-info .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #00C59B;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}
.dash-header .right .user-info .role {
  font-size: 12px;
  color: #999;
}
.dash-header .right .btn-outline-sm {
  padding: 4px 14px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: 0.2s;
}
.dash-header .right .btn-outline-sm:hover {
  border-color: #00C59B;
  color: #00C59B;
}

/* ===== 渐变按钮 (控制台入口) ===== */
.btn-gradient {
  background: linear-gradient(135deg, #00C59B 0%, #00A8FF 100%);
  color: #fff;
  border: none;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 197, 155, 0.25);
}
.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 197, 155, 0.35);
}
.btn-gradient i {
  font-size: 14px;
}

/* 主体 */
.dash-body {
  flex: 1;
  padding: 24px 32px 32px;
  overflow-y: auto;
  background: #f2f2f5;
}

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 6px;
  padding: 18px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border-left: 4px solid #00C59B;
}
.stat-card:nth-child(2) {
  border-left-color: #FA8C16;
}
.stat-card:nth-child(3) {
  border-left-color: #1890ff;
}
.stat-card:nth-child(4) {
  border-left-color: #722ed1;
}
.stat-card:nth-child(5) {
  border-left-color: #F20B27;
}
.stat-card .label {
  font-size: 13px;
  color: #999;
}
.stat-card .value {
  font-size: 26px;
  font-weight: 600;
  color: #333;
  margin-top: 4px;
}
.stat-card .value .link {
  font-size: 14px;
  font-weight: 400;
  color: #00C59B;
  cursor: pointer;
  margin-left: 8px;
}
.stat-card .value .link:hover {
  text-decoration: underline;
}

/* 快捷入口 */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.quick-item {
  background: #fff;
  border-radius: 6px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: 0.2s;
  border: 1px solid transparent;
}
.quick-item:hover {
  border-color: #00C59B;
  box-shadow: 0 4px 12px rgba(0, 197, 155, 0.12);
  transform: translateY(-2px);
}
.quick-item i {
  font-size: 28px;
  color: #00C59B;
  display: block;
  margin-bottom: 6px;
}
.quick-item .label {
  font-size: 13px;
  color: #333;
}
.quick-item .badge {
  display: inline-block;
  background: #F20B27;
  color: #fff;
  font-size: 11px;
  padding: 0 8px;
  border-radius: 10px;
  margin-left: 4px;
}

/* 最近合同 */
.recent-section {
  background: #fff;
  border-radius: 6px;
  padding: 18px 20px 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.recent-section .title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin-bottom: 14px;
}
.recent-section .title i {
  color: #00C59B;
  margin-right: 6px;
}
.recent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.recent-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  color: #999;
  font-weight: 400;
}
.recent-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}
.recent-table tr:hover td {
  background: #fafafa;
}
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.status-badge.done {
  background: #E0F8F2;
  color: #00C59B;
}
.status-badge.pending {
  background: #FFF7E6;
  color: #FA8C16;
}
.status-badge.reject {
  background: #FFF1F0;
  color: #F20B27;
}
.status-badge.expired {
  background: #f0f0f0;
  color: #999;
}

/* ===== 弹窗 (Layui风格) ===== */
.layui-layer-shade {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
  display: none;
}
.layui-layer-shade.active {
  display: block;
}
.layui-layer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
  width: 620px;
  max-width: 94%;
  max-height: 90vh;
  z-index: 1000;
  display: none;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}
.layui-layer.active {
  display: flex;
}
.layui-layer-title {
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.layui-layer-title .close {
  cursor: pointer;
  font-size: 20px;
  color: #999;
  transition: 0.2s;
}
.layui-layer-title .close:hover {
  color: #333;
}
.layui-layer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.layui-layer-footer {
  padding: 10px 24px 16px;
  border-top: 1px solid #f0f0f0;
  text-align: right;
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.layui-layer-footer .btn {
  padding: 6px 20px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
  color: #333;
}
.layui-layer-footer .btn-primary {
  background: #00C59B;
  border-color: #00C59B;
  color: #fff;
}
.layui-layer-footer .btn-primary:hover {
  background: #00a885;
  border-color: #00a885;
}

/* ===== 邀请员工弹窗 - 左右布局 ===== */
.invite-layout {
  display: flex;
  gap: 24px;
}
.invite-layout .invite-left {
  flex: 1;
  min-width: 0;
}
.invite-layout .invite-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 20px;
  border-left: 1px solid #f0f0f0;
  width: 220px;
}
.invite-layout .invite-right .qr-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}
.invite-layout .invite-right .qr-placeholder {
  width: 200px;
  height: 200px;
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #bfbfbf;
  position: relative;
  overflow: hidden;
}
.invite-layout .invite-right .qr-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.invite-layout .invite-right .qr-hint {
  font-size: 12px;
  color: #bbb;
  margin-top: 6px;
  text-align: center;
}
.invite-layout .invite-right .qr-hint i {
  margin-right: 4px;
}

.invite-form .form-group {
  margin-bottom: 14px;
}
.invite-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}
.invite-form .form-group label .required {
  color: #F20B27;
  margin-right: 4px;
}
.invite-form .form-group input,
.invite-form .form-group select {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  font-size: 14px;
  transition: 0.2s;
  background: #fafafa;
}
.invite-form .form-group input:focus,
.invite-form .form-group select:focus {
  border-color: #00C59B;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 197, 155, 0.1);
}
.invite-form .form-hint {
  font-size: 12px;
  color: #999;
  margin-top: 3px;
}
.invite-form .form-hint i {
  margin-right: 4px;
}
.invite-form .tip-box {
  background: #E0F8F2;
  border: 1px solid #B2EFDF;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  color: #00C59B;
  margin-top: 4px;
}
.invite-form .tip-box i {
  margin-right: 6px;
}

/* ===== 子客控制台入口弹窗 ===== */
.entry-info .org-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.entry-info .org-row .label {
  color: #999;
  font-size: 13px;
}
.entry-info .org-row .value {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}
.entry-info .org-row .value .tag {
  background: #E0F8F2;
  color: #00C59B;
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 400;
}
.entry-info .entry-link-box {
  margin-top: 16px;
  background: #E0F8F2;
  border: 1px solid #B2EFDF;
  border-radius: 4px;
  padding: 14px 16px;
}
.entry-info .entry-link-box .link-label {
  font-size: 13px;
  color: #00C59B;
  font-weight: 500;
}
.entry-info .entry-link-box .link-url {
  font-family: monospace;
  font-size: 14px;
  word-break: break-all;
  background: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 6px;
  border: 1px solid #d9d9d9;
  color: #333;
}
.entry-info .entry-link-box .link-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.entry-info .entry-link-box .link-actions .btn-sm {
  padding: 4px 14px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
  color: #333;
}
.entry-info .entry-link-box .link-actions .btn-sm:hover {
  border-color: #00C59B;
  color: #00C59B;
}
.entry-info .entry-link-box .link-actions .btn-primary-sm {
  background: #00C59B;
  border-color: #00C59B;
  color: #fff;
}
.entry-info .entry-link-box .link-actions .btn-primary-sm:hover {
  background: #00a885;
  border-color: #00a885;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) translateY(0);
  }
}

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  background: #fff;
  padding: 10px 24px;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  border-left: 4px solid #00C59B;
  max-width: 90%;
}
.toast.show {
  display: flex;
}
.toast.error {
  border-left-color: #F20B27;
}

/* 响应式 */
@media (max-width: 768px) {
  .dash-header {
    padding: 0 16px;
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 8px;
  }
  .dash-header .left .org-name {
    font-size: 12px;
    padding: 2px 10px;
  }
  .dash-body {
    padding: 16px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .login-container {
    padding: 24px 18px;
  }
  .layui-layer {
    width: 96%;
    max-width: 96%;
  }
  .invite-layout {
    flex-direction: column;
  }
  .invite-layout .invite-right {
    flex-direction: row;
    padding-left: 0;
    padding-top: 16px;
    border-left: none;
    border-top: 1px solid #f0f0f0;
    width: 100%;
    gap: 16px;
    justify-content: center;
  }
  .invite-layout .invite-right .qr-placeholder {
    width: 80px;
    height: 80px;
  }
  .dash-header .right .btn-gradient {
    font-size: 12px;
    padding: 4px 12px;
  }
}
@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .quick-grid {
    grid-template-columns: 1fr 1fr;
  }
  .dash-header .right .user-info .role {
    display: none;
  }
  .dash-header .right .btn-gradient span {
    display: none;
  }
}