/* 后台管理样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #ff7043;
  --primary-dark: #f4511e;
  --bg: #f5f6f8;
  --border: #e5e7eb;
  --text: #333;
  --muted: #9aa0a6;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* 登录页 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #fff; border-radius: 16px; padding: 48px 40px; width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); }
.login-box h1 { font-size: 24px; text-align: center; }
.login-sub { text-align: center; color: var(--muted); margin: 8px 0 32px; }
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }

/* 通用 */
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; margin-bottom: 12px; outline: none; font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.textarea { resize: vertical; min-height: 70px; }
.btn { padding: 10px 18px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: #ef5350; color: #fff; }
.btn-plain { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.error { color: #ef5350; min-height: 20px; margin-bottom: 8px; font-size: 13px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #2b2f3a; color: #fff; flex-shrink: 0; }
.sidebar .logo { padding: 22px 20px; font-size: 18px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar .nav { list-style: none; }
.sidebar .nav li { padding: 14px 20px; cursor: pointer; color: #b8bcc4; }
.sidebar .nav li:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar .nav li.active { background: var(--primary); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; }
.topbar { background: #fff; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.topbar h2 { font-size: 18px; }
.topbar .user { color: var(--muted); }
.content { padding: 24px; flex: 1; }

/* 卡片/统计 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border-radius: 12px; padding: 20px; }
.stat .num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat .label { color: var(--muted); margin-top: 6px; }

/* 表格 */
.table-wrap { background: #fff; border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #fafafa; color: var(--muted); font-weight: 600; }
tr:hover td { background: #fafbfc; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-orange { background: #fff3e0; color: #ef6c00; }
.tag-red { background: #fdecea; color: #c62828; }
.tag-gray { background: #f0f0f0; color: #666; }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 520px; max-width: 92vw; max-height: 86vh; overflow-y: auto; }
.modal h3 { margin-bottom: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.form-row { display: flex; gap: 12px; }
.form-row .input { flex: 1; }
.img-preview { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 10px; display: block; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
