.link-converter-page {
  min-height: calc(100vh - 120px);
}

.link-converter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.link-converter-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.link-converter-panel {
  min-width: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  background: var(--bs-body-bg);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.link-converter-panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bs-border-color);
}

.link-converter-template-select {
  width: min(100%, 320px);
}

.link-converter-head-controls,
.link-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.link-converter-date-select {
  min-width: 240px;
  width: 240px;
}

.link-converter-date-input {
  min-width: 150px;
  width: 150px;
}

.link-converter-body {
  padding: 16px;
}

.link-converter-textarea {
  height: 50vh;
  min-height: 420px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
}

.link-converter-status {
  min-height: 20px;
  color: var(--bs-secondary-color);
  font-size: 13px;
}

.link-converter-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  margin-top: 10px;
}

.link-history-panel {
  margin-top: 18px;
}

.link-history-actions .form-control {
  width: 220px;
}

.link-history-actions .form-select {
  width: 160px;
}

.link-history-table-wrap {
  overflow-x: auto;
}

.link-history-table {
  min-width: 1080px;
}

.link-history-table th,
.link-history-table td {
  white-space: nowrap;
}

.link-history-table td:nth-child(2),
.link-history-table td:nth-child(5) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-template-page {
  min-height: calc(100vh - 120px);
}

.link-template-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--bs-border-color);
}

.link-template-tab {
  min-width: 150px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  white-space: nowrap;
}

.link-template-tab.active {
  color: #123524;
  background: #e9f8ee;
  border-color: #b9d9c4;
  box-shadow: 0 -2px 0 #f97316 inset;
}

.link-template-editor {
  display: grid;
  grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
  gap: 18px;
}

.link-template-list-panel,
.link-template-form-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  background: var(--bs-body-bg);
}

.link-template-list-head,
.link-template-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.link-template-list {
  display: grid;
  gap: 8px;
  max-height: 580px;
  margin-top: 14px;
  overflow: auto;
}

.link-template-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  color: var(--bs-body-color);
  text-align: left;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
}

.link-template-item.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.link-template-item strong,
.link-template-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-template-item span,
.link-template-empty {
  color: var(--bs-secondary-color);
  font-size: 13px;
}

.link-template-form {
  display: grid;
  gap: 14px;
}

.link-template-form label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-weight: 700;
}

.link-template-form textarea {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.link-template-hint {
  color: var(--bs-secondary-color);
  font-size: 13px;
}

@media (max-width: 900px) {
  .link-converter-layout,
  .link-template-editor {
    grid-template-columns: 1fr;
  }
}
