:root {
    --primary: #1e98f0;
    --primary-dark: #0f74d3;
    --accent: #1e98f0;
    --student: #18b893;
    --teacher: #3d8eff;
    --page-bg: #f7f7f7;
    --panel: #ffffff;
    --line: #d7e1ea;
    --text: #26384a;
    --muted: #6d7c8d;
    --danger: #cf3e3e;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    line-height: 1.5;
}

body[data-active="signup"] {
    background: var(--page-bg);
}

a {
    color: var(--primary);
    text-decoration: none;
}

.signup-shell {
    min-height: calc(100vh - 50px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px 20px;
}

.signup-hero {
    width: calc(100% + 32px);
    min-height: 150px;
    margin-top: 0;
    padding: 46px 16px 88px;
    background-image: url("../images/test/8.png");
}

.signup-panel,
.signup-header,
.notice-box {
    width: min(1200px, 100%);
}

.signup-panel {
    margin-top: -87px;
    background: var(--panel);
    border: 1px solid #dddddd;
}

.signup-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto 30px;
    padding: 0 100px;
    color: #ffffff;
}

.signup-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
}

.login-link {
    color: #ffffff;
    white-space: nowrap;
    font-size: 14px;
}

.notice-box {
    margin: 0 auto;
    padding: 10px 34px;
    border: 0;
    border-radius: 3px;
    background: #ffffff;
    color: #c33a3a;
    font-size: 14px;
}

.notice-box ul {
    margin: 0;
    padding-left: 20px;
}

.notice-box li + li {
    margin-top: 4px;
}

.step-nav ol {
    min-height: 86px;
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 22px 110px 10px;
    list-style: none;
}

.step-nav li {
    width: 82px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    border: 0;
    background: #ffffff;
    color: #27384a;
    font-size: 15px;
    font-weight: 400;
}

.step-nav li[role="button"] {
    cursor: pointer;
}

