:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --ok-bg: #ecfdf5;
  --ok-fg: #065f46;
  --err-bg: #fef2f2;
  --err-fg: #991b1b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --panel: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #1f2937;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --ok-bg: #052e2b;
    --ok-fg: #6ee7b7;
    --err-bg: #3b0a0a;
    --err-fg: #fca5a5;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 600; }
.brand-logo { width: 32px; height: 32px; object-fit: contain; border-radius: 8px; }
.brand-logo--fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg); font-size: 20px;
}
.site-nav a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 14px; }
.site-nav a:hover { color: var(--accent); }
.lang-link { font-weight: 600; }

.container { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 32px 16px 48px; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-info h2 { margin-top: 22px; font-size: 16px; }
.card-info h2:first-of-type { margin-top: 8px; }

h1 { margin: 0 0 12px; font-size: 22px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.form { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; font-weight: 500; }
.req { color: #dc2626; font-style: normal; font-size: 11px; }

.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel); color: var(--text);
  font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea.input { resize: vertical; min-height: 60px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hint { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 4px; padding: 3px; background: var(--bg); border-radius: 8px; width: fit-content; }
.tab {
  padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer;
  border: none; background: transparent; color: var(--muted); border-radius: 6px;
}
.tab--active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

.btn {
  display: inline-block; padding: 10px 16px; border-radius: 8px;
  border: 1px solid transparent; font: inherit; font-size: 14px;
  font-weight: 500; cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: .7; cursor: default; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); margin-top: 12px; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.link-box { display: flex; gap: 8px; margin: 16px 0 4px; }
.link-input { flex: 1; font-family: ui-monospace, monospace; font-size: 13px; }

.qr-wrap { margin: 16px 0; text-align: center; }
.qr-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
#qr-canvas { background: #fff; border-radius: 8px; padding: 6px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-ok { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid #a7f3d0; }
.alert-err { background: var(--err-bg); color: var(--err-fg); border: 1px solid #fecaca; }
.error { color: var(--err-fg); font-size: 13px; }

.info-list { margin: 0; padding-left: 22px; font-size: 14px; color: var(--text); }
.info-list li { margin-bottom: 6px; }

.value { padding: 8px 0; font-size: 15px; }
#subject-block, #secret-block, #description-block { margin-top: 16px; }
#download-link { margin-top: 8px; }

.site-footer {
  padding: 16px 24px; text-align: center; font-size: 12px;
  color: var(--muted); border-top: 1px solid var(--border); background: var(--panel);
}

code {
  background: rgba(148, 163, 184, .2);
  padding: 1px 5px; border-radius: 4px;
  font-size: 12px;
}