/* ==========================================================================
   私域 AI 创作系统 · 安装向导样式
   纯原生 CSS，不依赖任何前端构建，保证「框架起不来」时向导依然能正常显示
   ========================================================================== */

:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --fg: #1f2328;
  --muted: #6a737d;
  --line: #e2e6ea;
  --line-2: #cfd6dd;
  --brand: #c0392b;
  --brand-2: #a5301f;
  --blue: #185fa5;
  --green: #1d9e75;
  --green-bg: #eaf7f1;
  --amber: #b7791f;
  --amber-bg: #fff8e6;
  --red: #c53030;
  --red-bg: #fdecec;
  --ok-bg: #eaf7f1;
  --code-bg: #f2f4f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 58px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.logo .mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
}
.ver { color: var(--muted); font-size: 13px; }

/* ---------- 布局 ---------- */
.shell {
  max-width: 1120px;
  margin: 26px auto;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 0 20px;
}
aside { width: 232px; flex: 0 0 232px; }
aside ol { list-style: none; margin: 0; padding: 0; }
aside li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 8px; color: var(--muted);
}
aside li.cur { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.06); color: var(--fg); }
aside li .no {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%;
  background: #e6eaee; color: #6a737d;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; margin-top: 2px;
}
aside li.cur .no { background: var(--brand); color: #fff; }
aside li.done .no { background: var(--green); color: #fff; }
aside li .tx { display: flex; flex-direction: column; line-height: 1.35; }
aside li .tx b { font-weight: 500; font-size: 13.5px; }
aside li .tx i { font-style: normal; font-size: 12px; color: var(--muted); }

main {
  flex: 1 1 auto; min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px 32px;
}

h1 { font-size: 21px; font-weight: 600; margin: 0 0 10px; }
h2 { font-size: 16px; font-weight: 600; margin: 30px 0 12px; }
p { margin: 10px 0; }
p.lead { color: #4a545e; margin-bottom: 20px; }
a { color: var(--blue); }
code {
  background: var(--code-bg); padding: 1px 5px; border-radius: 4px;
  font-family: Consolas, Monaco, "Courier New", monospace; font-size: 12.5px;
}
pre {
  background: #1f2430; color: #dfe6ee;
  padding: 12px 14px; border-radius: 8px; overflow-x: auto;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 12.5px; line-height: 1.65; margin: 10px 0;
}
.mono { font-family: Consolas, Monaco, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }

/* ---------- 提示条 ---------- */
.alert {
  border-radius: 8px; padding: 12px 16px; margin: 14px 0;
  border-left: 4px solid var(--line-2); background: #f7f9fa;
}
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert li { margin: 3px 0; }
.alert.err  { background: var(--red-bg);   border-left-color: var(--red);   color: #7d1d1d; }
.alert.ok   { background: var(--ok-bg);    border-left-color: var(--green); color: #125c45; }
.alert.warn { background: var(--amber-bg); border-left-color: var(--amber); color: #6b4a06; }
.alert p { margin: 6px 0; }

/* ---------- 环境检测统计 ---------- */
.stat-row { display: flex; gap: 12px; margin: 18px 0; }
.stat {
  flex: 1; border-radius: 10px; padding: 12px 16px;
  background: #f6f8fa; border: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 8px;
}
.stat .n { font-size: 22px; font-weight: 600; }
.stat .l { font-size: 12.5px; color: var(--muted); }
.stat.good { background: var(--green-bg); border-color: #bfe6d6; }
.stat.good .n { color: var(--green); }
.stat.warn { background: var(--amber-bg); border-color: #f0dfae; }
.stat.warn .n { color: var(--amber); }
.stat.bad  { background: var(--red-bg);   border-color: #f3c6c6; }
.stat.bad .n { color: var(--red); }

/* ---------- 检测表 ---------- */
table { border-collapse: collapse; width: 100%; }
.check-table, .summary, .mini { font-size: 13px; margin: 12px 0; }
.check-table th, .check-table td,
.summary th, .summary td,
.mini td {
  border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top;
}
.check-table th, .summary th { background: #f0f3f6; font-weight: 500; }
.summary th { width: 150px; background: #f6f8fa; font-weight: 500; color: #47525c; }
.mini td:first-child { width: 90px; color: var(--muted); background: #f8fafb; }
.check-table tr.row-bad td { background: #fffafa; }
.check-table td.hint { font-size: 12.5px; color: #7a5c1b; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 12px; line-height: 1.6; white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); color: var(--green); }
.pill.no { background: var(--red-bg); color: var(--red); }
.pill.wr { background: var(--amber-bg); color: var(--amber); }
.pill.gy { background: #eef1f4; color: var(--muted); }

/* ---------- 表单 ---------- */
.field { margin: 16px 0; }
.field label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13.5px; }
input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2);
  border-radius: 7px; font-size: 13.5px; font-family: inherit;
  background: #fff; color: var(--fg); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(192,57,43,.08); }
input:disabled { background: #f2f4f7; color: var(--muted); }
.grid2 { display: flex; gap: 16px; }
.grid2 .field { flex: 1; min-width: 0; }
.tip { font-size: 12.5px; color: var(--muted); margin: 5px 0 0; }

.checkbox {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 12px 0; cursor: pointer; font-size: 13.5px;
}
.checkbox input { margin-top: 4px; flex: 0 0 auto; }
.checkbox.big { font-size: 14.5px; font-weight: 500; }

.pwd-meter {
  height: 4px; background: #e6eaee; border-radius: 3px;
  margin-top: 8px; overflow: hidden;
}
.pwd-meter i { display: block; height: 100%; width: 5%; background: #e0e0e0; transition: all .25s; }

/* ---------- 盒子 ---------- */
.agree-box, .warn-box, .info-box, .sub-box {
  border-radius: 9px; padding: 14px 18px; margin: 16px 0;
}
.agree-box { background: #fafbfc; border: 1px solid var(--line); }
.agree-box ol { margin: 8px 0 0; padding-left: 20px; font-size: 13px; color: #40484f; }
.agree-box li { margin: 5px 0; }

.warn-box { background: var(--amber-bg); border-left: 4px solid var(--amber); }
.warn-box b { color: #6b4a06; }
.warn-box p, .warn-box ul { font-size: 13px; color: #6b4a06; margin: 6px 0; }
.warn-box ul { padding-left: 20px; }

.info-box { background: #f6f8fa; border-left: 4px solid var(--blue); }
.info-box p { font-size: 13px; color: #3d4650; margin: 6px 0; }

.sub-box { background: #fafbfc; border: 1px dashed var(--line-2); padding: 4px 18px 14px; }

/* ---------- 按钮 ---------- */
.actions { display: flex; gap: 12px; margin-top: 24px; align-items: center; flex-wrap: wrap; }
.actions.inline { margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 20px; border-radius: 7px; border: 1px solid var(--line-2);
  background: #fff; color: var(--fg); font-size: 13.5px; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); background: #f8fafb; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a52424; border-color: #a52424; }
.btn-lg { padding: 12px 30px; font-size: 14.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 进度条 ---------- */
.progress-wrap { margin: 20px 0; }
.progress-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: #47525c; margin-bottom: 7px;
}
.progress-bar { height: 8px; background: #e6eaee; border-radius: 5px; overflow: hidden; }
.progress-bar i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--brand), #e0745f);
  border-radius: 5px; transition: width .25s;
}
.progress-detail { font-size: 12.5px; color: var(--muted); margin-top: 7px; min-height: 18px; }

.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #e6eaee; border-top-color: var(--brand);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 完成页 ---------- */
.done-head { text-align: center; margin-bottom: 26px; }
.done-icon {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--green-bg); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 600;
}
.cred-box {
  background: #f6f8fa; border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 20px; margin: 18px 0;
}
.cred-row {
  display: flex; gap: 14px; padding: 7px 0;
  border-bottom: 1px dashed var(--line); align-items: center;
}
.cred-row:last-of-type { border-bottom: none; }
.cred-row span { width: 100px; color: var(--muted); font-size: 13px; flex: 0 0 100px; }
.cred-row b {
  font-family: Consolas, Monaco, monospace; font-size: 13.5px;
  cursor: pointer; padding: 2px 8px; border-radius: 5px; background: #fff;
  border: 1px solid var(--line);
}
.cred-row b:hover { border-color: var(--brand); }
.cred-tip { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

.todo { display: flex; gap: 14px; margin: 16px 0; }
.todo-no {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center; margin-top: 3px;
}
.todo-body { flex: 1; min-width: 0; }
.todo-body > b { font-size: 14.5px; }
.todo-body p { font-size: 13px; color: #4a545e; margin: 5px 0; }

/* ---------- 锁定页 ---------- */
body.locked-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 20px;
}
.locked-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 36px 40px; max-width: 700px; width: 100%;
}
.locked-icon { font-size: 34px; text-align: center; margin-bottom: 8px; }
.locked-icon.danger { color: var(--red); font-weight: 700; }
.locked-card h1 { text-align: center; margin-bottom: 16px; }
.locked-card .actions { justify-content: center; }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; color: #9aa4ae; font-size: 12px;
  padding: 26px 20px 40px;
}

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  aside { width: 100%; flex: none; }
  aside ol { display: flex; flex-wrap: wrap; gap: 6px; }
  aside li { padding: 6px 10px; }
  aside li .tx i { display: none; }
  main { padding: 20px 18px 24px; }
  .grid2 { flex-direction: column; gap: 0; }
  .stat-row { flex-direction: column; gap: 8px; }
}
