.dual-pane-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

/* 确保右侧结果面板在本页占满可用高度，而不是使用 sticky 导致高度异常 */
@media (min-width: 900px) {
  .result-pane {
    position: static;
    top: auto;
    height: 100%;
    align-self: stretch;
  }
  .config-pane {
    flex: 0.9;
    min-width: 0;
  }
  .result-pane {
    flex: 1.1;
    min-width: 0;
  }
}

@media (max-width: 899px) {
  .dual-pane-layout {
    flex-direction: column;
    gap: 16px;
  }
}

.config-pane .panel-body {
  overflow: visible;
}

.unit-config-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 20px;
}

.config-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-color);
}

.config-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.config-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
}

.config-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.config-input,
.config-select {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
  color: #e5e7eb;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.config-input:focus,
.config-select:focus {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  background: rgba(15, 23, 42, 0.5);
}

.config-select {
  appearance: none;
}

.config-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.unit-config-panel .searchable-select {
  position: relative;
  flex: 1;
  min-width: 120px;
}

.unit-config-panel .searchable-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  color: #f1f5f9;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.unit-config-panel .searchable-select-trigger:hover {
  border-color: #10b981;
}

.unit-config-panel .searchable-select-trigger .arrow {
  font-size: 12px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.unit-config-panel .searchable-select.open .searchable-select-trigger .arrow {
  transform: rotate(180deg);
}

.unit-config-panel .searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.unit-config-panel .searchable-select.open .searchable-select-dropdown {
  display: flex;
}

.unit-config-panel .options-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

.unit-config-panel .options-list::-webkit-scrollbar {
  width: 4px;
}

.unit-config-panel .options-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
}

.unit-config-panel .option-item {
  padding: 10px 12px;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.unit-config-panel .option-item:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.unit-config-panel .option-item.selected {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 600;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.25);
  color: #cbd5e1;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip-btn:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
  transform: translateY(-1px);
}

.unit-result-container {
  width: 100%;
  max-width: none;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  box-sizing: border-box;
}

.unit-target-card {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.4);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.unit-target-card:hover {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.unit-target-line {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
  word-break: break-word;
  text-align: center;
}

.unit-target-value {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 28px;
  font-weight: 700;
  color: #10b981;
  line-height: 1.1;
  word-break: break-all;
  text-align: center;
  padding: 14px 8px 12px;
  letter-spacing: 1px;
}

.unit-table {
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.18);
  border-radius: 14px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.unit-table-header {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: #9ca3af;
  font-size: 12px;
}

.unit-table-body {
  overflow: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}

.unit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 12px;
  align-items: center;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.10);
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.unit-row:hover {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(16, 185, 129, 0.22);
  transform: translateY(-1px);
}

.unit-row-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.unit-row-unit {
  font-size: 13px;
  color: #cbd5e1;
}

.unit-row-value {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 14px;
  color: #e5e7eb;
  word-break: break-all;
}

.unit-copy-btn {
  padding: 6px 10px;
  font-size: 12px;
}

.light-theme .config-input,
.light-theme .config-select {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(30, 41, 59, 0.18);
}

.light-theme .unit-config-panel .searchable-select-trigger {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}

.light-theme .unit-config-panel .searchable-select-trigger:hover {
  border-color: #10b981;
}

.light-theme .unit-config-panel .searchable-select-dropdown {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.light-theme .unit-config-panel .option-item {
  color: #64748b;
}

.light-theme .unit-config-panel .option-item:hover {
  background: rgba(16, 185, 129, 0.08);
}

.light-theme .unit-config-panel .option-item.selected {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.light-theme .config-input:focus,
.light-theme .config-select:focus {
  background: #ffffff;
  border-color: rgba(16, 185, 129, 0.8);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.light-theme .chip-btn {
  background: #ffffff;
  color: #334155;
  border-color: rgba(30, 41, 59, 0.18);
}

.light-theme .unit-target-card,
.light-theme .unit-table {
  background: #ffffff;
  border-color: rgba(30, 41, 59, 0.12);
}

.light-theme .unit-target-card:hover {
  background: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.light-theme .unit-target-line {
  color: #475569;
}

.light-theme .unit-row-unit {
  color: #334155;
}

.light-theme .unit-row-value {
  color: #0f172a;
}

.light-theme .unit-row {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.light-theme .unit-row:hover {
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  background: #ffffff;
}
