:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s ease, opacity 0.15s ease;
}

button:hover { background: var(--primary-dark); }
button.secondary { background: #e5e7eb; color: var(--text); }
button.secondary:hover { background: #d1d5db; }
button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }
button.small { padding: 5px 10px; font-size: 12px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}

textarea { resize: vertical; min-height: 84px; }

label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; }

.hidden { display: none !important; }

.topbar {
  height: 64px;
  background: #111827;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar h1 { font-size: 18px; margin: 0; }
.topbar .user-area { display: flex; align-items: center; gap: 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  background: rgba(255,255,255,0.12);
}
.badge.root { background: #f59e0b; color: #111827; }

.tabs {
  display: flex;
  gap: 8px;
  padding: 16px 24px 0;
  background: var(--bg);
}

.tab-btn {
  background: #e5e7eb;
  color: var(--text);
  border-radius: 10px 10px 0 0;
}
.tab-btn.active { background: var(--panel); color: var(--primary); font-weight: 600; }

.container { padding: 20px 24px 40px; }
.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
.toolbar .field { min-width: 180px; }
.toolbar .field label { margin-top: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
}
th { color: var(--muted); font-weight: 600; background: #f9fafb; }
.thumb {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #e5e7eb;
  cursor: pointer;
}
.code { font-family: Consolas, monospace; color: var(--primary-dark); }
.muted { color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e7ff, #f0fdf4);
  padding: 20px;
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-card h2 { margin: 0 0 6px; }
.login-error {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--danger);
}
.login-tip { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 30;
}
.modal {
  width: 480px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.secret-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  margin: 16px 24px 0;
  padding: 14px 16px;
}
.secret-card strong { display: block; }
.secret-card .muted { display: block; margin-top: 4px; font-size: 12px; }
.secret-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.secret-code {
  font-family: Consolas, monospace;
  color: var(--primary-dark);
  font-size: 16px;
  letter-spacing: 1px;
}

body.h5-body {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.h5-stage {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.h5-image {
  display: block;
  width: min(92vw, 420px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.h5-status {
  max-width: 92vw;
  margin: 0;
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
}

@media (max-width: 760px) {
  .topbar { padding: 0 14px; }
  .tabs, .container { padding-left: 14px; padding-right: 14px; }
  .secret-card { margin: 12px 14px 0; }
  .toolbar .field { flex: 1 1 140px; }
  .thumb { width: 72px; height: 48px; }
}
