:root {
  color-scheme: light;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: #ffffff;
  color: #1f2329;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #ffffff;
}

.app {
  min-height: 100vh;
  padding: 16px 16px 18px;
  background: #ffffff;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 15px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
}

p {
  margin-top: 4px;
  color: #3370ff;
  font-size: 12px;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef3ff;
  color: #245bdb;
  font-size: 12px;
}

.section {
  margin-bottom: 16px;
}

.section-title {
  margin-bottom: 8px;
  color: #4e5969;
  font-size: 14px;
  font-weight: 600;
}

.config-card,
.range-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 6px;
  padding: 12px;
  background: #f5f6f7;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #4e5969;
  font-size: 13px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

b {
  color: #f53f3f;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d0d3d9;
  border-radius: 6px;
  padding: 9px 10px;
  background: #ffffff;
  color: #1f2329;
  font: inherit;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3370ff;
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.12);
}

details {
  color: #4e5969;
  font-size: 13px;
}

summary {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 5px solid #4e5969;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

details:not([open]) summary::before {
  transform: rotate(-90deg);
}

.hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid #a8abb2;
  border-radius: 50%;
  color: #86909c;
  font-size: 10px;
  line-height: 1;
}

.link-button {
  border: 1px solid #3370ff;
  border-radius: 6px;
  padding: 5px 9px;
  background: #245bdb;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.link-button.inline {
  margin-left: auto;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented label {
  flex: 1;
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  border: 1px solid #d0d3d9;
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: #4e5969;
  text-align: center;
}

.segmented input:checked + span {
  border-color: #245bdb;
  background: #eef3ff;
  color: #245bdb;
  font-weight: 600;
}

.radio-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.radio-line {
  color: #1f2329;
  font-size: 14px;
}

input[type="radio"],
input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: #245bdb;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4e5969;
  font-size: 14px;
}

.switch-row input[type="checkbox"] {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #c9cdd4;
  cursor: pointer;
}

.switch-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(31, 35, 41, 0.22);
  transition: transform 0.16s ease;
}

.switch-row input[type="checkbox"]:checked {
  background: #245bdb;
}

.switch-row input[type="checkbox"]:checked::after {
  transform: translateX(14px);
}

.bottom-switch {
  margin: 14px 0;
}

.range-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
}

.number-input {
  width: 120px;
  margin-left: auto;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 9px 16px;
  background: #245bdb;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

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

.secondary {
  border: 1px solid #d0d3d9;
  background: #ffffff;
  color: #1f2329;
}

.ghost {
  border: 1px solid #d0d3d9;
  background: #ffffff;
  color: #1f2329;
}

.actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 14px;
  background: #ffffff;
}

.message {
  min-height: 22px;
  color: #4e5969;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message.error {
  color: #d92d20;
}

.message.success {
  color: #039855;
}

dialog {
  width: min(360px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 18px 48px rgba(31, 35, 41, 0.18);
}

dialog::backdrop {
  background: rgba(31, 35, 41, 0.3);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
