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

:root {
  --bg: #f4f5f9;
  --card-bg: #ffffff;
  --text: #1e1e2e;
  --muted: #6c6f85;
  --primary: #f38020;
  --primary-hover: #e67310;
  --border: #e2e4ec;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Status card */
.status-card .status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.status-card .status-row + .status-row {
  border-top: 1px solid var(--border);
}

.badge {
  font-size: 0.85rem;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.badge.checking {
  background: #fff3cd;
  color: #856404;
}

.badge.online {
  background: #d4edda;
  color: #155724;
}

.badge.offline {
  background: #f8d7da;
  color: #721c24;
}

.label {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Input row */
.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.input-row input:focus {
  border-color: var(--primary);
}

/* Buttons */
.btn {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

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

.btn.secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover:not(:disabled) {
  background: var(--border);
}

/* Result boxes */
.result-box {
  margin-top: 12px;
  padding: 12px 16px;
  background: #f8f9fc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  word-break: break-all;
}

.result-box.hidden {
  display: none;
}

pre.result-box {
  white-space: pre-wrap;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.8rem;
}

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

footer a:hover {
  text-decoration: underline;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
