* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.5;
    padding: 20px 15px;
}
.container {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 25px 20px;
}
h1 {
    font-size: 24px;
    margin-bottom: 5px;
    color: #1a1a1a;
}
.subtitle {
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}
.required {
    color: #e74c3c;
}
input[type="text"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.2s;
    background: #fff;
    /* 新增以下三行 */
    resize: vertical;        /* 只允许垂直拉伸，防止水平溢出 */
    max-width: 100%;         /* 确保宽度不超过父容器 */
    box-sizing: border-box;  /* 内边距和边框计入宽度 */
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
}
small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 13px;
}
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
}
.upload-area p {
    color: #7f8c8d;
    margin-top: 10px;
}
.file-list {
    margin-top: 15px;
    text-align: left;
}
.file-item {
    background: #ecf0f1;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 14px;
    word-break: break-all;
}
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    flex: 1;
}
.btn-primary {
    background: #3498db;
    color: #fff;
}
.btn-primary:hover {
    background: #2980b9;
}
.btn-outline {
    background: #fff;
    border-color: #ccc;
    color: #333;
}
.btn-outline:hover {
    background: #f8f9fa;
}
.error-msg {
    background: #fee;
    border: 1px solid #fcc;
    color: #c0392b;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.success-box {
    text-align: center;
    padding: 20px 0;
}
.success-box h2 {
    color: #27ae60;
    margin-bottom: 15px;
}
.query-code-display {
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 4px;
    background: #f1f9fe;
    border: 2px dashed #3498db;
    display: inline-block;
    padding: 15px 30px;
    border-radius: 12px;
    margin: 20px 0;
    font-family: monospace;
}
.warning {
    color: #e67e22;
    background: #fef5e7;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 25px;
}
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}
.action-buttons .btn {
    flex: 0 1 auto;
    min-width: 140px;
}
/* 字段错误提示 */
.field-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 6px;
    padding-left: 4px;
}

/* 单选/复选选项组 - 自适应换行 */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 5px;
}
.option-group label {
    display: inline-flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    white-space: nowrap;
}
.option-group input[type="radio"],
.option-group input[type="checkbox"] {
    margin-right: 6px;
    width: auto;
}

/* 确保错误信息在选项组下方正确显示 */
.dynamic-field .field-error {
    margin-top: 8px;
}
@media (max-width: 480px) {
    .container {
        padding: 20px 15px;
    }
    .query-code-display {
        font-size: 28px;
        padding: 10px 20px;
    }
    .form-actions {
        flex-direction: column;
    }
}