:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1a2332;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f9d7a;
  --brand-hover: #0b8468;
  --brand-soft: #e0f5ef;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1320px; margin: 0 auto; padding: 24px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--ink) 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.actions { display: flex; gap: 8px; align-items: center; }

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.btn.primary {
  background: linear-gradient(135deg, var(--brand) 0%, #0bb98a 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(15,157,122,0.25);
}
.btn.primary:hover {
  background: linear-gradient(135deg, var(--brand-hover) 0%, #0aa57c 100%);
  box-shadow: 0 4px 14px rgba(15,157,122,0.35);
}
.btn.danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(220,38,38,0.2);
}
.btn.danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 14px rgba(220,38,38,0.3);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}

.k { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.v { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }

.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 380px 1fr; gap: 16px; }

.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.meta { color: var(--muted); font-size: 12px; line-height: 1.6; }
.markdown-body {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
  word-break: break-word;
}
.summary-properties {
  margin: 10px 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #f8fafb 100%);
  box-shadow: var(--shadow-sm);
}
.summary-property-row {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid #eef1f5;
  transition: background var(--transition);
}
.summary-property-row:last-child {
  border-bottom: 0;
}
.summary-property-row:hover {
  background: #f1f5f9;
}
.summary-property-key {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 10px;
  min-width: 0;
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}
.summary-property-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  flex: 0 0 auto;
}
.summary-property-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.summary-property-value {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.summary-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.summary-tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
  color: #6d28d9;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: all var(--transition);
}
.summary-tag-chip:hover {
  background: linear-gradient(135deg, #ddd6fe 0%, #c7d2fe 100%);
  transform: translateY(-1px);
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 1.2em 0 0.55em;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.markdown-body h1 { font-size: 24px; }
.markdown-body h2 { font-size: 20px; }
.markdown-body h3 { font-size: 17px; }
.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table,
.markdown-body hr {
  margin: 0 0 1em;
}
.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4em;
}
.markdown-body li + li {
  margin-top: 0.35em;
}
.markdown-body blockquote {
  margin-left: 0;
  padding: 10px 14px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  color: #1e3a2f;
  border-radius: 0 8px 8px 0;
}
.markdown-body code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 0.15em 0.4em;
  color: #475569;
}
.markdown-body pre {
  overflow: auto;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.markdown-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.markdown-body a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.markdown-body a:hover {
  border-bottom-color: var(--brand);
}
.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--line);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  border-bottom: 2px solid var(--line);
  padding: 10px 8px;
  vertical-align: top;
  font-weight: 700;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: top;
}
tr { transition: background var(--transition); }
tr:hover { background: #f8fafc; }
.status-success { color: var(--brand); font-weight: 700; }
.status-failed { color: var(--danger); font-weight: 700; }
.status-running { color: #2563eb; font-weight: 700; }

.log {
  background: #0f172a;
  color: #94a3b8;
  border-radius: var(--radius);
  padding: 14px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  min-height: 180px;
  white-space: pre-wrap;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.three-col {
  display: grid;
  grid-template-columns: 200px 260px 1fr;
  height: calc(100vh - 58px);
}
.col {
  border-right: 1px solid var(--line);
  background: #fff;
  overflow: auto;
  min-height: 0;
}
.col:last-child { border-right: 0; background: #f8fafc; }
.item {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.item:hover { background: #f1f5f9; }
.item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  border-left: 3px solid var(--brand);
  padding-left: 11px;
}
.section {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f8fafc;
}
.item-title {
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.item-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  transition: all var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,157,122,0.12);
}
input::placeholder, textarea::placeholder {
  color: #94a3b8;
}

.form-row { margin-bottom: 10px; }
.label { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .summary-property-row { grid-template-columns: 1fr; gap: 6px; }
}
