.dealer-page {
    --dealer-ink: #202836;
    --dealer-muted: #5b6575;
    --dealer-line: #e2e6ed;
    --dealer-blue: #205de0;
    --dealer-blue-dark: #164cbf;
    --dealer-surface: #f4f6f9;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    margin: 0;
    background: var(--dealer-surface);
    color: var(--dealer-ink);
    font: 15px/1.6 "Microsoft YaHei", "PingFang SC", sans-serif;
}

.dealer-page *, .dealer-page *::before, .dealer-page *::after {
    box-sizing: border-box;
}

.dealer-page main {
    flex: 1;
}

.dealer-page :focus-visible {
    outline: 2px solid var(--dealer-blue);
    outline-offset: 3px;
}

.dealer-container {
    width: min(1080px, calc(100% - 48px));
    margin-inline: auto;
}

/* 页眉与标题区沿用官网标识，并为申请流程保留独立的版面。 */
.dealer-header {
    background: #fff;
}

.dealer-header-inner, .dealer-brand {
    display: flex;
    align-items: center;
}

.dealer-header-inner {
    min-height: 64px;
    justify-content: space-between;
    gap: 16px;
}

.dealer-brand {
    gap: 14px;
    font-size: 16px;
    font-weight: 600;
}

.dealer-brand img {
    display: block;
    object-fit: contain;
}

.dealer-brand span {
    padding-inline-start: 14px;
    border-inline-start: 1px solid var(--dealer-line);
}

.dealer-home-link {
    color: var(--dealer-muted);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.dealer-home-link:hover {
    color: var(--dealer-blue);
}

.dealer-banner {
    padding-block: 28px;
    background: linear-gradient(105deg, #202a3a, #293e61);
    color: #fff;
}

.dealer-banner h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 600;
    line-height: 1.4;
}

.dealer-card {
    margin-block: 32px 40px;
    padding: 38px 44px 40px;
    border: 1px solid #e7ebf1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(35, 55, 95, .05);
}

/* 连接线由每一步画到下一步圆点，完成状态随步骤一起更新。 */
.dealer-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 0 0 30px;
    border-bottom: 1px solid var(--dealer-line);
    list-style: none;
}

.dealer-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 10px;
    padding-inline: 4px;
    color: var(--dealer-muted);
    font-size: 14px;
    text-align: center;
}

.dealer-step:not(:last-child)::after {
    position: absolute;
    top: 17px;
    left: 50%;
    width: 100%;
    height: 1px;
    background: var(--dealer-line);
    content: "";
}

.dealer-step-number {
    z-index: 1;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #cbd3df;
    border-radius: 50%;
    background: #fff;
    line-height: 1;
}

.dealer-step[aria-current="step"] {
    color: var(--dealer-ink);
    font-weight: 700;
}

.dealer-step[aria-current="step"] .dealer-step-number {
    border-color: var(--dealer-blue);
    background: var(--dealer-blue);
    color: #fff;
}

.dealer-step[data-completed] .dealer-step-number {
    border-color: var(--dealer-blue);
    color: var(--dealer-blue);
}

.dealer-step[data-completed]::after {
    background: var(--dealer-blue);
}

.dealer-step[data-completed] .dealer-step-number span {
    display: none;
}

.dealer-step[data-completed] .dealer-step-number::before,
.dealer-success-mark::before {
    width: 11px;
    height: 6px;
    transform: translateY(-1px) rotate(-45deg);
    border: solid currentColor;
    border-width: 0 0 2px 2px;
    content: "";
}

/* 分类展示与申请表单共用标题、控件和操作按钮的样式。 */
.dealer-panel {
    padding-top: 34px;
}

.dealer-panel h2, .dealer-dialog h2 {
    margin: 0 0 20px;
    font-size: clamp(20px, 2.5vw, 24px);
    font-weight: 600;
    line-height: 1.45;
}

.dealer-product-panel, .dealer-success-panel {
    text-align: center;
}

.dealer-page input, .dealer-page select, .dealer-page textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #bfc8d5;
    border-radius: 6px;
    background: #fff;
    color: var(--dealer-ink);
    font: inherit;
}

.dealer-product-panel select {
    width: min(280px, 100%);
}

.dealer-page select:invalid, .dealer-page ::placeholder {
    color: var(--dealer-muted);
}

.dealer-products {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}

