
/* CHONGYI V9.1 — authentication layer. Scoped to its own elements. */
.chongyi-auth-trigger{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;justify-content:center;padding:9px 15px;border:1px solid #d3e1d7;border-radius:999px;background:linear-gradient(135deg,#f8fcf9,#eef6f0);font-size:12px;font-weight:750;color:#185e48;cursor:pointer;transition:transform .2s,border-color .2s,box-shadow .2s}
.chongyi-auth-trigger:hover{border-color:#a8cbb7;box-shadow:0 5px 16px #164d3920;transform:translateY(-1px)}.chongyi-auth-trigger:focus-visible{outline:3px solid #92c4a4;outline-offset:3px}
#chongyi-auth-root{--ha-ink:#1b3732;--ha-light:#f6f9f6;--ha-line:#dce7dc;--ha-accent:#17694e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:var(--ha-ink);font-size:14px}
#chongyi-auth-backdrop{position:fixed;inset:0;z-index:2147483600;background:rgba(19,38,31,.48);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);display:grid;place-items:center;padding:20px;animation:haFade .22s ease-out}
#chongyi-auth-panel{position:relative;width:min(424px,100%);max-height:min(92dvh,790px);overflow:auto;border:1px solid rgba(255,255,255,.8);border-radius:28px;background:linear-gradient(146deg,rgba(255,255,255,.98),rgba(242,248,243,.98));padding:30px;box-shadow:0 32px 100px #0a271d40,0 2px 10px #1b54301a;animation:haUp .34s cubic-bezier(.16,1,.3,1)}
#chongyi-auth-panel button,#chongyi-auth-panel input{font:inherit}#chongyi-auth-panel h2{font-size:27px;letter-spacing:-.9px;margin:8px 0;color:#173c30;line-height:1.35}#chongyi-auth-panel p{margin:0;color:#71877a;line-height:1.75;font-size:12px}
.ha-eyebrow{color:#267557;font-weight:800;font-size:11px;letter-spacing:.14em}.ha-x{position:absolute;top:19px;right:19px;width:34px;height:34px;border-radius:50%;border:1px solid #e3ebe3;background:white;color:#496c5d;cursor:pointer}
.ha-switch{display:grid;grid-template-columns:1fr 1fr;background:#eaf1eb;border-radius:14px;padding:5px;gap:5px;margin:22px 0}.ha-switch button{border:none;background:transparent;padding:11px;border-radius:10px;color:#668074;cursor:pointer;font-weight:750}.ha-switch button.active{background:#fff;box-shadow:0 2px 10px #153f2c12;color:#175c45}
.ha-field{display:block;margin:13px 0;color:#34584a;font-weight:650;font-size:12px}.ha-field input{margin-top:8px;width:100%;height:46px;border:1px solid #dbe6dd;border-radius:12px;padding:0 13px;background:white;color:#193d31;font-size:14px;outline:none;min-width:0}.ha-field input:focus{border-color:#4d9b74;box-shadow:0 0 0 3px #4d9b741c}
.ha-agreement{display:flex;align-items:flex-start;gap:10px;color:#668274;font-size:11px;line-height:1.6;margin:14px 0}.ha-agreement input{margin:3px 0;accent-color:#17694e}.ha-submit{height:48px;width:100%;border:0;border-radius:13px;background:#17694e;color:white;font-weight:800;cursor:pointer;margin-top:10px;transition:transform .2s,background .2s}.ha-submit:hover{background:#0c553d;transform:translateY(-1px)}.ha-submit:disabled{opacity:.65;cursor:wait}
.ha-status{min-height:25px;color:#b13b3b;font-size:12px;margin:8px 0;line-height:1.5}.ha-status.ok{color:#267557}.ha-note{margin-top:12px!important;padding:12px;background:#eef5ef;border-radius:11px}.ha-preview{margin-top:20px;text-align:center;width:100%;border:0;background:transparent;color:#307858;font-size:12px;font-weight:750;padding:10px;cursor:pointer}
#chongyi-account-popover{position:fixed;z-index:2147483590;top:68px;right:20px;width:275px;padding:17px;border:1px solid #e0eae0;background:#fff;border-radius:20px;box-shadow:0 14px 50px #123e2c20;color:#213d34;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif}
#chongyi-account-popover strong{display:block;font-size:15px}#chongyi-account-popover small{display:block;color:#748779;font-size:11px;margin:6px 0 15px;overflow-wrap:anywhere}#chongyi-account-popover button{width:100%;margin-top:8px;border:1px solid #dfebe1;border-radius:11px;padding:11px;background:#f5f9f6;color:#266044;font-weight:700;cursor:pointer}
.ha-guest-hint{font-size:12px;color:#557062;background:rgba(241,248,241,.92);border:1px solid #dce8de;padding:12px 16px;border-radius:15px;margin:0 0 15px;line-height:1.7}.ha-guest-hint b{color:#245e45}.ha-guest-hint button{border:0;background:transparent;color:#0f6848;text-decoration:underline;font-weight:800;cursor:pointer}
@keyframes haFade{from{opacity:0}to{opacity:1}}@keyframes haUp{from{opacity:0;transform:translateY(18px) scale(.985)}to{opacity:1;transform:none}}
@media(max-width:540px){#chongyi-auth-backdrop{padding:0;align-items:end}#chongyi-auth-panel{border-radius:28px 28px 0 0;width:100%;max-height:90dvh;padding:27px 23px max(27px,env(safe-area-inset-bottom));animation:haUp .3s ease-out}.chongyi-auth-trigger{font-size:11px;padding:8px 11px}}
@media(prefers-reduced-motion:reduce){#chongyi-auth-backdrop,#chongyi-auth-panel{animation:none}.chongyi-auth-trigger,.ha-submit{transition:none}}

@media(max-width:590px){.topbar .notification{display:none!important}.top-actions .chongyi-auth-trigger{max-width:126px;padding:8px 10px;overflow:hidden;text-overflow:ellipsis}}
@media(max-width:750px){.topactions .chongyi-auth-trigger{max-width:166px;overflow:hidden;text-overflow:ellipsis;min-width:0}}

/* ---------------------------------------------------------------------------
   登录 / 注册浮层
   1) 面板内容可能超过一屏（注册有 5 个字段），允许滚动但**不显示滚动条**：
      右侧不允许出现任何滚动轴，滚动能力保留（触控板/滚轮/键盘仍可用）。
   2) 浮层打开时锁住页面滚动，并补偿滚动条宽度，避免背景横向跳动。
   --------------------------------------------------------------------------- */
#chongyi-auth-panel {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* 旧 Edge */
  overscroll-behavior: contain;   /* 滚到尽头不要带动背景 */
}

#chongyi-auth-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;                  /* Chrome / Safari */
}

body.ha-lock { overflow: hidden; }

/* 字段下方的说明：解释「这一栏填来干什么」，不是装饰 */
.ha-help {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.62;
  color: #7b9084;
}

.ha-help strong { color: #3d6152; font-weight: 750; }

/* 注册表单有 5 个字段 + 3 段说明，把纵向节奏压紧一点，
   让它在 800—900px 高的窗口里尽量一屏装下（滚动条已隐藏，装不下会不容易被发现）。 */
#chongyi-auth-panel { padding: 24px 26px 22px; max-height: min(94dvh, 820px); }
#chongyi-auth-panel h2 { font-size: 23px; margin: 6px 0; }
#chongyi-auth-panel p { line-height: 1.66; }

.ha-switch { margin: 16px 0 14px; }
.ha-switch button { padding: 9px; }

.ha-field { margin: 10px 0; }
.ha-field input { height: 44px; margin-top: 6px; }

.ha-help { margin-top: 5px; font-size: 10.5px; line-height: 1.55; }

.ha-agreement { margin: 11px 0; }
.ha-submit { height: 46px; margin-top: 8px; }
.ha-status { min-height: 18px; margin: 5px 0; }
.ha-preview { margin-top: 14px; }

/* 内容超出一屏时给个底部渐隐提示：滚动条既然隐藏了，总得让人知道下面还有 */
#chongyi-auth-panel.is-scroll {
  box-shadow: 0 32px 100px #0a271d40, 0 2px 10px #1b54301a, inset 0 -26px 20px -22px rgba(23, 60, 48, .35);
  background-attachment: local, local;
}
