/* 后台样式 */
:root { --red: #e60012; --red-dark: #b8000e; --ink: #22252a; --muted: #6b7280; --line: #e8e9ec; --bg: #f4f5f7; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
input, textarea, select, button { font-family: inherit; font-size: 14px; }

/* 登录 */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #c90010, #e60012); padding: 20px; }
.login-box { width: min(420px, 100%); background: #fff; border-radius: 10px; padding: 38px; box-shadow: 0 20px 60px rgba(90,0,8,.25); }
.login-box .brand { text-align: center; margin-bottom: 26px; }
.login-box .brand img { width: 200px; margin: 0 auto 14px; }
.login-box .brand h1 { font-size: 20px; }
.login-box .brand p { color: var(--muted); margin: 4px 0 0; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; color: #444; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d8dbe0; border-radius: 4px; padding: 10px 12px; outline: none; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(230,0,18,.08); }
.field textarea { min-height: 260px; resize: vertical; line-height: 1.7; }
.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 18px; font-size: 13px; }
.alert.error { background: #fff1f2; color: #c90010; border: 1px solid #ffccd1; }
.alert.ok { background: #eefaf1; color: #16803c; border: 1px solid #c8edd5; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 20px; border: 1px solid var(--red); border-radius: 4px; background: var(--red); color: #fff; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--red-dark); color: #fff; }
.btn-block { width: 100%; }
.btn-light { background: #fff; color: var(--red); }
.btn-light:hover { background: var(--red); color: #fff; }
.btn-danger { background: #fff; color: #d00; border-color: #f0b7b7; }
.btn-danger:hover { background: #d00; border-color: #d00; color: #fff; }

/* 框架 */
.admin-wrap { min-height: 100vh; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; background: #24272c; color: #c9ccd1; overflow-y: auto; }
.sidebar .brand { padding: 22px 18px; border-bottom: 1px solid #35383e; }
.sidebar .brand img { width: 100%; background: #fff; border-radius: 4px; padding: 6px; }
.sidebar .brand p { text-align: center; color: #888; font-size: 12px; margin: 10px 0 0; }
.sidebar nav a { display: block; padding: 13px 22px; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: #2e3137; color: #fff; }
.sidebar nav a.active { background: #33363d; color: #fff; border-left-color: var(--red); }
.sidebar nav .group { padding: 18px 22px 6px; font-size: 12px; color: #73777f; }
.main { margin-left: 220px; min-height: 100vh; }
.topbar { height: 62px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.topbar h1 { font-size: 18px; }
.topbar .user { color: var(--muted); font-size: 13px; }
.topbar .user a { color: var(--red); margin-left: 14px; }
.content { padding: 26px 28px 50px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 24px; margin-bottom: 20px; }
.panel h2 { font-size: 17px; margin-bottom: 18px; padding-left: 10px; border-left: 3px solid var(--red); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 30px; color: var(--red); margin-top: 4px; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #fafafa; color: #666; font-weight: 600; font-size: 13px; }
tr:hover td { background: #fffafb; }
.actions a { color: var(--red); margin-right: 10px; }
.actions a.danger { color: #d00; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.toolbar h2 { font-size: 17px; }
.filter { display: flex; gap: 6px; }
.filter a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.filter a.active { background: var(--red); border-color: var(--red); color: #fff; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; background: var(--red-light, #fff1f2); color: var(--red); font-size: 12px; }
.hint { color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; }
  .sidebar .brand { padding: 12px 16px; }
  .sidebar .brand img { width: 180px; margin: 0 auto; }
  .sidebar .brand p, .sidebar nav .group { display: none; }
  .sidebar nav { display: flex; flex-wrap: wrap; padding: 6px; }
  .sidebar nav a { padding: 8px 12px; border-left: 0; border-bottom: 2px solid transparent; font-size: 13px; }
  .sidebar nav a.active { border-left: 0; border-bottom-color: var(--red); }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 14px 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 18px; }
  table { display: block; overflow-x: auto; }
}