.step-nav li[role="button"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.step-nav li[role="button"]:not(.active):hover strong {
    border-color: #6b7ef5;
    color: #6b7ef5;
}

.step-nav li.is-locked {
    cursor: default;
    pointer-events: none;
}

.step-nav li::after {
    content: "";
    position: absolute;
    top: 13px;
    left: calc(50% + 34px);
    width: calc((min(1180px, 100vw - 32px) - 550px) / 2 - 28px);
    height: 2px;
    border: 0;
    background: #c7ccd5;
}

.step-nav li::before {
    display: none;
}

.step-nav li:last-child::after,
.step-nav li:last-child::before {
    display: none;
}

.step-nav strong {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #c3c8d1;
    border-radius: 50%;
    color: #a8afbb;
    background: #ffffff;
    font-size: 18px;
    line-height: 1;
}

.step-nav li.active {
    color: #6b7ef5;
    border: 0;
    background: #ffffff;
}

.step-nav li.active::after {
    background: #c7ccd5;
}

.step-nav li.active::before {
    display: none;
}

.step-nav li.active + li {
    border-left: 0;
}

.step-nav li[data-step-indicator="4"]::after,
.step-nav li:last-child::after {
    display: none !important;
}

.step-nav[data-current-step="2"] li[data-step-indicator="1"],
.step-nav[data-current-step="3"] li[data-step-indicator="2"] {
    border-right: 0;
}

.step-nav[data-current-step="2"] li[data-step-indicator="1"]::before,
.step-nav[data-current-step="3"] li[data-step-indicator="2"]::before {
    display: none;
}

.step-nav li.active strong {
    color: #ffffff;
    border-color: #6b7ef5;
    background: #6b7ef5;
}

.signup-body {
    padding: 0;
}

.register-form {
    min-width: 0;
    min-height: 365px;
    padding: 38px 54px 34px;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-step h2 {
    margin: 0 0 24px;
    color: #ff8a19;
    font-size: 24px;
    font-weight: 400;
    text-align: center;
}

.form-step h3 {
    margin: 28px 0 16px;
    color: #35495e;
    font-size: 17px;
}

.form-section-title {
    display: block;
    margin: 30px 0 24px;
    padding-bottom: 10px;
    border-bottom: 1px solid #9b9b9b;
    color: #333333;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.agreement-field {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 0;
    color: #3c4f62;
    font-size: 14px;
}

.agreement-field input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.identity-grid {
    display: grid;
    grid-template-columns: repeat(2, 160px);
    justify-content: center;
    gap: 300px;
    margin: 26px auto 0;
}

.identity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 0 0 8px;
    border: 0;
    position: relative;
    cursor: pointer;
}

.identity-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.identity-image {
    width: 160px;
    height: 186px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: transparent;
    transition: transform 160ms ease;
}

/*.identity-image img {
    width: 120px;
    height: 120px;
    display: block;
}*/

.identity-card strong {
    min-width: 160px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid currentColor;
    border-radius: 4px;
    background: #ffffff;
    font-size: 18px;
    font-weight: 400;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.identity-card:first-child strong {
    color: var(--student);
}

.identity-card:last-child strong {
    color: var(--teacher);
}

.identity-card:first-child:hover strong,
.identity-card:first-child:has(input:checked) strong {
    color: #ffffff;
    border-color: var(--student);
    background: var(--student);
}

.identity-card:first-child:hover .identity-image,
.identity-card:first-child:has(input:checked) .identity-image {
    transform: translateY(-2px);
}

.identity-card:last-child:hover strong,
.identity-card:last-child:has(input:checked) strong {
    color: #ffffff;
    border-color: var(--teacher);
    background: var(--teacher);
}

.identity-card:last-child:hover .identity-image,
.identity-card:last-child:has(input:checked) .identity-image {
    transform: translateY(-2px);
}

.identity-fields {
    display: none;
}

.identity-fields.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.form-field {
    min-width: 0;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    color: #405368;
    font-size: 14px;
    font-weight: 700;
}

.form-field > span:first-child {
    text-align: right;
}

.form-field:has([data-required="true"]) > span:first-child::before {
    content: "*";
    margin-right: 4px;
    color: var(--danger);
}

.form-field-wide,
.country-field,
.captcha-field {
    grid-column: 1 / -1;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid #cfdbe6;
    border-radius: 2px;
    padding: 8px 10px;
    color: var(--text);
    background: #ffffff;
    font: inherit;
    font-weight: 400;
    outline: none;
}

.date-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
}

.date-control input {
    border-right: 0;
    border-radius: 2px 0 0 2px;
}

.date-control button {
    min-height: 38px;
    position: relative;
    border: 1px solid #cfdbe6;
    border-radius: 0 2px 2px 0;
    background: #f7f9fb;
    cursor: pointer;
}

.date-control button::before {
    content: "";
    width: 17px;
    height: 16px;
    position: absolute;
    left: 50%;
    top: 50%;
    border: 2px solid #7f96aa;
    border-top-width: 5px;
    border-radius: 2px;
    transform: translate(-50%, -50%);
}

.date-control button::after {
    content: "";
    width: 11px;
    height: 2px;
    position: absolute;
    left: 50%;
    top: 50%;
    background: #7f96aa;
    box-shadow: 0 5px 0 #7f96aa;
    transform: translate(-50%, -1px);
}

.date-control:focus-within input,
.date-control:focus-within button {
    border-color: var(--accent);
}

.form-field textarea {
    min-height: 86px;
    resize: vertical;
}

.school-field select,
.account-grid input[name="phone"],
.account-grid input[name="password"],
.account-grid input[name="confirmPassword"],
.student-fields input,
.student-fields select,
.teacher-fields input,
.teacher-fields select {
    width: 100%;
}

/* 可搜索下拉菜单 */
.searchable-select {
    position: relative;
    min-width: 0;
}
.form-field .searchable-select-input {
    width: 100%;
    min-height: 38px;
    border: 1px solid #cfdbe6;
    border-radius: 2px;
    padding: 8px 30px 8px 10px;
    color: var(--text);
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237f96aa'/%3E%3C/svg%3E") no-repeat right 10px center;
    font: inherit;
    font-weight: 400;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}
.searchable-select-input:focus {
    border-color: var(--accent);
}
.searchable-select-input.is-invalid {
    border-color: var(--danger);
}
.searchable-select-list {
    position: absolute;
    z-index: 1000;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--accent);
    border-top: 0;
    border-radius: 0 0 2px 2px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.searchable-select-list li {
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
}
.searchable-select-list li:hover,
.searchable-select-list li.active {
    background: var(--accent);
    color: #ffffff;
}
.searchable-select-list li.no-results {
    color: #999;
    font-size: 13px;
    cursor: default;
}
.searchable-select-list li.no-results:hover {
    background: transparent;
    color: #999;
}

.textarea-control {
    display: grid;
    gap: 6px;
}

.field-note {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.5;
}

.form-field:has(textarea) {
    align-items: start;
}

.form-field:has(textarea) > span:first-child {
    padding-top: 8px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(28, 137, 210, 0.14);
}

.form-field .is-invalid,
.agreement-field .is-invalid {
    border-color: var(--danger);
}

.field-error {
    display: block;
    grid-column: 2;
    min-height: 20px;
    margin: -4px 0 0;
    color: var(--danger);
    font-size: 13px;
}

.field-error:empty {
    display: none;
}

.photo-upload-field {
    display: grid;
    grid-template-columns: 112px 134px minmax(220px, 1fr);
    align-items: start;
    gap: 12px;
    margin-top: 18px;
    padding: 4px;
    /*border: 4px solid #ff4747;*/
    background: #ffffff;
    color: var(--muted);
    font-size: 13px;
}

.photo-upload-label {
    display: block;
    margin-bottom: 0;
    color: #405368;
    font-weight: 700;
    text-align: right;
}

.photo-upload-control {
    min-height: 164px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed #d7d7d7;
    background: #ffffff;
    cursor: pointer;
    text-align: center;
}

.photo-upload-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-upload-icon {
    width: 42px;
    height: 34px;
    position: relative;
    border: 4px solid #8a8a8a;
    border-radius: 4px;
}

.photo-upload-icon::before {
    content: "";
    position: absolute;
    left: 7px;
    bottom: 6px;
    width: 12px;
    height: 12px;
    background: #8a8a8a;
    clip-path: polygon(0 100%, 52% 28%, 100% 100%);
}

.photo-upload-icon::after {
    content: "";
    position: absolute;
    right: 7px;
    bottom: 6px;
    width: 15px;
    height: 15px;
    background: #8a8a8a;
    clip-path: polygon(0 100%, 48% 36%, 100% 100%);
}

.photo-upload-control strong {
    color: #1677ff;
    font-size: 13px;
    font-weight: 400;
}

.photo-upload-control em {
    max-width: 96px;
    color: #8c8c8c;
    font-size: 13px;
    font-style: normal;
    line-height: 1.45;
}

.photo-upload-tip {
    min-height: 102px;
    padding: 10px 20px 10px 32px;
    border: 1px solid #f5dfb8;
    border-radius: 4px;
    background: #fff8df;
    color: #8a6a37;
}

.photo-upload-tip p {
    position: relative;
    margin: 0;
    line-height: 1.7;
}

.photo-upload-tip p::before {
    content: "•";
    position: absolute;
    left: -18px;
    top: 0;
    color: #8a6a37;
    font-weight: 700;
}

.id-photo-field {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    /*margin-top: 18px;*/
    color: #405368;
    font-size: 14px;
    font-weight: 700;
}

.id-photo-label {
    text-align: right;
}

.id-photo-control {
    display: grid;
    grid-template-columns: 242px 64px 48px;
    align-items: center;
    gap: 8px;
}

.id-photo-name {
    width: 100%;
    height: 26px;
    border: 1px solid #8f8f8f;
    padding: 2px 6px;
    color: var(--text);
    background: #ffffff;
    font: inherit;
    font-weight: 400;
}

.id-photo-button {
    height: 37px;
    border-radius:2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfdbe6;
    background: #ffffff;
    color: #222222;
    font-weight: 400;
    cursor: pointer;
}

.id-photo-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.id-photo-link {
    display: none;
    color: #0070c0;
    font-size: 13px;
    font-weight: 400;
}

.phone-row,
.captcha-row {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 10px;
}

.captcha-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.captcha-row button {
    border: 1px solid #b9c9d7;
    background: #f2f6fa;
    color: #405368;
    cursor: pointer;
    white-space: nowrap;
    min-height: 38px;
    padding: 0 12px;
}

.captcha-row img {
    border: 1px solid #cfdbe6;
    border-radius: 2px;
}

.account-grid {
    max-width: 620px;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 10px auto 0;
}

.account-grid .form-field {
    color: #505050;
    font-weight: 400;
}

.account-grid .country-field,
.account-grid .captcha-field {
    grid-column: auto;
}

.account-grid .phone-row {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 8px;
}

.account-grid .captcha-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.account-grid .captcha-row button {
    min-height: 38px;
    border-color: var(--primary);
    color: var(--primary);
    background: #ffffff;
}

.account-grid .field-error {
    grid-column: 2;
    margin: -4px 0 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.primary-action,
.secondary-action {
    min-width: 98px;
    min-height: 38px;
    border: 1px solid var(--primary);
    border-radius: 2px;
    cursor: pointer;
    font: inherit;
}

.primary-action {
    color: #ffffff;
    background: var(--primary);
}

.primary-action:hover {
    background: var(--primary-dark);
}

.secondary-action {
    color: var(--primary);
    background: #ffffff;
}

.register-form[data-current-step="3"] .form-actions {
    justify-content: center;
    margin-top: 34px;
    padding-top: 0;
    border-top: 0;
}

.register-form[data-current-step="3"] .primary-action {
    min-width: 138px;
    min-height: 40px;
    border-radius: 3px;
}

.register-form[data-current-step="4"] {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.register-form[data-current-step="4"] .form-actions {
    display: none;
}

.register-complete-panel {
    padding: 36px 0 10px;
}

.register-complete-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 42px 20px 38px;
    border: 1px solid #d8e6ef;
    border-radius: 6px;
    background: #f8fcff;
    text-align: center;
    box-shadow: 0 8px 24px rgba(36, 72, 110, 0.08);
}

.register-complete-copy h2 {
    margin: 0 0 12px;
    color: #1f3d58;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.register-complete-copy p {
    margin: 0;
    color: #5f7284;
    font-size: 16px;
}

.register-complete-login {
    min-width: 160px;
    margin-top: 28px;
}

.success-message {
    display: none;
    width: min(560px, 100%);
    margin: 18px auto 0;
    padding: 13px 16px;
    border: 1px solid #a7d3ae;
    background: #f0fff3;
    color: #217a34;
    font-weight: 700;
    text-align: center;
}

.success-message.visible {
    display: block;
}

.file-size-error {
    display: block;
    margin-bottom: 6px;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
}

.id-photo-control .file-size-error {
    grid-column: 1 / -1;
}


.signup-footer {
    width: calc(100% + 32px);
    margin-top: 20px;
    padding: 18px 16px 64px;
    color: #555555;
    text-align: center;
    font-size: 13px;
    background: #ffffff;
}

@media (max-width: 860px) {
    .signup-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 0 20px;
    }

    .notice-box {
        width: calc(100% - 40px);
    }

    .signup-panel {
        margin-top: -44px;
    }

    .register-form {
        padding-left: 22px;
        padding-right: 22px;
    }

    .identity-grid {
        gap: 56px;
    }
}

@media (max-width: 620px) {
    .signup-shell {
        padding: 0;
    }

    .signup-hero {
        width: 100%;
        min-height: 288px;
        padding-top: 48px;
    }

    .signup-panel {
        width: 100%;
        border-left: 0;
        border-right: 0;
    }

    .signup-header h1 {
        font-size: 22px;
    }

    .notice-box {
        padding: 10px 16px;
    }

    .step-nav li {
        gap: 6px;
        font-size: 12px;
        width: 66px;
    }

    .step-nav ol {
        padding-left: 24px;
        padding-right: 24px;
    }

    .step-nav li::after {
        left: calc(50% + 30px);
        width: calc((100vw - 56px) / 2 - 63px);
    }

    .step-nav strong {
        width: 24px;
        height: 24px;
        font-size: 15px;
    }

    .register-form {
        padding: 34px 16px 26px;
    }

    .identity-grid,
    .form-grid,
    .phone-row,
    .captcha-row {
        grid-template-columns: 1fr;
    }

    .identity-grid {
        gap: 34px;
    }

    .form-field,
    .photo-upload-field,
    .id-photo-field,
    .account-grid .form-field,
    .account-grid .phone-row,
    .account-grid .captcha-row {
        grid-template-columns: 1fr;
    }

    .form-field > span:first-child,
    .photo-upload-label,
    .id-photo-label,
    .account-grid .form-field > span:first-child {
        text-align: left;
    }

    .id-photo-control {
        grid-template-columns: minmax(0, 1fr) 64px 48px;
    }

    .photo-upload-field {
        border-width: 3px;
        padding: 10px;
    }

    .photo-upload-control {
        min-height: 150px;
    }

    .field-error,
    .account-grid .field-error {
        grid-column: 1;
    }

    .form-field:has(textarea) > span:first-child {
        padding-top: 0;
    }

    .form-actions {
        justify-content: stretch;
    }

    .primary-action,
    .secondary-action {
        flex: 1;
        min-width: 0;
    }
}
