
/* 所有既有data-page文档的基础尺寸；侧栏、导航和后台弹层留在layout.css。 */
body[data-page] {
    height: 100vh;
    overflow: hidden;
}

@media (max-width: 767.98px) {
    body[data-page] {
        height: auto;
        overflow: visible;
    }
}


.address-linkage {
    display: grid;
    gap: 8px;
}

.address-linkage__label {
    display: inline-flex !important;
    width: max-content;
    max-width: 100%;
    align-items: baseline;
    white-space: nowrap !important;
}

.address-linkage__label.portal-required-label::after {
    content: none !important;
}

.address-linkage__label-text {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
}

.address-linkage__required-mark {
    display: inline-block;
    margin-left: 0.18rem;
    color: #dc2626;
    font-weight: 800;
    line-height: 1;
}

.address-linkage__selects {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.address-linkage__selects .form-select,
.address-linkage__detail {
    min-width: 0;
    width: 100%;
}

.address-mobile-picker {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    background: rgba(15, 23, 42, 0);
    pointer-events: none;
    transition: background-color 160ms ease;
}

.address-mobile-picker[hidden] {
    display: none;
}

.address-mobile-picker__scrim {
    position: absolute;
    inset: 0;
}

.address-mobile-picker__panel {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: #fff;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

.address-mobile-picker--open {
    background: rgba(15, 23, 42, 0.5);
    pointer-events: auto;
}

.address-mobile-picker--open .address-mobile-picker__panel {
    transform: translateY(0);
    opacity: 1;
}

.address-mobile-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.address-mobile-picker__title {
    min-width: 0;
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.address-mobile-picker__close {
    flex: 0 0 auto;
    min-width: 48px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    line-height: 1;
}

.address-mobile-picker__list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px calc(20px + env(safe-area-inset-bottom));
    background: #f9fafb;
}

.address-mobile-picker__option {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 13px 12px;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    word-break: break-word;
}

.address-mobile-picker__option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.address-mobile-picker__option:last-child {
    border-bottom: 0;
    border-bottom-right-radius: 8px;
    border-bottom-left-radius: 8px;
}

.address-mobile-picker__option--selected {
    background: #e0f2fe;
    color: #075985;
    font-weight: 600;
}

.address-mobile-picker-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .address-linkage__selects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .address-linkage__selects {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 641px) and (pointer: fine) {
    .address-mobile-picker {
        display: none !important;
    }
}


/* 客户门户与注册页共用的基础文档边界。 */
body.customer-portal-body,
body.customer-register-body {
    height: auto;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f7f8fb;
    color: #182230;
    font-family: "Satoshi", "Geist", "Segoe UI", Arial, sans-serif;
}

body.customer-portal-body::before,
body.customer-register-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(39, 81, 116, 0.12), transparent 34%),
        linear-gradient(245deg, rgba(18, 95, 72, 0.1), transparent 30%);
}


/* 客户门户与注册页共用的基础按钮、表单及手机控件；组内保持原声明顺序。 */
.customer-portal-button {
    border: 1px solid rgba(100, 116, 139, 0.24);
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.74);
    color: #243447;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.customer-portal-button:hover {
    border-color: rgba(25, 77, 69, 0.45);
    background: #ffffff;
    color: #194d45;
}

.customer-portal-button:active {
    transform: translateY(1px);
}

