/* Library import & Bilibili multi-mode preview/manual entry */

#library-import fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.li-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.li-head h2 {
  margin: 0;
}

.li-head .linkish {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.li-head .linkish:hover {
  border-color: var(--acid);
  color: var(--acid);
}

#li-add {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#li-add > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

#li-add textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  padding: 10px 12px;
  font: 13px/1.5 var(--font-body);
}

#li-add textarea:focus {
  border-color: rgba(214, 243, 74, 0.55);
}

#li-add .note {
  margin: 0;
}

#li-add .btn {
  align-self: flex-start;
}

.li-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ember-dim);
  border: 1px solid rgba(255, 122, 69, 0.35);
  color: #ffd0bc;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.li-error .btn {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}

.li-preview {
  margin-top: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.li-preview h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
  line-height: 1.3;
}

.li-preview > p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.li-preview > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.li-preview select,
.li-preview input[type="text"],
.li-preview input[type="number"],
.li-preview input:not([type]) {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
  padding: 8px 12px;
  font: 13px/1.4 var(--font-body);
}

.li-preview select:focus,
.li-preview input:focus {
  border-color: rgba(214, 243, 74, 0.55);
}

.li-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.li-check:hover {
  border-color: var(--line-strong);
}

.li-check input[type="checkbox"] {
  accent-color: var(--acid);
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin: 0;
}

.li-check.li-all {
  background: rgba(214, 243, 74, 0.08);
  border-color: rgba(214, 243, 74, 0.25);
  font-weight: 600;
}

.li-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.li-index {
  flex: 0 0 auto;
  min-width: 24px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.li-title-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.li-dur {
  flex: 0 0 auto;
  color: var(--sky);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.li-destination {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.li-destination label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.li-manual-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.li-manual-rows li {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.li-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.li-row-head b {
  color: var(--acid);
  font-weight: 600;
}

.li-row-head span {
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.li-fields {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
}

.li-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.li-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.li-manual-rows .li-actions .btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 12px;
}

.li-manual-rows .li-actions .linkish {
  margin-left: auto;
  min-height: 36px;
  padding: 6px 8px;
  color: #ffb090;
  font-size: 12px;
}

.li-saved {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(110, 231, 168, 0.1);
  border: 1px solid rgba(110, 231, 168, 0.35);
  color: var(--ok);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.li-saved .linkish {
  color: var(--acid);
  font-size: 13px;
  font-weight: 600;
}

#li-single {
  align-self: flex-start;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .li-fields {
    grid-template-columns: 1fr;
  }
  .li-destination {
    grid-template-columns: 1fr;
  }
}
