* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #333;
  min-height: 100vh;
}
.hidden { display: none !important; }

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #fff; border-bottom: 1px solid #e5e6eb;
}
.app-header h1 { font-size: 18px; }

.btn {
  padding: 8px 16px; border: none; border-radius: 6px;
  font-size: 14px; cursor: pointer; font-weight: 500;
}
.btn-primary { background: #3370ff; color: #fff; }
.btn-primary:hover { background: #2858d9; }
.btn-plain { background: transparent; color: #666; border: 1px solid #ddd; }

.login-prompt {
  max-width: 420px; margin: 120px auto; text-align: center;
  background: #fff; border-radius: 10px; padding: 40px; box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.login-prompt p { margin-bottom: 20px; color: #666; }

.debug-url {
  text-align: center; padding: 8px 16px;
  background: #fff3f3; color: #d03050;
  font-size: 14px; font-weight: 600; word-break: break-all;
  border-bottom: 1px solid #f5c6c6;
}

.layout { display: flex; height: calc(100vh - 54px); }
.sidebar {
  width: 280px; background: #fff; border-right: 1px solid #e5e6eb;
  padding: 16px; overflow-y: auto; flex-shrink: 0;
}
.content { flex: 1; padding: 20px; overflow-y: auto; }

.section-title {
  font-size: 13px; color: #888; font-weight: 600;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #eee;
}
.muted { font-size: 12px; color: #999; margin-top: 10px; }

.record-list { display: flex; flex-direction: column; gap: 6px; }
.record-item {
  border: 1px solid #e5e5e5; border-radius: 8px; padding: 10px 12px;
  cursor: pointer; transition: all .15s; background: #fff;
}
.record-item:hover { border-color: #3370ff; background: #f0f4ff; }
.record-item.selected { border-color: #3370ff; background: #eef3ff; }
.record-item.inactive { opacity: .75; border-left: 4px solid #f44747; }
.record-item.no-drawio { border-left: 4px solid #ffc53d; }
.record-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.record-status { font-size: 12px; color: #888; margin-top: 2px; }
.badge {
  font-size: 11px; padding: 1px 8px; border-radius: 10px;
  color: #fff; white-space: nowrap;
}
.badge-red { background: #f44747; }
.badge-gray { background: #9aa4b2; }

.empty-tip {
  padding: 60px 24px; text-align: center; color: #999; font-size: 14px;
  background: #fff; border-radius: 10px; border: 1px dashed #ddd;
}

.flow-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; font-size: 14px; font-weight: 600;
}
.flow-meta .status-tag { font-size: 12px; font-weight: 400; }
.flow-meta a { font-size: 12px; font-weight: 400; color: #3370ff; text-decoration: none; }

.drawio-container {
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
#graphContainer { width: 100%; height: calc(100vh - 160px); }
#graphContainer svg { display: block; }