:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #0f2137;
  --muted: #5f6f82;
  --border: #ccd5e1;
  --primary: #2f66e8;
  --primary-dark: #2456c7;
  --soft: #e9edf4;
  --ok: #12805c;
  --bad: #b42318;
  --shadow: 0 18px 45px rgba(15, 33, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

.page {
  width: min(1154px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 18px 0 44px;
}

.header {
  text-align: center;
  margin-bottom: 28px;
}

.header h1 {
  margin: 6px 0 8px;
  font-size: 30px;
  line-height: 1.2;
}

.header p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 28px 0 16px;
  flex-wrap: wrap;
}

.tab,
.format-btn {
  border: 0;
  border-radius: 10px;
  min-width: 156px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  background: #e4e8ee;
  color: #07182b;
  cursor: pointer;
}

.tab.active,
.format-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 25px rgba(47, 102, 232, 0.26);
}

.card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 10px;
}

.card h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

.hint {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #edf0ff;
  color: #3232d9;
  padding: 8px 14px;
  font-weight: 800;
}

label {
  display: block;
  margin: 12px 0 8px;
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 184px;
  resize: vertical;
}

button.primary,
a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  padding: 12px 16px;
  min-height: 40px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button.primary:hover,
a.primary:hover {
  background: var(--primary-dark);
}

button.secondary {
  border: 0;
  border-radius: 9px;
  padding: 12px 16px;
  background: var(--soft);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.message {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #eef6ff;
  color: #17456d;
  white-space: pre-wrap;
}

.message.ok {
  background: #e8f7ef;
  color: var(--ok);
}

.message.bad {
  background: #fff0ed;
  color: var(--bad);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid #e7edf5;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f7f9fc;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.code {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: #e9edf4;
  font-size: 12px;
  font-weight: 800;
}

.badge.ok {
  background: #def7ec;
  color: #0f6b4b;
}

.badge.bad {
  background: #ffe4df;
  color: #9f261a;
}

@media (max-width: 760px) {
  .page {
    width: min(100vw - 24px, 1154px);
  }

  .tab,
  .format-btn {
    flex: 1 1 100%;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}
