* {
  box-sizing: border-box;
}

/* 覆盖 admin_style 的 html,body{height:100%}，避免主区域高度被锁死、底部内容滚到视口底下仍被固定版权条盖住 */
html,
body {
  min-height: 100%;
  height: auto !important;
  max-height: none !important;
}

html {
  scroll-padding-bottom: 7rem;
}

body {
  margin: 0;
  /* 固定底栏约 32px + 额外留白（按钮区/换行/safe-area） */
  padding: 18px 0 calc(88px + env(safe-area-inset-bottom, 0px));
  color: #1e293b;
  text-align: center;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(59, 130, 246, 0.16), transparent 24%),
    radial-gradient(circle at 86% 6%, rgba(14, 165, 233, 0.18), transparent 22%),
    linear-gradient(135deg, #f3f8ff 0%, #f8fbff 50%, #eef6ff 100%);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 12px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 38px 38px;
}

.header,
.install-box {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100% - 32px)) !important;
  margin-left: auto;
  margin-right: auto;
}

.header {
  min-height: 118px;
  padding: 18px 24px 16px;
  border-radius: 16px 16px 0 0;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 52%, #0ea5e9 100%);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.18);
  overflow: hidden;
}

.header::before,
.header::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.header::before {
  width: 112px;
  height: 112px;
  right: -28px;
  top: -42px;
}

.header::after {
  width: 76px;
  height: 76px;
  left: 70px;
  bottom: -44px;
}

.header h1,
.header h2,
.install-progress {
  position: relative;
  z-index: 1;
}

.header h1,
.header h2 {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #fff;
}

.header h2 {
  display: none;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: 0.02em;
}

.header h1::after {
  content: "安全检测 · 数据库配置 · 自动补表";
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.78);
}

.install-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.install-progress span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  line-height: 22px;
  white-space: nowrap;
}

.install-box {
  margin-top: 0;
  margin-bottom: 40px;
  padding: 18px 22px 28px;
  border: 1px solid #dbeafe;
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(30, 64, 175, 0.09);
  text-align: left;
}

.install-title,
.protocol-box .title,
.title-run {
  margin: 0 0 14px !important;
  color: #0f172a !important;
  text-align: center !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 24px !important;
}

