* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

.register-container {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.register-content {
    padding: 40px;
}

.register-header {
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.register-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.login-prompt {
    font-size: 14px;
    color: #666;
}

.login-link {
    color: #FF6B35;
    text-decoration: underline;
    transition: color 0.3s;
}

.login-link:hover {
    color: #E55A2B;
}

.form-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* 必填字段星号已在 HTML 中手动添加，不需要 CSS 自动添加 */

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #FF6B35;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #333;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    font-size: 12px;
}

.select-wrapper select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.select-wrapper select:focus {
    outline: none;
    border-color: #FF6B35;
}

/* 必填字段提示 */
.required-star {
    color: #f44336;
    margin-left: 4px;
    font-weight: bold;
}

.required-hint {
    color: #f44336;
    font-size: 12px;
    font-weight: normal;
    margin-left: 8px;
}

/* 字段错误样式 */
.field-error {
    border-color: #f44336 !important;
    background-color: #ffebee !important;
}

.field-error-message {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* 上传区域错误样式 */
.upload-error-state {
    border-color: #f44336 !important;
    background-color: #ffebee !important;
}

.upload-error-state .upload-placeholder {
    border-color: #f44336;
}

.upload-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    text-align: center;
}

.required-upload {
    position: relative;
}

/* Upload Area */
.upload-area {
    width: 100%;
    height: 150px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s;
    position: relative;
    overflow: hidden;
}

/* 确保文件输入不影响布局 */
.upload-area input[type="file"] {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

.upload-area:hover {
    border-color: #FF6B35;
    background: #fff5f2;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #999;
    position: relative;
    z-index: 1;
}

.upload-icon {
    font-size: 32px;
}

.upload-text {
    font-size: 14px;
}

.upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

/* Shop Logo 特殊样式 - 固定128x128 */
#shopLogoPreview {
    width: 128px !important;
    height: 128px !important;
    object-fit: cover;
    border-radius: 4px;
    display: none;
}

#shopLogoUpload .upload-area {
    width: 128px;
    height: 128px;
    margin: 0 auto;
}

.upload-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.upload-item .upload-area {
    height: 120px;
}

.upload-label {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* Example Images */
.example-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.example-card {
    text-align: center;
}

.example-card p {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.example-front,
.example-back {
    width: 100%;
    min-height: 160px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    position: relative;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 正面样式 */
.example-front {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
}

.example-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ddd;
}

.example-title {
    font-size: 10px;
    font-weight: 700;
    color: #333;
    letter-spacing: 1px;
}

.example-circle {
    width: 24px;
    height: 24px;
    background: #FF6B35;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.example-content {
    display: flex;
    gap: 12px;
}

.example-photo-wrapper {
    flex-shrink: 0;
}

.example-photo {
    width: 50px;
    height: 60px;
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
    border: 2px solid #ccc;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.example-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #d0d0d0;
    border-radius: 50%;
}

.example-face::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 4px;
    height: 4px;
    background: #999;
    border-radius: 50%;
    box-shadow: 8px 0 0 #999;
}

.example-face::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    border: 2px solid #999;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.example-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.example-line {
    font-size: 9px;
    color: #555;
    line-height: 1.4;
    font-family: 'Courier New', monospace;
}

/* 反面样式 */
.example-back {
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
}

.example-back-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ddd;
}

.example-back-title {
    font-size: 10px;
    font-weight: 700;
    color: #333;
    letter-spacing: 1px;
    text-align: center;
}

.example-back-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.example-back-line {
    font-size: 9px;
    color: #555;
    line-height: 1.4;
    font-family: 'Courier New', monospace;
}

.example-rectangle {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 25px;
    background: #FF6B35;
    border-radius: 3px;
    border: 1px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Verification Tabs */
.verification-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #FF6B35;
    color: #fff;
    border-color: #FF6B35;
}

.tab-btn:hover:not(.active) {
    background: #f0f0f0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Checkbox */
.checkbox-label input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FF6B35;
}

