#fixedLoginBox {
  position: fixed;
  top: 32px;
  right: 40px;
  z-index: 3000;
  width: 270px;
  background: linear-gradient(135deg, #f8fafc 60%, #e3e9f7 100%);
  border-radius: 18px;
  box-shadow: 0 6px 32px rgba(80, 120, 200, 0.10), 0 1.5px 6px rgba(0, 0, 0, 0.04);
  padding: 28px 22px 20px 22px;
  border: 1.5px solid #e6eaf3;
  transition: box-shadow 0.2s;
}

#fixedLoginBox:hover {
  box-shadow: 0 10px 40px rgba(80, 120, 200, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
}

#fixedLoginBox .login-title {
  font-weight: 700;
  font-size: 19px;
  margin-bottom: 18px;
  color: #2d3a4a;
  letter-spacing: 1px;
  text-align: center;
}

#fixedLoginBox .form-control {
  border-radius: 8px;
  border: 1.2px solid #d2d8e6;
  font-size: 15px;
  padding: 8px 12px;
  margin-bottom: 14px;
  background: #fafdff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#fixedLoginBox .form-control:focus {
  border-color: #6c8cff;
  box-shadow: 0 0 0 2px #e3eaff;
  background: #fff;
}

#fixedLoginBox .btn-primary {
  background: linear-gradient(90deg, #6c8cff 60%, #4e6edb 100%);
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 0;
  margin-top: 2px;
  box-shadow: 0 2px 8px rgba(80, 120, 200, 0.08);
  transition: background 0.2s, box-shadow 0.2s;
}

#fixedLoginBox .btn-primary:hover {
  background: linear-gradient(90deg, #4e6edb 60%, #6c8cff 100%);
  box-shadow: 0 4px 16px rgba(80, 120, 200, 0.13);
}

#fixedLoginBox .alert {
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
}

/* 仅将首页 extra-info-item 中的首个"八字："行的四柱标红 */
.extra-info-container .extra-info-item:first-child span[data-keyword] {
  color: #f44336 !important;
}

/* 顶部工具栏样式 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  border: 1px solid #e9eef5;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  margin-bottom: 15px;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar .brand-btn {
  height: 28px;
  line-height: 26px;
  font-size: 15px !important;
  padding: 0 8px;
}

.topbar .inline-login {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px 8px;
}

.topbar .inline-login .form-control {
  width: 120px;
  height: 32px;
  font-size: 13px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.topbar .inline-login .form-control:focus {
  outline: none;
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
}

.topbar .inline-login .form-control::placeholder {
  color: #9ca3af;
  font-size: 12px;
}

.topbar .inline-login .btn {
  height: 32px;
  font-size: 13px;
}

.topbar .inline-login label {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar .inline-login label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #6b7280;
  border-radius: 3px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar .inline-login label input[type="checkbox"]:checked {
  background: #6b7280;
  border-color: #6b7280;
}

.topbar .inline-login label input[type="checkbox"]:hover {
  border-color: #9ca3af;
}

/* 扁平化复选框样式 */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  margin: 0;
}

input[type="checkbox"]:checked {
  background: #6b7280;
  border-color: #6b7280;
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

input[type="checkbox"]:hover {
  border-color: #9ca3af;
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(107, 114, 128, 0.2);
}

/* 命理分析区域清爽设计 */
.analysis-section {
  margin-top: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  position: relative;
  z-index: 10002;
}

.analysis-title {
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  position: relative;
  z-index: 10001;
}

.analysis-title-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.analysis-values {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-value {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.analysis-value.han-nuan-warm {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.2);
}

.analysis-value.han-nuan-cold {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.2);
}

.analysis-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  user-select: none;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
}

.analysis-toggle-switch {
  position: relative;
  width: 20px;
  height: 12px;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  z-index: 10000;
}

