/* 管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f1f5f9; color: #1e293b; min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* 登录 */
.login-box {
  max-width: 360px; margin: 14vh auto 0; background: #fff; border-radius: 18px;
  padding: 34px 30px; box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
  border: 1px solid #e2e8f0;
}
.login-box h1 { font-size: 20px; font-weight: 800; text-align: center; }
.login-box p.sub { text-align: center; color: #94a3b8; font-size: 13px; margin: 8px 0 22px; }
.login-box input {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px;
  outline: none; margin-bottom: 14px;
}
.login-box input:focus { border-color: #818cf8; }
.login-box .err { color: #dc2626; font-size: 13px; margin-bottom: 10px; min-height: 18px; }
.login-box .hint { text-align: center; color: #94a3b8; font-size: 12px; margin-top: 14px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
}
.topbar .logo { font-size: 16px; font-weight: 800; }
.topbar .spacer { flex: 1; }

/* 按钮 */
.btn {
  border: 1px solid #e2e8f0; background: #fff; color: #334155;
  border-radius: 10px; padding: 8px 16px; font-size: 13.5px;
  transition: background .15s ease;
}
.btn:hover { background: #f8fafc; }
.btn.primary { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.btn.primary:hover { background: #4338ca; }
.btn.danger { color: #dc2626; border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px; font-size: 15px; border-radius: 12px; }

/* 标签页 */
.tabs { display: flex; gap: 8px; padding: 14px 20px 0; max-width: 900px; margin: 0 auto; flex-wrap: wrap; }
.tabs button {
  border: 1px solid transparent; background: transparent; color: #64748b;
  font-size: 14px; padding: 8px 16px; border-radius: 999px;
}
.tabs button.active { background: #fff; border-color: #e2e8f0; color: #1e293b; font-weight: 700; }

/* 面板 */
.panel { max-width: 900px; margin: 0 auto; padding: 16px 20px 90px; }
.box {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 20px; margin-bottom: 16px;
}
.box > h3 { font-size: 15px; font-weight: 800; margin-bottom: 14px; }
.box > h3 .tip { font-weight: 400; color: #94a3b8; font-size: 12px; margin-left: 8px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: #64748b; margin-bottom: 6px; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px;
  outline: none; background: #fff; color: #1e293b;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: #818cf8; }
.field textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.field .help { font-size: 12px; color: #94a3b8; margin-top: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* 图片选择器 */
.img-picker { display: flex; align-items: center; gap: 10px; }
.img-picker img {
  flex: none; width: 52px; height: 52px; border-radius: 12px; object-fit: cover;
  background: #f1f5f9; border: 1px solid #e2e8f0;
}
.img-picker input { flex: 1; }

/* 链接编辑器 */
.link-item { border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; margin-bottom: 12px; background: #fbfdff; }
.link-item .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.link-item .row + .row { margin-top: 10px; }
.link-item select { flex: none; width: 130px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 10px; background: #fff; }
.link-item input[type="text"] { flex: 1; min-width: 140px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 12px; }
.link-item textarea { width: 100%; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 12px; min-height: 60px; resize: vertical; }
.link-item .chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #64748b; white-space: nowrap; }

/* 游戏列表 */
.game-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  background: #fff;
}
.game-row img { flex: none; width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: #f1f5f9; }
.game-row .g-info { flex: 1; min-width: 0; }
.game-row .g-name { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.game-row .g-slug { font-size: 12px; color: #94a3b8; margin-top: 3px; }
.badge { font-size: 11px; border-radius: 999px; padding: 2px 9px; font-weight: 700; }
.badge.on { background: #dcfce7; color: #16a34a; }
.badge.off { background: #f1f5f9; color: #94a3b8; }
.badge.tag { background: #fee2e2; color: #dc2626; }

/* 开关 */
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s;
}
.switch input:checked + .slider { background: #22c55e; }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #1e293b; color: #fff; font-size: 13.5px;
  padding: 10px 22px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .25s ease; z-index: 99;
}
.toast.show { opacity: .95; }
.notice {
  background: #fffbeb; border: 1px solid #fde68a; color: #b45309;
  border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}
.editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.editor-head h3 { font-size: 16px; font-weight: 800; flex: 1; }
