/* ==================================================================
   AuthLink 模板端资源 · auth-panel.css（前后台共用）
   ------------------------------------------------------------------
   由 license-client.php 的两个出口引用：
   · LH_Client::boot()       → 管理后台授权卡片（#auth-panel）
   · LH_Client::siteAssets() → 前台提示层（#auth-hint 容器 +
     未授权提示层 v1.0.6 起为居中弹窗（auth-notice-modal））
   前台不含任何授权详情样式钩子；授权码/到期/域名/指纹样式只作用于
   #auth-panel（后台卡片内部），前台 DOM 中不存在该容器。
   ================================================================== */

/* ==================== 第一部分：后台授权卡片 ==================== */

#auth-panel.auth-card {
  background: #fffefb;
  border: 1px solid #ebe7dd;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(72, 66, 50, .06);
  padding: 18px 20px;
  margin: 4px 0 2px;
  width: 100%;
  box-sizing: border-box;   /* 宽度自适应：跟随设置页容器宽度，不再固定 640px 上限 */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.65;
  color: #33373d;
  animation: authCardIn .28s ease both;
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---- 头部（标题 + 状态徽标，v1.0.3 对齐作者定稿图 1） ---- */
#auth-panel .auth-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ebe7dd;
}
#auth-panel .auth-title {
  font-size: 15px;
  font-weight: 700;
  color: #33373d;
}
#auth-panel .auth-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
}
#auth-panel .auth-badge.is-ok { background: #e8f5ec; color: #1a6b34; }
#auth-panel .auth-badge.is-err { background: #f9e9e7; color: #a8524a; }

/* ---- 行式布局：左标签 + 右值（浅分隔线，图 1 同款） ---- */
#auth-panel .auth-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed #f1eee6;
}
#auth-panel .auth-row:last-of-type { border-bottom: none; }
#auth-panel .auth-k {
  flex: 0 0 72px;
  font-size: 12.5px;
  color: #a2a7b0;
  letter-spacing: .04em;
  white-space: nowrap;
}
#auth-panel .auth-v {
  flex: 1 1 auto;
  min-width: 0;
  color: #33373d;
  font-size: 13.5px;
  word-break: break-all;
}

/* 当前域名：绿色勾选徽标（图 1 同款）；未授权态 is-mute 灰 */
#auth-panel .auth-domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfe3cc;
  background: #f2faf4;
  color: #1a6b34;
  border-radius: 7px;
  padding: 3px 12px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  word-break: break-all;
}
#auth-panel .auth-domain-pill::after {
  content: "✓";
  font-weight: 800;
}
#auth-panel .auth-domain-pill.is-mute {
  border-color: #e3e1d8;
  background: #f7f6f1;
  color: #8b8f98;
}
#auth-panel .auth-domain-pill.is-mute::after { content: "✕"; }

/* 凭据指纹：等宽长条（对应图 1「授权码」行的打码长条形态） */
#auth-panel .auth-fp {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #f7f8fa;
  border: 1px solid #eceef2;
  border-radius: 6px;
  padding: 7px 12px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  color: #6f7480;
  letter-spacing: .05em;
}

/* ---- 未授权态：授权码输入行（v1.0.3 起嵌在 .auth-row-input .auth-v 内） ---- */
#auth-panel .auth-row-input { align-items: center; }
#auth-panel .auth-row-input .auth-v { display: flex; }
#auth-panel.auth-state-unauth input#auth-code-input {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: 1px solid #ded9cc;
  border-radius: 7px;
  background: #fff;
  color: #33373d;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13.5px;
  letter-spacing: .06em;
  padding: 8px 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
#auth-panel.auth-state-unauth input#auth-code-input:focus {
  outline: none;
  border-color: #46549b;
  box-shadow: 0 0 0 3px rgba(70, 84, 155, .13);
}
#auth-panel.auth-state-unauth input#auth-code-input::placeholder {
  color: #b3b7bf;
  letter-spacing: .02em;
}

/* ---- 按钮（后台卡片 + 通用 auth-btn 均覆盖） ---- */
#auth-panel.auth-card button,
.auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease,
              background .16s ease, border-color .16s ease;
}
#auth-panel.auth-card button:active,
.auth-btn:active { transform: translateY(1px); }

#auth-panel #auth-activate {
  background: linear-gradient(120deg, #46549b 0%, #4f9b83 100%);
  color: #fff;
  box-shadow: 0 5px 14px rgba(70, 84, 155, .26);
}
#auth-panel #auth-activate:hover {
  box-shadow: 0 8px 18px rgba(70, 84, 155, .32);
  transform: translateY(-1px);
}
#auth-panel #auth-activate[disabled] { opacity: .6; cursor: wait; transform: none; }