.analysis-toggle-slider {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.analysis-toggle-switch.active {
  background: #3b82f6;
}

.analysis-toggle-switch.active .analysis-toggle-slider {
  transform: translateX(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.analysis-toggle-switch:hover {
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
}

.analysis-toggle-switch.active:hover {
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.3);
}

.analysis-toggle-text {
  font-size: 12px;
  color: #64748b;
  transition: color 0.2s ease;
  margin-left: 6px;
}

.analysis-toggle-switch.active+.analysis-toggle-text {
  color: #374151;
}

/* 确保info-modal-content最大化时在最顶层 */
.info-modal-content.maximized {
  z-index: 99999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  max-width: none !important;
}

/* 确保info-modal-body在最大化时也处于最顶层 */
.info-modal-content.maximized .info-modal-body {
  z-index: 100000 !important;
  position: relative !important;
  max-height: calc(100vh - 120px) !important;
  overflow-y: auto !important;
}

.analysis-title::before {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M18.7 8l-5.1 5.2-2.8-2.7L7 14.3'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.analysis-content {
  padding: 20px;
  background: #fff;
  color: #334155;
  line-height: 1.6;
  font-size: 14px;
  min-height: 60px;
}

.analysis-content p {
  margin: 0 0 12px 0;
  color: #475569;
}

.analysis-content p:last-child {
  margin-bottom: 0;
}

.analysis-content strong {
  color: #1e293b;
  font-weight: 600;
}

.analysis-content em {
  color: #64748b;
  font-style: italic;
}

.topbar .user-chip {
  font-size: 11px;
  color: #2d3a4a;
  background: #eef3ff;
  border: 1px solid #dbe6ff;
  border-radius: 999px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.topbar .group-label {
  font-size: 11px;
  color: #94a3b8;
  background: transparent;
  border: none;
  padding: 0 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 无外框紧凑标签 */
.topbar .btn {
  height: 28px;
  line-height: 26px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 15px !important;
  border: none;
  background: transparent;
  color: #000000;
  transition: color 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  margin: 0;
}

.topbar .btn:hover {
  color: #334155;
  background: transparent;
}

.topbar .btn:active {
  color: #1e293b;
  background: transparent;
}

/* 主要操作标签 */
.topbar .btn-primary {
  color: #0369a1;
  font-weight: 500;
}

.topbar .btn-primary:hover {
  color: #0c4a6e;
}

/* 当前激活状态 */
.topbar .btn.active {
  color: #1e293b;
  font-weight: 500;
}

@media (max-width: 768px) {
  .topbar {
    gap: 0px;
    padding: 10px;
  }

  .topbar .inline-login .form-control {
    width: 70px;
  }

  .topbar .inline-login {
    padding: 4px 6px;
    gap: 4px;
  }

  .topbar .inline-login label {
    font-size: 10px;
  }

  .topbar-left {
    gap: 1px;
  }

  .topbar .group-label {
    font-size: 10px;
    width: 100%;
    margin-bottom: 2px;
  }

  /* 移动端按钮统一尺寸 */
  .topbar .btn,
  .topbar .brand-btn {
    height: 28px !important;
    line-height: 26px !important;
    font-size: 15px !important;
    padding: 0 8px !important;
    min-height: 28px !important;
  }
}

/* 登录错误弹窗动画 */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#loginErrorCloseBtn:hover {
  background: #b91c1c !important;
}



/* 反推八字：让年柱/月柱/日柱/时柱的 label 与输入框并排，同一行显示 */
#solarReverseContent .input-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}

#solarReverseContent .input-row+.input-row {
  margin-top: 10px;
}

#solarReverseContent .input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

#solarReverseContent .input-group label {
  white-space: nowrap;
  width: 24px;
}

#solarReverseContent .input-group input,
#solarReverseContent .input-group select {
  flex: 1;
  min-width: 0;
}

/* 快速输入行占满宽度并横向排列 */
#solarReverseContent .quick-input-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

#solarReverseContent .quick-input-row .btn {
  flex: 0 0 auto;
}

/* 扁平按钮样式 */
#solarReverseContent .btn {
  border: none;
  box-shadow: none;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  padding: 5px 10px;
  font-size: 14px;
  min-height: 0px;
}

#solarReverseContent .btn-primary {
  background-color: #007bff;
  color: white;
}

#solarReverseContent .btn-primary:hover {
  background-color: #0056b3;
}

#solarReverseContent .btn-success {
  background-color: #28a745;
  color: white;
}

#solarReverseContent .btn-success:hover {
  background-color: #1e7e34;
}


/*  独立自定义关键字查询功能（可隐藏/展开，图标触发）   */
#customQueryBox2 {
  position: fixed;
  bottom: 60px;
  right: 20px;
  z-index: 10000;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.13);
  padding: 10px 12px 8px 12px;
  display: none;
  align-items: center;
  gap: 6px;
}

#customQueryBox2 input {
  height: 28px;
  font-size: 14px;
  padding: 0 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  outline: none;
  min-width: 120px;
  max-width: 180px;
}

#customQueryCloseBtn {
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  margin-left: 2px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
  transition: background 0.2s;
}

#customQueryCloseBtn:hover {
  background: #eee;
  color: #1976d2;
}

/* 浮动按钮悬停效果 */
#customerLibraryFab:hover,
#analysisSkillsFab:hover,
#saveCustomerFab:hover,
#solarReverseFab:hover,
#aiChatFab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

#customerLibraryFab,
#analysisSkillsFab,
#saveCustomerFab,
#solarReverseFab,
#aiChatFab {
  transition: all 0.2s ease;
}

/* 浮动按钮容器样式 */
#floatingButtonsContainer {
  background: transparent;
  backdrop-filter: none;
  border-radius: 20px;
  padding: 6px;
  border: none;
}