:root {
  --purple: #533afd;
  --purple-dark: #4434d4;
  --purple-light: #b9b9f9;
  --navy: #061b31;
  --brand-dark: #1c1e54;
  --ink: #273951;
  --muted: #64748d;
  --line: #e5edf5;
  --bg: #f6f9fc;
  --card: #ffffff;
  --green: #108c3d;
  --amber: #9b6829;
  --red: #c0392b;
  --shadow: rgba(50, 50, 93, 0.1) 0 6px 18px -8px, rgba(0, 0, 0, 0.05) 0 3px 7px -3px;
  --shadow-lg: rgba(50, 50, 93, 0.25) 0 30px 45px -30px, rgba(0, 0, 0, 0.1) 0 18px 36px -18px;
  font-feature-settings: "ss01", "tnum";
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "SF Pro Display", "PingFang SC", "Segoe UI", Roboto, sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

.topbar {
  background: linear-gradient(120deg, var(--navy), var(--purple));
  color: #fff;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand { font-size: 17px; font-weight: 400; letter-spacing: .2px; }
.topbar .brand span { opacity: .7; font-weight: 300; margin-left: 8px; font-size: 13px; }
.topbar .right { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.topbar .right a { color: #fff; opacity: .85; }
.topbar .right a:hover { opacity: 1; }

.wrap { max-width: 1080px; margin: 32px auto; padding: 0 28px; }
.narrow { max-width: 460px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 28px;
}

h1 { font-size: 24px; font-weight: 400; color: var(--navy); margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 500; color: var(--navy); margin: 0 0 18px; }
.sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }

label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin: 16px 0 6px; }
.hint { font-weight: 300; color: var(--muted); font-size: 12px; margin-left: 6px; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(83, 58, 253, .15);
}
textarea { resize: vertical; min-height: 64px; }

.btn {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--purple-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--purple); border: 1px solid var(--line); }
.btn.sm { padding: 6px 13px; font-size: 13px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.msg { margin-top: 16px; font-size: 13px; padding: 10px 12px; border-radius: 5px; display: none; }
.msg.err { display: block; background: #fdecea; color: var(--red); }
.msg.ok  { display: block; background: #e7f6ee; color: var(--green); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
td .cat { font-weight: 500; color: var(--navy); }
td .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
tr:hover td { background: #fafbfc; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge.submitted { background: #eef0f4; color: #5b6677; }
.badge.claimed   { background: #e7effe; color: #2f6fed; }
.badge.running   { background: #fff3e0; color: var(--amber); }
.badge.done      { background: #e7f6ee; color: var(--green); }
.badge.failed    { background: #fdecea; color: var(--red); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; font-size: 14px; }
.mono { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); }

/* ───────── 门户首页(部门选择) ───────── */
.portal-hero {
  background:
    radial-gradient(1200px 400px at 15% -10%, rgba(83, 58, 253, .10), transparent 60%),
    radial-gradient(900px 380px at 100% 0%, rgba(249, 107, 238, .08), transparent 55%);
  padding: 64px 28px 36px;
}
.portal-hero .inner { max-width: 1080px; margin: 0 auto; }
.portal-hero h1 {
  font-size: 44px; font-weight: 300; letter-spacing: -0.9px; line-height: 1.1;
  color: var(--navy); margin: 0 0 12px;
}
.portal-hero p { font-size: 18px; font-weight: 300; color: var(--muted); margin: 0; max-width: 620px; }
.portal-hero .who { color: var(--purple); }

.dept-wrap { max-width: 1080px; margin: 8px auto 56px; padding: 0 28px; }
.dept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 980px) { .dept-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .dept-grid { grid-template-columns: 1fr; } }

.dept-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  min-height: 150px;
  display: flex; flex-direction: column;
}
.dept-card.active:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--purple-light); }
.dept-card .ico { font-size: 26px; line-height: 1; margin-bottom: 12px; }
.dept-card h3 { font-size: 19px; font-weight: 400; color: var(--navy); margin: 0 0 4px; letter-spacing: -0.2px; }
.dept-card .count { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.dept-card.muted { background: #fbfcfe; }
.dept-card.muted h3 { color: #8a97a8; }

.feat-list { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.feat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 6px;
  background: rgba(83, 58, 253, .05);
  color: var(--purple); font-size: 14px; font-weight: 400;
  text-decoration: none; transition: background .15s;
}
.feat:hover { background: rgba(83, 58, 253, .12); text-decoration: none; }
.feat .arrow { opacity: .5; font-size: 13px; }
.dept-soon { margin-top: auto; font-size: 13px; color: #9aa6b6; font-weight: 300; }
.dept-badge {
  position: absolute; top: 16px; right: 16px;
  font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 4px;
  background: rgba(21, 190, 83, .15); color: var(--green);
}
