/* ============================================================================
   PayChat 方案访问门禁 · 视觉层
   沿用 PayChat 绿色医疗主视觉（--green #0d6b5c），不引入红白模板色。
   ========================================================================== */

:root {
  --pg-ink: #142321;
  --pg-muted: #5f706c;
  --pg-line: #dfe8e5;
  --pg-green: #0d6b5c;
  --pg-green-dark: #07463e;
  --pg-mint: #dff4ec;
  --pg-paper: #ffffff;
}

html.pc-locked,
html.pc-locked body {
  overflow: hidden !important;
  height: 100% !important;
}

/* 锁定时隐藏真实正文，避免在遮罩下层被读取 */
html.pc-locked #app,
html.pc-locked #document-content,
html.pc-locked .site-shell,
html.pc-locked .layout,
html.pc-locked main {
  visibility: hidden !important;
}

.pc-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 620px at 12% -8%, #e8f5f0 0%, rgba(232, 245, 240, 0) 62%),
    radial-gradient(900px 560px at 96% 108%, #e2f1ec 0%, rgba(226, 241, 236, 0) 58%),
    #f4f8f6;
  font-family: "Alibaba PuHuiTi 3", "PingFang SC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  animation: pc-gate-in 0.42s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@keyframes pc-gate-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 医疗语义的柔光十字纹理 */
.pc-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(13, 107, 92, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(13, 107, 92, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 74%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 74%);
  pointer-events: none;
}

.pc-gate-card {
  position: relative;
  width: 100%;
  max-width: 452px;
  padding: 44px 40px 36px;
  background: var(--pg-paper);
  border: 1px solid var(--pg-line);
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 30px 70px rgba(18, 67, 58, 0.11),
    0 4px 14px rgba(18, 67, 58, 0.05);
  animation: pc-card-in 0.5s cubic-bezier(0.22, 0.8, 0.3, 1) 0.06s both;
}

@keyframes pc-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.pc-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  margin-bottom: 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--pg-green-dark);
  background: var(--pg-mint);
  border-radius: 999px;
}

.pc-gate-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pg-green);
  box-shadow: 0 0 0 3px rgba(13, 107, 92, 0.16);
}

.pc-gate-title {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--pg-ink);
}

.pc-gate-sub {
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 1.62;
  color: var(--pg-muted);
}

.pc-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pc-gate-label {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--pg-muted);
}

.pc-gate-field {
  position: relative;
  display: flex;
  align-items: center;
}

.pc-gate-input {
  width: 100%;
  height: 50px;
  padding: 0 46px 0 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--pg-ink);
  background: #fbfdfc;
  border: 1.5px solid var(--pg-line);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pc-gate-input::placeholder { color: #a7b6b2; }

.pc-gate-input:focus {
  background: #fff;
  border-color: var(--pg-green);
  box-shadow: 0 0 0 4px rgba(13, 107, 92, 0.1);
}

.pc-gate-eye {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--pg-muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.pc-gate-eye:hover { color: var(--pg-green); background: var(--pg-mint); }

.pc-gate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 50px;
  margin-top: 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(180deg, #10796a 0%, var(--pg-green) 100%);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(13, 107, 92, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.pc-gate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(13, 107, 92, 0.3);
}

.pc-gate-btn:active { transform: translateY(0) scale(0.995); }
.pc-gate-btn:disabled { opacity: 0.62; cursor: progress; transform: none; }

.pc-gate-error {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.5;
  color: #b3262b;
  background: #fdf0f0;
  border: 1px solid #f7d7d8;
  border-radius: 10px;
}

.pc-gate-error.is-on { display: flex; }

.pc-gate-error::before {
  content: "";
  flex: none;
  width: 15px;
  height: 15px;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 15h-2v-2h2v2Zm0-4h-2V7h2v6Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm1 15h-2v-2h2v2Zm0-4h-2V7h2v6Z'/%3E%3C/svg%3E");
}

.pc-gate-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--pg-line);
  font-size: 12px;
  color: var(--pg-muted);
}

.pc-gate-foot strong {
  font-weight: 600;
  color: var(--pg-green-dark);
}

.pc-gate-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pc-gate-lock svg { width: 13px; height: 13px; }

@media (max-width: 520px) {
  .pc-gate { padding: 16px; }
  .pc-gate-card { padding: 32px 24px 26px; border-radius: 18px; }
  .pc-gate-title { font-size: 21px; }
  .pc-gate-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-gate, .pc-gate-card { animation: none; }
}

/* ============================================================================
   退出访问按钮
   ---------------------------------------------------------------------------
   仅在已授权状态显示（gate.js 授权成功后才移除 hidden）。
   与语言切换器并排，视觉权重刻意压低 —— 客户阅读时不抢注意力，
   但共享设备场景下需要能一键退出。
   ========================================================================== */

.gate-exit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--pg-muted, #5f706c);
  background: transparent;
  border: 1px solid var(--pg-line, #dfe8e5);
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.gate-exit:hover {
  color: var(--pg-green, #0d6b5c);
  background: var(--pg-mint, #dff4ec);
  border-color: rgba(13, 107, 92, 0.28);
}

.gate-exit svg { flex: none; }

.gate-exit[hidden] { display: none; }

@media (max-width: 720px) {
  .gate-exit span { display: none; }
  .gate-exit { padding: 0 9px; }
}
