/* tm-register.css */

/* 使用本地阿里巴巴普惠体 */
@font-face {
    font-family: 'AlibabaPuHuiTi';
    src: url('../fonts/AlibabaPuHuiTi-3-65-Medium.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'AlibabaPuHuiTi';
    src: url('../fonts/AlibabaPuHuiTi-3-85-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
}

body {
    background-color: #f8f9fa;
    font-family: "AlibabaPuHuiTi", "Microsoft YaHei", sans-serif;
    /* Light gray background */
}

.tm-register-page {
    padding-bottom: 80px;
    /* Space for footer/mobile */
}

/* Card Styles */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    transition: transform 0.2s;
}

.card:hover {
    /* transform: translateY(-2px); */
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); */
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0 !important;
}

.card-body {
    padding: 24px;
}

/* Section Titles */
.section-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
    font-weight: bold;
}

/* Form Controls */
.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border-radius: 8px;
    border-color: #dee2e6;
    padding: 10px 14px;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Radio Buttons for Trademark Type */
.tm-type-group .btn-check:checked+.btn-outline-primary {
    background-color: #e7f1ff;
    color: #0d6efd;
    border-color: #0d6efd;
    box-shadow: none;
}

.tm-type-group .btn-outline-primary {
    border-radius: 8px;
    padding: 10px 20px;
    margin-right: 10px;
    border-color: #dee2e6;
    color: #555;
}

.tm-type-group .btn-outline-primary:hover {
    background-color: #f8f9fa;
    color: #333;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    background-color: #fafafa;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: #0d6efd;
    background-color: #f0f8ff;
}

.upload-preview {
    max-width: 150px;
    max-height: 150px;
    margin-top: 10px;
    border-radius: 8px;
    display: none;
}

/* Square Upload Area */
.tm-image-controls {
    flex-shrink: 0;
}

.upload-area-square {
    width: 150px;
    height: 150px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: #fafafa;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.upload-area-square:hover {
    border-color: #0d6efd;
    background-color: #f0f8ff;
}

.upload-preview-square {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: none;
    background: #fff;
    cursor: zoom-in;
}

