:root {
  --bg: #050810;
  --card: #0d1220;
  --border: #1c2333;
  --text: #e8ecf5;
  --muted: #7c869c;
  --accent1: #7c5cff;
  --accent2: #4b3aa8;
  --up: #2ecc71;
  --down: #ff5d5d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 50% 0%, #12172a 0%, var(--bg) 60%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 18, 32, 0.7);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; gap: 18px; flex: 1; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.topbar nav a:hover { color: var(--text); }
.link-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.85rem; padding: 0;
}
.link-btn:hover { color: var(--text); }
.content { max-width: 960px; margin: 0 auto; padding: 32px 24px 80px; }

h1 { font-size: 1.5rem; margin: 0 0 6px; }
.subtitle { color: var(--muted); margin: 0 0 28px; font-size: 0.9rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 1.05rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }

.tile {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: #0a0e1a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile .name { font-weight: 600; font-size: 0.92rem; }
.tile .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.up { background: var(--up); box-shadow: 0 0 6px var(--up); }
.dot.down { background: var(--down); box-shadow: 0 0 6px var(--down); }
.tile .state { font-size: 0.8rem; color: var(--muted); }
.tile button {
  margin-top: 4px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: 0.78rem; cursor: pointer;
}
.tile button:hover { color: var(--text); border-color: var(--accent1); }

label { display: block; font-size: 0.8rem; color: var(--muted); margin: 0 0 6px 2px; }
input[type=text], input[type=password], input[type=file], textarea, select {
  width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: #0a0e1a; color: var(--text); font-size: 0.92rem; outline: none;
  font-family: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent1); }
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 14px; }

button.primary {
  padding: 10px 18px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #fff; font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { filter: grayscale(0.6); cursor: not-allowed; }

.model-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.model-tabs label {
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px;
  cursor: pointer; font-size: 0.85rem; color: var(--muted);
}
.model-tabs input { display: none; }
.model-tabs input:checked + span { color: var(--text); }

.result-box { margin-top: 16px; padding: 16px; background: #0a0e1a; border-radius: 10px; border: 1px solid var(--border); }
.result-box img, .result-box video { max-width: 100%; border-radius: 8px; margin-top: 8px; }
.error-box { color: var(--down); font-size: 0.88rem; }
.spinner { color: var(--muted); font-size: 0.88rem; }

pre.json { background: #0a0e1a; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 0.82rem; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 90vh; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.login-card h1 { font-size: 1.2rem; }

.chat-log { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.chat-turn .prompt { color: var(--muted); font-size: 0.85rem; margin-bottom: 4px; }
.chat-turn .reply { background: #0a0e1a; padding: 12px 14px; border-radius: 10px; white-space: pre-wrap; }

iframe.embed { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 12px; }
