:root {
  --brand: #2f6fed;
  --brand-dark: #2458c4;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e3e8f0;
  --text: #1f2933;
  --muted: #6b7280;
  --green: #1a9e5c;
  --red: #d64545;
  --blue: #2f6fed;
  --orange: #b26a00;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  display: flex; min-height: 100vh; flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 18px; width: 100%; }
main.wrap { flex: 1; padding-top: 22px; padding-bottom: 40px; }

/* 顶栏 */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 54px; }
.brand { font-weight: 700; font-size: 16px; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--brand); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.nav a:hover { background: #eef2fb; text-decoration: none; }
.nav a.on { background: var(--brand); color: #fff; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.who { color: var(--text); font-size: 13px; }
.who .role { font-style: normal; color: var(--brand); font-size: 12px; margin-left: 4px; }

/* 通用 */
h1 { font-size: 21px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
h3 { font-size: 15px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(20,30,50,.05);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; color: var(--brand); }
.stat span { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #f8faff; }
.tbl-wrap { overflow-x: auto; }

.badge { display: inline-block; border-radius: 6px; padding: 2px 9px; font-size: 12px; white-space: nowrap; }
.b-green { background: #e6f6ee; color: var(--green); border: 1px solid #bfe8d2; }
.b-red   { background: #fdecec; color: var(--red);   border: 1px solid #f3c6c6; }
.b-blue  { background: #e8f0fe; color: var(--blue);  border: 1px solid #c6d8fb; }
.b-gray  { background: #eef0f4; color: var(--muted); border: 1px solid #dde1e8; }
.b-orange{ background: #fff4e0; color: var(--orange); border: 1px solid #ffdca8; }

.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 8px 16px;
  background: var(--brand); color: #fff; font-size: 14px; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f2f4f8; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.btn-jump { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-jump:hover { background: #eef4ff; }

.flash {
  background: #e8f0fe; border: 1px solid #c6d8fb; color: #1d4eab;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px;
}
.flash.err { background: #fdecec; border-color: #f3c6c6; color: #a32626; }
.err { background: #fdecec; border: 1px solid #f3c6c6; color: #a32626; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 34px 0; }

/* 表单 */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=datetime-local], select, textarea {
  width: 100%; max-width: 420px; min-height: 36px; border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 14px; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
select[multiple] { min-height: 120px; }
.form-actions { margin-top: 16px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 200px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.mono { font-family: Consolas, Menlo, monospace; word-break: break-all; }

/* 作品 */
.work-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.tag { display: inline-block; background: #eef4ff; color: #2f5db8; border-radius: 5px; padding: 2px 8px; margin: 2px 4px 2px 0; font-size: 12px; }
.desc-box { white-space: pre-wrap; word-break: break-word; color: #374151; line-height: 1.7; font-size: 13.5px; max-height: 260px; overflow: auto; background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 380px; padding: 18px; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.modal-body { display: flex; flex-direction: column; gap: 10px; }
.modal-foot { margin-top: 14px; text-align: right; }
.jump-opt {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  background: #fff; cursor: pointer; font-size: 14px; color: var(--text);
}
.jump-opt:hover { border-color: var(--brand); background: #f4f8ff; text-decoration: none; }
.jump-opt b { color: var(--brand); }
.jump-opt span { color: var(--muted); font-size: 12px; }

/* 分割/徽标行 */
.meta-line { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.note { background: #fff8e6; border: 1px solid #ffe3a3; color: #8a6100; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 22px 0 30px; border-top: 1px solid var(--line); margin-top: 20px; background: #fff; }

@media (max-width: 720px) {
  th, td { padding: 8px 8px; }
  .userbox { margin-left: 0; }
}