.agreement-link {
    color: #FF6B35;
    text-decoration: none;
}

.agreement-link:hover {
    text-decoration: underline;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: #FF6B35;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 20px;
}

.submit-btn:hover {
    background: #E55A2B;
}

.submit-btn:active {
    background: #CC4A1F;
}

/* 必填字段星号已在 HTML 中手动添加，不需要 CSS 自动添加 */

/* Agreement Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: transparent;
    border-radius: 0;
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    overflow-y: auto;
    position: relative;
    box-shadow: none;
    margin: auto;
    border: none;
    padding: 10px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    padding: 30px 30px 20px;
    border-bottom: 2px solid #f0f0f0;
    margin: 0;
}

.contract-content {
    padding: 30px 25px;
    background: #ffffff;
    font-family: 'Times New Roman', 'Times', 'Georgia', 'Palatino', serif;
    color: #1a1a1a;
    line-height: 1.6;
    letter-spacing: 0.2px;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.contract-content::before {
    display: none;
}

.contract-content > * {
    position: relative;
    z-index: 1;
}

.contract-header {
    text-align: left;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.contract-title {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin: 0 0 10px 0;
    letter-spacing: 1px;
    font-family: 'Times New Roman', 'Times', serif;
    text-transform: uppercase;
}

.contract-intro {
    font-size: 13px;
    color: #333;
    margin-bottom: 0;
    line-height: 1.6;
    text-indent: 0;
    font-weight: 400;
}

.contract-section {
    margin-bottom: 18px;
    line-height: 1.6;
}

.contract-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: none;
    font-family: 'Times New Roman', 'Times', serif;
}

.contract-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
    margin-top: 0;
    text-indent: 0;
    font-family: 'Times New Roman', 'Times', serif;
    line-height: 1.6;
}

.contract-section p {
    font-size: 12px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 6px;
    margin-top: 0;
    text-indent: 0;
    text-align: left;
    font-weight: 400;
    font-family: 'Times New Roman', 'Times', serif;
}

.signature-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.signature-field {
    position: relative;
    min-height: 120px;
    width: 100%;
}

.signature-field-top {
    margin-bottom: 20px;
}

.signature-field-bottom {
    margin-top: 10px;
}

.signature-label {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
    font-family: 'Times New Roman', 'Times', serif;
}

.signature-date {
    font-size: 12px;
    color: #333;
    margin-top: 10px;
    position: absolute;
    bottom: 0;
    left: 0;
    font-family: 'Times New Roman', 'Times', serif;
    font-weight: 400;
}

.signature-stamp {
    width: 85px;
    height: 85px;
    position: absolute;
    top: 25px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chop-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.signature-area {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    background: #fff;
    position: relative;
    margin-bottom: 10px;
}

#signatureCanvas {
    display: block;
    width: 100%;
    height: 80px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background: #fafafa;
    cursor: default;
    touch-action: none;
    pointer-events: none; /* 禁用直接点击签名 */
}

.signature-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-sign {
    padding: 6px 16px;
    background: #4CAF50;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Times New Roman', 'Times', serif;
}

.btn-sign:hover {
    background: #45a049;
    border-color: #45a049;
}

.clear-signature-btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Times New Roman', 'Times', serif;
}

.clear-signature-btn:hover {
    background: #e0e0e0;
    color: #333;
    border-color: #999;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0;
    border-top: none;
    margin-top: 0;
}

