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

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    height: 100vh;
    gap: 20px;
    padding: 20px;
}

/* 小于1200px的container */
@media (max-width: 1200px) {
    .container {
        height: auto;
        display: block;

        /* flex-direction: column; */
        .left-container {
            .left-panel {
                position: relative;
            }

            .console-panel {
                position: relative;
            }
        }

        .preview-container {
            margin-bottom: 40px;
        }
    }
}

.left-container {
    display: flex;
    flex-direction: column;
    flex: 0 0 40%;
}

.tab-header {
    display: flex;
    border-bottom: 1px solid #ddd;
    background-color: #fff;
}

.tab-item {
    flex: 1;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 11px;
    border: 1px solid #ddd;
    border-bottom: none;
    background-color: #f5f5f5;
    border-right: none;
}

.tab-item:last-child {
    border-right: 1px solid #ddd;
}

.tab-item.active {
    background-color: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

.tab-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.left-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    box-sizing: border-box;
}

.left-panel.active {
    display: block;
}

.left-panel h2 {
    font-size: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.form-sections-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    .form-sections-container {
        grid-template-columns: 1fr;
    }
}

.form-section {
    border: 1px solid #ddd;
    padding: 12px;
    margin-bottom: 15px;
    background-color: #fff;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.form-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #666;
    font-weight: normal;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 3px;
    color: #666;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    font-size: 13px;
    background-color: #fff;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.charge-item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3px;
    margin-bottom: 5px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.charge-item-row input {
    padding: 5px;
    border: 1px solid #ccc;
    font-size: 13px;
    min-width: 0;
    box-sizing: border-box;
}

#addItem {
    padding: 6px 18px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    font-size: 14px;
    margin-top: 8px;
}

#addItem:hover {
    background-color: #f0f0f0;
}

.right-panel {
    flex: 0 0 60%;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    overflow: auto;
    position: relative;
}

.export-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.export-button:hover {
    background-color: #f0f0f0;
}

.export-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #f5f5f5;
}

.export-preview {
    flex: 1;
    overflow: auto;
    background-color: #fff;
    /* border: 1px solid #ddd; */
    padding: 15px;
}

.export-preview h2 {
    font-size: 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.export-actions {
    padding: 20px;
    /* border-top: 1px solid #ddd; */
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
    background-color: #fff;
}

.export-actions button {
    width: 100%;
    max-width: 300px;
    padding: 12px 0;
    border: none;
    background-color: #4a90e2;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    font-weight: bold;
    letter-spacing: 1px;
}

.export-actions button:hover {
    background-color: #357abd;
}

.export-actions #backBtn {
    background-color: #fff;
    color: #666;
    border: 1px solid #ddd;
    margin-top: 10px;
}

.export-actions #backBtn:hover {
    background-color: #f5f5f5;
}

.right-panel h2 {
    font-size: 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.preview-container {
    width: 100%;
    height: calc(100% - 50px);
    overflow: auto;
}

.preview-wrapper {
    position: relative;
    display: inline-block;
}

.template-image {
    display: block;
    max-width: 100%;
    height: auto;
}

.text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.text-element {
    position: absolute;
    font-size: 6px;
    font-family: "黑体", "Microsoft YaHei", "黑体", Arial, sans-serif;
    /* font-weight: bold; */
    color: #000;
    white-space: pre-wrap;
    pointer-events: none;
}

.console-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 12px;
    overflow-y: auto;
    display: none;
}

.console-panel.active {
    display: block;
}

.console-panel h3 {
    font-size: 11px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.console-controls {
    margin-bottom: 10px;
}

.console-controls button {
    padding: 4px 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    font-size: 10px;
    margin-right: 5px;
}

.console-controls button:hover {
    background-color: #f0f0f0;
}

.console-output {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 8px;
    font-family: "Courier New", monospace;
    font-size: 9px;
    height: calc(100% - 100px);
    overflow-y: auto;
}

.console-line {
    margin-bottom: 3px;
    word-break: break-all;
}