.customer-portal-eyebrow {
    margin: 0 0 0.45rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.customer-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.customer-portal-button {
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1rem;
    font-weight: 700;
}

.customer-portal-button-primary {
    border-color: #194d45;
    background: #194d45;
    color: #ffffff;
}

.customer-portal-button-primary:hover {
    background: #103f38;
    color: #ffffff;
}

.customer-portal-form {
    display: grid;
    gap: 1.1rem;
}

.customer-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.customer-portal-form label {
    display: grid;
    gap: 0.42rem;
    color: #334155;
    font-weight: 700;
}

.customer-portal-form label span {
    font-size: 0.9rem;
}

.portal-required-label {
    display: inline-flex;
    align-items: baseline;
    white-space: nowrap;
}

.portal-required-label::after {
    content: "*";
    margin-left: 0.18rem;
    color: #dc2626;
    font-weight: 800;
}

.customer-portal-form .form-control,
.customer-portal-form .form-select {
    min-height: 2.8rem;
    border-color: rgba(100, 116, 139, 0.32);
    border-radius: 0.75rem;
}

.customer-manager-readonly {
    display: grid;
    gap: 0.35rem;
    min-height: 2.8rem;
    padding: 0.72rem 0.9rem;
    border: 1px solid rgba(47, 125, 110, 0.24);
    border-radius: 0.75rem;
    background: #f0fdfa;
    color: #134e4a;
}

.customer-manager-readonly span {
    color: #0f766e;
    font-size: 0.9rem;
    font-weight: 800;
}

.customer-manager-readonly strong {
    color: #111827;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.customer-manager-readonly small {
    color: #475569;
    line-height: 1.45;
}

.customer-form-span,
.customer-form-full {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .customer-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}


/* 客户与角色注册专属布局；角色规则仍限定在原页面与类名内。 */
.customer-register-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(260px, 0.7fr) minmax(360px, 1.3fr);
    gap: clamp(1rem, 3vw, 2rem);
    width: min(1180px, calc(100% - 2rem));
    min-height: 100vh;
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 3rem) 0;
    align-items: center;
}

.customer-register-intro {
    display: grid;
    gap: 1rem;
    align-content: center;
}

.customer-register-intro h1 {
    margin: 0;
    color: #111827;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    line-height: 1.02;
}

.customer-register-intro p {
    margin: 0;
    color: #64748b;
    line-height: 1.8;
}

.customer-register-card {
    padding: clamp(1rem, 3vw, 2rem);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 26px 80px rgba(15, 23, 42, 0.1);
}

body[data-page='role_register'] {
    background: #f3f6fa;
}

body[data-page='role_register']::before {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0)),
        linear-gradient(120deg, rgba(37, 99, 235, 0.08), transparent 42%);
}

.role-register-shell {
    width: min(980px, calc(100% - 2rem));
    grid-template-columns: minmax(250px, 0.72fr) minmax(340px, 0.95fr);
}

.role-register-card {
    border-radius: 0.9rem;
}

.role-register-role-alert {
    border-color: rgba(14, 165, 233, 0.34);
    background: #e0f7ff;
    color: #075985;
    font-weight: 700;
}

@media (max-width: 980px) {
    .customer-register-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body[data-page='role_register']::before {
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
    }

    .role-register-shell {
        width: 100%;
        min-height: 100dvh;
        align-content: start;
        align-items: start;
        gap: 1.1rem;
        padding: calc(1.35rem + env(safe-area-inset-top)) 1rem calc(1.75rem + env(safe-area-inset-bottom));
    }

    .role-register-intro {
        gap: 0.75rem;
        padding: 0 0.25rem;
    }

    .role-register-intro .customer-portal-eyebrow {
        margin-bottom: 0;
        color: #64748b;
        font-size: 0.76rem;
        letter-spacing: 0;
        text-transform: none;
    }

    .role-register-intro h1 {
        font-size: 1.8rem;
        line-height: 1.16;
    }

    .role-register-intro .customer-portal-button,
    .role-register-card .customer-form-actions .customer-portal-button {
        width: 100%;
        min-height: 2.9rem;
        border-radius: 0.55rem;
        font-size: 1rem;
    }

    .role-register-card {
        width: 100%;
        padding: 1rem;
        border-radius: 0.8rem;
        box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
    }

    .role-register-card .alert {
        margin-bottom: 0.9rem;
        padding: 0.78rem 0.85rem;
        border-radius: 0.65rem;
        font-size: 0.94rem;
        line-height: 1.5;
    }

    .role-register-card .customer-portal-form {
        gap: 0.95rem;
    }

    .role-register-card .customer-form-grid {
        grid-template-columns: 1fr;
        gap: 0.78rem;
    }

    .role-register-card .customer-portal-form label {
        gap: 0.38rem;
    }

    .role-register-card .customer-portal-form label span {
        color: #64748b;
        font-size: 0.9rem;
    }

    .role-register-card .customer-portal-form .form-control {
        min-height: 2.9rem;
        padding: 0.62rem 0.75rem;
        border-radius: 0.55rem;
        font-size: 1rem;
    }

    .role-register-card .customer-form-actions {
        gap: 0.65rem;
    }
}


