@layer pages {
  .auth-page {
    min-height: var(--viewport-block);
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(380px, .72fr) minmax(0, 1.28fr);
    color: var(--text-primary);
    overflow: clip;
  }
  .auth-page :where(h1, h2, p, small, strong, span) { overflow-wrap: anywhere; }
  .auth-panel {
    min-width: 0;
    padding: clamp(24px, 5vw, 76px);
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--cc-surface-open) 52%, transparent);
    -webkit-backdrop-filter: blur(34px) saturate(130%);
    backdrop-filter: blur(34px) saturate(130%);
  }
  .auth-card { width: min(430px, 100%); }
  .auth-panel-brand { display: none; }
  .auth-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--divider);
  }

  @media (prefers-reduced-transparency: reduce) {
    .auth-panel {
      background: var(--surface-solid);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
  }
  .auth-tabs a {
    min-height: 44px;
    position: relative;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 680;
  }
  .auth-tabs a.active { color: var(--text-primary); }
  .auth-tabs a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-primary);
  }
  .auth-heading { margin: clamp(32px, 6vh, 62px) 0 26px; }
  .auth-heading > span { color: var(--accent-fg); font-size: 10px; font-weight: 760; letter-spacing: .16em; }
  .auth-heading h1 { margin: 9px 0 10px; font-size: clamp(30px, 4vw, 45px); font-weight: 720; letter-spacing: -.045em; line-height: 1.06; }
  .auth-heading p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.65; }
  .wechat-auth-button {
    width: 100%;
    min-height: 70px;
    padding: 12px 16px;
    border: 0;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 13px;
    color: #f6fff9;
    background: linear-gradient(135deg, #12a866, #078a54);
    box-shadow: 0 16px 42px rgba(5, 112, 67, .18), inset 0 1px rgba(255,255,255,.28);
    text-align: left;
    transition: transform .18s ease, filter .18s ease;
  }
  .wechat-auth-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
  .wechat-auth-button:disabled { opacity: .66; transform: none; }
  .wechat-auth-button > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
  .wechat-auth-button strong { font-size: 15px; }
  .wechat-auth-button small { color: rgba(246,255,249,.76); font-size: 11px; }
  .wechat-auth-button i { font-size: 20px; font-style: normal; }
  .wechat-mark { width: 40px; height: 40px; border-radius: 15px; display: grid; place-items: center; color: #087248; background: rgba(255,255,255,.94); font-weight: 800; }
  .wechat-unavailable { padding: 13px 0; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
  .auth-provider-boundary { margin: 9px 2px 0; color: var(--text-muted); font-size: 11px; line-height: 1.55; }
  .auth-alternative { margin-top: 22px; border-top: 1px solid var(--divider); }
  .auth-alternative > summary { min-height: 48px; display: flex; align-items: center; color: var(--text-muted); font-size: 12px; cursor: pointer; }
  .auth-alternative > summary::marker { color: var(--text-muted); }
  .auth-form { padding-top: 8px; display: grid; gap: 14px; }
  .auth-form label { display: grid; gap: 6px; }
  .auth-form label > span { color: var(--text-secondary); font-size: 12px; }
  .auth-form input { width: 100%; min-height: 48px; border: 0; border-bottom: 1px solid var(--divider-strong); border-radius: 0; background: transparent; }
  .auth-form input:focus { border-color: var(--text-primary); box-shadow: none; }
  .auth-email-button { min-height: 48px; border: 0; border-radius: 14px; color: var(--text-on-accent); background: var(--text-primary); font-weight: 700; }
  .auth-form-message { padding: 10px 12px; border-radius: 12px; color: var(--danger-fg); background: var(--danger-bg); font-size: 12px; line-height: 1.55; }
  .auth-recovery-note { margin: 18px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.65; }
  .auth-visual {
    min-width: 0;
    padding: clamp(34px, 6vw, 94px);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
  }
  .auth-visual::before,
  .auth-visual::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(2px);
  }
  .auth-visual::before { width: 64vw; height: 64vw; right: -28vw; top: -32vw; border: 1px solid rgba(175,133,66,.16); box-shadow: 0 0 0 7vw rgba(175,133,66,.018), 0 0 0 14vw rgba(62,113,107,.014); }
  .auth-visual::after { width: 36vw; height: 36vw; left: 8vw; bottom: -24vw; background: radial-gradient(circle, rgba(90,142,135,.11), transparent 68%); }
  .auth-visual > * { position: relative; z-index: 1; }
  .auth-copy { max-width: 820px; margin: clamp(48px, 10vh, 120px) 0; }
  .auth-copy h2 { margin: 0; font-size: clamp(42px, 6vw, 82px); font-weight: 650; letter-spacing: -.055em; line-height: 1.03; }
  .auth-copy h2 span { color: var(--accent-fg); }
  .auth-copy p { max-width: 680px; margin: 22px 0 0; color: var(--text-secondary); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.8; }
  .auth-proof { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1px; background: var(--divider); }
  .auth-proof > div { min-width: 0; padding: 18px; background: color-mix(in srgb, var(--cc-surface-open) 66%, transparent); }
  .auth-proof :where(strong, small) { display: block; }
  .auth-proof strong { font-size: 13px; }
  .auth-proof small { margin-top: 5px; color: var(--text-muted); font-size: 11px; }

  .auth-completion { min-height: var(--viewport-block); display: grid; place-items: center; padding: 24px; }
  .auth-completion-card { width: min(460px, 100%); text-align: center; }
  .auth-completion-card h1 { margin: 22px 0 8px; font-size: clamp(28px, 5vw, 42px); letter-spacing: -.04em; }
  .auth-completion-card p { color: var(--text-muted); line-height: 1.7; }
  .completion-symbol { width: 70px; height: 70px; margin: auto; border-radius: 50%; display: grid; place-items: center; background: rgba(18,168,102,.1); }
  .completion-symbol span { width: 20px; height: 20px; border: 2px solid #12a866; border-right-color: transparent; border-radius: 50%; animation: auth-spin .8s linear infinite; }
  .completion-symbol.is-error { color: var(--danger-fg); background: var(--danger-bg); font-size: 28px; font-weight: 800; }
  .completion-actions { margin-top: 24px; display: grid; gap: 14px; }
  .wechat-auth-button.compact { min-height: 54px; grid-template-columns: 36px 1fr; text-decoration: none; }
  .wechat-auth-button.compact .wechat-mark { width: 34px; height: 34px; border-radius: 12px; }
  .auth-text-link { color: var(--text-secondary); font-size: 13px; }
  @keyframes auth-spin { to { transform: rotate(360deg); } }

  .account-access { margin: 28px 0; padding: 24px 0; border-block: 1px solid var(--divider); }
  .account-access-grid { margin-top: 20px; display: grid; grid-template-columns: minmax(220px,.75fr) minmax(0,1.25fr); gap: 20px; }
  .account-access-primary { display: grid; align-content: center; gap: 4px; }
  .account-access-primary > span { color: var(--text-muted); font-size: 11px; }
  .account-access-primary strong { font-size: 18px; }
  .account-access-primary small { color: var(--text-muted); }
  .identity-row { min-width: 0; padding: 14px; border-radius: 18px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; background: var(--surface-subtle); }
  .identity-row > div { min-width: 0; display: grid; gap: 3px; }
  .identity-row small { color: var(--text-muted); }
  .identity-row em { color: var(--warning); font-size: 11px; font-style: normal; }
  .identity-empty > span { width: 40px; height: 40px; display: grid; place-items: center; color: var(--text-muted); }

  @media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-panel { order: 1; padding: max(18px, var(--safe-top)) max(18px, var(--safe-right)) 28px max(18px, var(--safe-left)); }
    .auth-panel-brand { min-height: 46px; margin-bottom: 22px; display: flex; }
    .auth-visual { order: 2; padding: 32px max(22px, var(--safe-right)) max(40px, var(--safe-bottom)) max(22px, var(--safe-left)); }
    .auth-visual > .brand { display: none; }
    .auth-copy { margin: 18px 0 32px; }
    .auth-copy h2 { font-size: clamp(34px, 10vw, 56px); }
    .account-access-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 520px) {
    .auth-heading { margin-top: 28px; }
    .auth-heading h1 { font-size: 31px; }
    .auth-proof { grid-template-columns: 1fr; }
    .auth-proof > div { padding: 12px 4px; }
    .auth-proof small { display: none; }
    .identity-row { grid-template-columns: 42px 1fr; }
    .identity-row .button { grid-column: 1 / -1; }
  }
  @media (prefers-reduced-motion: reduce) {
    .completion-symbol span { animation-duration: 1.8s; }
    .wechat-auth-button { transition: none; }
  }
}
