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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #22263a;
  --border: #2e3450;
  --accent: #4f8ef7;
  --accent-dim: rgba(79, 142, 247, 0.15);
  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.15);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.15);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.15);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 24px 16px;
}

.container {
  max-width: 560px;
  margin: 0 auto;
}

/* Header */
header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

header .globe {
  font-size: 20px;
}

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

.card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Status indicator */
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--surface-2);
}

.status-row:last-child {
  margin-bottom: 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.red   { background: var(--red);   box-shadow: 0 0 6px var(--red); }
.dot.yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); animation: pulse 1.5s ease-in-out infinite; }
.dot.gray  { background: var(--text-muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-label {
  color: var(--text-dim);
  flex: 1;
  font-size: 13px;
}

.status-value {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 12px;
  color: var(--text);
}

.badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge.green { background: var(--green-dim); color: var(--green); }
.badge.red   { background: var(--red-dim);   color: var(--red); }
.badge.yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge.gray  { background: var(--surface-2); color: var(--text-muted); }

/* Action buttons */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

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

.btn.primary {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.btn.danger {
  background: var(--red-dim);
  border-color: var(--red);
  color: var(--red);
}

.btn .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

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

/* Log panel */
.log-panel {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.log-panel:empty::before {
  content: "— 等待操作 —";
  color: var(--text-muted);
  font-style: italic;
}

.log-line {
  display: flex;
  gap: 10px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  line-height: 1.5;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-msg { color: var(--text-dim); }
.log-msg.ok     { color: var(--green); }
.log-msg.err    { color: var(--red); }
.log-msg.warn   { color: var(--yellow); }
.log-msg.info   { color: var(--accent); }

/* Divider */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* Refresh button small */
.refresh-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
  margin-left: auto;
}

.refresh-btn:hover { color: var(--accent); }

.card-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.card-title-row .card-title {
  margin-bottom: 0;
}