/* 客户门户与注册页共用主题变量；必须晚于完整基础层加载。 */
body.customer-portal-body,
body.customer-register-body {
    --customer-xadmin-bg: #f2f4f7;
    --customer-xadmin-panel: #ffffff;
    --customer-xadmin-panel-soft: #f7f9fc;
    --customer-xadmin-line: #e4e8ef;
    --customer-xadmin-line-strong: #d7dde7;
    --customer-xadmin-text: #26333f;
    --customer-xadmin-muted: #7a8797;
    --customer-xadmin-primary: #1e9fff;
    --customer-xadmin-primary-dark: #1687d9;
    --customer-xadmin-danger: #ff5722;
    --customer-xadmin-shadow: 0 1px 2px rgba(15, 35, 55, 0.05);
    min-height: 100vh;
    background: var(--customer-xadmin-bg);
    color: var(--customer-xadmin-text);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
}

body.customer-portal-body::before,
body.customer-register-body::before {
    content: none;
}


/* 客户门户与注册页共用主题控件；只提取共享分支，不移动门户导航焦点规则。 */
.customer-portal-eyebrow {
    margin-bottom: 0.25rem;
    color: var(--customer-xadmin-muted);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.customer-portal-form {
    gap: 0.75rem;
}

.customer-portal-button {
    border-radius: 3px;
    font-weight: 500;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

.customer-portal-button {
    min-height: 34px;
    padding: 0.42rem 0.9rem;
    border: 1px solid var(--customer-xadmin-line-strong);
    background: #ffffff;
    color: var(--customer-xadmin-text);
}

.customer-portal-button:hover {
    border-color: var(--customer-xadmin-primary);
    background: #f5fbff;
    color: var(--customer-xadmin-primary);
}

.customer-portal-button-primary {
    border-color: var(--customer-xadmin-primary);
    background: var(--customer-xadmin-primary);
    color: #ffffff;
}

.customer-portal-button-primary:hover {
    border-color: var(--customer-xadmin-primary-dark);
    background: var(--customer-xadmin-primary-dark);
    color: #ffffff;
}

.customer-portal-button:focus-visible,
.customer-portal-form .form-control:focus,
.customer-portal-form .form-select:focus {
    border-color: var(--customer-xadmin-primary);
    box-shadow: 0 0 0 0.16rem rgba(30, 159, 255, 0.16);
    outline: 0;
}

.customer-form-grid {
    gap: 0.75rem;
}

.customer-portal-form label {
    gap: 0.32rem;
    color: var(--customer-xadmin-text);
    font-weight: 500;
}

.customer-portal-form label span {
    color: var(--customer-xadmin-muted);
    font-size: 0.83rem;
    font-weight: 500;
}

.customer-portal-form .form-control,
.customer-portal-form .form-select {
    min-height: 34px;
    border-color: var(--customer-xadmin-line-strong);
    border-radius: 3px;
    background-color: #ffffff;
    color: var(--customer-xadmin-text);
    font-size: 0.92rem;
}

@media (max-width: 760px) {
    .customer-portal-button {
        min-height: 32px;
        padding: 0.36rem 0.7rem;
        font-size: 0.88rem;
    }

    .customer-form-grid {
        gap: 0.55rem;
    }
}


/* 注册页主题覆盖；沿用基础注册布局，不进入已登录客户入口。 */
.customer-register-card {
    border: 1px solid var(--customer-xadmin-line);
    border-radius: 4px;
    background: var(--customer-xadmin-panel);
    box-shadow: var(--customer-xadmin-shadow);
}

.customer-register-shell {
    grid-template-columns: minmax(240px, 0.56fr) minmax(420px, 1fr);
    width: min(1120px, calc(100% - 2rem));
    min-height: 100vh;
    padding: 1.5rem 0;
}

.customer-register-intro {
    padding: 1.2rem;
}

.customer-register-intro h1 {
    color: var(--customer-xadmin-text);
    font-size: 1.65rem;
    font-weight: 600;
    line-height: 1.3;
}

.customer-register-intro p {
    color: var(--customer-xadmin-muted);
}

.customer-register-card {
    padding: 1.25rem;
}

@media (max-width: 980px) {
    .customer-register-shell {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

@media (max-width: 760px) {
    .customer-register-card {
        border-radius: 4px;
    }
}


/* 沿用原compliance-task9的全局打印隐藏，不携带追溯页面规则。 */
@media print {
    nav,
    aside,
    .btn,
    .alert {
        display: none !important;
    }
}

