:root {
  --bg: #f6fafb;
  --card: #ffffff;
  --card2: #f8fbfc;
  --border: #e4eef0;
  --text: #0b1e22;
  --muted: #587075;
  --primary: #00d5ff;
  --accent: #1be4b0;
  --danger: #ef4444;
  --warning: #facc15;
  --blue: #0ea5e9;
  --code: #0b1e22;
  --codeText: #d6f6ff;
  --shadow: 0 12px 30px rgba(7,31,35,.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background:
    radial-gradient(80% 80% at 0% 0%, rgba(0, 213, 255, .16), transparent 42%),
    radial-gradient(70% 70% at 100% 0%, rgba(27, 228, 176, .13), transparent 42%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--blue); text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.page { width: min(1120px, calc(100vw - 32px)); margin: 0 auto; padding: 22px 0 34px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand { font-weight: 900; letter-spacing: .04em; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 10px; }
.nav a.active { color: var(--text); background: rgba(0, 213, 255, .12); font-weight: 700; }
.nav a:hover { color: var(--text); background: rgba(0, 213, 255, .08); }

.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; margin-bottom: 16px; }
.card {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card h1 { font-size: clamp(25px, 4vw, 40px); line-height: 1.12; margin: 10px 0 10px; }
.card h2 { font-size: 17px; margin: 0 0 14px; }
.card h3 { font-size: 15px; margin: 0 0 10px; }
.card p, .hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.badge { display: inline-flex; font-size: 12px; color: #04758a; background: #e7faff; border: 1px solid #c9f4fb; border-radius: 999px; padding: 5px 10px; font-weight: 700; }
.pill { display: none; color: #096449; background: rgba(27, 228, 176, .13); border: 1px solid rgba(27, 228, 176, .26); padding: 8px 10px; border-radius: 999px; font-size: 12px; margin-bottom: 12px; font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .card { margin-bottom: 0; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.section-title { margin: 8px 0 14px; font-size: 20px; }
.section { margin-top: 16px; }

label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin: 0 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card2);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  font-size: 14px;
  margin-bottom: 12px;
  font-family: inherit;
}
textarea { min-height: 82px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
input:focus, select:focus, textarea:focus { border-color: rgba(0,213,255,.7); box-shadow: 0 0 0 3px rgba(0,213,255,.12); }
.form-row { margin-bottom: 0; }

button, .button {
  width: auto;
  min-height: 44px;
  border: none;
  border-radius: 12px;
  margin: 0 0 10px;
  padding: 0 12px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #06333a;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:active, .button:active { transform: translateY(1px); opacity: .82; }
button.secondary, .button.secondary { background: #eef5f6; color: var(--text); border: 1px solid var(--border); }
button.danger { background: var(--danger); color: #fff; }
button.warning { background: var(--warning); color: #111827; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.actions button { margin-bottom: 0; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row button { width: 100%; }

pre, .result {
  min-height: 260px;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--code);
  color: var(--codeText);
  padding: 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  overflow: auto;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.result { margin-top: 12px; }
.status { color: var(--blue); font-size: 13px; margin-top: 10px; font-weight: 700; }
.small { color: var(--muted); font-size: 12px; }

.table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); font-size: 13px; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px; text-align: left; vertical-align: top; }
.table th { color: var(--text); background: rgba(0, 213, 255, .08); }
.table tr:last-child td { border-bottom: 0; }

.qr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 14px; align-items: start; }
.qr-img { width: 150px; height: 150px; border: 1px solid var(--border); background: #fff; padding: 8px; border-radius: 14px; }
.code-line {
  position: relative;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 74px 12px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.copy {
  position: absolute;
  right: 8px;
  top: 8px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 9px;
  background: #eef5f6;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  margin: 0;
}
.note { border-left: 4px solid var(--primary); background: rgba(0,213,255,.08); border-radius: 14px; padding: 12px 14px; color: var(--muted); }

@media (max-width: 860px) {
  .hero, .grid, .row, .btn-row, .qr-grid { grid-template-columns: 1fr; }
  .page { width: min(100vw - 24px, 1120px); padding-top: 14px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .qr-img { width: 180px; height: 180px; }
  button, .button { width: 100%; }
  .actions { display: grid; grid-template-columns: 1fr; }
}
