/* ============================================================
 * SaaS 安装向导样式 — 粉紫高端主题
 * 仅视觉层,类名与结构与旧版完全一致(不改 JS/HTML)
 * ============================================================ */
:root {
  --pp-1: #8b5cf6; --pp-2: #d946ef; --pp-3: #ec4899;
  --pp-deep: #7c3aed;
  --pp-grad: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 35%, #d946ef 70%, #ec4899 100%);
  --pp-soft: #f6f2fd; --pp-border: #ece4fb; --pp-ring: rgba(139, 92, 246, .18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f0fa;
  min-height: 100vh;
  color: #2b2350;
}
/* 两角粉紫径向光斑 */
body::before, body::after {
  content: ""; position: fixed; border-radius: 50%; pointer-events: none; z-index: 0;
}
body::before {
  top: -180px; right: -140px; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(168, 85, 247, .22) 0%, rgba(168, 85, 247, 0) 68%);
}
body::after {
  bottom: -200px; left: -160px; width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(236, 72, 153, .16) 0%, rgba(236, 72, 153, 0) 68%);
}
a { color: var(--pp-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 容器 */
.wrap {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 20px;
}

/* 头部 logo */
.logo {
  text-align: center;
  margin-bottom: 26px;
  animation: ppFadeUp .55s ease both;
}
.logo h1 {
  font-size: 28px; font-weight: 800; letter-spacing: 2px;
  background: var(--pp-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--pp-deep);
}
.logo p {
  display: inline-block; margin-top: 10px;
  font-size: 13px; color: #6d28d9; letter-spacing: 1px;
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--pp-border);
  border-radius: 999px; padding: 5px 18px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, .08);
}

/* 主卡片 */
.card {
  width: 100%;
  max-width: 880px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid #e9e1f9;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(124, 58, 237, .16);
  overflow: hidden;
  animation: ppPopIn .5s cubic-bezier(.2, .9, .3, 1.1) both;
  animation-delay: .08s;
}

