.ouou-profile-layer {
  --profile-blue: #4169e8;
  --profile-blue-hover: #365bcf;
  --profile-ink: #202124;
  --profile-muted: #7d8189;
  --profile-line: #e8e9ed;
  --profile-field: #f5f6f8;
  --profile-danger: #d94848;
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--profile-ink);
  background: rgba(18,21,25,.66);
  font-family: var(--ouou-ui-font, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif);
  font-size: 13px;
  letter-spacing: 0;
}

.ouou-profile-layer[hidden] { display: none !important; }
.ouou-profile-layer [hidden] { display: none !important; }
.ouou-profile-layer * { box-sizing: border-box; }
.ouou-profile-layer button,
.ouou-profile-layer input,
.ouou-profile-layer textarea { font: inherit; letter-spacing: 0; }
.ouou-profile-layer button { border: 0; cursor: pointer; }
.ouou-profile-layer button:disabled,
.ouou-profile-layer input:disabled,
.ouou-profile-layer textarea:disabled { cursor: not-allowed; opacity: .58; }
.ouou-profile-layer button:focus-visible,
.ouou-profile-layer input:focus-visible,
.ouou-profile-layer textarea:focus-visible { outline: 2px solid rgba(65,105,232,.4); outline-offset: 2px; }
.ouou-profile-layer svg { display: block; }
.ouou-profile-layer .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.ouou-profile-layer .profile-dialog { position: relative; width: min(480px,100%); height: min(692px,calc(100dvh - 32px)); display: flex; flex-direction: column; overflow: visible; border-radius: 8px; background: #fff; box-shadow: 0 22px 70px rgba(0,0,0,.3); }
.ouou-profile-layer .profile-close { position: absolute; z-index: 2; top: 3px; right: -42px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; color: #fff; background: rgba(30,33,37,.34); }
.ouou-profile-layer .profile-close:hover { background: rgba(30,33,37,.62); }
.ouou-profile-layer .profile-close svg { width: 17px; height: 17px; }
.ouou-profile-layer .profile-scroll { min-height: 0; flex: 1; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 0; scrollbar-width: thin; }
.ouou-profile-layer .profile-header-media { position: relative; width: 100%; height: 190px; overflow: hidden; background: #f7fbff; }
.ouou-profile-layer .profile-header-media::before { content: ""; position: absolute; inset: 0; background: url("./assets/profile-header-skyline-v2.jpg") center/cover no-repeat; opacity: .68; filter: saturate(.72) contrast(.82) brightness(1.12); }
.ouou-profile-layer .avatar-editor { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; margin: -46px 0 17px; }
.ouou-profile-layer .avatar-preview { width: 80px; height: 80px; display: grid; place-items: center; overflow: hidden; border: 3px solid #fff; border-radius: 50%; color: #fff; background: #303757; box-shadow: 0 0 0 1px #d9dce2; font-size: 20px; font-weight: 700; }
.ouou-profile-layer .avatar-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ouou-profile-layer .avatar-button { width: 116px; height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border-radius: 6px; color: #33373d; background: #f3f4f6; font-weight: 600; }
.ouou-profile-layer .avatar-button:hover { background: #e9ebef; }
.ouou-profile-layer .avatar-button svg { width: 15px; height: 15px; }
.ouou-profile-layer .avatar-note { color: #989ca4; font-size: 10px; }
.ouou-profile-layer .field { display: grid; gap: 7px; margin-top: 14px; }
.ouou-profile-layer .field-head { min-width: 0; display: flex; align-items: center; gap: 6px; }
.ouou-profile-layer .field-head label,
.ouou-profile-layer .field-head > span:first-child { color: #34373c; font-size: 13px; font-weight: 600; }
.ouou-profile-layer .required { color: var(--profile-danger); }
.ouou-profile-layer .counter { margin-left: auto; color: #9ca0a8; font-variant-numeric: tabular-nums; font-size: 11px; }
.ouou-profile-layer .field input,
.ouou-profile-layer .field textarea { width: 100%; border: 1px solid transparent; border-radius: 6px; outline: 0; color: #30343a; background: var(--profile-field); }
.ouou-profile-layer .field input { height: 48px; padding: 0 13px; }
.ouou-profile-layer .field textarea { height: 102px; min-height: 102px; padding: 12px 13px; resize: none; line-height: 20px; }
.ouou-profile-layer .field input:hover,
.ouou-profile-layer .field textarea:hover { border-color: #e0e2e7; }
.ouou-profile-layer .field input:focus,
.ouou-profile-layer .field textarea:focus { border-color: #6c8df0; background: #fff; box-shadow: 0 0 0 2px rgba(65,105,232,.08); }
.ouou-profile-layer .field input.invalid,
.ouou-profile-layer .field textarea.invalid { border-color: var(--profile-danger); background: #fffafa; }
.ouou-profile-layer .field-hint { min-height: 15px; color: #92969e; font-size: 10px; line-height: 15px; }
.ouou-profile-layer .field-error { color: var(--profile-danger); }
.ouou-profile-layer .social-title { margin: 18px 0 8px; color: #34373c; font-size: 13px; font-weight: 600; }
.ouou-profile-layer .social-list { display: grid; gap: 8px; }
.ouou-profile-layer .social-row { min-width: 0; height: 48px; display: grid; grid-template-columns: 76px minmax(0,1fr); align-items: center; border: 1px solid transparent; border-radius: 6px; background: var(--profile-field); }
.ouou-profile-layer .social-row:focus-within { border-color: #6c8df0; background: #fff; box-shadow: 0 0 0 2px rgba(65,105,232,.08); }
.ouou-profile-layer .social-row.invalid { border-color: var(--profile-danger); background: #fffafa; }
.ouou-profile-layer .platform { height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 10px 0 12px; border-right: 1px solid #e4e6ea; color: #3d4147; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ouou-profile-layer .platform-mark { width: 20px; height: 20px; display: grid; place-items: center; color: #5b6068; }
.ouou-profile-layer .platform-mark svg { width: 17px; height: 17px; }
.ouou-profile-layer .social-row input { min-width: 0; width: 100%; height: 46px; padding: 0 12px; border: 0; outline: 0; color: #30343a; background: transparent; }
.ouou-profile-layer .social-error { min-height: 15px; margin: 3px 2px 0; color: var(--profile-danger); font-size: 10px; }
.ouou-profile-layer .recommendation { min-height: 55px; display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 5px 1px; border-top: 1px solid #eceef1; }
.ouou-profile-layer .recommendation-copy { min-width: 0; }
.ouou-profile-layer .recommendation-copy strong { display: block; font-size: 13px; font-weight: 600; }
.ouou-profile-layer .recommendation-copy span { display: block; margin-top: 3px; color: #91969e; font-size: 10px; line-height: 15px; }
.ouou-profile-layer .switch { position: relative; width: 38px; height: 22px; flex: 0 0 38px; margin-left: auto; }
.ouou-profile-layer .switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ouou-profile-layer .switch-track { position: absolute; inset: 0; border-radius: 11px; background: #c7cad1; transition: background .16s ease; }
.ouou-profile-layer .switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.22); transition: transform .16s ease; }
.ouou-profile-layer .switch input:checked + .switch-track { background: var(--profile-blue); }
.ouou-profile-layer .switch input:checked + .switch-track::after { transform: translateX(16px); }
.ouou-profile-layer .switch input:focus-visible + .switch-track { outline: 2px solid rgba(65,105,232,.4); outline-offset: 2px; }
.ouou-profile-layer .profile-status { min-height: 20px; margin-top: 7px; color: var(--profile-muted); font-size: 11px; line-height: 18px; text-align: center; }
.ouou-profile-layer .profile-fields { padding: 0 20px 20px; }
.ouou-profile-layer .profile-status.error { color: var(--profile-danger); }
.ouou-profile-layer .profile-status.success { color: #23764d; }
.ouou-profile-layer .profile-actions { flex: 0 0 66px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--profile-line); background: #fff; border-radius: 0 0 8px 8px; }
.ouou-profile-layer .profile-actions button { height: 48px; border-radius: 6px; font-size: 14px; font-weight: 600; }
.ouou-profile-layer .secondary { color: #33373d; background: #f1f2f4; }
.ouou-profile-layer .secondary:hover { background: #e6e8ec; }
.ouou-profile-layer .primary { color: #fff; background: var(--profile-blue); }
.ouou-profile-layer .primary:hover { background: var(--profile-blue-hover); }
.ouou-profile-layer .loading-view,
.ouou-profile-layer .error-view { min-height: 100%; display: grid; place-items: center; padding: 48px 24px; text-align: center; }
.ouou-profile-layer .state-copy { max-width: 300px; }
.ouou-profile-layer .spinner { width: 30px; height: 30px; margin: 0 auto 16px; border: 2px solid #e4e7ed; border-top-color: var(--profile-blue); border-radius: 50%; animation: profile-spin .8s linear infinite; }
.ouou-profile-layer .state-copy h2 { margin: 0; font-size: 17px; line-height: 25px; }
.ouou-profile-layer .state-copy p { margin: 7px 0 0; color: #838890; font-size: 12px; line-height: 20px; }
.ouou-profile-layer .retry-button { height: 38px; display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding: 0 14px; border-radius: 6px; color: #fff; background: var(--profile-blue); }
.ouou-profile-layer .retry-button svg { width: 15px; height: 15px; }
@keyframes profile-spin { to { transform: rotate(360deg); } }

.ouou-profile-layer.auth-backdrop { z-index: 100; }
.ouou-profile-layer .auth-dialog { width: min(430px,100%); max-height: calc(100dvh - 32px); overflow: auto; border-radius: 8px; background: #fff; box-shadow: 0 22px 70px rgba(0,0,0,.3); }
.ouou-profile-layer .auth-head { height: 58px; display: flex; align-items: center; gap: 9px; padding: 0 18px; border-bottom: 1px solid var(--profile-line); }
.ouou-profile-layer .auth-head .brand-mark { width: 22px; height: 20px; flex-basis: 22px; }
.ouou-profile-layer .auth-head strong { font-size: 15px; }
.ouou-profile-layer .auth-close { width: 30px; height: 30px; display: grid; place-items: center; margin-left: auto; border-radius: 6px; color: #5c6169; background: transparent; }
.ouou-profile-layer .auth-close:hover { background: #f1f2f4; }
.ouou-profile-layer .auth-close svg { width: 17px; height: 17px; }
.ouou-profile-layer .auth-body { padding: 27px 24px 24px; text-align: center; }
.ouou-profile-layer .auth-body h2 { margin: 0; font-size: 19px; line-height: 28px; }
.ouou-profile-layer .auth-body > p { margin: 7px auto 19px; color: #7e838b; font-size: 12px; line-height: 20px; }
.ouou-profile-layer .provider-mark { width: 104px; height: 104px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid #e0e3e7; border-radius: 8px; color: #858b94; background: #f7f8f9; }
.ouou-profile-layer .provider-mark svg { width: 30px; height: 30px; }
.ouou-profile-layer .wechat-button { width: 100%; height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 6px; color: #fff; background: #2aa865; font-weight: 600; }
.ouou-profile-layer .wechat-button:disabled { color: #8b9098; background: #eceef1; opacity: 1; }
.ouou-profile-layer .wechat-button svg { width: 17px; height: 17px; }
.ouou-profile-layer .auth-status { min-height: 42px; margin-top: 13px; color: #777c85; font-size: 11px; line-height: 18px; }
.ouou-profile-layer .auth-return { width: 100%; height: 38px; margin-top: 3px; border-radius: 6px; color: #555a62; background: #f1f2f4; }

@media (max-width: 620px) {
  .ouou-profile-layer { align-items: flex-end; padding: 8px; }
  .ouou-profile-layer .profile-dialog { width: 100%; height: min(692px,calc(100dvh - 16px)); border-radius: 8px; }
  .ouou-profile-layer .profile-close { top: 10px; right: 10px; width: 32px; height: 32px; border-color: #e3e5e9; color: #555a62; background: #f4f5f6; }
  .ouou-profile-layer .profile-close:hover { background: #eceef1; }
  .ouou-profile-layer .profile-header-media { height: 150px; }
  .ouou-profile-layer .avatar-editor { margin-top: -42px; }
  .ouou-profile-layer .profile-fields { padding: 0 14px 16px; }
  .ouou-profile-layer .profile-actions { padding-inline: 14px; }
  .ouou-profile-layer .social-row { grid-template-columns: 72px minmax(0,1fr); }
  .ouou-profile-layer .auth-dialog { max-height: calc(100dvh - 16px); }
}

@media (max-width: 380px) {
  .ouou-profile-layer { padding: 0; }
  .ouou-profile-layer .profile-dialog,
  .ouou-profile-layer .auth-dialog { height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .ouou-profile-layer .profile-actions { gap: 8px; padding-inline: 10px; border-radius: 0; }
  .ouou-profile-layer .profile-fields { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ouou-profile-layer *,
  .ouou-profile-layer *::before,
  .ouou-profile-layer *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
