* {
  box-sizing: border-box;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #0f172a;
}

.app {
  max-width: 1200px;
  margin: 32px auto 64px;
  padding: 0 20px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav {
  display: flex;
  gap: 8px;
  background: #e2e8f0;
  padding: 6px;
  border-radius: 999px;
}

.nav-button {
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: #475569;
}

.nav-button.active {
  background: #0f172a;
  color: #fff;
}

.app-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.app-header p {
  margin: 0;
  color: #64748b;
}

.badge {
  padding: 8px 14px;
  background: #0f172a;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
}

.panel {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.hidden {
  display: none;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.panel-body {
  display: block;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.upload-box {
  border: 2px dashed #cbd5f5;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
}

.upload-box input {
  width: 140px;
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
}

.upload-hint {
  color: #64748b;
  font-size: 12px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #94a3b8;
}

.field textarea {
  resize: vertical;
}

.readonly-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}

.readonly-row .label {
  display: block;
  font-size: 12px;
  color: #64748b;
}

.readonly-row .value {
  font-size: 14px;
  font-weight: 600;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

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

.primary {
  background: #2563eb;
  color: #fff;
}

.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.label {
  font-size: 12px;
  color: #64748b;
}

.value {
  font-size: 15px;
  font-weight: 600;
}

.progress {
  margin-top: 16px;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  width: 0;
  transition: width 0.4s ease;
}

.status-footer {
  margin-top: 12px;
  color: #475569;
  font-size: 13px;
}

.review-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 10px;
}

.review-title {
  margin-bottom: 0;
}

.review-download {
  justify-self: center;
}

.status-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  animation: status-spin 0.9s linear infinite;
  vertical-align: middle;
}

@keyframes status-spin {
  to {
    transform: rotate(360deg);
  }
}

.sub-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.list-item .tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
  display: inline-block;
}

.tag.block {
  background: #fee2e2;
  color: #b91c1c;
}

.tag.suggest {
  background: #fef9c3;
  color: #a16207;
}

.tag.ok {
  background: #dcfce7;
  color: #15803d;
}

.tag.low {
  background: #e0f2fe;
  color: #0369a1;
}

.deliverables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.deliverable {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 12px;
}

.deliverable-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.deliverable-meta {
  color: #475569;
  font-size: 13px;
}

.risk-summary {
  border-radius: 12px;
  border: 1px dashed #e2e8f0;
  padding: 12px;
  background: #f8fafc;
  font-size: 13px;
  color: #475569;
}

.history {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.history-item {
  border-radius: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.audit-log {
  border-radius: 12px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  font-size: 12px;
  min-height: 88px;
  white-space: pre-line;
}

.output-box {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.output-actions {
  display: flex;
  justify-content: flex-end;
}

.output-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.contract-output {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 12px;
  font-size: 13px;
  color: #0f172a;
  min-height: 520px;
  white-space: pre-wrap;
  resize: vertical;
  width: 100%;
}

@media (max-width: 960px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .readonly-row {
    grid-template-columns: 1fr;
  }
  .status-row {
    grid-template-columns: 1fr;
  }
  .deliverables {
    grid-template-columns: 1fr;
  }
  .output-header {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
}
