/* 追加样式：分页、工具类、表单错误等（app.css 之后加载） */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 28px 0 4px;
}

.pager a,
.pager span {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    box-shadow: var(--shadow-sm);
}

.pager a:hover { border-color: #cfd6e6; color: var(--text); }
.pager .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .disabled { opacity: .45; pointer-events: none; }
.pager .ellipsis { border: 0; background: none; box-shadow: none; color: var(--muted); }

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted-text { color: var(--muted); font-size: 12.5px; }

.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

.form .field.has-error input,
.form .field.has-error textarea,
.form .field.has-error select { border-color: #fca5a5; }

.honeypot { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.auth-wrap { max-width: 420px; margin: 40px auto 0; }
.auth-card { padding: 26px 24px; }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card .lead { margin: 0 0 18px; color: var(--text-2); font-size: 13.5px; }
.auth-foot { margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--primary); font-weight: 600; }

.code-block {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    overflow-x: auto;
    line-height: 1.7;
}
.code-block .c { color: #94a3b8; }

/* ---------- 软件源弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-mask.open { display: flex; }

.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .16s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 8px;
}
.modal-head h2 { margin: 0; font-size: 17.5px; letter-spacing: -.2px; }
.modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: #e2e8f0; }

.modal-body { padding: 6px 16px 18px; display: grid; gap: 10px; }

.source-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.source-option:hover {
  transform: translateY(-1px);
  border-color: #d6ddec;
  box-shadow: var(--shadow);
}
.source-option .ico {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.source-option .ico svg { width: 20px; height: 20px; }
.source-option .txt { min-width: 0; }
.source-option strong { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.4; }
.source-option small { color: var(--muted); font-size: 12.5px; }
.source-option .chev { margin-left: auto; color: var(--muted); flex: 0 0 auto; }

.ico-blue { background: #e0f2fe; color: #0284c7; }
.ico-green { background: #dcfce7; color: #16a34a; }
.ico-purple { background: #ede9fe; color: #7c3aed; }

.modal-hint {
  display: none;
  margin: 2px 4px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--warning-soft);
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12.5px;
}
.modal-hint.show { display: block; }

/* ---------- 我的：软件源入口 ---------- */
.source-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(420px 120px at 100% 0%, rgba(99, 102, 241, .08), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.source-entry:hover {
  transform: translateY(-1px);
  border-color: #d6ddec;
  box-shadow: var(--shadow);
}

.source-entry .ico {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #eef2ff, #e0e7ff);
  color: var(--primary);
}
.source-entry .ico svg { width: 22px; height: 22px; }

.source-entry .txt { flex: 1; min-width: 0; }
.source-entry .txt strong { display: block; font-size: 15px; letter-spacing: -.1px; }
.source-entry .txt small { display: block; color: var(--text-2); font-size: 12.8px; margin-top: 2px; }

.source-entry .go {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .source-entry { align-items: flex-start; }
  .source-entry .go { align-self: center; }
}

/* ---------- 我的：账号头部 ---------- */
.account-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 14px;
}
.account-avatar {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(140deg, #6366f1, #4338ca);
  box-shadow: 0 8px 20px rgba(79, 70, 229, .28);
}
.account-meta { min-width: 0; }
.account-meta h1 { margin: 0 0 3px; font-size: 22px; letter-spacing: -.3px; }
.account-meta p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 13.5px;
}

@media (max-width: 560px) {
  .account-avatar { flex-basis: 52px; width: 52px; height: 52px; border-radius: 16px; font-size: 22px; }
  .account-meta h1 { font-size: 19px; }
  .account-head .row { margin-left: 0 !important; width: 100%; }
}

/* ---------- UDID 页面：长地址与窄屏适配 ---------- */
.code-block {
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.steps li { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .steps li { padding: 14px 14px 14px 52px; font-size: 13.5px; }
  .steps li::before { left: 12px; top: 12px; width: 26px; height: 26px; font-size: 12px; }
  .install-row .btn { flex: 1 1 100%; }
}

/* ---------- 签名页：两个动作卡 ---------- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(320px 140px at 100% 0%, rgba(99, 102, 241, .08), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.action-card:hover {
  transform: translateY(-2px);
  border-color: #d6ddec;
  box-shadow: var(--shadow);
}

.action-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #e0e7ff;
  color: var(--primary);
}
.action-icon svg { width: 24px; height: 24px; }
.action-icon-violet { background: #ede9fe; color: #7c3aed; }

.action-body { flex: 1; min-width: 0; }
.action-body strong { display: block; font-size: 15.5px; letter-spacing: -.1px; }
.action-body small { display: block; margin-top: 3px; color: var(--text-2); font-size: 12.8px; }

.action-go { flex: 0 0 auto; color: var(--primary); font-size: 13.5px; font-weight: 600; }

@media (max-width: 560px) {
  .action-card { align-items: flex-start; }
  .action-go { align-self: center; }
}

/* ---------- 我的设备：卡片列表 ---------- */
.device-list { display: grid; gap: 12px; }

.device-card {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.device-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: var(--primary);
}
.device-icon svg { width: 22px; height: 22px; }

.device-main { flex: 1; min-width: 0; }

.device-name-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.device-name-input {
  flex: 1 1 180px;
  max-width: 280px;
  padding: 7px 10px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
}
.device-name-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}

.device-udid-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

.device-udid {
  flex: 1 1 240px;
  min-width: 0;
  padding: 6px 9px;
  border-radius: 8px;
  background: #f6f7fb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.device-actions { display: flex; align-items: flex-start; }
.btn.danger { color: #dc2626; }
.btn.danger:hover { background: #fee2e2; border-color: #fecaca; }

@media (max-width: 560px) {
  .device-card { flex-wrap: wrap; }
  .device-actions { width: 100%; justify-content: flex-end; }
  .device-name-input { max-width: none; }
}

.action-icon-amber { background: #fef3c7; color: #b45309; }

/* ---------- 我的签名：卡片列表 ---------- */
.sign-list { display: grid; gap: 10px; }

.sign-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.sign-main { flex: 1; min-width: 0; }

.sign-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sign-name { font-size: 15px; }

.sign-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}

.sign-error {
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
  word-break: break-all;
}

.sign-actions { flex: 0 0 auto; }

@media (max-width: 560px) {
  .sign-card { flex-wrap: wrap; }
  .sign-actions { width: 100%; }
  .sign-actions .btn { width: 100%; }
}

/* 昵称后面的编辑小按钮 */
.name-edit {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--text-2);
  background: #f1f5f9;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.name-edit svg { width: 15px; height: 15px; }
.name-edit:hover { background: #e0e7ff; color: var(--primary); }