#auth-panel #auth-verify,
#auth-panel #auth-deactivate {
  background: #fff;
  border-color: #ded9cc;
  color: #6f7480;
}
#auth-panel #auth-verify:hover {
  border-color: #4f9b83;
  color: #4f9b83;
}
#auth-panel #auth-deactivate:hover {
  border-color: #bb5148;
  color: #bb5148;
  background: #f9e9e7;
}
#auth-panel #auth-verify[disabled],
#auth-panel #auth-deactivate[disabled] { opacity: .6; cursor: wait; }

/* （v1.0.3 图 1 定稿：旧 dl/dt/dd 信息段已由行式 .auth-row 布局取代，整段删除；
   指纹样式统一走 .auth-fp，#auth-fingerprint 旧规则一并移除） */

#auth-panel .auth-btn-row {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed #ebe7dd;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- 组件署名行 ---- */
#auth-panel .auth-by {
  margin: 14px 0 0;
  font-size: 11.5px;
  color: #b3b7bf;
  letter-spacing: .03em;
}

/* ---- 作者服务块（boot() 输出在 #auth-panel 外部，两态常驻）----
   v1.0.3 图 2 定稿：「支持与联系」头部（标题 + 副题）
   + 横向图标卡片（圆形图标 + 名称粗体 + 灰色副行）。 */
.auth-contact {
  margin: 8px 0 2px;
  width: 100%;
  box-sizing: border-box;
  font-size: 12.5px;
  line-height: 1.6;
  color: #6f7480;
}
.auth-contact .auth-contact-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 2px 9px;
}
.auth-contact .auth-contact-head b {
  font-size: 13px;
  font-weight: 700;
  color: #46549b;
  letter-spacing: .04em;
}
.auth-contact .auth-contact-head span {
  font-size: 11.5px;
  color: #a2a7b0;
  letter-spacing: .03em;
}
.auth-contact .auth-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  width: 100%;
}
.auth-contact .auth-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f7f9fc;
  border: 1px solid #e3e9f2;
  border-radius: 12px;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.auth-contact .auth-contact-item:hover {
  border-color: #c5d2ea;
  box-shadow: 0 4px 12px rgba(70, 84, 155, .10);
  transform: translateY(-1px);
}
.auth-contact .auth-contact-ico {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  background: #fff;
  border: 1px solid #e3e9f2;
  border-radius: 50%;
}
.auth-contact .auth-contact-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.auth-contact .auth-contact-txt b {
  font-size: 12.5px;
  color: #33373d;
}
.auth-contact .auth-contact-txt i {
  font-style: normal;
  font-size: 11.5px;
  color: #a2a7b0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- 消息提示条 ---- */
#auth-panel #auth-msg,
#auth-panel div#auth-msg {
  margin: 12px 0 0;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px;
  display: none;
}
#auth-panel #auth-msg.is-show {
  display: block;
  animation: authMsgIn .18s ease both;
}
@keyframes authMsgIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}
#auth-panel #auth-msg.is-err {
  background: #f9e9e7;
  border: 1px solid #efcfc9;
  color: #a8524a;
}
#auth-panel #auth-msg.is-ok {
  background: #e7f3ed;
  border: 1px solid #cbe4d7;
  color: #3e7a63;
}

/* ---- 插件占位输入框收口（结构性防御）----
   tpl-options 插件会为承载项额外渲染一只无 label 的空输入框。
   授权卡片挂在承载项的 option-body 内时，把同容器里的多余
   空文本输入框收掉（不含授权码输入框本身）。 */
#auth-panel.auth-card ~ input[type="text"]:not(#auth-code-input) {
  display: none;
}

/* ---- 小屏适配：按钮拉满便于点按 ---- */
@media (max-width: 520px) {
  #auth-panel.auth-card { padding: 15px 14px; }
  #auth-panel #auth-activate,
  #auth-panel .auth-btn-row button {
    width: 100%;
    justify-content: center;
  }
}

/* ---- 动效弱化偏好：跟随系统 ---- */
@media (prefers-reduced-motion: reduce) {
  #auth-panel.auth-card,
  #auth-panel #auth-msg.is-show {
    animation: none;
  }
}

/* ==================== 第二部分：前台提示层 ==================== */

/* siteAssets() 输出的标记容器：本体会挂在 body 上，容器自身不占位 */
#auth-hint,
#auth-notice-root { display: none; }

