body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 16px;
}

input[type="file"], textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background-color: #218838;
}

#preview {
    margin-top: 20px;
    text-align: center;
}

#preview img, #preview video {
    max-width: 100%;
    border-radius: 8px;
}

#outputBoxContainer {
    position: relative;
    margin-top: 20px;
}

#outputBox {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background-color: #f9f9f9;
    resize: none;
    box-sizing: border-box;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 8px;
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #28a745;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading p {
    margin-top: 10px;
    font-size: 16px;
    color: #333;
}

#cameraPreview {
    position: relative; /* 使子元素相对于摄像框定位 */
    margin-top: 20px;
    text-align: center;
}

#recordingTime {
    position: absolute; /* 相对于摄像框定位 */
    top: 10px; /* 距离摄像框顶部 10px */
    left: 10px; /* 距离摄像框左侧 10px */
    background: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    color: white; /* 白色文字 */
    padding: 5px 10px; /* 内边距 */
    border-radius: 5px; /* 圆角 */
    font-size: 14px; /* 字体大小 */
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 20px;
    }

    label {
        font-size: 14px;
    }

    input[type="file"], textarea {
        font-size: 14px;
        padding: 8px;
    }

    button {
        padding: 10px;
        font-size: 14px;
    }

    #outputBox {
        font-size: 14px;
        padding: 8px;
    }

    #loading p {
        font-size: 14px;
    }
}