.install-title::after,
.protocol-box .title::after,
.title-run::after {
  content: "";
  display: block;
  width: 30px;
  height: 3px;
  margin: 6px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.install-section {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #fbfdff;
}

.install-section:last-child {
  margin-bottom: 0;
}

.install-section-title {
  margin: 0 0 10px;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.protocol-box {
  display: block;
}

.protocol {
  height: min(44vh, 320px);
  padding: 13px 15px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  color: #475569;
  background: #f8fbff;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.75;
}

.protocol h2 {
  margin: 0 0 8px;
  color: #0f172a;
  text-align: center;
  font-size: 14px;
}

.layui-form {
  text-align: left;
}

.layui-form-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 9px;
}

.layui-form-pane .layui-form-label {
  flex: 0 0 118px;
  width: 118px;
  height: 32px;
  padding: 0 10px;
  border-color: #bfdbfe;
  border-radius: 8px 0 0 8px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 12px;
  line-height: 30px;
}

.layui-form-pane .layui-input-inline,
.layui-form-pane .layui-input-block {
  margin-left: 0;
}

.layui-form-item .layui-input-inline.w200 {
  width: 310px !important;
}

.layui-input,
.layui-select,
.layui-textarea {
  height: 32px;
  padding-left: 10px;
  border-color: #bfdbfe;
  border-radius: 0 8px 8px 0;
  color: #0f172a;
  font-size: 12px;
}

.layui-input:focus,
.layui-textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.layui-form-mid {
  float: none;
  max-width: 250px;
  min-height: 32px;
  padding: 6px 0 0 10px !important;
  color: #64748b !important;
  font-size: 12px;
  line-height: 18px;
}

.layui-form-radio {
  margin: 3px 10px 0 0;
  padding-right: 0;
  line-height: 24px;
}

.layui-form-radio > i {
  margin-right: 5px;
  font-size: 18px !important;
  /* form.js 单选图标用 wb-cms-icon（maccms-icon），勿强制 layui-icon */
  font-family: maccms-icon, "maccms-icon" !important;
  speak: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.layui-form-radio cite,
.layui-form-radio > span {
  font-size: 12px;
}

/* 安装页单选/复选统一 layui-icon（避免错字体显示成 X） */
.layui-form-checkbox[lay-skin=primary] i,
.layui-form-checkbox i,
.layui-form-radio > i {
  font-family: layui-icon !important;
}
.layui-form-checked[lay-skin=primary] i:before,
.layui-form-checked i.layui-icon-ok:before {
  content: "\e605" !important;
}

.install-lang-select {
  position: relative;
  z-index: 3;
}

.install-hidden-frame {
  display: none;
}

.layui-table {
  width: 100%;
  margin: 0 !important;
  border: 1px solid #dbeafe !important;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: none;
}

.layui-table + .layui-table {
  margin-top: 12px !important;
}

.layui-table th {
  background: #eff6ff !important;
  color: #1e3a8a !important;
  font-weight: 700;
}

.layui-table td,
.layui-table th {
  padding: 7px 9px !important;
  border-color: #e5efff !important;
  color: #334155;
  text-align: center;
  font-size: 12px !important;
  line-height: 18px;
}

.layui-table tbody tr:hover {
  background: #f8fbff;
}

.layui-table tbody tr.ok td:last-child,
.layui-table tbody tr.yes td:last-child {
  color: #0f766e;
}

.layui-table tbody tr.no {
  background: #fff1f2 !important;
}

.layui-table tbody tr.no td {
  color: #be123c !important;
}

.layui-table tbody tr.yes td:last-child::before,
.layui-table tbody tr.ok td:last-child::before,
.layui-table tbody tr.no td:last-child::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  background-size: 14px 14px;
  background-repeat: no-repeat;
}

.layui-table tbody tr.yes td:last-child::before,
.layui-table tbody tr.ok td:last-child::before {
  background-image: url(../images/install/monitor_ic_check.png);
}

.layui-table tbody tr.no td:last-child::before {
  background-image: url(../images/install/monitor_ic_wrong.png);
}

.install-actions,
.step-btns {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  padding-bottom: 18px;
  text-align: center;
}

.install-actions-left,
.install-actions-center,
.install-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.install-actions-left {
  justify-content: flex-start;
}

.install-actions-center {
  justify-content: center;
}

.install-actions-right {
  justify-content: flex-end;
}

.install-action-tip {
  color: #64748b;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.step-btns .layui-btn,
.install-actions .layui-btn,
.test .layui-btn {
  min-width: 132px !important;
  height: 32px !important;
  padding: 0 16px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: #fff !important;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%) !important;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
  font-size: 12px;
  line-height: 30px !important;
}

.step-btns .last,
.step-btns .common,
.install-actions .last,
.install-actions .common,
.layui-btn-primary {
  color: #1d4ed8 !important;
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  box-shadow: none !important;
}

.step-btns .common,
.install-actions .common {
  color: #334155 !important;
  background: #fff !important;
}

.test {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 4px 0 10px;
}

.test-text {
  color: #64748b !important;
  text-align: center;
  font-size: 12px !important;
  line-height: 18px !important;
}

.layui-elem-field,
.layui-field-title {
  margin: 10px 0 12px;
  border-color: #dbeafe !important;
}

.copyright {
  position: fixed;
  z-index: 2;
  bottom: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 32px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid rgba(191, 219, 254, 0.75);
  color: #64748b;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 32px;
  backdrop-filter: blur(12px);
}

.copyright a {
  color: #2563eb;
}

@media (max-width: 860px) {
  body {
    padding-top: 10px;
    /* 窄屏按钮常换行，多留底部空间 */
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  .header,
  .install-box {
    width: calc(100% - 20px) !important;
  }

  .header {
    min-height: auto;
    padding: 14px 12px;
  }

  .header h1 {
    font-size: 22px;
    line-height: 30px;
  }

  .install-progress {
    flex-wrap: wrap;
  }

  .install-box {
    padding: 14px;
  }

  .install-grid {
    grid-template-columns: 1fr;
  }

  .layui-form-item {
    display: block;
  }

  .layui-form-pane .layui-form-label {
    display: block;
    width: 100%;
    border-radius: 8px 8px 0 0;
  }

  .layui-form-item .layui-input-inline.w200 {
    width: 100% !important;
  }

  .layui-input,
  .layui-select,
  .layui-textarea {
    border-radius: 0 0 8px 8px;
  }

  .layui-form-mid {
    max-width: none;
    padding-left: 0 !important;
  }

  .install-actions,
  .step-btns {
    grid-template-columns: 1fr;
  }

  .install-actions-left,
  .install-actions-center,
  .install-actions-right {
    justify-content: center;
  }
}
