/* ==========================================================================
   星际导航 · 文章下载区（v94）
   下载卡片 / 锁定面板 / 验证码弹窗 / 付费弹窗 / 找回页
   配色全部走 nav.css 的 CSS 变量，自动跟随主题与暗色模式
   ========================================================================== */

/* ---------------- 容器 ---------------- */
.adl {
  margin: 18px 0 8px;
  padding: 16px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 76px;
}
.adl-hd { display: flex; align-items: center; gap: 12px; }
.adl-hd-ic {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 20px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .28);
}
.adl-hd-tx { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.adl-hd-tx > b { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.adl-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1;
  color: var(--accent); background: var(--primary-light);
  border: 1px solid transparent;
}
.adl-badge i { font-size: 12px; }
.adl-hit {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.adl-hit em { font-style: normal; color: var(--text-2); font-weight: 600; }
.adl-tip {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 10px 0 0; padding: 9px 12px;
  font-size: 13px; line-height: 1.65; color: var(--text-2);
  background: var(--surface-2); border-radius: 10px;
}
.adl-tip i { color: var(--accent); margin-top: 2px; }
.adl-body { margin-top: 12px; }
.adl-ft {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--muted);
}
.adl-ft span, .adl-ft a { display: inline-flex; align-items: center; gap: 5px; }
.adl-ft a { color: var(--accent); text-decoration: none; }
.adl-ft a:hover { text-decoration: underline; }

/* ---------------- 下载卡片网格 ---------------- */
.adl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 10px; }
.adl-card {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 13px;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.adl-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, .38);
  box-shadow: 0 10px 22px rgba(28, 31, 39, .10);
}
.adl-ic {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c, #64748b); color: #fff; font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .16);
}
.adl-tx { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.adl-tx b {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adl-tx em { font-size: 12px; font-style: normal; color: var(--muted); margin-top: 1px; }
.adl-code {
  flex: 0 0 auto;
  padding: 3px 8px; border-radius: 7px;
  font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text-2); background: var(--surface-2);
  border: 1px dashed var(--border);
  cursor: pointer; user-select: all;
}
.adl-code:hover { color: var(--accent); border-color: var(--accent); }
.adl-go {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); background: var(--primary-light); font-size: 13px;
  transition: transform .18s ease;
}
.adl-card:hover .adl-go { transform: translateY(1px); }
.adl-quota {
  display: flex; align-items: center; gap: 6px;
  margin: 10px 0 0; font-size: 12.5px; color: var(--text-2);
}
.adl-quota i { color: var(--accent); }

