@media (max-width: 768px) {
    .temu-y2-profit-page {
        padding: 4px;
        gap: 4px;
        padding-left: max(4px, env(safe-area-inset-left));
        padding-right: max(4px, env(safe-area-inset-right));
        padding-bottom: max(4px, env(safe-area-inset-bottom));
        overflow-x: clip;
        touch-action: pan-y;
    }

    .temu-y2-profit-page__subtitle {
        display: none;
    }

    .temu-y2-profit-mode-switch {
        padding: 6px;
        border-radius: 10px;
    }

    .temu-y2-profit-mode-switch__options {
        margin-top: 4px;
        gap: 2px;
        padding: 2px;
        border-radius: 12px;
    }

    .temu-y2-profit-mode-switch__option {
        min-height: 34px;
        padding: 5px 4px;
        border-radius: 10px;
    }

    .temu-y2-profit-mode-switch__option-title {
        font-size: 12px;
        white-space: nowrap;
    }

    /* iPhone 上输入框字号低于 16px 会触发自动缩放。 */
    .temu-y2-profit-field .el-input__inner {
        font-size: 16px !important;
    }

    .temu-y2-profit-page__header {
        padding: 6px 8px;
        gap: 4px;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .temu-y2-profit-page__header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .temu-y2-profit-page__auth-panel {
        width: 100%;
        justify-content: space-between;
        gap: 4px;
        padding: 5px 6px;
    }

    .temu-y2-profit-page__auth-user strong {
        max-width: 120px;
        font-size: 12px;
    }

    .temu-y2-profit-page__auth-name-row {
        gap: 6px;
        align-items: flex-start;
    }

    .temu-y2-profit-page__upgrade-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .temu-y2-profit-page__auth-actions {
        gap: 4px;
    }

    .temu-y2-profit-page__title {
        font-size: 18px;
    }

    .temu-y2-profit-page__header-main {
        width: 100%;
        min-width: 0;
    }

    .temu-y2-profit-page__title-row {
        width: 100%;
        align-items: flex-start;
        justify-content: space-between;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .temu-y2-profit-page__title {
        flex: 1;
        min-width: 0;
        font-size: 18px;
        line-height: 1.35;
        word-break: break-word;
    }

    .temu-y2-profit-page__title-row .el-tag {
        flex-shrink: 0;
        align-self: flex-start;
        margin-top: 1px;
    }

    .temu-y2-profit-panel {
        padding: 6px;
    }

    .temu-y2-profit-panel__header {
        margin-bottom: 4px;
        padding-bottom: 3px;
    }

    .temu-y2-profit-panel__header h3 {
        font-size: 15px;
    }

    .temu-y2-profit-section {
        padding: 5px;
    }

    .temu-y2-profit-section-row {
        align-items: start;
        gap: 4px;
        margin-top: 4px;
    }

    .temu-y2-profit-section + .temu-y2-profit-section {
        margin-top: 4px;
    }

    /* 桌面端的等高规则会在 iPhone/WebView 的双列 grid 下误算高度，移动端改回内容高度。 */
    .temu-y2-profit-section--half {
        min-height: auto;
        height: auto;
        align-self: start;
    }

    .temu-y2-profit-section__header,
    .temu-y2-profit-price-box__header {
        margin-bottom: 3px;
    }

    .temu-y2-profit-section__header h4 {
        font-size: 14px;
    }

    .temu-y2-profit-form-grid {
        gap: 3px 5px;
    }

    .temu-y2-profit-field {
        gap: 1px;
    }

    .temu-y2-profit-field label {
        font-size: 11px;
    }

    .temu-y2-profit-field .el-input__wrapper,
    .temu-y2-profit-field .el-select .el-select__wrapper,
    .temu-y2-profit-field .el-input-number .el-input__wrapper {
        min-height: 30px;
    }

    /* 平台核价/目标利润率这类强调输入框字号更大，补一点高度避免视觉上显得更扁。 */
    .temu-y2-profit-field--pricing .el-input__wrapper,
    .temu-y2-profit-field--pricing .el-input-number .el-input__wrapper {
        min-height: 32px;
        align-items: center;
    }

    .temu-y2-profit-field--pricing .el-input-number .el-input__inner,
    .temu-y2-profit-field--pricing .el-input__inner {
        line-height: 32px;
    }

    .temu-y2-profit-field--list-price .el-input__wrapper,
    .temu-y2-profit-field--list-price .el-input-number .el-input__wrapper {
        background: #fff7d6;
        box-shadow: 0 0 0 1px #f2d88a inset;
    }

    .temu-y2-profit-field--list-price .el-input__inner::placeholder,
    .temu-y2-profit-field--list-price .el-input-number .el-input__inner::placeholder {
        color: #b8821f;
        opacity: 0.95;
        font-size: 12px;
    }

    .temu-y2-profit-switch-row {
        min-height: 28px;
    }

    .temu-y2-profit-disabled-display {
        min-height: 28px;
        padding: 0 6px;
        font-size: 11px;
    }

    .temu-y2-profit-field-hint {
        margin-top: 0;
        font-size: 10px;
        line-height: 1.2;
    }

    .temu-y2-profit-form-grid,
    .temu-y2-profit-section-row,
    .temu-y2-profit-advice-toolbar,
    .temu-y2-profit-advice-metrics {
        grid-template-columns: 1fr;
    }

    .temu-y2-profit-overview,
    .temu-y2-profit-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3px;
    }

    .temu-y2-profit-overview__item,
    .temu-y2-profit-card {
        padding: 6px 5px;
        min-width: 0;
    }

    .temu-y2-profit-overview__item span,
    .temu-y2-profit-card__label {
        font-size: 10px;
        line-height: 1.25;
    }

    .temu-y2-profit-overview__item strong,
    .temu-y2-profit-card strong {
        margin-top: 2px;
        font-size: 14px;
        line-height: 1.25;
        word-break: break-word;
    }

    .temu-y2-profit-summary,
    .temu-y2-profit-formula {
        margin-top: 4px;
        padding: 6px 8px;
    }

    .temu-y2-profit-summary p {
        margin-top: 3px;
    }

    .temu-y2-profit-formula ul {
        margin-top: 3px;
        padding-left: 14px;
        line-height: 1.4;
    }

    .temu-y2-profit-form-grid--base {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* 广告设置和折扣设置在手机端仍保持左右并排，但不再允许高度异常拉伸。 */
    .temu-y2-profit-section-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3px;
    }

    .temu-y2-profit-form-grid--single {
        grid-template-columns: 1fr;
    }

    .temu-y2-profit-form-grid--pricing-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* 仅广告/折扣模块在手机端改为开关与输入框同一行，桌面端保持原样。 */
    .temu-y2-profit-form-grid--mobile-inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .temu-y2-profit-form-grid--mobile-inline .temu-y2-profit-switch-row {
        min-height: 28px;
        justify-content: flex-start;
    }

    .temu-y2-profit-panel__header,
    .temu-y2-profit-price-box__header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .temu-y2-profit-panel__actions {
        width: auto;
        margin-left: auto;
    }

    .temu-y2-profit-panel--form .temu-y2-profit-panel__header {
        justify-content: space-between;
    }

    .temu-y2-profit-panel__actions .el-button {
        padding: 4px 8px;
        font-size: 12px;
        height: 24px;
    }

    .temu-y2-profit-login-dialog,
    .temu-y2-profit-save-dialog {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }

    .temu-y2-profit-login-dialog__switch {
        width: 100%;
        justify-content: stretch;
    }

    .temu-y2-profit-login-dialog__switch-btn {
        flex: 1;
        min-width: 0;
    }

    .temu-y2-profit-login-dialog__code-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .temu-y2-profit-login-dialog__code-btn {
        width: 100%;
        min-width: 0;
    }

    .temu-y2-profit-save-dialog__meta {
        grid-template-columns: 1fr;
        padding: 6px;
        gap: 4px;
    }

    .temu-y2-profit-save-drawer__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .temu-y2-profit-save-card {
        padding: 6px;
        gap: 4px;
    }

    .temu-y2-profit-save-card__summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .temu-y2-profit-save-card__actions {
        justify-content: space-between;
    }

    .temu-y2-profit-price-box {
        margin-top: 4px;
    }

    .temu-y2-profit-ad-dialog {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }

    .temu-y2-profit-ad-dialog__description {
        font-size: 12px;
        line-height: 1.6;
    }

    .temu-y2-profit-ad-dialog__images {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .temu-y2-profit-ad-dialog__card {
        padding: 8px;
        gap: 6px;
    }

    .temu-y2-profit-ad-dialog__image {
        max-width: 100%;
        height: 132px;
    }

    .temu-y2-profit-ad-dialog__caption {
        font-size: 11px;
        line-height: 1.4;
    }

    .temu-y2-profit-ad-dialog__description {
        font-size: 11px;
        line-height: 1.5;
    }

    .temu-y2-profit-ad-dialog__footer {
        width: 100%;
        justify-content: space-between;
    }
}
