/* ============================================================
 * SaaS 认证/个人中心/套餐 页面样式
 * v1.0.0
 * ============================================================ */

/* ── 登录页 ── */
.saas-login-page {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1a1d2e 0%, #252836 50%, #1a1d2e 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.saas-login-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #3a3e4d;
  border-radius: 8px;
  color: #8b8fa3;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  z-index: 10;
}

.saas-login-close:hover {
  background: #3a3e4d;
  border-color: #8b5cf6;
  color: #e4e7ed;
}

.saas-login-card {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.saas-login-logo {
  text-align: center;
  margin-bottom: 40px;
}

.saas-login-logo .logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  box-shadow: 0 10px 40px rgba(99,102,241,.3);
}

.saas-login-logo h1 {
  font-size: 32px;
  color: #e4e7ed;
  margin: 0 0 8px;
  font-weight: 700;
}

.saas-login-logo p {
  font-size: 15px;
  color: #8b8fa3;
  margin: 0;
}

.saas-login-form {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 24px;
  box-sizing: border-box;
}

.saas-input-group {
  position: relative;
}

.saas-input-group label {
  display: block;
  font-size: 12px;
  color: #8b8fa3;
  margin-bottom: 6px;
}

.saas-input-group input {
  width: 100%;
  height: 52px;
  background: rgba(26,29,46,.8);
  border: 1px solid #3a3e4d;
  border-radius: 12px;
  color: #e4e7ed;
  font-size: 16px;
  padding: 0 16px;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}

.saas-input-group input:focus {
  border-color: #6366f1;
}

.saas-input-group input::placeholder {
  color: #5a5e6d;
}

.saas-code-row {
  display: flex;
  gap: 10px;
}

.saas-code-row input {
  flex: 1;
}

.saas-send-code-btn {
  height: 52px;
  min-width: 130px;
  background: #3a3e4d;
  border: 1px solid #4a4e5d;
  border-radius: 12px;
  color: #c7cad4;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  padding: 0 18px;
}

.saas-send-code-btn:hover:not(:disabled) {
  background: #4a4e5d;
  color: #e4e7ed;
}

.saas-send-code-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.saas-login-btn {
  height: 54px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
  margin-top: 8px;
  box-shadow: 0 8px 24px rgba(99,102,241,.3);
}

.saas-login-btn:hover {
  opacity: .9;
}

.saas-login-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.saas-login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: #5a5e6d;
}

.saas-login-error {
  color: #ef4444;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
  margin-top: -4px;
}

/* ── 个人中心弹窗（全屏模式） ── */
.saas-user-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1a1d2e 0%, #252836 50%, #1a1d2e 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99998;
}

.saas-user-modal-content {
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  overflow-y: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 40px 24px;
  box-sizing: border-box;
}

.saas-user-modal-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #3a3e4d;
}

.saas-user-modal-header h2 {
  font-size: 22px;
  font-weight: 500;
  color: #e4e7ed;
  margin: 0;
  text-align: center;
}

.saas-user-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #3a3e4d;
  border-radius: 8px;
  color: #8b8fa3;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  z-index: 10;
}

.saas-user-modal-close:hover {
  background: #3a3e4d;
  border-color: #8b5cf6;
  color: #e4e7ed;
}

.saas-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.saas-user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
}

.saas-user-details h3 {
  font-size: 16px;
  color: #e4e7ed;
  margin: 0 0 4px;
}

.saas-user-details p {
  font-size: 13px;
  color: #8b8fa3;
  margin: 0;
}

.saas-subscription-card {
  background: #1a1d2e;
  border: 1px solid #3a3e4d;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.saas-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.saas-sub-plan-name {
  font-size: 16px;
  font-weight: 600;
  color: #8b5cf6;
}

.saas-sub-status {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  background: #1d9e75;
  color: #fff;
}

.saas-sub-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.saas-sub-stat {
  text-align: center;
}

.saas-sub-stat-value {
  font-size: 22px;
  font-weight: 600;
  color: #e4e7ed;
}

.saas-sub-stat-label {
  font-size: 11px;
  color: #8b8fa3;
  margin-top: 2px;
}

.saas-sub-progress {
  margin-top: 14px;
  height: 6px;
  background: #3a3e4d;
  border-radius: 3px;
  overflow: hidden;
}

.saas-sub-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 3px;
  transition: width .3s;
}

.saas-user-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.saas-action-btn {
  height: 42px;
  background: #3a3e4d;
  border: 1px solid #4a4e5d;
  border-radius: 10px;
  color: #c7cad4;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .2s;
}

.saas-action-btn:hover {
  background: #4a4e5d;
  color: #e4e7ed;
}

.saas-action-btn--primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #fff;
}

.saas-action-btn--primary:hover {
  opacity: .9;
}

.saas-action-btn--danger {
  color: #ef4444;
}

/* ── 通用全屏弹窗关闭按钮（统一右上角） ── */
.saas-modal-close,
.saas-login-close,
.saas-user-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #3a3e4d;
  border-radius: 8px;
  color: #8b8fa3;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  z-index: 10;
}
.saas-modal-close:hover,
.saas-login-close:hover,
.saas-user-modal-close:hover {
  background: #3a3e4d;
  border-color: #8b5cf6;
  color: #e4e7ed;
}

