:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e3e6ea;
  --text: #1f2329;
  --muted: #6b7280;
  --accent: #2b5fd9;
  --accent-dark: #234cc0;
  --danger: #c0392b;
  --ok: #1f8a4c;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

/* GitLab 风格布局：左侧固定边栏 + 顶栏面包屑 + 主内容区 */
body.app-body { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.sidebar-brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-brand .brand-text { font-size: 16px; font-weight: 600; }

.nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.nav-item.active { background: var(--accent); color: #fff; }
.nav-badge {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}
a.nav-item:not(.active):hover { background: #f0f1f3; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.sidebar-user .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user .username { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .settings-icon { color: var(--muted); font-size: 16px; cursor: default; }

.app-main { flex: 1; min-width: 0; }
.app-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 12px 32px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb .crumb { color: var(--muted); text-decoration: none; }
.breadcrumb a.crumb:hover { color: var(--accent); }
.breadcrumb .crumb.current { color: var(--text); font-weight: 600; }
.breadcrumb .crumb-divider { margin: 0 8px; color: var(--line); }

.page { max-width: 1080px; margin: 0 auto; padding: 24px 32px 48px; }
.page-title { display: flex; align-items: center; gap: 16px; margin: 0 0 20px; font-size: 20px; font-weight: 600; }
.page-title .spacer { flex: 1; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }

button, .button {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 7px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.secondary { background: var(--panel); color: var(--text); border-color: var(--line); }
button.secondary:hover { background: #f0f1f3; }
button.link { background: none; border: none; color: var(--muted); padding: 0; }
button.link:hover { color: var(--text); background: none; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
input[type="text"]:focus, input[type="password"]:focus { outline: none; border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-weight: 600; color: var(--muted); background: #fafbfc; }
tbody tr:last-child td { border-bottom: none; }
td.uuid a { color: var(--accent); text-decoration: none; font-family: Consolas, Monaco, monospace; }
td.uuid a:hover { text-decoration: underline; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

.meta { list-style: none; margin: 0; padding: 0; }
.meta li { display: flex; gap: 16px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.meta li:last-child { border-bottom: none; }
.meta .label { width: 180px; color: var(--muted); flex-shrink: 0; }
.meta .value { word-break: break-all; font-family: Consolas, Monaco, monospace; }

.summary { display: flex; flex-wrap: wrap; gap: 28px; margin-bottom: 20px; }
.summary .item .label { color: var(--muted); margin-right: 8px; }

.boxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.box h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.box .text { min-height: 48px; color: var(--text); }
.box a { color: var(--accent); text-decoration: none; }
.box a:hover { text-decoration: underline; }

.status { display: inline-block; padding: 1px 10px; border-radius: 10px; font-size: 12px; border: 1px solid transparent; }
.status-waiting { color: var(--muted); border-color: var(--line); background: #f4f5f7; }
.status-running { color: var(--accent); border-color: #cddcf7; background: #eef3fd; }
.status-completed { color: var(--ok); border-color: #c6e6d3; background: #eef8f2; }
.status-failed { color: var(--danger); border-color: #f3cfc9; background: #fdf1ef; }

.error-box { margin-top: 16px; padding: 12px 16px; border: 1px solid #f3cfc9; background: #fdf1ef; color: var(--danger); border-radius: var(--radius); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--muted); }
.field .hint { margin-top: 6px; color: var(--danger); min-height: 18px; font-size: 13px; }
.login-card button { width: 100%; padding: 9px; }