/* 步骤条 */
.stepper {
  display: flex;
  align-items: flex-start;
  background: linear-gradient(180deg, #faf7ff 0%, #f4eefc 100%);
  border-bottom: 1px solid var(--pp-border);
  padding: 24px 28px 20px;
}
.step-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  color: #b6a9d4;
  font-size: 13px;
  line-height: 1.4;
}
.step-item .num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e4ddf3;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  transition: all .35s ease;
  position: relative;
  z-index: 2;
}
.step-item .label {
  margin-top: 8px;
  font-weight: 500;
  transition: color .3s;
}
.step-item.active { color: var(--pp-deep); }
.step-item.active .num {
  background: var(--pp-grad);
  transform: scale(1.08);
  animation: ppBreath 2.2s ease-in-out infinite;
}
.step-item.active .label { font-weight: 700; color: var(--pp-deep); }
.step-item.done { color: #8b5cf6; }
.step-item.done .num {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  box-shadow: 0 4px 10px rgba(124, 58, 237, .25);
}
.step-item.done .label { color: #7c3aed; }
.step-item::after {
  content: "";
  position: absolute;
  left: calc(50% + 22px);
  top: 17px;
  right: calc(-50% + 22px);
  height: 2px;
  background: #e4ddf3;
  z-index: 0;
  transition: background .3s;
}
.step-item:last-child::after { display: none; }
.step-item.done::after {
  background: linear-gradient(90deg, #8b5cf6, #d946ef);
}
.step-item.active::after {
  background: linear-gradient(90deg, #c4b0ee, #e4ddf3);
}

/* 内容区 */
.body { padding: 32px 40px 8px; min-height: 380px; }
.body h2 {
  position: relative;
  padding-left: 14px;
  font-size: 20px;
  margin-bottom: 6px;
  color: #2b2350;
  font-weight: 700;
}
.body h2::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 18px; border-radius: 999px; background: var(--pp-grad);
}
.body .desc { color: #9a8fc0; font-size: 13px; margin-bottom: 24px; }

/* 协议内容 */
.protocol {
  background: #faf8fe;
  border: 1px solid var(--pp-border);
  border-radius: 12px;
  padding: 20px;
  height: 320px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  color: #4a3f6b;
}
.agree {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #5b4a8a;
}
.agree input { accent-color: var(--pp-1); width: 16px; height: 16px; }

/* 检测表 */
.check-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--pp-border); }
.check-table th {
  text-align: left;
  padding: 10px 14px;
  background: linear-gradient(180deg, #f8f5fe, #f3edfc);
  color: #5b4a8a;
  font-weight: 600;
  border-bottom: 1px solid var(--pp-border);
  font-size: 13px;
}
.check-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f4f0fb;
  color: #3d3554;
}
.check-table tr:last-child td { border-bottom: none; }
.check-table tbody tr { transition: background .18s ease; }
.check-table tbody tr:hover { background: #faf7ff; }
.check-table .ok { color: #0d9a56; font-weight: 600; }
.check-table .fail { color: #d92d43; font-weight: 600; }
.check-table .warn { color: #cf7a10; font-weight: 600; }
.tag-required {
  display: inline-block; color: #6d28d9; font-size: 12px;
  background: #f1e9fd; border-radius: 999px; padding: 2px 10px;
}
.tag-optional {
  display: inline-block; color: #8678a8; font-size: 12px;
  background: #f2f0f7; border-radius: 999px; padding: 2px 10px;
}

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.form-grid .full { grid-column: 1 / -1; }
.form-item { display: flex; flex-direction: column; }
.form-item label {
  font-size: 13px;
  color: #5b4a8a;
  margin-bottom: 6px;
  font-weight: 600;
}
.form-item label .req { color: #ec4899; margin-left: 4px; }
.form-item input,
.form-item select {
  height: 40px;
  padding: 0 14px;
  border: 1px solid #e3ddf3;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
  color: #2b2350;
}
.form-item input:focus,
.form-item select:focus {
  border-color: var(--pp-1);
  box-shadow: 0 0 0 3px var(--pp-ring);
}
.form-item .tip { font-size: 12px; color: #a89cc8; margin-top: 4px; }
.form-item input.readonly { background: #f7f5fc; color: #6d5a9c; }

.fieldset {
  border: 1px solid var(--pp-border);
  border-radius: 14px;
  padding: 18px 20px 4px;
  margin-bottom: 20px;
  background: #fdfcff;
}
.fieldset legend {
  font-size: 14px;
  font-weight: 700;
  color: var(--pp-deep);
  padding: 0 8px;
}

/* 底部操作 */
.footer {
  padding: 18px 40px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--pp-border);
  background: linear-gradient(180deg, #fdfbff, #f9f5fe);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 26px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease, border-color .2s ease, color .2s ease;
  font-family: inherit;
  letter-spacing: 1px;
  font-weight: 600;
}
.btn-primary {
  background: var(--pp-grad); color: #fff;
  box-shadow: 0 6px 16px rgba(124, 58, 237, .28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(124, 58, 237, .36); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); background: linear-gradient(135deg, #6d28d9, #9333ea 35%, #c026d3 70%, #db2777); }
.btn-primary:disabled { background: #e0d8f0; color: #a89cc8; cursor: not-allowed; box-shadow: none; transform: none; filter: none; }
.btn-default { background: #fff; color: #6b5b95; border: 1px solid #e3ddf3; box-shadow: 0 2px 8px rgba(124, 58, 237, .06); }
.btn-default:hover { border-color: #c4b0ee; color: var(--pp-deep); transform: translateY(-1px); }
.btn-success {
  background: linear-gradient(135deg, #34d399, #10b981); color: #fff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, .28);
}
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(16, 185, 129, .36); filter: brightness(1.05); }
.btn-link { background: transparent; color: var(--pp-deep); padding: 0 8px; height: auto; font-weight: 500; box-shadow: none; }
.btn-link:hover { text-decoration: underline; transform: none; box-shadow: none; }

/* 提示框 */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.7;
}
.alert-info { background: #f1ecfd; color: #6d28d9; border: 1px solid #ddd0f7; }
.alert-warn { background: #fdf6e9; color: #b45309; border: 1px solid #f2ddb8; }
.alert-error { background: #fdeef0; color: #be123c; border: 1px solid #f6c8cf; }
.alert-success { background: #e9faf1; color: #047857; border: 1px solid #b8ecd0; }
.alert .dev-code { font-weight: 700; font-size: 16px; letter-spacing: 2px; }

/* 日志输出 */
.log-box {
  background: #241d3f;
  color: #a6e3a1;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  line-height: 1.7;
  padding: 18px;
  border-radius: 12px;
  height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid #37295e;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, .35);
}
.log-box .err { color: #f38ba8; }
.log-box .ok { color: #a6e3a1; }

/* 进度条 */
.progress {
  height: 6px;
  background: #ece4fb;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress-bar {
  height: 100%;
  background: var(--pp-grad);
  background-size: 200% 100%;
  width: 0%;
  transition: width .4s;
  animation: ppShine 2s linear infinite;
}

/* 完成页 */
.success-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--pp-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  margin: 20px auto 18px;
  box-shadow: 0 12px 30px rgba(124, 58, 237, .35);
  animation: ppBounce .6s cubic-bezier(.2, .9, .3, 1.4) both;
}
.complete-box { text-align: center; padding: 20px 0 10px; }
.complete-box h2 { margin-bottom: 8px; }
.complete-box .info-list {
  text-align: left;
  max-width: 460px;
  margin: 20px auto;
  background: linear-gradient(135deg, #f8f5fe, #fdf4fa);
  border: 1px solid var(--pp-border);
  border-radius: 14px;
  padding: 16px 22px;
  font-size: 13px;
  line-height: 2;
  color: #3d3554;
}
.complete-box .info-list b { color: #7c3aed; display: inline-block; width: 110px; font-weight: 600; }
.warning-tips {
  background: #fdf6e9;
  border: 1px solid #f2ddb8;
  color: #b45309;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  margin-top: 18px;
  text-align: left;
  line-height: 1.7;
}

/* 加载遮罩 */
.mask {
  position: fixed; inset: 0;
  background: rgba(43, 35, 80, .45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.mask.show { display: flex; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 动画 */
@keyframes ppFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ppPopIn { from { opacity: 0; transform: scale(.96) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ppBreath {
  0%, 100% { box-shadow: 0 0 0 4px rgba(139, 92, 246, .16); }
  50% { box-shadow: 0 0 0 9px rgba(139, 92, 246, .07); }
}
@keyframes ppShine { from { background-position: 0% 0; } to { background-position: 200% 0; } }
@keyframes ppBounce { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .card, .logo, .success-icon, .step-item.active .num, .progress-bar { animation: none; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .body, .footer { padding-left: 20px; padding-right: 20px; }
  .step-item .label { display: none; }
  .stepper { padding: 20px 12px 16px; }
}
