/* Shared frame. Keep geometry independent of public and workspace styles. */
html { scrollbar-gutter: stable; }
html body .ui-header,
html body .ui-footer {
    --shell-height: 75px;
    --shell-width: min(1440px, calc(100% - clamp(40px, 8vw, 112px)));
    --shell-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    box-sizing: border-box;
    width: 100%;
    height: var(--shell-height);
    flex: none;
    font-family: var(--shell-font);
    font-size: 16px;
    line-height: 1.8;
    color: #233441;
    background: #e9eee4;
}
html body .ui-header *, html body .ui-footer * { box-sizing: border-box; }
html body .ui-header {
    position: sticky;
    top: 0;
    z-index: 80;
    border-bottom: 1px solid #e9eee4;
    box-shadow: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
html body .ui-header::before, html body .ui-header::after,
html body .ui-footer::before { display: none; }
html body .ui-header .ui-container, html body .ui-footer .ui-container {
    width: var(--shell-width);
    max-width: none;
    margin-inline: auto;
}
html body .ui-header .ui-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    height: 100%;
    min-height: 0;
    gap: 16px;
    padding: 0;
}
html body .ui-header .ui-brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 12px;
    width: auto;
    margin: 0;
    color: #203f59;
    font-size: 18.72px;
    font-weight: 850;
    letter-spacing: .02em;
    white-space: nowrap;
    text-decoration: none;
}
html body .ui-header .ui-brand-text { display: flex; flex-direction: column; line-height: 1.12; }
html body .ui-header .ui-brand-text small {
    display: block;
    margin-top: 3px;
    color: #485f70;
    font-size: 10.88px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: .24em;
}
html body .ui-header .ui-brand-text .ui-brand-tagline {
    display: flex;
    justify-content: space-between;
    letter-spacing: normal;
}
html body .ui-header .ui-nav {
    display: flex;
    grid-column: auto;
    grid-row: auto;
    justify-self: center;
    align-items: center;
    width: auto;
    max-width: 100%;
    overflow: visible;
    flex-wrap: nowrap;
    margin: 0;
    gap: 4px;
    padding: 6px;
    border: 0;
    border-radius: 999px;
    background: #f4f8fa;
    box-shadow: none;
}
html body .ui-header .ui-nav-link {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: clamp(74px, 6.5vw, 90px);
    min-height: 48px;
    margin: 0;
    padding: 6px 0;
    border-radius: 999px;
    color: #355166;
    font-family: var(--shell-font);
    font-size: 16px;
    line-height: 1.8;
    font-weight: 500;
    letter-spacing: normal;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    transform: none;
    transition: none;
}
html body .ui-header .ui-nav-link:is(.active, :hover, :focus-visible) { background: #c4d9e6; color: #193f59; box-shadow: none; }
html body .ui-header .ui-nav-link.active::after { display: none; }
html body .ui-header .ui-user {
    display: flex;
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding-left: 6px;
}
html body .ui-header .ui-user > form { display: flex; margin: 0; }
html body .ui-header .ui-user :is(.ui-ghost, .ui-cta, .ui-user-chip) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: auto;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid #a9bfcd;
    border-radius: 999px;
    background: #f4f8fa;
    color: #294d66;
    font-family: var(--shell-font);
    font-size: 14.4px;
    line-height: 20px;
    font-weight: 750;
    letter-spacing: normal;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    transform: none;
    transition: none;
}
html body .ui-header .ui-user .ui-auth-entry {
    min-width: 88px;
}
@media (max-width: 760px) {
    html body .ui-header .ui-user .ui-auth-entry {
        min-width: 76px;
    }
}
html body .ui-header .ui-user .ui-user-chip { font-size: 16.32px; font-weight: 800; }
html body .ui-header .ui-user .ui-user-name { max-width: 4em; overflow: hidden; text-overflow: ellipsis; }
html body .ui-header .ui-user .ui-cta { background: #ffda99; color: #203647; border-color: #ffda99; }
html body .ui-header .ui-user .ui-cta:hover { background: #ffe6b9; }
html body .ui-header .ui-user .ui-ghost:hover { background: #e7f0f5; color: #193f59; }
html body .ui-header :is(a, button):focus-visible { outline: 2px solid #285e81; outline-offset: 2px; }
html body .ui-footer {
    position: relative;
    width: 100%;
    border-top: 1px solid #e9eee4;
    padding: 0;
    box-shadow: none;
}
html body .ui-footer .ui-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 6px 16px;
    text-align: start;
    font-size: 16.8px;
    line-height: 1.8;
}
html body .ui-footer :is(.ui-footer-copy, .ui-footer-beian) { color: #355166; font-weight: 650; white-space: nowrap; }
html body .ui-footer .ui-footer-beian { text-decoration: none; }
html body .ui-footer .ui-footer-beian:is(:hover, :focus-visible) { color: #163e59; text-decoration: underline; }
/* Short pages place the footer at the bottom without an extra viewport of blank space. */
html body:not(.fi-body):has(> .ui-header):has(> .ui-footer) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
html body:not(.fi-body) > :is(.page, .shell) { flex: 1; min-height: 0; }
@media (max-width: 1480px) {
    html body :is(.ui-header, .ui-footer) { --shell-height: 139px; }
    html body .ui-header .ui-header-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 48px 60px; gap: 10px 14px; min-height: 0; padding: 10px 0; }
    html body .ui-header .ui-user { grid-column: 2; grid-row: 1; }
    html body .ui-header .ui-nav { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
    html body .ui-header, html body .ui-footer { --shell-width: calc(100% - 28px); }
    html body .ui-header .ui-brand-text .ui-brand-tagline { display: none; }
    html body .ui-header .ui-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); justify-self: stretch; width: 100%; border-radius: 16px; gap: 2px; padding: 5px; }
    html body .ui-header .ui-nav-link { width: auto; min-height: 44px; padding: 4px 0; border-radius: 11px; font-size: 14.4px; line-height: 1.2; }
    html body .ui-header .ui-user { gap: 8px; padding-left: 0; }
    html body .ui-header .ui-user :is(.ui-cta, .ui-ghost, .ui-user-chip) { padding-inline: 11px; }
}
@media (max-width: 600px) {
    html body :is(.ui-header, .ui-footer) { --shell-height: 189px; }
    html body .ui-header .ui-header-inner { grid-template-columns: minmax(0, 1fr); grid-template-rows: 46px 48px 54px; }
    html body .ui-header .ui-user { overflow-x: auto; scrollbar-width: none; padding: 2px; }
    html body .ui-header .ui-user :is(.ui-cta, .ui-ghost, .ui-user-chip) { padding-inline: 8px; }
    html body .ui-header .ui-user { grid-column: 1; grid-row: 2; justify-self: start; justify-content: flex-start; }
    html body .ui-header .ui-nav { grid-row: 3; }
    html body .ui-footer .ui-footer-inner { flex-direction: column; justify-content: center; font-size: 14px; text-align: center; }
}