/* ── 套餐选择页（全屏） ── */
.saas-plans-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1a1d2e 0%, #252836 50%, #1a1d2e 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99997;
  padding: 60px 24px 24px;
  box-sizing: border-box;
  overflow-y: auto;
}

.saas-plans-content {
  width: 100%;
  max-width: 1100px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.saas-plans-header {
  text-align: center;
  margin-bottom: 30px;
}

.saas-plans-header h2 {
  font-size: 24px;
  color: #e4e7ed;
  margin: 0 0 8px;
}

.saas-plans-header p {
  font-size: 14px;
  color: #8b8fa3;
  margin: 0;
}

.saas-plans-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .saas-plans-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.saas-plan-card {
  background: #1a1d2e;
  border: 2px solid #3a3e4d;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
  position: relative;
}

.saas-plan-card:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
}

.saas-plan-card--current {
  border-color: #1d9e75;
}

.saas-plan-card--recommended {
  border-color: #8b5cf6;
}

.saas-plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #8b5cf6;
  color: #fff;
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 10px;
  white-space: nowrap;
}

.saas-plan-name {
  font-size: 16px;
  font-weight: 600;
  color: #e4e7ed;
  margin-bottom: 8px;
}

.saas-plan-price {
  font-size: 32px;
  font-weight: 700;
  color: #e4e7ed;
  margin-bottom: 4px;
}

.saas-plan-price .unit {
  font-size: 14px;
  font-weight: 400;
  color: #8b8fa3;
}

.saas-plan-quota {
  font-size: 13px;
  color: #8b8fa3;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #3a3e4d;
}

.saas-plan-features {
  text-align: left;
  margin-bottom: 20px;
}

.saas-plan-features li {
  font-size: 12px;
  color: #c7cad4;
  padding: 4px 0;
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.saas-plan-features li::before {
  content: "✓";
  color: #1d9e75;
  font-weight: 700;
  flex-shrink: 0;
}

.saas-plan-features li.disabled {
  color: #5a5e6d;
}

.saas-plan-features li.disabled::before {
  content: "✗";
  color: #5a5e6d;
}

.saas-plan-btn {
  width: 100%;
  height: 38px;
  border: 1px solid #4a4e5d;
  background: transparent;
  border-radius: 8px;
  color: #c7cad4;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}

.saas-plan-btn:hover {
  background: #3a3e4d;
  color: #e4e7ed;
}

.saas-plan-btn--primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #fff;
}

.saas-plan-btn--current {
  background: transparent;
  border-color: #1d9e75;
  color: #1d9e75;
  cursor: default;
}

/* ── 支付二维码弹窗（全屏） ── */
.saas-pay-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1a1d2e 0%, #252836 50%, #1a1d2e 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99996;
  padding: 60px 24px 24px;
  box-sizing: border-box;
}

.saas-pay-content {
  width: 100%;
  max-width: 380px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  text-align: center;
}

.saas-pay-amount {
  font-size: 36px;
  font-weight: 700;
  color: #e4e7ed;
  margin-bottom: 4px;
}

.saas-pay-desc {
  font-size: 13px;
  color: #8b8fa3;
  margin-bottom: 20px;
}

.saas-pay-qrcode {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.saas-pay-qrcode img {
  width: 100%;
  height: 100%;
}

.saas-pay-status {
  font-size: 14px;
  color: #8b8fa3;
  margin-bottom: 16px;
}

.saas-pay-status.paying {
  color: #8b5cf6;
}

.saas-pay-status.success {
  color: #1d9e75;
}

.saas-pay-timer {
  font-size: 12px;
  color: #5a5e6d;
  margin-bottom: 16px;
}

.saas-pay-cancel {
  display: none;
}

/* ── 升级提示弹窗（全屏） ── */
.saas-upgrade-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #1a1d2e 0%, #252836 50%, #1a1d2e 100%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99995;
  padding: 60px 24px 24px;
  box-sizing: border-box;
}

.saas-upgrade-content {
  width: 100%;
  max-width: 420px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  text-align: center;
}

.saas-upgrade-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}

.saas-upgrade-title {
  font-size: 18px;
  font-weight: 600;
  color: #e4e7ed;
  margin-bottom: 8px;
}

.saas-upgrade-quota-info {
  font-size: 13px;
  color: #8b8fa3;
  margin-bottom: 24px;
}

.saas-upgrade-actions {
  display: flex;
  gap: 12px;
}

.saas-upgrade-actions button {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}

.saas-upgrade-actions .btn-secondary {
  background: transparent;
  border: 1px solid #4a4e5d;
  color: #8b8fa3;
}

.saas-upgrade-actions .btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #fff;
}

/* ── 顶部用户信息栏（集成在登录按钮中） ── */
.saas-entry-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.saas-entry-name {
  font-size: 12px;
  color: #c7cad4;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saas-entry-plan {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  background: #8b5cf6;
  color: #fff;
  white-space: nowrap;
}

/* 兼容旧样式名 */
.saas-user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 32px;
  background: #252836;
  border: 1px solid #3a3e4d;
  border-radius: 16px;
  cursor: pointer;
  transition: all .2s;
}

.saas-user-bar:hover {
  background: #2d3142;
}

.saas-user-bar-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.saas-user-bar-name {
  font-size: 12px;
  color: #c7cad4;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saas-user-bar-plan {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  background: #8b5cf6;
  color: #fff;
}
