/* 基本样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    margin: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 顶部区域：生成二维码与扫描二维码 */
.top-section {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* 生成二维码和扫描二维码的样式 */
#qr-generator, #qr-scanner {
    flex: 1;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 5px;
    box-sizing: border-box;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 历史记录区域 */
#history {
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 标题样式 */
h2, h3 {
    color: #333;
    margin-bottom: 15px;
}

/* 标签样式 */
label {
    display: inline-block;
    width: 120px;
    margin-top: 10px;
    vertical-align: top;
}

/* 调整输入框和文本区域的样式 */
.resizable-container {
    resize: both;
    overflow: auto;
    display: inline-block;
    width: 100%;
    padding: 5px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

#qr-content {
    width: 100%;
    box-sizing: border-box;
    border: none;
    outline: none;
    font-size: 14px;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

#real-time-results-textarea {
    width: 100%;
    height: 150px;
    resize: both;
    padding: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: none;
}

input[type="number"], input[type="color"], select, input[type="range"], textarea {
    width: 100%;
    padding: 5px;
    margin-top: 10px;
    box-sizing: border-box;
    box-shadow: none;
}

input[type="file"] {
    margin-top: 10px;
}

/* 按钮样式 */
button {
    padding: 10px 15px;
    margin-top: 20px;
    cursor: pointer;
    border: none;
    border-radius: 3px;
    background-color: #28a745;
    color: white;
    font-size: 14px;
}

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

canvas {
    border: 1px solid #ccc;
    margin-top: 20px;
}

#real-time-results {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #f9f9f9;
}

#real-time-results textarea {
    width: 100%;
    height: 150px;
    resize: both;
}

#real-time-results button,
#scanner-buttons button {
    background-color: #007bff;
    margin-right: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 生成历史样式 */
.generated-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.generated-item img {
    width: 100px;
    height: 100px;
    margin-right: 10px;
}

.generated-item .item-text {
    flex-grow: 1;
    word-break: break-all;
}

.generated-item button {
    background-color: #17a2b8;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 历史记录内容布局 */
.history-contents {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}

/* 生成历史和扫描历史的样式 */
#generate-history, #scan-history {
    flex: 1;
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 5px;
    box-sizing: border-box;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .top-section {
        flex-direction: column;
    }

    #qr-generator, #qr-scanner {
        width: 100%;
    }

    /* 隐藏实时屏幕扫描部分 */
    #real-time-scan-section {
        display: none;
    }

    /* 历史记录内容在移动设备上垂直堆叠 */
    .history-contents {
        flex-direction: column;
    }

    /* 隐藏阴影以优化移动设备显示 */
    .top-section,
    #qr-generator, 
    #qr-scanner,
    #history,
    .history-contents,
    .generated-item,
    #generate-history,
    #scan-history {
        box-shadow: none;
    }
}

/* 视觉优化 */
#qr-generator, #qr-scanner, #history, #generate-history, #scan-history {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

h2, h3 {
    margin-bottom: 15px;
}

/* 提示信息样式 */
.info-message {
    color: red;
    margin-top: 10px;
}

/* 隐藏元素 */
.hidden {
    display: none;
}

/* 特定按钮样式 */
.download-btn {
    display: none;
    margin-top: 10px;
    background-color: #17a2b8;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stop-camera-btn {
    background-color: #dc3545;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.clear-results-btn {
    background-color: #ffc107;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.clear-history-btn {
    background-color: #ffc107;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}