.tm-register-proxy-preview-box {
    width: 100px;
    height: 100px;
    line-height: 100px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.tm-register-proxy-placeholder {
    font-size: 2rem;
}

.tm-register-proxy-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tm-register-image-format-tip {
    max-width: 140px;
}

.tm-register-image-format-tip-emphasis {
    color: #dc3545;
}

.tm-register-upload-icon {
    font-size: 2rem;
    color: #adb5bd;
}

/* Class Selector */
.class-search-box {
    position: relative;
    max-width: 400px;
}

.main-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.main-class-item {
    font-size: 13px;
    padding: 6px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    background-color: #fff;
    white-space: nowrap;
    overflow: visible;
    transition: all 0.1s;
    margin: 4px 0;
}

.main-class-item:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.main-class-item.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

/* Selection Badge (count indicator) */
.main-class-item {
    position: relative;
}

.selection-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background-color: #dc3545;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tree-main-class-header,
.tree-group-header {
    position: relative;
}

.tree-main-class-header .selection-badge,
.tree-group-header .selection-badge {
    position: static;
    margin-left: auto;
    margin-right: 8px;
}

/* Tree Structure Styles */
.tree-wrapper {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    height: 650px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.tree-search {
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    flex-shrink: 0;
}

.tree-search input {
    border-radius: 20px;
    padding-left: 15px;
}

.tree-list {
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.tree-main-content {
    display: none;
}

/* Main Class in Tree */
.tree-main-class {
    border-bottom: 1px solid #eee;
}

.tree-main-class-header {
    padding: 10px 12px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    transition: background 0.15s;
}

.tree-main-class-header:hover {
    background: #e9ecef;
}

/* Zebra striping for main class blocks */
.tree-main-block:nth-child(odd) .tree-main-class-header {
    background: #fff;
}

.tree-main-block:nth-child(even) .tree-main-class-header {
    background: #f8f9fa;
}

.tree-main-block {
    border-bottom: 1px solid #e9ecef;
}

.tree-main-class-header .bi {
    margin-right: 8px;
    font-size: 12px;
    transition: transform 0.2s;
}

.tree-main-class-header.expanded .bi {
    transform: rotate(90deg);
}

/* Group in Tree */
.tree-group {
    border-bottom: 1px solid #f0f0f0;
}

.tree-group-header {
    padding: 8px 12px 8px 24px;
    font-size: 13px;
    color: #0d6efd;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.tree-group-header:hover {
    background: #f0f8ff;
}

.tree-group-header .bi {
    margin-right: 6px;
    font-size: 10px;
    transition: transform 0.2s;
}

.tree-group-header.expanded .bi {
    transform: rotate(90deg);
}

/* Items in Tree */
.tree-items {
    padding: 5px 12px 10px 36px;
    display: none;
}

.tree-items.show {
    display: block;
}

.tree-item {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    margin: 3px 4px 3px 0;
    font-size: 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

/* Vertical list style for main classes */
.main-class-list {
    padding-left: 12px !important;
}

.main-class-list .tree-item {
    display: flex;
    width: auto;
    margin: 4px 12px 4px 0;
    border: none;
    background: transparent;
    font-size: 14px;
    padding: 8px 10px;
}

.main-class-list .tree-item:hover {
    background-color: #f0f8ff;
    color: #0d6efd;
}

.tree-item:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.tree-item.selected {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.tree-item .bi-check {
    margin-right: 4px;
    color: #28a745;
}

.tree-item.selected .bi-check {
    color: #fff;
}

/* Selected Wrapper (Right Panel) */
.selected-wrapper {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    height: 650px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.selected-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    font-size: 16px;
}

.selected-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Selected Class Group */
.selected-class-group {
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.selected-class-header {
    padding: 10px 12px;
    background: #f8f9fa;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.selected-class-header .class-info {
    color: #666;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.selected-class-toggle {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    text-align: left;
    cursor: pointer;
}

.selected-class-toggle:hover strong {
    color: #0d6efd;
}

.selected-class-header .class-info strong {
    color: #333;
}

.selected-class-group.is-collapsed .selected-class-header {
    border-bottom: 0;
}

.copy-class-items-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: #dc3545;
    font-size: 13px;
    line-height: 1.2;
    padding: 0;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.copy-class-items-btn:hover {
    color: #b02a37;
    text-decoration: underline;
}

.selected-class-header .class-price {
    color: #dc3545;
    font-weight: 600;
}

.selected-class-header .remove-class {
    color: #999;
    cursor: pointer;
    margin-left: 10px;
}

.selected-class-header .remove-class:hover {
    color: #dc3545;
}

.selected-class-items {
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.selected-item-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.tm-register-group-code {
    min-width: 45px;
}

.selected-item-tag .remove-item {
    margin-left: 6px;
    color: #999;
    cursor: pointer;
    font-size: 14px;
}

.selected-item-tag .remove-item:hover {
    color: #dc3545;
}

/* Empty State */
.selected-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.selected-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

/* Fee Summary Card at Bottom */
.fee-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
}

.fee-summary-card .card-body {
    padding: 20px 30px;
}

.fee-item {
    display: flex;
    align-items: center;
}

.fee-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.fee-value {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-left: 5px;
}

.fee-item.total .fee-value {
    font-size: 24px;
    color: #ffd700;
}

.sub-group-title {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    margin-top: 15px;
    margin-bottom: 8px;
    background: #f1f1f1;
    padding: 5px 10px;
    border-radius: 4px;
}

.item-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.item-badge {
    display: inline-block;
    padding: 5px 10px;
    font-size: 12px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s;
}

.item-badge:hover {
    border-color: #adb5bd;
}

.item-badge.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.item-badge .code {
    margin-right: 4px;
    opacity: 0.8;
}

/* Sticky Right Sidebar */
.sticky-sidebar {
    position: sticky;
    top: 80px;
    /* Adjust based on header height */
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.selected-list {
    margin-bottom: 20px;
}

.selected-group-item {
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-group-item:last-child {
    border-bottom: none;
}

.remove-item {
    color: #999;
    cursor: pointer;
    font-size: 16px;
}

.remove-item:hover {
    color: #dc3545;
}

.price-summary {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
    color: #555;
}

.price-row.total {
    font-size: 18px;
    font-weight: bold;
    color: #d63384;
    /* Pricing color */
    border-top: 1px solid #ddd;
    padding-top: 10px;
    margin-top: 5px;
}

/* Applicant */
.applicant-card {
    border: 1px dashed #ced4da;
    border-radius: 8px;
    padding: 15px;
    background-color: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.applicant-info h5 {
    font-size: 16px;
    margin: 0 0 5px 0;
}

.applicant-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* Font Selection Modal Styles */
.font-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.font-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.font-item:last-child {
    border-bottom: none;
}

.font-item:hover {
    background-color: #f8f9fa;
}

.font-item.active {
    background-color: #e7f1ff;
    border-color: #0d6efd;
}

.font-preview {
    font-size: 24px;
    min-width: 120px;
}

.tm-register-font-alibaba {
    font-family: 'AlibabaPuHuiTi', sans-serif;
}

.font-name {
    font-size: 13px;
    color: #666;
    flex: 1;
}

.tm-register-font-color-text {
    width: 100px;
}

.generate-preview-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    overflow: hidden;
}

.generate-preview-area canvas {
    max-width: 100%;
    max-height: 300px;
}

.tm-register-confirm-image {
    max-width: 120px;
    max-height: 120px;
    border: 1px solid #ddd;
    padding: 2px;
}

.tm-register-class-detail {
    max-height: 250px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.tm-register-wxpay-qr-container {
    display: none;
}

.tm-mobile-class-picker {
    display: none;
}

.tm-mobile-class-picker-overlay {
    display: none;
}

@media (max-width: 767.98px) {
    .tm-register-page.container {
        margin-top: 12px !important;
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 96px;
    }

    .tm-register-applicant-section,
    .tm-register-info-section {
        margin-bottom: 14px;
        border: 1px solid #edf2f7;
        border-radius: 16px;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
        overflow: hidden;
    }

    .tm-register-applicant-section .card-header,
    .tm-register-info-section .card-header {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 14px 16px 12px;
        border-bottom: 1px solid #eef2f7;
        color: #111827;
        font-size: 17px;
        line-height: 1.35;
        background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
    }

    .tm-register-applicant-section .card-header .bi,
    .tm-register-info-section .card-header .bi {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        margin-right: 0 !important;
        border-radius: 10px;
        background: #eaf3ff;
        color: #0d6efd;
        font-size: 15px;
    }

    .tm-register-applicant-section .card-body,
    .tm-register-info-section .card-body {
        padding: 16px;
    }

    #applicantSelectionArea > .d-flex {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
        gap: 8px !important;
        margin-bottom: 0 !important;
    }

    #applicantSelectionArea > .d-flex .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-height: 44px;
        padding: 9px 8px;
        border-radius: 12px;
        font-size: 13px;
        font-weight: 700;
        line-height: 1.2;
        white-space: nowrap;
    }

    #applicantSelectionArea > .d-flex .btn .bi {
        flex: 0 0 auto;
        margin-right: 0 !important;
        line-height: 1;
    }

    #applicantSelectionArea > .d-flex #reloadApplicantsBtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        padding-left: 0 !important;
        padding-right: 0 !important;
        color: #64748b !important;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        font-size: 0;
        overflow: hidden;
        white-space: nowrap;
    }

    #applicantSelectionArea > .d-flex #reloadApplicantsBtn .bi {
        margin-right: 0 !important;
        font-size: 18px;
        line-height: 1;
    }

    #selectedApplicantDisplay.applicant-card {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
        border: 1px solid #dbeafe;
        border-radius: 14px;
        background: #f8fbff;
    }

    #selectedApplicantDisplay.applicant-card.d-none {
        display: none !important;
    }

    #selectedApplicantDisplay .applicant-info h5 {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 16px;
        line-height: 1.35;
    }

    #selectedApplicantDisplay .applicant-info h5 .badge {
        flex-shrink: 0;
        margin-right: 0 !important;
        border-radius: 999px;
        background: #fff !important;
        color: #2563eb !important;
        font-size: 12px;
    }

    #selectedApplicantDisplay .proxy-area {
        margin-top: 12px !important;
        padding-top: 12px !important;
        border-top-color: #e2e8f0 !important;
    }

    #selectedApplicantDisplay .proxy-area .form-label {
        margin-bottom: 8px;
        color: #475569 !important;
        font-size: 13px;
    }

    #selectedApplicantDisplay .proxy-area .d-flex {
        gap: 12px !important;
        align-items: center !important;
    }

    .tm-register-proxy-preview-box {
        width: 74px;
        height: 74px;
        line-height: 74px;
        border-radius: 12px !important;
    }

    .tm-register-proxy-placeholder {
        font-size: 24px;
    }

    .tm-register-proxy-preview-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    #proxyStatus {
        margin-bottom: 8px !important;
        color: #64748b !important;
    }

    #proxyUploadBtn,
    #clearApplicantBtn {
        min-height: 36px;
        border-radius: 10px;
        font-weight: 700;
    }

    #clearApplicantBtn {
        align-self: stretch !important;
        margin-top: 0 !important;
    }

    .tm-register-info-section .mb-4,
    .tm-register-info-section .mb-3 {
        margin-bottom: 14px !important;
    }

    .tm-register-info-section .form-label {
        margin-bottom: 8px;
        color: #334155;
        font-size: 14px;
        font-weight: 800;
    }

    .tm-register-info-section .form-control {
        min-height: 46px;
        padding: 11px 12px;
        border-color: #dbe3ee;
        border-radius: 12px;
        background: #fbfdff;
        font-size: 15px;
    }

    .tm-register-info-section textarea.form-control {
        min-height: 92px;
        line-height: 1.5;
    }

    .tm-register-info-section .form-text {
        margin-top: 7px;
        color: #7c8798;
        font-size: 12px;
        line-height: 1.45;
    }

    .tm-type-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .tm-type-group .btn-outline-primary {
        width: 100%;
        min-height: 44px;
        margin-right: 0;
        padding: 10px 6px;
        border-color: #dbe3ee;
        border-radius: 12px;
        background: #fbfdff;
        color: #475569;
        font-size: 14px;
        font-weight: 800;
    }

    .tm-type-group .btn-check:checked + .btn-outline-primary {
        border-color: #0d6efd;
        background: #eaf3ff;
        color: #0d6efd;
        box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.2);
    }

    .tm-register-image-row {
        align-items: stretch;
        gap: 10px !important;
    }

    .tm-image-controls {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
        flex-direction: column;
    }

    .tm-image-controls .btn {
        min-height: 40px;
        border-radius: 11px;
        font-size: 13px;
        font-weight: 800;
    }

    .tm-register-image-format-tip {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        margin-top: auto;
        padding: 9px 10px;
        border-radius: 10px;
        background: #f8fafc;
        font-size: 11px !important;
        line-height: 1.45;
    }

    .upload-area-square {
        width: 116px;
        height: 116px;
        border-color: #cfe0f5;
        border-radius: 14px;
        background: #f8fbff;
    }

    .tm-register-upload-icon {
        color: #0d6efd;
        font-size: 28px;
    }

    #uploadText {
        font-size: 12px;
    }

    .upload-preview-square {
        border-radius: 12px;
    }

    .fee-summary-card {
        margin-top: 14px;
        border-radius: 14px;
    }

    .fee-summary-card .card-body {
        padding: 16px;
    }

    .fee-summary-card .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 122px;
        gap: 14px;
        align-items: center !important;
    }

    .fee-summary-card .col-md-8,
    .fee-summary-card .col-md-4 {
        width: auto;
        padding: 0;
    }

    .fee-summary-card .col-md-8 > .d-flex {
        display: flex !important;
        flex-direction: column;
        gap: 8px !important;
    }

    .fee-item {
        display: flex;
        align-items: baseline;
        min-width: 0;
        line-height: 1.25;
    }

    .fee-label {
        flex: 0 0 auto;
        color: rgba(255, 255, 255, 0.82);
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
    }

    .fee-value {
        min-width: 0;
        margin-left: 6px;
        font-size: 16px;
        font-weight: 800;
        white-space: nowrap;
    }

    .fee-item.total .fee-value {
        font-size: 22px;
        line-height: 1;
    }

    .fee-summary-card .text-end {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 100%;
    }

    #submitOrderBtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 122px;
        min-height: 52px;
        padding: 0 12px !important;
        border-radius: 11px;
        font-size: 17px;
        font-weight: 800;
        line-height: 1.2;
        white-space: nowrap;
    }

    #submitOrderBtn .bi {
        display: none;
    }

    #generateImageModal .modal-dialog {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
    }

    #generateImageModal .modal-content {
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background: #f6f8fb;
    }

    #generateImageModal .modal-header {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 10px 14px;
        border-bottom: 1px solid #e2e8f0;
        border-radius: 0;
        background: #fff;
    }

    #generateImageModal .modal-title {
        display: flex;
        min-width: 0;
        align-items: center;
        color: #0f172a;
        font-size: 16px;
        font-weight: 800;
        line-height: 1.35;
    }

    #generateImageModal .modal-title .bi {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        margin-right: 7px !important;
        border-radius: 10px;
        background: #eaf3ff;
        color: #0d6efd;
        font-size: 16px;
    }

    #generateImageModal .btn-close {
        width: 32px;
        height: 32px;
        margin: 0;
        border: 1px solid #dbe3ee;
        border-radius: 12px;
        background-color: #f8fafc;
        opacity: 1;
    }

    #generateImageModal .modal-body {
        flex: 1 1 auto;
        padding: 10px 10px 78px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #generateImageModal .modal-body > .row {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-right: 0;
        margin-left: 0;
    }

    #generateImageModal .modal-body > .row > .col-md-6 {
        width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    #generateImageModal .modal-body > .row > .col-md-6:first-child {
        order: 2;
    }

    #generateImageModal .modal-body > .row > .col-md-6:last-child {
        order: 1;
        padding: 10px 12px 12px;
        border: 1px solid #edf2f7;
        border-radius: 14px;
        background: #fff;
    }

    #generateImageModal .form-label {
        margin-bottom: 6px;
        color: #334155;
        font-size: 13px;
        font-weight: 800;
    }

    #generateImageModal .mb-3 {
        margin-bottom: 10px !important;
        padding: 10px;
        border: 1px solid #edf2f7;
        border-radius: 12px;
        background: #fff;
    }

    #generateImageModal .form-control {
        min-height: 40px;
        border-color: #dbe3ee;
        border-radius: 10px;
        background: #fbfdff;
        font-size: 14px;
    }

    #generateImageModal .font-list {
        max-height: none;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    #generateImageModal .font-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 8px;
        align-items: center;
        padding: 8px 10px;
        border: 1px solid #dbeafe;
        border-radius: 10px;
        background: #f8fbff;
    }

    #generateImageModal .font-item.active {
        border-color: #0d6efd;
        background: #eef6ff;
        box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.14);
    }

    #generateImageModal .font-preview {
        min-width: 0;
        color: #0f172a;
        font-size: 16px;
        font-weight: 800;
        line-height: 1.25;
    }

    #generateImageModal .font-name {
        grid-column: 1 / 2;
        color: #64748b;
        font-size: 11px;
        line-height: 1.35;
    }

    #generateImageModal .font-item .badge {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        align-self: center;
        justify-self: end;
        border-radius: 999px;
        font-size: 10px;
        line-height: 1.4;
    }

    #generateImageModal #fontColorPicker {
        flex: 0 0 42px;
        width: 42px;
        height: 40px;
        min-height: 40px;
        padding: 4px;
        border-radius: 10px;
    }

    #generateImageModal .tm-register-font-color-text {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        font-weight: 700;
        letter-spacing: 0;
    }

    #generateImageModal .generate-preview-area {
        width: min(100%, 236px);
        min-height: 0;
        aspect-ratio: 1 / 1;
        margin: 0 auto;
        border: 1px solid #dbe3ee;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
    }

    #generateImageModal .generate-preview-area canvas {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 12px;
    }

    #generateImageModal #refreshGeneratePreviewBtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 7px 11px;
        border-color: #dbe3ee;
        border-radius: 10px;
        background: #fff;
        color: #475569;
        font-weight: 700;
    }

    #generateImageModal .modal-footer {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 6;
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid #e2e8f0;
        border-radius: 0;
        background: #fff;
    }

    #generateImageModal .modal-footer .btn {
        min-height: 42px;
        margin: 0;
        border-radius: 11px;
        font-size: 14px;
        font-weight: 800;
    }

    #generateImageModal #applyGeneratedImageBtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.tm-mobile-class-picker-lock {
        overflow: hidden;
    }

    .tm-mobile-class-picker {
        display: block;
    }

    .tm-register-class-section {
        border-radius: 14px;
        overflow: hidden;
    }

    .tm-register-class-section .card-body {
        padding: 12px;
    }

    .tm-register-class-header {
        gap: 10px;
        padding: 12px 14px !important;
    }

    .tm-register-class-header > div:first-child {
        flex: 0 0 auto;
        color: #0f172a;
        font-size: 16px;
        font-weight: 800;
        line-height: 1.3;
        white-space: nowrap;
    }

    .tm-register-class-header > div:first-child .bi {
        margin-right: 6px !important;
        color: #0d6efd;
        font-size: 16px;
    }

    .tm-mobile-class-picker-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 14px;
        border: 1px solid #dbeafe;
        border-radius: 12px;
        background: #f8fbff;
    }

    .tm-register-class-header .tm-mobile-class-picker-summary {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 230px;
        justify-content: flex-end;
        gap: 8px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .tm-mobile-class-picker-label {
        color: #64748b;
        font-size: 12px;
        font-weight: 700;
    }

    .tm-register-class-header .tm-mobile-class-picker-label {
        font-size: 10px;
        line-height: 1.1;
        text-align: right;
        white-space: nowrap;
    }

    .tm-mobile-class-picker-count {
        margin-top: 3px;
        color: #0f172a;
        font-size: 18px;
        font-weight: 800;
    }

    .tm-register-class-header .tm-mobile-class-picker-count {
        margin-top: 2px;
        font-size: 13px;
        line-height: 1.2;
        text-align: right;
        white-space: nowrap;
    }

    .tm-mobile-class-picker-total {
        color: #dc2626;
        font-size: 24px;
        font-weight: 900;
        white-space: nowrap;
    }

    .tm-register-class-header .tm-mobile-class-picker-total {
        font-size: 18px;
        line-height: 1;
    }

    .tm-mobile-class-picker-preview {
        display: flex;
        flex-direction: column;
        gap: 10px;
        min-height: 0;
        margin: 0 0 12px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .tm-mobile-class-picker-empty {
        display: block;
        width: 100%;
        padding: 12px;
        border: 1px dashed #cbd5e1;
        border-radius: 12px;
        background: #fff;
        color: #94a3b8;
        font-size: 13px;
    }

    .tm-mobile-selected-class-group {
        overflow: hidden;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        background: #fff;
    }

    .tm-mobile-selected-class-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto 26px;
        gap: 8px;
        align-items: center;
        padding: 10px 10px 8px;
        border-bottom: 1px solid #edf2f7;
        background: #f8fafc;
    }

    .tm-mobile-selected-class-title {
        appearance: none;
        -webkit-appearance: none;
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 4px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #111827;
        font: inherit;
        font-size: 14px;
        line-height: 1.35;
        text-align: left;
    }

    .tm-mobile-selected-class-title strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tm-mobile-selected-class-arrow {
        flex: 0 0 auto;
        color: #78350f;
        font-size: 12px;
    }

    .tm-mobile-selected-class-price {
        color: #dc2626;
        font-size: 14px;
        font-weight: 800;
        white-space: nowrap;
    }

    .tm-mobile-selected-class-group.is-collapsed .tm-mobile-selected-class-header {
        border-bottom: 0;
    }

    .tm-mobile-selected-remove-class {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #94a3b8;
        font-size: 13px;
    }

    .tm-mobile-selected-class-meta {
        display: flex;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        color: #64748b;
        font-size: 12px;
        line-height: 1.4;
    }

    .tm-mobile-selected-copy {
        flex: 0 0 auto;
        padding: 0;
        border: 0;
        background: transparent;
        color: #dc2626;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.4;
    }

    .tm-mobile-selected-class-body {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .tm-mobile-selected-subgroup {
        display: block;
    }

    .tm-mobile-selected-subgroup-code {
        display: block;
        margin-bottom: 6px;
        padding-top: 0;
        color: #475569;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.35;
        text-align: left;
    }

    .tm-mobile-selected-tags {
        display: flex;
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        gap: 6px;
    }

    .tm-mobile-selected-item-tag {
        appearance: none;
        -webkit-appearance: none;
        display: inline-flex;
        max-width: 100%;
        align-items: center;
        padding: 5px 7px;
        border: 1px solid #dbe3ee;
        border-radius: 4px;
        background: #fff;
        color: #0f172a;
        font-family: inherit;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.35;
        text-align: left;
        cursor: pointer;
    }

    .tm-mobile-selected-item-tag:active {
        border-color: #93c5fd;
        background: #eff6ff;
    }

    .tm-mobile-selected-item-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tm-mobile-selected-remove-item {
        flex: 0 0 auto;
        width: 16px;
        height: 16px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #94a3b8;
        font-size: 15px;
        line-height: 14px;
    }

    .tm-mobile-class-chip {
        display: inline-flex;
        align-items: center;
        max-width: 100%;
        padding: 7px 10px;
        border: 1px solid #bfdbfe;
        border-radius: 999px;
        background: #eff6ff;
        color: #1d4ed8;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.3;
    }

    .tm-mobile-class-chip-more {
        background: #f1f5f9;
        border-color: #e2e8f0;
        color: #475569;
    }

    .tm-mobile-class-picker-btn {
        min-height: 46px;
        border-radius: 12px;
        font-weight: 800;
    }

    .tm-mobile-class-picker-overlay {
        position: fixed;
        inset: 0;
        z-index: 3000;
        background: #fff;
    }

    .tm-mobile-class-picker-overlay.is-open {
        display: block;
    }

    .tm-mobile-class-picker-frame,
    .tm-mobile-class-picker-frame iframe {
        width: 100%;
        height: 100%;
    }

    .tm-mobile-class-picker-frame iframe {
        display: block;
        border: 0;
        background: #fff;
    }

    .layui-layer.tm-register-payment-layer-shell {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: none !important;
        margin: 0 !important;
        overflow: hidden;
        border-radius: 0 !important;
        background: #f6f8fb;
        box-shadow: none !important;
    }

    .tm-register-payment-layer-shell .layui-layer-title {
        height: 49px;
        padding: 0 48px 0 16px;
        border-bottom: 1px solid #e2e8f0;
        background: #fff;
        color: #0f172a;
        font-size: 16px;
        font-weight: 800;
        line-height: 49px;
    }

    .tm-register-payment-layer-shell .layui-layer-title .bi {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 26px;
        height: 26px;
        margin-right: 7px !important;
        border-radius: 9px;
        background: #eaf3ff;
        color: #0d6efd;
        font-size: 15px;
        vertical-align: -7px;
    }

    .tm-register-payment-layer-shell .layui-layer-setwin {
        top: 15px;
        right: 14px;
    }

    .tm-register-payment-layer-shell .layui-layer-content {
        height: calc(100vh - 49px - 68px) !important;
        height: calc(100dvh - 49px - 68px - env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        background: #f6f8fb;
        -webkit-overflow-scrolling: touch;
    }

    .tm-register-payment-layer-shell .layui-layer-btn {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid #e2e8f0;
        background: #fff;
        box-sizing: border-box;
    }

    .tm-register-payment-layer-shell .layui-layer-btn a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        height: 44px;
        margin: 0 !important;
        padding: 0 12px !important;
        border-radius: 12px !important;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
    }

    .tm-register-payment-layer-shell .layui-layer-btn0 {
        grid-column: 2;
        grid-row: 1;
        border-color: #0d6efd !important;
        background: #0d6efd !important;
        color: #fff !important;
    }

    .tm-register-payment-layer-shell .layui-layer-btn1 {
        grid-column: 1;
        grid-row: 1;
        border-color: #dbe3ee !important;
        background: #f8fafc !important;
        color: #475569 !important;
    }

    .tm-register-payment-layer {
        min-height: 100%;
        padding: 12px !important;
        background: #f6f8fb;
        box-sizing: border-box;
    }

    .tm-register-payment-info-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
        margin: 0 0 10px !important;
    }

    .tm-register-payment-info-card {
        width: auto;
        margin: 0 !important;
        padding: 12px !important;
        border: 1px solid #edf2f7;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    }

    .tm-register-payment-label {
        display: flex;
        align-items: center;
        min-height: 18px;
        margin-bottom: 6px;
        color: #64748b !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        line-height: 1.3;
    }

    .tm-register-payment-info-value {
        min-width: 0;
        color: #0f172a !important;
        font-size: 15px !important;
        font-weight: 800;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .tm-register-payment-section {
        margin-bottom: 10px !important;
        padding: 12px;
        border: 1px solid #edf2f7;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    }

    .tm-register-payment-image-preview {
        display: flex;
        align-items: center;
        min-height: 76px;
        color: #94a3b8;
        font-size: 13px;
    }

    .tm-register-payment-layer-shell .tm-register-confirm-image {
        width: 84px;
        height: 84px;
        max-width: 84px;
        max-height: 84px;
        padding: 4px;
        border: 1px solid #dbe3ee;
        border-radius: 12px;
        background: #fff;
        object-fit: contain;
    }

    .tm-register-payment-class-card .tm-register-payment-label {
        gap: 8px;
        margin-bottom: 8px;
    }

    .tm-register-payment-class-card .tm-register-payment-label .badge {
        flex: 0 0 auto;
        border-radius: 999px;
        background: #eaf3ff !important;
        color: #0d6efd;
        font-size: 11px;
        font-weight: 800;
    }

    .tm-register-payment-layer-shell .tm-register-class-detail {
        max-height: 168px;
        padding: 8px;
        border: 1px solid #edf2f7;
        border-radius: 10px;
        background: #f8fafc;
        font-size: 12px;
    }

    .tm-register-payment-class-row {
        margin-bottom: 8px !important;
    }

    .tm-register-payment-class-row:last-child {
        margin-bottom: 0 !important;
    }

    .tm-register-payment-class-badge {
        border-radius: 999px;
        background: #475569 !important;
        font-size: 11px;
        line-height: 1.4;
    }

    .tm-register-payment-class-items {
        color: #475569 !important;
        font-size: 12px;
        line-height: 1.55 !important;
    }

    .tm-register-payment-divider {
        display: none;
    }

    .tm-register-payment-total {
        margin: 0 0 10px !important;
        padding: 12px !important;
        border: 1px solid #fee2e2;
        border-radius: 14px !important;
        background: #fff7ed !important;
    }

    .tm-register-payment-total label {
        color: #7c2d12;
        font-size: 14px !important;
        font-weight: 800;
    }

    .tm-register-payment-total-value {
        color: #dc2626 !important;
        font-size: 24px !important;
        line-height: 1;
        white-space: nowrap;
    }

    .tm-register-payment-methods {
        margin-bottom: 10px !important;
        padding: 12px;
        border: 1px solid #edf2f7;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    }

    .tm-register-payment-method-title {
        margin-bottom: 10px !important;
        color: #0f172a;
        font-size: 14px !important;
        font-weight: 800;
    }

    .tm-register-payment-method {
        padding: 0 !important;
        overflow: hidden;
        border-color: #e2e8f0 !important;
        border-radius: 12px !important;
        background: #fbfdff !important;
    }

    .tm-register-payment-method .form-check {
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    .tm-register-payment-method .form-check-input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .tm-register-payment-method .form-check-label {
        display: block;
        padding: 12px;
    }

    .tm-register-payment-method .d-flex {
        gap: 8px;
        min-height: 26px;
    }

    .tm-register-payment-method span:first-child {
        display: inline-flex;
        min-width: 0;
        align-items: center;
        color: #0f172a;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.3;
    }

    .tm-register-payment-method span:first-child .bi {
        flex: 0 0 auto;
        margin-right: 6px !important;
        font-size: 17px;
    }

    .tm-register-payment-method .text-success,
    .tm-register-payment-method .text-danger {
        flex: 0 0 auto;
        font-size: 12px;
        font-weight: 800;
        line-height: 1.3;
        white-space: nowrap;
    }

    .tm-register-payment-method.is-selected {
        border-color: #0d6efd !important;
        background: #eef6ff !important;
        box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.16);
    }

    .tm-register-payment-layer-shell .tm-register-wxpay-qr-container {
        margin-bottom: 10px;
        padding: 18px 12px !important;
        border: 1px solid #dbeafe;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    }

    .tm-register-payment-layer-shell .tm-register-wxpay-qr-container h6 {
        margin-bottom: 12px !important;
        color: #0f172a;
        font-size: 15px;
        font-weight: 800;
    }

    .tm-register-payment-layer-shell #wxPayQrCode {
        display: inline-flex !important;
        padding: 10px;
        border: 1px solid #edf2f7;
        border-radius: 14px;
        background: #fff;
    }

    .tm-register-payment-layer-shell #wxPayQrCode img,
    .tm-register-payment-layer-shell #wxPayQrCode canvas {
        width: 180px !important;
        height: 180px !important;
    }

    .tm-register-payment-layer-shell .tm-register-wxpay-qr-container p {
        margin-bottom: 0;
        color: #64748b !important;
        font-size: 12px;
    }

    .tm-register-payment-layer-shell.tm-register-payment-qr-active .layui-layer-btn0 {
        background: #16a34a !important;
        border-color: #16a34a !important;
    }
}
