/* 下载链接弹窗：投稿编辑页与「我的投稿」共用 */

.lnk-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.lnk-modal[hidden] { display: none !important; }

body.lnk-lock { overflow: hidden; }

.lnk-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 24, 0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lnk-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 36rem;
  max-height: min(88vh, 720px);
  overflow: hidden;
  background: #fff;
  color: #15202b;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -24px 60px -24px rgba(0, 0, 0, 0.4);
}

.lnk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.35rem 1.15rem;
}

.lnk-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.lnk-sub {
  margin: 0.18rem 0 0;
  color: #667085;
  font-size: 0.78rem;
  line-height: 1.4;
  word-break: break-word;
}

.lnk-close {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 99px;
  background: #f3f6f8;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.lnk-note {
  margin: 0;
  padding: 0.15rem 1.15rem 0.8rem;
  border-bottom: 1px solid rgba(21, 32, 43, 0.08);
  color: #667085;
  font-size: 0.76rem;
  line-height: 1.45;
}

.lnk-list {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.85rem 1rem 1.05rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.lnk-state {
  margin: 1.4rem 0.2rem;
  color: #667085;
  font-size: 0.86rem;
  text-align: center;
}

.lnk-card {
  padding: 0.8rem 0.85rem 0.7rem;
  border: 1px solid rgba(21, 32, 43, 0.08);
  border-radius: 14px;
  background: #f7f9fb;
}

.lnk-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.lnk-type {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(21, 32, 43, 0.08);
  color: #15202b;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.lnk-size {
  color: #667085;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.lnk-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 0.7rem;
}

.lnk-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.lnk-field.is-wide { grid-column: 1 / -1; }

.lnk-field span {
  color: #667085;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
}

.lnk-field input {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(21, 32, 43, 0.1);
  border-radius: 10px;
  background: #fff;
  color: #15202b;
  font: inherit;
  font-size: 0.9rem;
}

.lnk-field input:focus {
  outline: none;
  border-color: rgba(255, 87, 69, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 87, 69, 0.14);
}

.lnk-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(21, 32, 43, 0.08);
}

.lnk-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: #15202b;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.lnk-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.lnk-switch i {
  position: relative;
  flex: 0 0 auto;
  width: 2.05rem;
  height: 1.22rem;
  border-radius: 99px;
  background: #d5dbe3;
  transition: background 0.15s;
}

.lnk-switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.96rem;
  height: 0.96rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: transform 0.15s;
}

.lnk-switch input:checked + i { background: #ff5745; }
.lnk-switch input:checked + i::after { transform: translateX(0.82rem); }
.lnk-switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(255, 87, 69, 0.28); }

.lnk-save {
  appearance: none;
  min-height: 2.15rem;
  padding: 0 0.95rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff6b5b, #ff5745);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.lnk-save:disabled { opacity: 0.6; cursor: default; }

@media (min-width: 768px) {
  .lnk-modal {
    align-items: center;
    padding: 1.25rem;
  }
  .lnk-panel {
    border-radius: 18px;
    box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.45);
  }
}

@media (max-width: 520px) {
  .lnk-fields { grid-template-columns: 1fr; }
  .lnk-field.is-wide { grid-column: auto; }
}

.nice-dark-mode .lnk-panel {
  background: #23272e;
  color: #f2f4f7;
}

.nice-dark-mode .lnk-sub,
.nice-dark-mode .lnk-note,
.nice-dark-mode .lnk-state,
.nice-dark-mode .lnk-size,
.nice-dark-mode .lnk-field span {
  color: #a8b0bd;
}

.nice-dark-mode .lnk-close,
.nice-dark-mode .lnk-card {
  background: #2c313a;
  border-color: rgba(255, 255, 255, 0.08);
}

.nice-dark-mode .lnk-note,
.nice-dark-mode .lnk-foot {
  border-color: rgba(255, 255, 255, 0.08);
}

.nice-dark-mode .lnk-type,
.nice-dark-mode .lnk-field input {
  background: #1b1f25;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f2f4f7;
}

.nice-dark-mode .lnk-switch { color: #f2f4f7; }
.nice-dark-mode .lnk-switch i { background: #4b5563; }
