:root {
  --bg: #0f0f1a;
  --card: #1a1a2e;
  --border: #2d2d44;
  --border-light: #3d3d5c;
  --text: #e8e8f0;
  --muted: #a0a0b8;
  --dim: #707088;
  --accent: #8b8bff;
  --primary: #5b5bd6;
  --primary-hover: #4a4ac4;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-size: 0.88em;
  background: #2d2d44;
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

.btn {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-light);
}

.test-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #141425 0%, var(--bg) 100%);
}

.test-header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 28px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.test-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.lead {
  color: var(--muted);
  font-size: 15px;
  max-width: 620px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.test-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card h2 {
  font-size: 1.05rem;
}

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(91, 91, 214, 0.25);
  color: var(--accent);
  border: 1px solid rgba(139, 139, 255, 0.25);
}

.badge-local {
  background: rgba(40, 200, 64, 0.12);
  color: #7dffb0;
  border-color: rgba(40, 200, 64, 0.25);
}

.hint {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 16px;
}

.test-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.test-form-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.type {
  font-weight: 400;
  font-size: 11px;
  color: var(--dim);
}

input,
textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 139, 255, 0.12);
}

textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

.rich-editor {
  min-height: 120px;
  padding: 11px 13px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
  outline: none;
}

.rich-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 139, 255, 0.12);
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--dim);
  pointer-events: none;
}

.test-iframe {
  width: 100%;
  height: 240px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #12121f;
}

.card-note p,
.card-note li {
  font-size: 13px;
  color: var(--muted);
}

.card-note ul {
  margin-top: 10px;
  padding-left: 20px;
}

.card-note li + li {
  margin-top: 6px;
}

.card-checklist ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-checklist li {
  font-size: 13px;
  color: var(--muted);
}

.test-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--dim);
}

@media (max-width: 600px) {
  .test-header h1 {
    font-size: 1.3rem;
  }
}