/* ---------------- 未解锁面板 ---------------- */
.adl-lock {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px dashed var(--border);
  border-radius: 14px;
}
.adl-lock-ic {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--accent); font-size: 21px;
}
.adl-lock-tx { flex: 1 1 220px; min-width: 0; }
.adl-lock-tx b { display: block; font-size: 15px; color: var(--text); }
.adl-lock-tx p { margin: 4px 0 0; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.adl-lock-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adl-unavailable { font-size: 13px; color: var(--muted); }

.adl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.adl-btn:active { transform: scale(.97); }
.adl-btn.primary {
  color: #fff; background: var(--grad);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .28);
}
.adl-btn.primary:hover { box-shadow: 0 9px 22px rgba(99, 102, 241, .36); }
.adl-btn.ghost {
  color: var(--text-2); background: var(--surface);
  border-color: var(--border);
}
.adl-btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.adl-btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.adl-btn-block { width: 100%; }

.adl-price { display: inline-flex; align-items: baseline; gap: 6px; margin-right: 2px; }
.adl-price b { font-size: 20px; font-weight: 800; color: var(--accent); letter-spacing: -.4px; }
.adl-price s { font-size: 12px; color: var(--muted); }
.adl-vip-tag {
  font-style: normal; font-size: 11px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px; color: #b45309;
  background: rgba(245, 158, 11, .16);
}
.adl-wechat { width: 100%; margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.adl-wechat i { color: #07c160; margin-right: 2px; }

/* ---------------- 弹窗 ---------------- */
/* 付费弹窗：浮层居中但不加笼罩层，背景页面仍然可见、可点 */
.adl-pop-float { pointer-events: none; background: none !important; }
/* 双保险：即使模板/旧缓存里还残留 mask，也不显示任何遮罩与模糊 */
.adl-pop-float .adl-pop-mask {
  display: none !important;
  background: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
html[data-theme="dark"] .adl-pop-float .adl-pop-mask { background: none !important; }
.adl-pop-float .adl-pop-box {
  pointer-events: auto;
  box-shadow: 0 22px 60px rgba(15, 17, 23, .26), 0 2px 8px rgba(15, 17, 23, .10);
}
@media (max-width: 640px) {
  /* 无遮罩时手机端也用居中卡片，而不是底部抽屉 */
  .adl-pop-float .adl-pop-box {
    left: 50%; right: auto; top: 50%; bottom: auto;
    transform: translate(-50%, -50%);
    width: calc(100vw - 32px); max-height: 82vh; overflow-y: auto;
    padding: 18px 16px; border-radius: 16px;
    animation: adlPop .22s cubic-bezier(.2, .9, .3, 1.2);
  }
  .adl-pop-float .adl-pop-hd { gap: 9px; }
  .adl-pop-float .adl-pop-ic { width: 36px; height: 36px; border-radius: 11px; font-size: 17px; }
  .adl-pop-float .adl-pop-hd b { font-size: 15px; }
}
.adl-pop { position: fixed; inset: 0; z-index: 1200; display: none; }
.adl-pop.on { display: block; }
.adl-pop-mask {
  position: absolute; inset: 0;
  background: rgba(15, 17, 23, .46);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  animation: adlFade .18s ease;
}
.adl-pop-box {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  max-height: min(82vh, 720px); overflow-y: auto;
  padding: 20px;
  background: rgb(255 255 255);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: adlPop .22s cubic-bezier(.2, .9, .3, 1.2);
}
.adl-pop-x {
  position: absolute; right: 12px; top: 12px;
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
  font-size: 14px;
}
.adl-pop-x:hover { color: var(--text); background: var(--surface-2); }
.adl-pop-hd { display: flex; align-items: center; gap: 11px; padding-right: 26px; }
.adl-pop-ic {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--accent); font-size: 19px;
}
.adl-pop-hd b { display: block; font-size: 16px; color: var(--text); }
.adl-pop-hd em { display: block; margin-top: 2px; font-size: 12.5px; font-style: normal; color: var(--muted); }
.adl-pop-bd { margin-top: 14px; }

.adl-step {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 10px; font-size: 13px; line-height: 1.7; color: var(--text-2);
}
.adl-step > span {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
}
.adl-step b { color: var(--text); }
.adl-note {
  display: flex; align-items: flex-start; gap: 5px;
  margin: 8px 0 0; font-size: 12px; line-height: 1.65; color: var(--muted);
}
.adl-note i { margin-top: 2px; flex: 0 0 auto; }
.adl-qr {
  display: flex; align-items: center; justify-content: center;
  padding: 10px; margin: 0 0 10px;
  background: var(--surface-2); border-radius: 12px;
}
.adl-qr img { width: 176px; height: 176px; border-radius: 8px; background: #fff; object-fit: contain; }

.adl-field { display: block; margin-top: 10px; }
.adl-field > span {
  display: block; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.adl-field input {
  width: 100%; height: 40px; padding: 0 12px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.adl-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
.adl-field input::placeholder { color: var(--muted); }

.adl-msg {
  margin: 10px 0 0; padding: 8px 11px; border-radius: 9px;
  font-size: 12.5px; line-height: 1.6;
}
.adl-msg.err { color: #b91c1c; background: rgba(244, 63, 94, .10); }
.adl-msg.ok { color: var(--ok-fg); background: var(--ok-bg); }
.adl-btn-block { margin-top: 12px; }

.adl-amt {
  display: flex; align-items: baseline; gap: 7px;
  padding: 11px 14px; margin-bottom: 12px;
  background: var(--surface-2); border-radius: 12px;
}
.adl-amt > span { font-size: 12.5px; color: var(--muted); }
.adl-amt > b { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -.5px; }

.adl-ch-list { display: flex; flex-direction: column; gap: 8px; }
.adl-ch {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px;
  transition: border-color .15s ease, background .15s ease;
}
.adl-ch input { position: absolute; opacity: 0; pointer-events: none; }
.adl-ch-ic {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--accent); font-size: 15px;
}
.adl-ch-tx { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.adl-ch-tx b { font-size: 13.5px; color: var(--text); }
.adl-ch-tx em { font-size: 11.5px; font-style: normal; color: var(--muted); }
.adl-ch-dot {
  flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border);
}
.adl-ch input:checked ~ .adl-ch-dot {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 42%, transparent 46%);
}
.adl-ch:has(input:checked) {
  border-color: rgba(99, 102, 241, .55);
  background: var(--primary-light);
}

.adl-pay-rs { margin-top: 12px; }
.adl-qrbox {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px; text-align: center;
  background: var(--surface-2); border-radius: 12px;
}
.adl-qrbox img { width: 200px; height: 200px; border-radius: 8px; background: #fff; }
.adl-qrbox p { margin: 0; font-size: 12.5px; color: var(--text-2); }
.adl-wait { font-size: 12px; color: var(--muted); }
.adl-wait i { animation: adlSpin 1s linear infinite; display: inline-block; margin-right: 4px; }
.adl-manual {
  padding: 13px; border-radius: 12px; background: var(--surface-2);
}
.adl-manual-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.adl-manual-imgs img {
  width: 132px; max-width: 45%; border-radius: 9px; background: #fff;
  border: 1px solid var(--border); object-fit: contain;
}
.adl-manual-note {
  margin: 0 0 10px; font-size: 12.5px; line-height: 1.7; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
}

/* ---------------- 动画 ---------------- */
@keyframes adlFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes adlPop { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes adlSpin { to { transform: rotate(360deg); } }

/* ---------------- 找回解锁记录页 ---------------- */
.dlf-wrap { max-width: 620px; margin: 0 auto; }
.dlf-card {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.dlf-ic {
  width: 48px; height: 48px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 22px;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .28);
}
.dlf-card h1 {
  margin: 14px 0 6px; font-size: 20px; font-weight: 700; color: var(--text);
}
.dlf-card > p { margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.dlf-form { display: flex; gap: 8px; margin-top: 16px; }
.dlf-form input {
  flex: 1 1 auto; height: 42px; padding: 0 13px; min-width: 0;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; outline: none;
}
.dlf-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
.dlf-msg { margin-top: 12px; font-size: 13px; line-height: 1.7; }
.dlf-msg.ok { color: var(--ok-fg); }
.dlf-msg.err { color: #b91c1c; }
.dlf-tips {
  margin: 16px 0 0; padding: 12px 14px;
  background: var(--surface-2); border-radius: 12px;
  font-size: 12.5px; line-height: 1.8; color: var(--text-2);
}
.dlf-tips li { margin: 2px 0; }
.dlf-back { display: inline-flex; align-items: center; gap: 5px; margin-top: 14px; font-size: 13px; color: var(--accent); text-decoration: none; }
.dlf-back:hover { text-decoration: underline; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .adl { margin: 12px 0 6px; padding: 13px 13px 12px; border-radius: 15px; }
  .adl-hd-ic { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
  .adl-hd-tx > b { font-size: 15.5px; }
  /* 手机端下载列表：单列横向卡片，图标在左、下载箭头在右，避免两列挤压 */
  .adl-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .adl-card {
    flex-direction: row; align-items: center; gap: 10px;
    padding: 10px 11px; border-radius: 12px;
  }
  .adl-ic { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, .14); }
  .adl-tx { width: auto; flex: 1 1 auto; }
  .adl-tx b { font-size: 13.5px; }
  .adl-tx em { font-size: 11.5px; }
  .adl-code { align-self: center; font-size: 11px; padding: 2px 6px; }
  .adl-go { position: static; width: 26px; height: 26px; font-size: 12px; }
  .adl-lock {
    display: grid; grid-template-columns: 34px minmax(0, 1fr);
    align-items: start; gap: 2px 9px;
    padding: 11px 12px; border-radius: 12px;
  }
  .adl-lock-ic {
    align-self: start;
    width: 34px; height: 34px; border-radius: 10px;
    font-size: 15px; margin-top: 1px; box-shadow: none;
  }
  .adl-lock-tx { flex: none; }
  .adl-lock-tx b { font-size: 14px; line-height: 1.4; letter-spacing: 0; text-align: left; }
  .adl-lock-tx p { margin-top: 2px; font-size: 12px; line-height: 1.55; }
  .adl-lock-act {
    grid-column: 1 / -1;
    width: auto; margin-top: 8px; padding-top: 8px;
    border-top: 1px dashed var(--border);
    gap: 8px;
  }
  .adl-lock-act .adl-price { margin-right: auto; }
  .adl-lock-act .adl-price b { font-size: 17px; }
  .adl-lock-act .adl-btn { flex: 0 1 auto; height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
  .adl-lock-act .adl-btn.ghost { height: 30px; padding: 0 10px; font-size: 12px; }
  .adl-wechat { margin-top: 2px; font-size: 12px; }
  .adl-pop-box {
    left: 0; right: 0; top: auto; bottom: 0;
    transform: none; width: 100%; max-height: 88vh;
    border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    animation: adlSheet .24s cubic-bezier(.2, .9, .3, 1.1);
  }
  .dlf-card { padding: 18px 16px; border-radius: 15px; }
  .dlf-form { flex-direction: column; }
  .dlf-form .adl-btn { width: 100%; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .adl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@keyframes adlSheet { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ---------------- 暗色微调 ---------------- */
html[data-theme="dark"] .adl-card:hover { box-shadow: 0 10px 22px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .adl-btn.primary { box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .adl-lock { background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
html[data-theme="dark"] .adl-pop-mask { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .adl-vip-tag { color: #fbbf24; background: rgba(245, 158, 11, .2); }
