/* ═══════════ 卡密门禁 · 浅色质感（居中单卡布局） ═══════════ */
.gate{
  position:fixed;inset:0;z-index:2000;
  display:flex;flex-direction:column;align-items:center;
  background:linear-gradient(180deg,#eef1f6 0%,#f7f8fa 340px);
  font:14px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color:#1a1d29;overflow:auto;
  padding:48px 20px 56px;
}
.gate.hidden{display:none!important}

/* 上：品牌 + 标题（居中精简） */
.gate-left{
  flex:none;max-width:640px;width:100%;min-width:0;
  display:flex;flex-direction:column;align-items:center;
  padding:0 0 26px;text-align:center;
}
.gate-brand{display:flex;align-items:center;gap:10px;font-size:14.5px;font-weight:600;letter-spacing:.3px;color:#1a1d29}
.gate-logo{
  width:30px;height:30px;border-radius:8px;flex:none;
  background:#5e6ad2;
  display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:700;color:#fff;
}
/* 品牌标题：图标与文字一行显示（图标原为块级，会独占一行） */
.gate-title{font-size:26px;line-height:1.3;font-weight:700;margin:20px 0 8px;letter-spacing:.3px;color:#1a1d29;
  display:flex;align-items:center;justify-content:center;gap:10px}
.gate-sub{color:#6f7688;font-size:13.5px;line-height:1.85;max-width:460px}
.gate-steps{
  list-style:none;margin:22px 0 0;padding:0;
  display:flex;gap:32px;justify-content:center;flex-wrap:wrap;
}
.gate-steps li{display:flex;gap:9px;align-items:center}
.gate-steps .num{
  width:24px;height:24px;border-radius:7px;flex:none;
  background:#eef0fb;color:#5e6ad2;
  display:flex;align-items:center;justify-content:center;font-size:11.5px;font-weight:700;
}
.gate-steps strong{font-size:13px;font-weight:600;color:#1a1d29}
.gate-steps span{display:none}

/* 下：白色表单卡 */
.gate-right{
  flex:none;width:100%;max-width:600px;
  background:#fff;border:1px solid #e7e9ef;border-radius:16px;
  box-shadow:0 1px 2px rgba(18,25,38,.05),0 12px 40px rgba(18,25,38,.09);
  padding:34px 38px 30px;
}
.gate-right h3{font-size:20px;font-weight:700;margin:0 0 8px;color:#1a1d29}
.gate-desc{color:#6f7688;font-size:13.5px;line-height:1.85;margin:0 0 24px}
.gate-row{display:flex;gap:10px;align-items:stretch}
.gate-row input{
  flex:1;min-width:0;height:46px;padding:0 14px;border:1px solid #d4d8e3;border-radius:9px;
  font:14px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.4px;
  color:#1a1d29;background:#fff;outline:none;transition:border-color .15s,box-shadow .15s;
}
.gate-row input::placeholder{color:#9ba1b0;letter-spacing:0}
.gate-row input:focus{border-color:#5e6ad2;box-shadow:0 0 0 3px rgba(94,106,210,.14)}
.gate-row button{
  flex:none;height:46px;padding:0 26px;border:0;border-radius:9px;cursor:pointer;
  background:#5e6ad2;color:#fff;font:600 14px/1 inherit;transition:.15s;
  box-shadow:0 1px 2px rgba(18,25,38,.08);
}
.gate-row button:hover{background:#4f5bc0}
.gate-row button:disabled{opacity:.55;cursor:default}

/* ===== 提示条（四色，浅色淡底） ===== */
.gate-msg{
  display:none;align-items:flex-start;gap:9px;
  margin-top:14px;padding:11px 13px;border-radius:10px;
  font-size:13px;line-height:1.65;color:#6f7688;
  background:#f4f5f8;border:1px solid #e7e9ef;
}
.gate-msg.on{display:flex;animation:tip-in .22s ease-out}
@keyframes tip-in{
  from{opacity:0;transform:translateY(-5px)}
  to{opacity:1;transform:none}
}
.gate-msg .ico{
  flex:none;width:18px;height:18px;margin-top:1px;
  display:flex;align-items:center;justify-content:center;
}
.gate-msg .ico svg{width:17px;height:17px;display:block}
.gate-msg .txt{flex:1;min-width:0;word-break:break-word}
.gate-msg.info{background:#eef0fb;border-color:#dcdff0;color:#4550a8}
.gate-msg.info .ico{color:#5e6ad2}
.gate-msg.err{background:#fdeeee;border-color:#f3cdcf;color:#a63842}
.gate-msg.err .ico{color:#d64550}
.gate-msg.ok{background:#e9f7f0;border-color:#c4e7d6;color:#167853}
.gate-msg.ok .ico{color:#1a9e6c}
.gate-msg.warn{background:#faf3e2;border-color:#ecdcbb;color:#8a6410}
.gate-msg.warn .ico{color:#b97d10}

/* 校验失败：输入框轻微抖动 + 红边 */
.gate-row input.bad{
  border-color:#eba6ab;box-shadow:0 0 0 3px rgba(214,69,80,.1);
  animation:field-shake .32s ease-in-out;
}
@keyframes field-shake{
  0%,100%{transform:translateX(0)}
  20%{transform:translateX(-5px)}
  45%{transform:translateX(4px)}
  70%{transform:translateX(-2px)}
  85%{transform:translateX(1px)}
}
.gate-tip{
  margin-top:22px;padding:13px 15px;border-radius:10px;background:#f4f5f8;
  border:1px solid #e7e9ef;
  color:#6f7688;font-size:12.5px;line-height:1.85;
}
.gate-tip b{color:#1a1d29}
.gate-foot{margin-top:20px;display:flex;gap:14px;align-items:center;font-size:12.5px;flex-wrap:wrap;color:#9ba1b0}
.gate-foot a{color:#5e6ad2;text-decoration:none}
.gate-foot a:hover{text-decoration:underline}
.gate-foot .dot-sep{color:#c9cedb}

/* ===== 验证前确认弹窗 ===== */
.modal-mask{
  position:fixed;inset:0;z-index:2100;background:rgba(18,25,38,.4);
  display:flex;align-items:center;justify-content:center;padding:20px;
}
.modal-mask.hidden{display:none!important}
.modal-box{
  width:100%;max-width:560px;background:#fff;border-radius:14px;
  box-shadow:0 2px 4px rgba(18,25,38,.08),0 24px 64px rgba(18,25,38,.18);overflow:hidden;
  animation:modalIn .18s ease both;
}
@keyframes modalIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.modal-head{
  display:flex;align-items:center;gap:10px;padding:20px 22px 0;
  font-size:17px;font-weight:600;color:#1a1d29;
}
.modal-close{
  margin-left:auto;width:28px;height:28px;border:0;background:transparent;cursor:pointer;
  color:#9ba1b0;font-size:18px;line-height:1;border-radius:7px;
}
.modal-close:hover{background:#f4f5f8;color:#6f7688}
.modal-body{padding:14px 22px 4px}
.modal-warn{display:flex;gap:8px;color:#6f7688;font-size:13px;line-height:1.9}
.modal-warn .icon{
  flex:none;width:18px;height:18px;margin-top:3px;border-radius:50%;
  background:#b97d10;color:#fff;font-size:12px;font-weight:700;
  display:flex;align-items:center;justify-content:center;
}
.modal-rules{margin:6px 0 0;padding:0 0 0 8px;list-style:none}
.modal-rules li{
  position:relative;padding-left:18px;margin:10px 0;font-size:13px;color:#454b5c;line-height:1.9;
}
.modal-rules li::before{
  content:attr(data-i);position:absolute;left:0;top:0;
  color:#9ba1b0;font-weight:600;font-size:13px;
}
.modal-rules b{color:#d64550;font-weight:600}
.modal-foot{
  display:flex;justify-content:flex-end;gap:10px;padding:14px 22px 22px;
}
.modal-foot button{
  height:38px;padding:0 20px;border-radius:8px;border:1px solid transparent;
  font:500 13.5px/1 inherit;cursor:pointer;transition:.15s;
}
.modal-foot .cancel{background:#fff;border-color:#d4d8e3;color:#6f7688}
.modal-foot .cancel:hover{background:#f4f5f8}
.modal-foot .confirm{background:#5e6ad2;color:#fff;font-weight:600}
.modal-foot .confirm:hover{background:#4f5bc0}

/* ===== 顶栏卡密信息（完整卡密 + 剩余时长 + 退出） ===== */
header .card-info{
  margin-left:auto;flex:none;
  display:flex;align-items:center;gap:8px;
  min-width:0;
}
header .card-code{
  font:11.5px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:#6f7688;background:#f4f5f8;border:1px solid #e7e9ef;
  border-radius:8px;padding:5px 9px;letter-spacing:.01em;
  white-space:nowrap;
  -webkit-user-select:all;user-select:all;
  cursor:text;
}
header .card-chip{
  flex:none;white-space:nowrap;
  font-size:12px;font-weight:500;color:#5e6ad2;background:#eef0fb;
  border:1px solid #dcdff0;border-radius:999px;padding:3px 11px;
  font-variant-numeric:tabular-nums;
}
header .card-exit{
  flex:none;white-space:nowrap;
  height:28px;padding:0 11px;border-radius:8px;
  font-size:12px;font-weight:500;
  color:#6f7688;background:#fff;border:1px solid #d4d8e3;
  cursor:pointer;transition:.15s;
}
header .card-exit:hover{color:#d64550;border-color:#f3cdcf;background:#fdeeee}

/* ===== 多端自适应 ===== */
@media (max-width:900px){
  .gate{padding:28px 16px 40px}
  .gate-title{font-size:21px;margin:16px 0 6px}
  .gate-sub{font-size:12.5px}
  .gate-steps{gap:20px;margin-top:16px}
  .gate-right{padding:24px 20px 24px;border-radius:14px}
  .gate-right h3{font-size:18px}
  .gate-desc{font-size:12.8px;margin-bottom:18px}
  .gate-row input{height:44px;font-size:13px}
  .gate-row button{height:44px;padding:0 18px;font-size:13px}
  .gate-tip{font-size:12px;padding:12px 14px}
  .modal-box{max-height:88vh;overflow:auto}
  .modal-head{font-size:15.5px;padding:16px 16px 0}
  .modal-body{padding:12px 16px 2px}
  .modal-rules li{font-size:12.5px}
  .modal-foot{padding:12px 16px 16px}
  .modal-foot button{flex:1;height:40px}
}
@media (max-width:600px){
  /* 移动端门禁输入框：加大点击区、字号提到 16px（避免 iOS 聚焦自动放大）、居中更工整 */
  .gate-row input{
    height:52px;font-size:16px;text-align:center;letter-spacing:1.5px;
    padding:0 14px;border-radius:12px;background:#f7f8fb;border-color:#e3e6ee;
  }
  .gate-row input::placeholder{letter-spacing:1px;font-size:14px}
  .gate-row input:focus{background:#fff}
  .gate-row button{height:48px;border-radius:12px;font-size:15px;letter-spacing:2px}
  /* 窄屏顶栏：卡密完整显示独占一行（右对齐、可横向滚动） */
  header{height:auto;min-height:56px;flex-wrap:wrap;row-gap:2px;padding:6px 14px}
  header .card-info{width:100%;flex-wrap:wrap;justify-content:flex-end;gap:6px;padding-bottom:2px}
  header .card-code{
    order:-1;width:100%;text-align:right;font-size:10.5px;padding:4px 8px;
    overflow-x:auto;scrollbar-width:none;
  }
  header .card-chip{font-size:11px;padding:3px 8px}
  header .card-exit{height:26px;padding:0 8px;font-size:11px}
}
@media (max-width:400px){
  .gate-row{flex-direction:column;gap:12px}
  .gate-row button{width:100%}
  .gate-right{padding:20px 16px}
  .gate{padding:22px 14px 32px}
}
