:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: #f4f7f6;
  color: #1c2523;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 40px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e2df;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(20, 35, 31, 0.06);
}

.editor {
  min-height: 340px;
}

.top-bar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

p {
  margin-top: 8px;
  color: #51605c;
}

.form {
  margin-top: 28px;
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid #b9c8c4;
  border-radius: 6px;
  padding: 12px 14px;
  color: #1c2523;
  background: #ffffff;
}

input:focus {
  outline: 3px solid #cde8df;
  border-color: #327c67;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

legend {
  width: 100%;
  margin-bottom: 8px;
  font-weight: 700;
}

.radio-option {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #b9c8c4;
  border-radius: 6px;
  font-weight: 400;
  cursor: pointer;
}

.radio-option input {
  width: auto;
}

.form-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  cursor: pointer;
  color: #ffffff;
  background: #1f6f5b;
  font-weight: 700;
}

button:hover {
  background: #195a4a;
}

.secondary {
  background: #e8efed;
  color: #1f3b34;
}

.secondary:hover {
  background: #d9e4e1;
}

.message {
  min-height: 22px;
  color: #9b2f22;
}

.message.success {
  color: #1f6f5b;
}

.result {
  display: grid;
  align-content: start;
  gap: 18px;
}

.qr-box {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px dashed #b9c8c4;
  border-radius: 8px;
  background: #fbfdfc;
}

#qr-image {
  width: min(280px, 100%);
  height: auto;
  display: none;
}

.redirect-link {
  overflow-wrap: anywhere;
  color: #1f6f5b;
}

.mappings {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mapping-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.mapping-row {
  display: grid;
  grid-template-columns: 170px 100px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e0e8e5;
  border-radius: 6px;
}

.keyword {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.category {
  color: #1f6f5b;
  font-weight: 700;
}

.url {
  color: #51605c;
  overflow-wrap: anywhere;
}

.empty {
  padding: 16px;
  border: 1px dashed #b9c8c4;
  border-radius: 6px;
  color: #51605c;
}

@media (max-width: 760px) {
  .shell {
    margin: 16px auto;
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .mapping-row {
    grid-template-columns: 1fr;
  }

  .top-bar {
    align-items: stretch;
    flex-direction: column;
  }
}

.login-shell {
  width: min(420px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.login-panel {
  width: 100%;
}
