/* Monster Portal — 统一蓝色设计系统
 * 全站统一：蓝色主色、统一按钮形状、统一字体、统一圆角。无青绿。 */

:root {
  --primary: #1d4ed8;          /* blue-700 */
  --primary-hover: #1e40af;    /* blue-800 */
  --primary-soft: #eff6ff;     /* blue-50 */
  --primary-fg: #ffffff;
  --danger: #dc2626;
  --danger-hover: #b91c1c;

  --bg: #f1f5f9;               /* slate-100 */
  --surface: #ffffff;
  --surface-2: #f8fafc;        /* slate-50 */
  --border: #e2e8f0;           /* slate-200 */
  --border-strong: #cbd5e1;    /* slate-300 */

  --text: #0f172a;             /* slate-900 */
  --text-2: #334155;           /* slate-700 */
  --muted: #64748b;            /* slate-500 */

  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
          "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 布局：管理端 ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--primary);
  color: var(--primary-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1.25rem 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.sidebar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1rem;
  font-weight: 700;
}

.sidebar-nav { padding: 0.75rem 0.6rem; display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.10); text-decoration: none; color: #fff; }
.sidebar-nav a.active { background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 600; }

.sidebar-foot { margin-top: auto; padding: 0.9rem 1.25rem; font-size: 0.8rem; color: rgba(255,255,255,0.7); border-top: 1px solid rgba(255,255,255,0.15); }

.content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}
.topbar .page-title { font-size: 1.05rem; font-weight: 600; }
.topbar .topbar-actions { display: flex; gap: 0.5rem; align-items: center; }

.page-body { padding: 1.5rem; max-width: 1080px; width: 100%; }

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.card h3 { margin: 1rem 0 0.5rem; font-size: 0.95rem; color: var(--text-2); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.nav-card { display: block; color: inherit; text-decoration: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.nav-card:hover { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }
.nav-card h2 { color: var(--text); }
.nav-card p { margin: 0; }

/* ===== 按钮（统一形状） ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.btn + .btn { margin-left: 0.5rem; }

/* ===== 表单 ===== */
.form-label { display: block; font-weight: 600; font-size: 0.88rem; margin: 0.9rem 0 0.3rem; color: var(--text-2); }
.input, .textarea, .select {
  width: 100%;
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}
.textarea { min-height: 5rem; resize: vertical; }
.field-hint { color: var(--muted); font-size: 0.82rem; margin: 0.25rem 0 0; }

/* ===== 表格 ===== */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.table th { background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table a { font-weight: 500; }

/* ===== 徽标 / 提示 ===== */
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--primary-soft); color: var(--primary-hover); }
.notice { color: var(--muted); font-size: 0.88rem; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 1rem 0; }

/* ===== 登录页（居中单栏） ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.auth-card h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.auth-card .brand { color: var(--primary); font-weight: 700; }
.auth-card .sub { color: var(--muted); margin: 0 0 1.5rem; font-size: 0.9rem; }

/* ===== APP 移动端外壳 ===== */
.app-mobile { max-width: 640px; margin: 0 auto; padding: 1.25rem; }
.app-mobile .card { border-radius: var(--radius); }
.app-mobile canvas {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  touch-action: none;
  display: block;
}
.app-mobile .toolbar { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

@media (max-width: 720px) {
  .sidebar { position: static; width: 100%; height: auto; flex-basis: auto; }
  .app-shell { flex-direction: column; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { display: none; }
}
