* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #222;
}

.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: #1f6feb;
  color: #fff;
}

.brand {
  font-weight: 700;
  margin-right: 8px;
}

.task-label {
  color: rgba(255, 255, 255, 0.9);
}

.topbar select,
.topbar button {
  height: 30px;
  border: none;
  border-radius: 6px;
  padding: 0 10px;
  background: #fff;
  color: #222;
}

.summary {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.user-label {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  white-space: nowrap;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 41, 55, 0.72);
}

.login-box {
  width: 340px;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-box h2 {
  margin: 0 0 2px;
}

.login-box input {
  height: 36px;
  border: 1px solid #d3d8df;
  border-radius: 6px;
  padding: 0 10px;
}

.login-btn {
  height: 36px;
  margin-top: 4px;
}

.login-error {
  color: #e5484d;
  font-size: 12px;
  margin: 0;
  min-height: 16px;
}

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

.user-form input,
.user-form select {
  height: 32px;
  border: 1px solid #d3d8df;
  border-radius: 6px;
  padding: 0 8px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #eef0f3;
  font-size: 13px;
}

.user-row .u-name {
  flex: 1;
  min-width: 0;
}

.user-row select,
.user-row button {
  height: 26px;
  border-radius: 5px;
  border: 1px solid #d3d8df;
  background: #fff;
  font-size: 12px;
}

.user-row button {
  color: #e5484d;
  border-color: #e5484d;
  padding: 0 8px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.layout {
  height: calc(100% - 52px);
  display: flex;
}

.map-panel {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #e8ebf0;
}

#mapCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-controls button {
  width: 38px;
  height: 34px;
  border: 1px solid #c9cfd8;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
}

.map-controls .source-select {
  width: 108px;
  height: 34px;
  border: 1px solid #c9cfd8;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.map-status {
  position: absolute;
  left: 12px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
}

.side {
  width: 360px;
  overflow-y: auto;
  padding: 12px;
  background: #f5f6f8;
  border-left: 1px solid #e0e3e8;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

h2 {
  font-size: 15px;
  margin: 0 0 10px;
}

h3 {
  font-size: 13px;
  margin: 14px 0 8px;
  color: #555;
}

.field-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.field-row input,
.field-row select {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid #d3d8df;
  border-radius: 6px;
  padding: 0 8px;
}

.static-type {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  height: 32px;
  background: #e8f1fe;
  color: #1f6feb;
  border-radius: 6px;
  font-size: 13px;
  flex-shrink: 0;
}

.branch-tip {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e3e7ee;
}

.btn {
  height: 32px;
  border: none;
  border-radius: 6px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 13px;
}

.btn-primary {
  background: #1f6feb;
  color: #fff;
}

.btn-danger {
  background: #fff;
  color: #e5484d;
  border: 1px solid #e5484d;
}

.meta,
.pipeline-list,
.order-list {
  font-size: 13px;
  line-height: 1.7;
}

.pipeline-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid #eef0f3;
  cursor: pointer;
}

.pipeline-item:last-child {
  border-bottom: none;
}

.pipeline-item.active {
  background: #e8f1fe;
  margin: 0 -8px;
  padding: 6px 8px;
  border-radius: 8px;
}

.pipeline-item .p-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-item .p-tag {
  color: #1f6feb;
  background: #e8f1fe;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
}

.order-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px solid #eef0f3;
}

.field-row .arrow {
  align-self: center;
  color: #8a919f;
}

.export-row {
  margin-top: 10px;
}

.export-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: #1f6feb;
  text-decoration: none;
}

.order-row:last-child {
  border-bottom: none;
}

.order-idx {
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  background: #1f6feb;
  color: #fff;
  font-size: 12px;
  flex-shrink: 0;
}

.order-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-row button {
  border: 1px solid #d3d8df;
  background: #fff;
  border-radius: 4px;
  height: 26px;
  width: 30px;
  cursor: pointer;
}

.order-row button.danger {
  color: #e5484d;
  border-color: #e5484d;
  width: auto;
  padding: 0 8px;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
}

.total-len {
  margin-top: 8px;
  font-weight: 600;
  color: #222;
}

.seg-len {
  font-size: 12px;
  margin-top: 2px;
}

.muted {
  color: #8a919f;
}

.legend {
  position: absolute;
  left: 12px;
  top: 12px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  max-height: calc(100% - 100px);
  overflow-y: auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.empty-tip {
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
  color: #8a919f;
}