/* ---- ① 底部作者链接条：v1.0.5 已删除（JS 不再生成，样式随之移除） ---- */

/* ---- ② 右下角连接提示：v1.0.6 已删除（JS 不再生成） ---- */

/* ---- ③ 未授权提示层：v1.0.9 回归顶部横幅（站长要求：删除居中弹窗） ----
   深色玻璃横条 fixed 顶部全宽；主按钮（领取）渐变、其余幽灵半透明。 */
.auth-notice-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2147483000;
  background: rgba(15, 23, 32, .92);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid rgba(45, 212, 191, .35);
  box-shadow: 0 10px 32px -12px rgba(0, 0, 0, .5);
  color: #e8eef4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  animation: authDrop .35s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes authDrop { from { transform: translateY(-100%); } to { transform: translateY(0); } }
/* v1.1.1：底部横幅 = 同一套样式 + 定位/边框/入场方向变体（两端观感一致） */
.auth-notice-banner.is-bottom {
  top: auto;
  bottom: 0;
  border-bottom: none;
  border-top: 1px solid rgba(45, 212, 191, .35);
  box-shadow: 0 -10px 32px -12px rgba(0, 0, 0, .5);
  animation: authUp .35s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes authUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.auth-notice-banner .auth-notice-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth-notice-banner .auth-notice-badge {
  flex: 0 0 auto;
  display: inline-flex;
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, .45));
}
.auth-notice-banner .auth-notice-body {
  flex: 1 1 auto;
  min-width: 0;
}
.auth-notice-banner .auth-notice-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #f2f6fa;
}
.auth-notice-banner .auth-notice-text {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #9fb0c3;
}
.auth-notice-banner .auth-notice-text a { color: #5eead4; text-decoration: underline; }
.auth-notice-banner .auth-notice-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
/* 主按钮：青绿渐变（领取）；其余幽灵半透明（后台输入/联系作者） */
.auth-notice-banner .auth-notice-btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: #5eead4;
  background: rgba(13, 148, 136, .12);
  border: 1px solid rgba(94, 234, 212, .4);
  transition: transform .16s ease, background .16s ease, filter .16s ease;
}
.auth-notice-banner .auth-notice-btn:hover {
  background: rgba(13, 148, 136, .24);
  transform: translateY(-1px);
}
.auth-notice-banner .auth-notice-btn.is-primary {
  color: #fff;
  background: linear-gradient(120deg, #0d9488, #14b8a6);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(13, 148, 136, .38);
}
.auth-notice-banner .auth-notice-btn.is-primary:hover { filter: brightness(1.1); }
@media (max-width: 640px) {
  .auth-notice-banner .auth-notice-inner { flex-wrap: wrap; padding: 10px 14px; }
  .auth-notice-banner .auth-notice-actions { justify-content: flex-start; width: 100%; }
  .auth-notice-banner .auth-notice-btn { padding: 7px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-notice-banner, .auth-notice-banner.is-bottom { animation: none; }
}

/* ---- ④ 管理端公告弹窗（v1.1.0：内容支持 HTML，3 秒后可关闭） ---- */
#auth-announce {
  position: fixed;
  inset: 0;
  z-index: 2147483002;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 24, 34, .45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  padding: 20px;
}
#auth-announce .auth-announce-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  max-width: 520px;
  width: 100%;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  padding: 22px 24px 18px;
  animation: authCardIn .28s ease both;
}
#auth-announce .auth-announce-body {
  overflow: auto;
  font-size: 14px;
  line-height: 1.75;
  color: #33373d;
  word-break: break-word;
}
#auth-announce .auth-announce-body img { max-width: 100%; height: auto; }
#auth-announce .auth-announce-close {
  margin: 16px 0 0;
  align-self: flex-end;
  border: 1px solid #ded9cc;
  background: #fff;
  color: #6f7480;
  border-radius: 10px;
  padding: 7px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease;
}
#auth-announce .auth-announce-close:hover { color: #46549b; border-color: #46549b; }
#auth-announce .auth-announce-close[disabled] { opacity: .55; cursor: wait; }

/* ---- ⑤ 后台卡片「免费领取授权码」链接（v1.0.2 未授权态） ---- */
#auth-panel .auth-claim-link {
  display: inline-block;
  margin: 10px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #46549b;
  text-decoration: none;
  border-bottom: 1px dashed rgba(70, 84, 155, .45);
}
#auth-panel .auth-claim-link:hover {
  color: #36427e;
  border-bottom-color: currentColor;
}
