:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #667085;
  --line: #dde2ea;
  --accent: #146c94;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

h1, h2, p { margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
p, span { color: var(--muted); }
.hint {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #b8d7e5;
  border-radius: 6px;
  background: #f0f8fb;
  color: #344054;
  font-size: 13px;
}
main { padding: 24px; max-width: 1280px; margin: 0 auto; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-card {
  width: min(460px, 100%);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.stat strong { display: block; font-size: 26px; margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.wide { min-width: 0; }
.panel { margin-bottom: 16px; }
.panel-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
input, textarea, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; }
input[type="checkbox"] { width: auto; margin-right: 8px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.actions, .item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 12px;
  margin-bottom: 12px;
}
.checkbox-grid label {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  color: var(--text);
}
.code-preview-wrap {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 220px;
  overflow: hidden;
}
.code-preview-wrap iframe {
  display: block;
  width: 100%;
  min-height: 260px;
  border: 0;
  background: #fff;
}
.menu-list { margin-top: 14px; }
.admin-list { margin-top: 12px; }
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.admin-row button { padding: 7px 10px; }

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 13px;
  font: inherit;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}
button.secondary { background: #4b5563; }
button.danger { background: var(--danger); }
button.wolf-login-button {
  width: 100%;
  background: #0b6bd3;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 8px 18px rgba(11, 107, 211, .22);
  position: relative;
  overflow: hidden;
}
button.wolf-login-button:hover { background: #075db8; }
.login-neon-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 20px;
  color: var(--neon-text-color, #fff);
  text-shadow: var(--neon-text-shadow, 0 0 4px rgba(255,255,255,.95), 0 0 10px rgba(255,230,0,.85), 0 0 18px rgba(10,28,255,.9));
}
.login-neon-emoji {
  filter: drop-shadow(0 0 calc(var(--neon-glow, 18px) / 2) var(--neon-accent, #ffe600));
}
.login-neon-text {
  font-weight: 800;
}
.login-neon-sweep {
  position: absolute;
  top: 50%;
  left: -45%;
  width: 42%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, #fff, var(--neon-accent, #ffe600), #fff, transparent);
  box-shadow: 0 0 calc(var(--neon-glow, 18px) / 2) #fff, 0 0 var(--neon-glow, 18px) var(--neon-accent, #ffe600);
  animation: loginNeonSweep var(--neon-speed, 1.8s) linear infinite;
  pointer-events: none;
}
@keyframes loginNeonSweep {
  0% { left: -45%; opacity: 0; }
  12% { opacity: 1; }
  58% { left: 118%; opacity: 1; }
  100% { left: 145%; opacity: 0; }
}
button:disabled { opacity: .55; cursor: not-allowed; }

.list { display: grid; gap: 10px; }
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}
.item h3 { margin: 0 0 6px; font-size: 15px; }
.item pre, .log pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0;
  color: #344054;
}
.small { font-size: 13px; }
.log {
  max-height: 360px;
  overflow: auto;
  background: #101828;
  color: #e4e7ec;
  border-radius: 8px;
  padding: 12px;
}
.log div { padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.hidden { display: none; }
.preview-box {
  border: 1px solid #b8d7e5;
  border-radius: 8px;
  background: #f0f8fb;
  padding: 14px;
  margin-bottom: 14px;
}
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.preview-head span { display: block; font-size: 12px; margin-top: 3px; }
.message-preview {
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.message-preview pre {
  margin: 0 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.preview-media {
  margin-bottom: 10px;
}
.preview-media img {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.preview-media a {
  display: block;
  padding: 10px;
  border-radius: 6px;
  background: #eef4ff;
  color: #1849a9;
  text-decoration: none;
}
.preview-buttons {
  display: grid;
  gap: 8px;
}
.preview-buttons a,
.preview-buttons span {
  display: block;
  text-align: center;
  padding: 9px;
  border-radius: 6px;
  background: #e8f2f7;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  main { padding: 14px; }
}
