:root {
  --teal: #0f766e;
  --teal-2: #14b8a6;
  --mint: #e9f7f3;
  --ink: #0f2e2a;
  --muted: #5f7a76;
  --line: #d9ebe6;
  --bg: #f4faf8;
  --danger: #b91c1c;
  --card: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.topbar {
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.logo {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--teal);
  box-shadow: inset 0 0 0 5px var(--mint);
}
.status {
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
  background: var(--mint); color: var(--teal); border: 1px solid var(--line);
}
.topnav { display: flex; align-items: center; gap: 10px; }
.guide-link {
  font-size: 12.5px; text-decoration: none; color: var(--teal);
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  white-space: nowrap;
}
.guide-link:hover { background: var(--mint); }
.status.bad { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
.status.ok { background: var(--mint); color: var(--teal); border-color: var(--line); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 34px 20px 60px; }
.hero { margin-bottom: 28px; }
.eyebrow { font-size: 11px; letter-spacing: .14em; color: var(--teal); font-weight: 650; }
.hero h1 { font-size: 30px; margin: 8px 0 10px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0 0 20px; max-width: 720px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; }
.steps b { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 12px; display: grid; place-items: center; }
.steps span { font-size: 13px; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card h2 { font-size: 17px; margin: 0; }
.tag, .points { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--mint); color: var(--teal); }
label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 7px; }
textarea, input[type=text], input:not([type]) {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 13px; resize: vertical; background: #fff; color: var(--ink);
}
textarea:focus, input:focus { outline: 2px solid #99e2d3; border-color: var(--teal-2); }
input[type=file] { width: 100%; font-size: 12px; color: var(--muted); }
.key { letter-spacing: .3em; font-family: ui-monospace, Consolas, monospace; font-size: 18px !important; }
.divider { text-align: center; color: #9ab3ae; font-size: 12px; margin: 12px 0; }
button.primary {
  width: 100%; margin-top: 18px; padding: 12px 16px; border: 0; border-radius: 10px;
  background: var(--teal); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
button.primary:hover { background: #0c665f; }
button.primary:disabled { opacity: .55; cursor: wait; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-row button { margin-top: 0; }
button.ghost {
  flex: 0 0 40%; padding: 12px 10px; border: 1px solid var(--teal); border-radius: 10px;
  background: #fff; color: var(--teal); font: inherit; font-weight: 600; cursor: pointer;
}
button.ghost:hover { background: var(--mint); }
button.ghost:disabled { opacity: .55; cursor: wait; }
.devlist { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dev { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.dev:last-child { border-bottom: 0; }
.report {
  white-space: pre-wrap; word-break: break-all; margin-top: 12px; padding: 12px;
  background: #f6fbfa; border: 1px solid var(--line); border-radius: 10px;
  font-family: ui-monospace, Consolas, monospace; font-size: 11px; line-height: 1.5;
  max-height: 220px; overflow: auto;
}
.action-group { margin: 4px 0 16px; }
.apple-btn {
  width: 100%; padding: 11px 14px; border: 1px solid #d7e5e1; border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px;
}
.apple-btn:hover { background: var(--mint); border-color: var(--teal-2); }
.apple-logo {
  display: inline-block; width: 15px; height: 17px; flex: 0 0 auto;
  background: currentColor;
  clip-path: path('M11.7 9.0c0-2.0 1.6-3.0 1.7-3.1-0.9-1.4-2.4-1.6-2.9-1.6-1.2-0.1-2.4 0.7-3.0 0.7s-1.6-0.7-2.6-0.7c-1.3 0-2.6 0.8-3.3 2.0-1.4 2.4-0.4 6.0 1.0 7.9 0.7 0.9 1.5 2.0 2.5 1.9 1.0 0 1.4-0.6 2.6-0.6s1.5 0.6 2.6 0.6 1.7-0.9 2.4-1.8c0.7-1.0 1.0-2.0 1.0-2.1-0.1 0-2.0-0.8-2.0-3.2zM9.8 3.2c0.5-0.6 0.9-1.5 0.8-2.4-0.8 0-1.8 0.5-2.4 1.1-0.5 0.6-1.0 1.5-0.9 2.4 0.9 0.1 1.9-0.5 2.5-1.1z');
}
.modal-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(11, 40, 36, .5); padding: 18px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  position: relative; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto;
  background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.2);
}
.modal-close {
  position: absolute; top: 10px; right: 12px; border: 0; background: transparent;
  font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-head { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; color: var(--teal); }
.mode-switch { display: flex; gap: 8px; margin: 18px 0 14px; }
.mode-btn {
  flex: 1; padding: 9px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
}
.mode-btn.active { background: var(--mint); border-color: var(--teal-2); color: var(--teal); font-weight: 600; }
.step-list { display: flex; flex-direction: column; gap: 9px; }
.step-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.6; }
.step-item b {
  flex: 0 0 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  background: var(--teal); color: #fff; font-size: 12px;
}
.modal-note { margin: 16px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-btn {
  flex: 1; padding: 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
}
.modal-btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 600; }

.upload-zone {
  margin-top: 8px; padding: 22px 14px; border: 2px dashed #9fd9cc; border-radius: 12px;
  background: #f4fbf9; text-align: center; cursor: pointer; transition: .15s;
}
.upload-zone:hover, .upload-zone.drag, .upload-zone.ready { border-color: var(--teal); background: var(--mint); }
.upload-zone h3 { margin: 0 0 6px; font-size: 14px; color: var(--teal); }
.upload-zone .hint { margin: 3px 0; font-size: 11px; }
.upload-zone input[type=file] { display: none; }
.file-meta {
  margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 11px; color: var(--muted); word-break: break-all;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 12px; }
.result { margin-top: 16px; font-size: 13px; min-height: 20px; }
.result .ok { color: var(--teal); }
.result .err { color: var(--danger); }
.keybox { font-family: ui-monospace, Consolas, monospace; font-size: 26px; letter-spacing: .18em; font-weight: 700; color: var(--teal); }
.info-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.info-row span:first-child { color: var(--muted); }

footer { margin-top: 22px; display: flex; gap: 20px; font-size: 12px; color: var(--muted); }
footer b { color: var(--ink); font-weight: 600; }

@media (max-width: 760px) {
  .grid, .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 25px; }
  .wrap { padding: 24px 14px 40px; }
}
