* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

a {
  color: #2563eb;
}

button,
input,
select {
  font: inherit;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

input,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.app-shell {
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0 0 6px;
}

.topbar p {
  margin: 0;
  color: #64748b;
}

.api-config-form {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #075985;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
}

.hidden {
  display: none !important;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
}

.panel {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-header h2,
.panel h3 {
  margin: 0;
}

.task-list,
.stack-list {
  display: grid;
  gap: 12px;
}

.task-card,
.stack-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.task-card.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.task-card-title,
.stack-card-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.task-card-meta,
.muted {
  color: #64748b;
  font-size: 13px;
}

.content {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.analysis-summary,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-bottom: 14px;
}

.full-row {
  grid-column: 1 / -1;
}

.json-block {
  margin: 6px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-sections {
  display: grid;
  gap: 16px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
}

.empty-inline {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .analysis-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