.btn-agree {
    padding: 14px 60px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-sure {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-agree {
    background: #FF6B35;
    color: #fff;
}

.btn-agree:hover {
    background: #E55A2B;
}

.btn-agree:active {
    background: #CC4A1F;
}

.btn-sure {
    background: rgba(255, 107, 53, 0.2);
    color: #FF6B35;
    border: 1px solid #FF6B35;
}

.btn-sure:hover {
    background: rgba(255, 107, 53, 0.3);
}

.signature-display {
    position: absolute;
    bottom: 0;
    right: 0;
    display: none;
    text-align: right;
    z-index: 5;
}

.signature-field-bottom .signature-display {
    bottom: 0;
    right: 0;
}

.signature-display.active {
    display: block;
}

.signature-display img {
    max-width: 150px;
    max-height: 60px;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    display: block;
    margin-left: auto;
    box-shadow: none;
}

.signature-display .signature-date-display {
    font-size: 11px;
    color: #333;
    margin-top: 4px;
    text-align: right;
    font-weight: 400;
    font-family: 'Times New Roman', 'Times', serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    .register-content {
        padding: 20px;
    }

    .register-title {
        font-size: 24px;
    }

    .upload-row,
    .example-images {
        grid-template-columns: 1fr;
    }

    .verification-tabs {
        flex-direction: column;
    }

    .modal-content {
        margin: 5px;
        max-height: 98vh;
        max-width: 100%;
        width: calc(100% - 10px);
        padding: 10px;
        overflow-y: auto;
    }

    .contract-content {
        padding: 15px;
        font-size: 12px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .contract-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .contract-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .contract-intro {
        font-size: 11px;
    }

    .contract-section {
        margin-bottom: 15px;
    }

    .contract-section h3 {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .contract-section p {
        font-size: 10px;
        margin-bottom: 5px;
        line-height: 1.5;
    }

    .contract-subtitle {
        font-size: 11px;
    }

    .signature-section {
        flex-direction: column;
        gap: 20px;
        margin-top: 20px;
        padding-top: 15px;
    }
    
    .signature-field {
        min-height: 90px;
        width: 100%;
    }

    .signature-label {
        font-size: 11px;
        margin-bottom: 10px;
    }

    .signature-stamp {
        width: 70px;
        height: 70px;
        top: 20px;
    }

    .signature-stamp img {
        width: 70px;
        height: 70px;
    }

    .signature-area {
        width: 100%;
        max-width: 100%;
    }

    #signatureCanvas {
        width: 100% !important;
        max-width: 100%;
        height: 80px !important;
    }

    .signature-date {
        font-size: 10px;
        margin-top: 8px;
    }

    .signature-display {
        max-width: 100%;
    }

    .signature-display img {
        max-width: 100%;
        height: auto;
    }

    .modal-buttons {
        flex-direction: column;
    }

}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast-notification.toast-success {
    background: #27ae60;
}

.toast-notification.toast-error {
    background: #e74c3c;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 18px;
    font-weight: bold;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .toast-notification {
        top: 60px;
        left: 20px;
        right: 20px;
        transform: translateY(-100px);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}

/* Signature Modal Styles */
.signature-modal-content {
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.signature-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.signature-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-signature-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.3s;
}

.close-signature-modal:hover {
    color: #333;
}

.signature-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.signature-instruction {
    margin-bottom: 20px;
    text-align: center;
}

.signature-instruction p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.signature-area-modal {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    position: relative;
    margin-bottom: 15px;
}

#signatureCanvasModal {
    display: block;
    width: 100%;
    height: 200px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background: #fafafa;
    cursor: crosshair;
    touch-action: none;
}

.signature-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-cancel-signature,
.btn-confirm-signature {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel-signature {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel-signature:hover {
    background: #e0e0e0;
}

.btn-confirm-signature {
    background: #4CAF50;
    color: #fff;
}

.btn-confirm-signature:hover {
    background: #45a049;
}

.btn-confirm-signature:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .signature-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    #signatureCanvasModal {
        height: 250px;
        width: 100%;
    }
    
    .signature-modal-footer {
        flex-direction: column;
    }
    
    .btn-cancel-signature,
    .btn-confirm-signature {
        width: 100%;
    }
    
    #signatureCanvas {
        height: 100px;
    }
    
    .signature-area {
        padding: 10px;
    }
}

