* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0d0d0d; --panel: #1a1a1a; --panel2: #242424;
  --red: #e10600; --red-dim: #b00500;
  --text: #eaeaea; --muted: #888; --border: #333;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}
button { cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit; background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); padding: 10px 12px; border-radius: 4px; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--red); }

/* 登录 */
.login-view { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box {
  background: var(--panel); padding: 40px; border-radius: 8px; width: 340px;
  border-top: 3px solid var(--red); display: flex; flex-direction: column; gap: 14px;
}
.login-box h1 { font-size: 20px; letter-spacing: 1px; text-align: center; }
.login-box .sub { color: var(--muted); text-align: center; font-size: 13px; margin-top: -8px; }
.login-box button {
  background: var(--red); color: #fff; border: none; padding: 12px;
  border-radius: 4px; font-size: 15px; letter-spacing: 4px; margin-top: 6px;
}
.login-box button:hover { background: var(--red-dim); }
.error { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; }

/* 主布局 */
.app-view { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 0;
}
.brand { font-size: 22px; font-weight: 700; text-align: center; color: var(--red); margin-bottom: 24px; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
  padding: 13px 24px; color: var(--muted); text-decoration: none; cursor: pointer;
  border-left: 3px solid transparent; font-size: 14px;
}
.sidebar nav a:hover { color: var(--text); background: var(--panel2); }
.sidebar nav a.active { color: #fff; border-left-color: var(--red); background: var(--panel2); }
.logout {
  margin: auto 24px 0; background: transparent; color: var(--muted);
  border: 1px solid var(--border); padding: 9px; border-radius: 4px; font-size: 13px;
}
.logout:hover { color: var(--red); border-color: var(--red); }

.content { flex: 1; padding: 32px 40px; overflow-y: auto; }
.tab h2 { font-size: 18px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* 通用按钮 */
.btn { background: var(--red); color: #fff; border: none; padding: 9px 18px; border-radius: 4px; font-size: 14px; }
.btn:hover { background: var(--red-dim); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.row-actions { display: flex; gap: 8px; }

/* 展示区卡片网格 */
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.work-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; display: flex; flex-direction: column;
}
.work-card.hidden-item { opacity: 0.45; }
.work-card img { width: 100%; height: 150px; object-fit: cover; background: #000; }
.work-card .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.work-card .title { font-size: 14px; font-weight: 600; }
.work-card .meta { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; background: var(--panel2); }
.badge.music { color: var(--red); }
.drag-handle { cursor: grab; color: var(--muted); font-size: 12px; }
.work-card.dragging { opacity: 0.4; }

/* 文案编辑 */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field textarea { min-height: 70px; resize: vertical; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 500; }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--panel); padding: 28px; border-radius: 8px; width: 440px;
  max-height: 90vh; overflow-y: auto; border-top: 3px solid var(--red);
}
.modal h3 { margin-bottom: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.upload-preview { max-width: 100%; max-height: 160px; margin-top: 8px; border-radius: 4px; }

/* toast */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--red); color: #fff;
  padding: 12px 24px; border-radius: 6px; z-index: 200; font-size: 14px;
}
.toast.err { border-color: var(--red); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