.dealer-products li {
    display: grid;
    min-height: 122px;
    align-content: center;
    justify-items: center;
    gap: 9px;
    padding: 12px 6px;
    border: 1px solid #edf0f4;
    border-radius: 8px;
    background: #f8f9fb;
    color: #48556b;
    font-size: 14px;
}

.dealer-products li[data-selected] {
    border-color: #b6caf5;
    background: #f2f6ff;
    color: var(--dealer-blue-dark);
}

.dealer-product-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 14px;
    background: #edf1f7;
}

[data-selected] .dealer-product-icon {
    background: #e4edff;
}

.dealer-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.dealer-button {
    display: inline-flex;
    min-width: min(136px, 100%);
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 22px;
    border: 1px solid #cbd3df;
    border-radius: 6px;
    background: #fff;
    color: var(--dealer-ink);
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.dealer-button:hover {
    background: #f4f6f9;
}

.dealer-button-primary {
    border-color: var(--dealer-blue);
    background: var(--dealer-blue);
    color: #fff;
}

.dealer-button-primary:hover {
    border-color: var(--dealer-blue-dark);
    background: var(--dealer-blue-dark);
}

.dealer-button:disabled {
    border-color: #e1e5eb;
    background: #edf0f4;
    color: #667184;
    cursor: not-allowed;
}

.dealer-product-panel .dealer-button {
    width: min(280px, 100%);
}

.dealer-details-panel {
    width: min(560px, 100%);
    margin-inline: auto;
}

.dealer-details-panel h2 {
    margin-bottom: 28px;
    text-align: center;
}

.dealer-details-panel fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.dealer-details-panel legend {
    margin-bottom: 14px;
    padding: 0;
    font-size: 17px;
    font-weight: 600;
}

.dealer-details-panel fieldset + fieldset, .dealer-notes {
    margin-top: 26px;
}

.dealer-field + .dealer-field {
    margin-top: 14px;
}

.dealer-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.dealer-field-grid .dealer-field {
    margin: 0;
}

.dealer-submit-error {
    margin: 18px 0 0;
    color: #c1293d;
    font-size: 14px;
}

.dealer-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.dealer-required {
    color: #c1293d;
}

.dealer-optional {
    color: var(--dealer-muted);
    font-size: 13px;
}

.dealer-page textarea {
    display: block;
    resize: vertical;
}

/* 确认弹窗与结果页共用申请流程的视觉样式。 */
.dealer-dialog {
    width: min(420px, calc(100% - 32px));
    padding: 28px;
    border: 1px solid var(--dealer-line);
    border-radius: 12px;
    color: var(--dealer-ink);
    text-align: center;
}

.dealer-dialog::backdrop {
    background: rgba(20, 31, 48, .48);
}

.dealer-dialog h2 {
    margin-bottom: 10px;
}

.dealer-dialog p, .dealer-success-panel p {
    margin: 0;
    color: var(--dealer-muted);
}


.dealer-success-panel {
    padding-block: 64px 34px;
}

.dealer-success-panel h2 {
    margin-bottom: 12px;
}

.dealer-success-mark {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    place-items: center;
    border-radius: 50%;
    background: #e8f0ff;
    color: var(--dealer-blue);
}

.dealer-success-mark::before {
    width: 22px;
    height: 12px;
    border-width: 0 0 3px 3px;
}

.dealer-footer {
    padding-block: 20px;
    border-top: 1px solid var(--dealer-line);
    color: var(--dealer-muted);
    font-size: 13px;
}

@media (max-width: 760px) {
    .dealer-container {
        width: calc(100% - 32px);
    }

    .dealer-card {
        margin-block: 22px 28px;
        padding: 25px 20px 30px;
    }

    .dealer-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 510px) {
    .dealer-card {
        padding-inline: 14px;
    }

    .dealer-banner {
        padding-block: 21px;
    }

    .dealer-steps {
        padding-bottom: 20px;
    }

    .dealer-step {
        font-size: 12px;
    }

    .dealer-panel {
        padding-top: 25px;
    }

    .dealer-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 22px;
    }

    .dealer-products li {
        min-height: 99px;
        font-size: 13px;
    }

    .dealer-field-grid {
        grid-template-columns: 1fr;
    }

    .dealer-dialog {
        padding-inline: 18px;
    }

    .dealer-actions .dealer-button {
        min-width: 0;
        padding-inline: 14px;
    }
}
